resend 6.10.0-preview-tracking-domains.2 → 6.10.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/dist/index.cjs +58 -35
- package/dist/index.d.cts +37 -89
- package/dist/index.d.mts +37 -89
- package/dist/index.mjs +46 -28
- package/package.json +13 -13
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -7,12 +7,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
return to;
|
|
18
22
|
};
|
|
@@ -20,12 +24,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
24
|
value: mod,
|
|
21
25
|
enumerable: true
|
|
22
26
|
}) : target, mod));
|
|
27
|
+
|
|
23
28
|
//#endregion
|
|
24
29
|
let postal_mime = require("postal-mime");
|
|
25
30
|
postal_mime = __toESM(postal_mime);
|
|
26
31
|
let svix = require("svix");
|
|
32
|
+
|
|
27
33
|
//#region package.json
|
|
28
|
-
var version = "6.10.0
|
|
34
|
+
var version = "6.10.0";
|
|
35
|
+
|
|
29
36
|
//#endregion
|
|
30
37
|
//#region src/common/utils/build-pagination-query.ts
|
|
31
38
|
/**
|
|
@@ -40,6 +47,7 @@ function buildPaginationQuery(options) {
|
|
|
40
47
|
if ("before" in options && options.before !== void 0) searchParams.set("before", options.before);
|
|
41
48
|
return searchParams.toString();
|
|
42
49
|
}
|
|
50
|
+
|
|
43
51
|
//#endregion
|
|
44
52
|
//#region src/api-keys/api-keys.ts
|
|
45
53
|
var ApiKeys = class {
|
|
@@ -58,6 +66,7 @@ var ApiKeys = class {
|
|
|
58
66
|
return await this.resend.delete(`/api-keys/${id}`);
|
|
59
67
|
}
|
|
60
68
|
};
|
|
69
|
+
|
|
61
70
|
//#endregion
|
|
62
71
|
//#region src/common/utils/parse-email-to-api-options.ts
|
|
63
72
|
function parseAttachments(attachments) {
|
|
@@ -90,6 +99,7 @@ function parseEmailToApiOptions(email) {
|
|
|
90
99
|
topic_id: email.topicId
|
|
91
100
|
};
|
|
92
101
|
}
|
|
102
|
+
|
|
93
103
|
//#endregion
|
|
94
104
|
//#region src/render.ts
|
|
95
105
|
async function render(node) {
|
|
@@ -101,6 +111,7 @@ async function render(node) {
|
|
|
101
111
|
}
|
|
102
112
|
return render(node);
|
|
103
113
|
}
|
|
114
|
+
|
|
104
115
|
//#endregion
|
|
105
116
|
//#region src/batch/batch.ts
|
|
106
117
|
var Batch = class {
|
|
@@ -128,6 +139,7 @@ var Batch = class {
|
|
|
128
139
|
});
|
|
129
140
|
}
|
|
130
141
|
};
|
|
142
|
+
|
|
131
143
|
//#endregion
|
|
132
144
|
//#region src/broadcasts/broadcasts.ts
|
|
133
145
|
var Broadcasts = class {
|
|
@@ -181,6 +193,7 @@ var Broadcasts = class {
|
|
|
181
193
|
});
|
|
182
194
|
}
|
|
183
195
|
};
|
|
196
|
+
|
|
184
197
|
//#endregion
|
|
185
198
|
//#region src/common/utils/parse-contact-properties-to-api-options.ts
|
|
186
199
|
function parseContactPropertyFromApi(contactProperty) {
|
|
@@ -200,6 +213,7 @@ function parseContactPropertyToApiOptions(contactProperty) {
|
|
|
200
213
|
};
|
|
201
214
|
return { fallback_value: contactProperty.fallbackValue };
|
|
202
215
|
}
|
|
216
|
+
|
|
203
217
|
//#endregion
|
|
204
218
|
//#region src/contact-properties/contact-properties.ts
|
|
205
219
|
var ContactProperties = class {
|
|
@@ -271,6 +285,7 @@ var ContactProperties = class {
|
|
|
271
285
|
return await this.resend.delete(`/contact-properties/${id}`);
|
|
272
286
|
}
|
|
273
287
|
};
|
|
288
|
+
|
|
274
289
|
//#endregion
|
|
275
290
|
//#region src/contacts/segments/contact-segments.ts
|
|
276
291
|
var ContactSegments = class {
|
|
@@ -319,6 +334,7 @@ var ContactSegments = class {
|
|
|
319
334
|
return this.resend.delete(`/contacts/${identifier}/segments/${options.segmentId}`);
|
|
320
335
|
}
|
|
321
336
|
};
|
|
337
|
+
|
|
322
338
|
//#endregion
|
|
323
339
|
//#region src/contacts/topics/contact-topics.ts
|
|
324
340
|
var ContactTopics = class {
|
|
@@ -354,6 +370,7 @@ var ContactTopics = class {
|
|
|
354
370
|
return this.resend.get(url);
|
|
355
371
|
}
|
|
356
372
|
};
|
|
373
|
+
|
|
357
374
|
//#endregion
|
|
358
375
|
//#region src/contacts/contacts.ts
|
|
359
376
|
var Contacts = class {
|
|
@@ -454,6 +471,7 @@ var Contacts = class {
|
|
|
454
471
|
return this.resend.delete(`/audiences/${payload.audienceId}/contacts/${payload?.email ? payload?.email : payload?.id}`);
|
|
455
472
|
}
|
|
456
473
|
};
|
|
474
|
+
|
|
457
475
|
//#endregion
|
|
458
476
|
//#region src/common/utils/parse-domain-to-api-options.ts
|
|
459
477
|
function parseDomainToApiOptions(domain) {
|
|
@@ -467,37 +485,12 @@ function parseDomainToApiOptions(domain) {
|
|
|
467
485
|
tls: domain.tls
|
|
468
486
|
};
|
|
469
487
|
}
|
|
470
|
-
|
|
471
|
-
//#region src/domains/tracking/tracking.ts
|
|
472
|
-
var Tracking = class {
|
|
473
|
-
constructor(resend) {
|
|
474
|
-
this.resend = resend;
|
|
475
|
-
}
|
|
476
|
-
async create(domainId, payload, options = {}) {
|
|
477
|
-
return this.resend.post(`/domains/${domainId}/tracking`, payload, options);
|
|
478
|
-
}
|
|
479
|
-
async list(domainId) {
|
|
480
|
-
return this.resend.get(`/domains/${domainId}/tracking`);
|
|
481
|
-
}
|
|
482
|
-
async get(domainId, trackingId) {
|
|
483
|
-
return this.resend.get(`/domains/${domainId}/tracking/${trackingId}`);
|
|
484
|
-
}
|
|
485
|
-
async update(domainId, trackingId, payload) {
|
|
486
|
-
return this.resend.patch(`/domains/${domainId}/tracking/${trackingId}`, payload);
|
|
487
|
-
}
|
|
488
|
-
async remove(domainId, trackingId) {
|
|
489
|
-
return this.resend.delete(`/domains/${domainId}/tracking/${trackingId}`);
|
|
490
|
-
}
|
|
491
|
-
async verify(domainId, trackingId) {
|
|
492
|
-
return this.resend.post(`/domains/${domainId}/tracking/${trackingId}/verify`);
|
|
493
|
-
}
|
|
494
|
-
};
|
|
488
|
+
|
|
495
489
|
//#endregion
|
|
496
490
|
//#region src/domains/domains.ts
|
|
497
491
|
var Domains = class {
|
|
498
492
|
constructor(resend) {
|
|
499
493
|
this.resend = resend;
|
|
500
|
-
this.tracking = new Tracking(resend);
|
|
501
494
|
}
|
|
502
495
|
async create(payload, options = {}) {
|
|
503
496
|
return await this.resend.post("/domains", parseDomainToApiOptions(payload), options);
|
|
@@ -525,6 +518,7 @@ var Domains = class {
|
|
|
525
518
|
return await this.resend.post(`/domains/${id}/verify`);
|
|
526
519
|
}
|
|
527
520
|
};
|
|
521
|
+
|
|
528
522
|
//#endregion
|
|
529
523
|
//#region src/emails/attachments/attachments.ts
|
|
530
524
|
var Attachments$1 = class {
|
|
@@ -542,6 +536,7 @@ var Attachments$1 = class {
|
|
|
542
536
|
return await this.resend.get(url);
|
|
543
537
|
}
|
|
544
538
|
};
|
|
539
|
+
|
|
545
540
|
//#endregion
|
|
546
541
|
//#region src/emails/receiving/attachments/attachments.ts
|
|
547
542
|
var Attachments = class {
|
|
@@ -559,6 +554,7 @@ var Attachments = class {
|
|
|
559
554
|
return await this.resend.get(url);
|
|
560
555
|
}
|
|
561
556
|
};
|
|
557
|
+
|
|
562
558
|
//#endregion
|
|
563
559
|
//#region src/emails/receiving/receiving.ts
|
|
564
560
|
var Receiving = class {
|
|
@@ -676,6 +672,7 @@ var Receiving = class {
|
|
|
676
672
|
});
|
|
677
673
|
}
|
|
678
674
|
};
|
|
675
|
+
|
|
679
676
|
//#endregion
|
|
680
677
|
//#region src/emails/emails.ts
|
|
681
678
|
var Emails = class {
|
|
@@ -706,6 +703,23 @@ var Emails = class {
|
|
|
706
703
|
return await this.resend.post(`/emails/${id}/cancel`);
|
|
707
704
|
}
|
|
708
705
|
};
|
|
706
|
+
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region src/logs/logs.ts
|
|
709
|
+
var Logs = class {
|
|
710
|
+
constructor(resend) {
|
|
711
|
+
this.resend = resend;
|
|
712
|
+
}
|
|
713
|
+
async list(options = {}) {
|
|
714
|
+
const queryString = buildPaginationQuery(options);
|
|
715
|
+
const url = queryString ? `/logs?${queryString}` : "/logs";
|
|
716
|
+
return await this.resend.get(url);
|
|
717
|
+
}
|
|
718
|
+
async get(id) {
|
|
719
|
+
return await this.resend.get(`/logs/${id}`);
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
|
|
709
723
|
//#endregion
|
|
710
724
|
//#region src/segments/segments.ts
|
|
711
725
|
var Segments = class {
|
|
@@ -727,6 +741,7 @@ var Segments = class {
|
|
|
727
741
|
return await this.resend.delete(`/segments/${id}`);
|
|
728
742
|
}
|
|
729
743
|
};
|
|
744
|
+
|
|
730
745
|
//#endregion
|
|
731
746
|
//#region src/common/utils/get-pagination-query-properties.ts
|
|
732
747
|
function getPaginationQueryProperties(options = {}) {
|
|
@@ -736,6 +751,7 @@ function getPaginationQueryProperties(options = {}) {
|
|
|
736
751
|
if (options.limit) query.set("limit", options.limit.toString());
|
|
737
752
|
return query.size > 0 ? `?${query.toString()}` : "";
|
|
738
753
|
}
|
|
754
|
+
|
|
739
755
|
//#endregion
|
|
740
756
|
//#region src/common/utils/parse-template-to-api-options.ts
|
|
741
757
|
function parseVariables(variables) {
|
|
@@ -757,6 +773,7 @@ function parseTemplateToApiOptions(template) {
|
|
|
757
773
|
variables: parseVariables(template.variables)
|
|
758
774
|
};
|
|
759
775
|
}
|
|
776
|
+
|
|
760
777
|
//#endregion
|
|
761
778
|
//#region src/templates/chainable-template-result.ts
|
|
762
779
|
var ChainableTemplateResult = class {
|
|
@@ -777,6 +794,7 @@ var ChainableTemplateResult = class {
|
|
|
777
794
|
return this.publishFn(data.id);
|
|
778
795
|
}
|
|
779
796
|
};
|
|
797
|
+
|
|
780
798
|
//#endregion
|
|
781
799
|
//#region src/templates/templates.ts
|
|
782
800
|
var Templates = class {
|
|
@@ -817,6 +835,7 @@ var Templates = class {
|
|
|
817
835
|
return await this.resend.patch(`/templates/${identifier}`, parseTemplateToApiOptions(payload));
|
|
818
836
|
}
|
|
819
837
|
};
|
|
838
|
+
|
|
820
839
|
//#endregion
|
|
821
840
|
//#region src/topics/topics.ts
|
|
822
841
|
var Topics = class {
|
|
@@ -870,6 +889,7 @@ var Topics = class {
|
|
|
870
889
|
return await this.resend.delete(`/topics/${id}`);
|
|
871
890
|
}
|
|
872
891
|
};
|
|
892
|
+
|
|
873
893
|
//#endregion
|
|
874
894
|
//#region src/webhooks/webhooks.ts
|
|
875
895
|
var Webhooks = class {
|
|
@@ -901,6 +921,7 @@ var Webhooks = class {
|
|
|
901
921
|
});
|
|
902
922
|
}
|
|
903
923
|
};
|
|
924
|
+
|
|
904
925
|
//#endregion
|
|
905
926
|
//#region src/resend.ts
|
|
906
927
|
const defaultBaseUrl = "https://api.resend.com";
|
|
@@ -919,6 +940,7 @@ var Resend = class {
|
|
|
919
940
|
this.contactProperties = new ContactProperties(this);
|
|
920
941
|
this.domains = new Domains(this);
|
|
921
942
|
this.emails = new Emails(this);
|
|
943
|
+
this.logs = new Logs(this);
|
|
922
944
|
this.webhooks = new Webhooks(this);
|
|
923
945
|
this.templates = new Templates(this);
|
|
924
946
|
this.topics = new Topics(this);
|
|
@@ -1041,5 +1063,6 @@ var Resend = class {
|
|
|
1041
1063
|
return this.fetchRequest(path, requestOptions);
|
|
1042
1064
|
}
|
|
1043
1065
|
};
|
|
1066
|
+
|
|
1044
1067
|
//#endregion
|
|
1045
|
-
exports.Resend = Resend;
|
|
1068
|
+
exports.Resend = Resend;
|
package/dist/index.d.cts
CHANGED
|
@@ -916,9 +916,7 @@ interface CreateDomainOptions {
|
|
|
916
916
|
region?: DomainRegion;
|
|
917
917
|
customReturnPath?: string;
|
|
918
918
|
capabilities?: Partial<DomainCapabilities>;
|
|
919
|
-
/** @deprecated Use {@link Tracking.create} instead */
|
|
920
919
|
openTracking?: boolean;
|
|
921
|
-
/** @deprecated Use {@link Tracking.create} instead */
|
|
922
920
|
clickTracking?: boolean;
|
|
923
921
|
tls?: 'enforced' | 'opportunistic';
|
|
924
922
|
}
|
|
@@ -955,9 +953,7 @@ type RemoveDomainsResponse = Response<RemoveDomainsResponseSuccess>;
|
|
|
955
953
|
//#region src/domains/interfaces/update-domain.interface.d.ts
|
|
956
954
|
interface UpdateDomainsOptions {
|
|
957
955
|
id: string;
|
|
958
|
-
/** @deprecated Use {@link Tracking.update} instead */
|
|
959
956
|
clickTracking?: boolean;
|
|
960
|
-
/** @deprecated Use {@link Tracking.update} instead */
|
|
961
957
|
openTracking?: boolean;
|
|
962
958
|
tls?: 'enforced' | 'opportunistic';
|
|
963
959
|
capabilities?: Partial<DomainCapabilities>;
|
|
@@ -973,77 +969,6 @@ type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
|
973
969
|
};
|
|
974
970
|
type VerifyDomainsResponse = Response<VerifyDomainsResponseSuccess>;
|
|
975
971
|
//#endregion
|
|
976
|
-
//#region src/domains/tracking/interfaces/tracking.d.ts
|
|
977
|
-
type TrackingStatus = 'not_started' | 'pending' | 'verified' | 'failed';
|
|
978
|
-
interface TrackingRecord {
|
|
979
|
-
record: 'Tracking';
|
|
980
|
-
type: 'CNAME';
|
|
981
|
-
name: string;
|
|
982
|
-
value: string;
|
|
983
|
-
ttl: 'Auto';
|
|
984
|
-
status: TrackingStatus;
|
|
985
|
-
}
|
|
986
|
-
interface Tracking {
|
|
987
|
-
object: 'tracking';
|
|
988
|
-
id: string;
|
|
989
|
-
name: string;
|
|
990
|
-
full_name: string;
|
|
991
|
-
status: TrackingStatus;
|
|
992
|
-
open_tracking: boolean;
|
|
993
|
-
click_tracking: boolean;
|
|
994
|
-
created_at: string;
|
|
995
|
-
}
|
|
996
|
-
//#endregion
|
|
997
|
-
//#region src/domains/tracking/interfaces/create-tracking-options.interface.d.ts
|
|
998
|
-
interface CreateTrackingOptions {
|
|
999
|
-
subdomain: string;
|
|
1000
|
-
open_tracking?: boolean;
|
|
1001
|
-
click_tracking?: boolean;
|
|
1002
|
-
}
|
|
1003
|
-
interface CreateTrackingRequestOptions extends PostOptions {}
|
|
1004
|
-
interface CreateTrackingResponseSuccess extends Tracking {
|
|
1005
|
-
records: TrackingRecord[];
|
|
1006
|
-
}
|
|
1007
|
-
type CreateTrackingResponse = Response<CreateTrackingResponseSuccess>;
|
|
1008
|
-
//#endregion
|
|
1009
|
-
//#region src/domains/tracking/interfaces/get-tracking.interface.d.ts
|
|
1010
|
-
interface GetTrackingResponseSuccess extends Tracking {
|
|
1011
|
-
records: TrackingRecord[];
|
|
1012
|
-
}
|
|
1013
|
-
type GetTrackingResponse = Response<GetTrackingResponseSuccess>;
|
|
1014
|
-
//#endregion
|
|
1015
|
-
//#region src/domains/tracking/interfaces/list-tracking.interface.d.ts
|
|
1016
|
-
interface ListTrackingResponseSuccess {
|
|
1017
|
-
object: 'list';
|
|
1018
|
-
data: Tracking[];
|
|
1019
|
-
}
|
|
1020
|
-
type ListTrackingResponse = Response<ListTrackingResponseSuccess>;
|
|
1021
|
-
//#endregion
|
|
1022
|
-
//#region src/domains/tracking/interfaces/remove-tracking.interface.d.ts
|
|
1023
|
-
interface RemoveTrackingResponseSuccess {
|
|
1024
|
-
object: 'tracking';
|
|
1025
|
-
id: string;
|
|
1026
|
-
deleted: true;
|
|
1027
|
-
}
|
|
1028
|
-
type RemoveTrackingResponse = Response<RemoveTrackingResponseSuccess>;
|
|
1029
|
-
//#endregion
|
|
1030
|
-
//#region src/domains/tracking/interfaces/update-tracking.interface.d.ts
|
|
1031
|
-
interface UpdateTrackingOptions {
|
|
1032
|
-
open_tracking?: boolean;
|
|
1033
|
-
click_tracking?: boolean;
|
|
1034
|
-
}
|
|
1035
|
-
interface UpdateTrackingResponseSuccess extends Tracking {
|
|
1036
|
-
records: TrackingRecord[];
|
|
1037
|
-
}
|
|
1038
|
-
type UpdateTrackingResponse = Response<UpdateTrackingResponseSuccess>;
|
|
1039
|
-
//#endregion
|
|
1040
|
-
//#region src/domains/tracking/interfaces/verify-tracking.interface.d.ts
|
|
1041
|
-
interface VerifyTrackingResponseSuccess {
|
|
1042
|
-
object: 'tracking';
|
|
1043
|
-
id: string;
|
|
1044
|
-
}
|
|
1045
|
-
type VerifyTrackingResponse = Response<VerifyTrackingResponseSuccess>;
|
|
1046
|
-
//#endregion
|
|
1047
972
|
//#region src/emails/attachments/interfaces/get-attachment.interface.d.ts
|
|
1048
973
|
interface GetAttachmentOptions {
|
|
1049
974
|
emailId: string;
|
|
@@ -1191,6 +1116,33 @@ type ListReceivingEmailsResponse = {
|
|
|
1191
1116
|
error: ErrorResponse;
|
|
1192
1117
|
};
|
|
1193
1118
|
//#endregion
|
|
1119
|
+
//#region src/logs/interfaces/log.d.ts
|
|
1120
|
+
interface Log {
|
|
1121
|
+
id: string;
|
|
1122
|
+
created_at: string;
|
|
1123
|
+
endpoint: string;
|
|
1124
|
+
method: string;
|
|
1125
|
+
response_status: number;
|
|
1126
|
+
user_agent: string | null;
|
|
1127
|
+
request_body: unknown;
|
|
1128
|
+
response_body: unknown;
|
|
1129
|
+
}
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region src/logs/interfaces/get-log.interface.d.ts
|
|
1132
|
+
type GetLogResponseSuccess = {
|
|
1133
|
+
object: 'log';
|
|
1134
|
+
} & Log;
|
|
1135
|
+
type GetLogResponse = Response<GetLogResponseSuccess>;
|
|
1136
|
+
//#endregion
|
|
1137
|
+
//#region src/logs/interfaces/list-logs.interface.d.ts
|
|
1138
|
+
type ListLogsOptions = PaginationOptions;
|
|
1139
|
+
type ListLogsResponseSuccess = {
|
|
1140
|
+
object: 'list';
|
|
1141
|
+
has_more: boolean;
|
|
1142
|
+
data: Pick<Log, 'id' | 'created_at' | 'endpoint' | 'method' | 'response_status' | 'user_agent'>[];
|
|
1143
|
+
};
|
|
1144
|
+
type ListLogsResponse = Response<ListLogsResponseSuccess>;
|
|
1145
|
+
//#endregion
|
|
1194
1146
|
//#region src/api-keys/api-keys.d.ts
|
|
1195
1147
|
declare class ApiKeys {
|
|
1196
1148
|
private readonly resend;
|
|
@@ -1262,22 +1214,9 @@ declare class Contacts {
|
|
|
1262
1214
|
remove(payload: RemoveContactOptions): Promise<RemoveContactsResponse>;
|
|
1263
1215
|
}
|
|
1264
1216
|
//#endregion
|
|
1265
|
-
//#region src/domains/tracking/tracking.d.ts
|
|
1266
|
-
declare class Tracking$1 {
|
|
1267
|
-
private readonly resend;
|
|
1268
|
-
constructor(resend: Resend);
|
|
1269
|
-
create(domainId: string, payload: CreateTrackingOptions, options?: CreateTrackingRequestOptions): Promise<CreateTrackingResponse>;
|
|
1270
|
-
list(domainId: string): Promise<ListTrackingResponse>;
|
|
1271
|
-
get(domainId: string, trackingId: string): Promise<GetTrackingResponse>;
|
|
1272
|
-
update(domainId: string, trackingId: string, payload: UpdateTrackingOptions): Promise<UpdateTrackingResponse>;
|
|
1273
|
-
remove(domainId: string, trackingId: string): Promise<RemoveTrackingResponse>;
|
|
1274
|
-
verify(domainId: string, trackingId: string): Promise<VerifyTrackingResponse>;
|
|
1275
|
-
}
|
|
1276
|
-
//#endregion
|
|
1277
1217
|
//#region src/domains/domains.d.ts
|
|
1278
1218
|
declare class Domains {
|
|
1279
1219
|
private readonly resend;
|
|
1280
|
-
readonly tracking: Tracking$1;
|
|
1281
1220
|
constructor(resend: Resend);
|
|
1282
1221
|
create(payload: CreateDomainOptions, options?: CreateDomainRequestOptions): Promise<CreateDomainResponse>;
|
|
1283
1222
|
list(options?: ListDomainsOptions): Promise<ListDomainsResponse>;
|
|
@@ -1329,6 +1268,14 @@ declare class Emails {
|
|
|
1329
1268
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1330
1269
|
}
|
|
1331
1270
|
//#endregion
|
|
1271
|
+
//#region src/logs/logs.d.ts
|
|
1272
|
+
declare class Logs {
|
|
1273
|
+
private readonly resend;
|
|
1274
|
+
constructor(resend: Resend);
|
|
1275
|
+
list(options?: ListLogsOptions): Promise<ListLogsResponse>;
|
|
1276
|
+
get(id: string): Promise<GetLogResponse>;
|
|
1277
|
+
}
|
|
1278
|
+
//#endregion
|
|
1332
1279
|
//#region src/segments/interfaces/create-segment-options.interface.d.ts
|
|
1333
1280
|
interface CreateSegmentOptions {
|
|
1334
1281
|
name: string;
|
|
@@ -1824,6 +1771,7 @@ declare class Resend {
|
|
|
1824
1771
|
readonly contactProperties: ContactProperties;
|
|
1825
1772
|
readonly domains: Domains;
|
|
1826
1773
|
readonly emails: Emails;
|
|
1774
|
+
readonly logs: Logs;
|
|
1827
1775
|
readonly webhooks: Webhooks;
|
|
1828
1776
|
readonly templates: Templates;
|
|
1829
1777
|
readonly topics: Topics;
|
|
@@ -1836,4 +1784,4 @@ declare class Resend {
|
|
|
1836
1784
|
delete<T>(path: string, query?: unknown): Promise<Response<T>>;
|
|
1837
1785
|
}
|
|
1838
1786
|
//#endregion
|
|
1839
|
-
export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess,
|
|
1787
|
+
export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, ForwardReceivingEmailOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetLogResponse, GetLogResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListLogsOptions, ListLogsResponse, ListLogsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, Log, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, Template, TemplateVariable, Topic, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, Webhook, WebhookEvent, WebhookEventPayload };
|
package/dist/index.d.mts
CHANGED
|
@@ -916,9 +916,7 @@ interface CreateDomainOptions {
|
|
|
916
916
|
region?: DomainRegion;
|
|
917
917
|
customReturnPath?: string;
|
|
918
918
|
capabilities?: Partial<DomainCapabilities>;
|
|
919
|
-
/** @deprecated Use {@link Tracking.create} instead */
|
|
920
919
|
openTracking?: boolean;
|
|
921
|
-
/** @deprecated Use {@link Tracking.create} instead */
|
|
922
920
|
clickTracking?: boolean;
|
|
923
921
|
tls?: 'enforced' | 'opportunistic';
|
|
924
922
|
}
|
|
@@ -955,9 +953,7 @@ type RemoveDomainsResponse = Response<RemoveDomainsResponseSuccess>;
|
|
|
955
953
|
//#region src/domains/interfaces/update-domain.interface.d.ts
|
|
956
954
|
interface UpdateDomainsOptions {
|
|
957
955
|
id: string;
|
|
958
|
-
/** @deprecated Use {@link Tracking.update} instead */
|
|
959
956
|
clickTracking?: boolean;
|
|
960
|
-
/** @deprecated Use {@link Tracking.update} instead */
|
|
961
957
|
openTracking?: boolean;
|
|
962
958
|
tls?: 'enforced' | 'opportunistic';
|
|
963
959
|
capabilities?: Partial<DomainCapabilities>;
|
|
@@ -973,77 +969,6 @@ type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
|
973
969
|
};
|
|
974
970
|
type VerifyDomainsResponse = Response<VerifyDomainsResponseSuccess>;
|
|
975
971
|
//#endregion
|
|
976
|
-
//#region src/domains/tracking/interfaces/tracking.d.ts
|
|
977
|
-
type TrackingStatus = 'not_started' | 'pending' | 'verified' | 'failed';
|
|
978
|
-
interface TrackingRecord {
|
|
979
|
-
record: 'Tracking';
|
|
980
|
-
type: 'CNAME';
|
|
981
|
-
name: string;
|
|
982
|
-
value: string;
|
|
983
|
-
ttl: 'Auto';
|
|
984
|
-
status: TrackingStatus;
|
|
985
|
-
}
|
|
986
|
-
interface Tracking {
|
|
987
|
-
object: 'tracking';
|
|
988
|
-
id: string;
|
|
989
|
-
name: string;
|
|
990
|
-
full_name: string;
|
|
991
|
-
status: TrackingStatus;
|
|
992
|
-
open_tracking: boolean;
|
|
993
|
-
click_tracking: boolean;
|
|
994
|
-
created_at: string;
|
|
995
|
-
}
|
|
996
|
-
//#endregion
|
|
997
|
-
//#region src/domains/tracking/interfaces/create-tracking-options.interface.d.ts
|
|
998
|
-
interface CreateTrackingOptions {
|
|
999
|
-
subdomain: string;
|
|
1000
|
-
open_tracking?: boolean;
|
|
1001
|
-
click_tracking?: boolean;
|
|
1002
|
-
}
|
|
1003
|
-
interface CreateTrackingRequestOptions extends PostOptions {}
|
|
1004
|
-
interface CreateTrackingResponseSuccess extends Tracking {
|
|
1005
|
-
records: TrackingRecord[];
|
|
1006
|
-
}
|
|
1007
|
-
type CreateTrackingResponse = Response<CreateTrackingResponseSuccess>;
|
|
1008
|
-
//#endregion
|
|
1009
|
-
//#region src/domains/tracking/interfaces/get-tracking.interface.d.ts
|
|
1010
|
-
interface GetTrackingResponseSuccess extends Tracking {
|
|
1011
|
-
records: TrackingRecord[];
|
|
1012
|
-
}
|
|
1013
|
-
type GetTrackingResponse = Response<GetTrackingResponseSuccess>;
|
|
1014
|
-
//#endregion
|
|
1015
|
-
//#region src/domains/tracking/interfaces/list-tracking.interface.d.ts
|
|
1016
|
-
interface ListTrackingResponseSuccess {
|
|
1017
|
-
object: 'list';
|
|
1018
|
-
data: Tracking[];
|
|
1019
|
-
}
|
|
1020
|
-
type ListTrackingResponse = Response<ListTrackingResponseSuccess>;
|
|
1021
|
-
//#endregion
|
|
1022
|
-
//#region src/domains/tracking/interfaces/remove-tracking.interface.d.ts
|
|
1023
|
-
interface RemoveTrackingResponseSuccess {
|
|
1024
|
-
object: 'tracking';
|
|
1025
|
-
id: string;
|
|
1026
|
-
deleted: true;
|
|
1027
|
-
}
|
|
1028
|
-
type RemoveTrackingResponse = Response<RemoveTrackingResponseSuccess>;
|
|
1029
|
-
//#endregion
|
|
1030
|
-
//#region src/domains/tracking/interfaces/update-tracking.interface.d.ts
|
|
1031
|
-
interface UpdateTrackingOptions {
|
|
1032
|
-
open_tracking?: boolean;
|
|
1033
|
-
click_tracking?: boolean;
|
|
1034
|
-
}
|
|
1035
|
-
interface UpdateTrackingResponseSuccess extends Tracking {
|
|
1036
|
-
records: TrackingRecord[];
|
|
1037
|
-
}
|
|
1038
|
-
type UpdateTrackingResponse = Response<UpdateTrackingResponseSuccess>;
|
|
1039
|
-
//#endregion
|
|
1040
|
-
//#region src/domains/tracking/interfaces/verify-tracking.interface.d.ts
|
|
1041
|
-
interface VerifyTrackingResponseSuccess {
|
|
1042
|
-
object: 'tracking';
|
|
1043
|
-
id: string;
|
|
1044
|
-
}
|
|
1045
|
-
type VerifyTrackingResponse = Response<VerifyTrackingResponseSuccess>;
|
|
1046
|
-
//#endregion
|
|
1047
972
|
//#region src/emails/attachments/interfaces/get-attachment.interface.d.ts
|
|
1048
973
|
interface GetAttachmentOptions {
|
|
1049
974
|
emailId: string;
|
|
@@ -1191,6 +1116,33 @@ type ListReceivingEmailsResponse = {
|
|
|
1191
1116
|
error: ErrorResponse;
|
|
1192
1117
|
};
|
|
1193
1118
|
//#endregion
|
|
1119
|
+
//#region src/logs/interfaces/log.d.ts
|
|
1120
|
+
interface Log {
|
|
1121
|
+
id: string;
|
|
1122
|
+
created_at: string;
|
|
1123
|
+
endpoint: string;
|
|
1124
|
+
method: string;
|
|
1125
|
+
response_status: number;
|
|
1126
|
+
user_agent: string | null;
|
|
1127
|
+
request_body: unknown;
|
|
1128
|
+
response_body: unknown;
|
|
1129
|
+
}
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region src/logs/interfaces/get-log.interface.d.ts
|
|
1132
|
+
type GetLogResponseSuccess = {
|
|
1133
|
+
object: 'log';
|
|
1134
|
+
} & Log;
|
|
1135
|
+
type GetLogResponse = Response<GetLogResponseSuccess>;
|
|
1136
|
+
//#endregion
|
|
1137
|
+
//#region src/logs/interfaces/list-logs.interface.d.ts
|
|
1138
|
+
type ListLogsOptions = PaginationOptions;
|
|
1139
|
+
type ListLogsResponseSuccess = {
|
|
1140
|
+
object: 'list';
|
|
1141
|
+
has_more: boolean;
|
|
1142
|
+
data: Pick<Log, 'id' | 'created_at' | 'endpoint' | 'method' | 'response_status' | 'user_agent'>[];
|
|
1143
|
+
};
|
|
1144
|
+
type ListLogsResponse = Response<ListLogsResponseSuccess>;
|
|
1145
|
+
//#endregion
|
|
1194
1146
|
//#region src/api-keys/api-keys.d.ts
|
|
1195
1147
|
declare class ApiKeys {
|
|
1196
1148
|
private readonly resend;
|
|
@@ -1262,22 +1214,9 @@ declare class Contacts {
|
|
|
1262
1214
|
remove(payload: RemoveContactOptions): Promise<RemoveContactsResponse>;
|
|
1263
1215
|
}
|
|
1264
1216
|
//#endregion
|
|
1265
|
-
//#region src/domains/tracking/tracking.d.ts
|
|
1266
|
-
declare class Tracking$1 {
|
|
1267
|
-
private readonly resend;
|
|
1268
|
-
constructor(resend: Resend);
|
|
1269
|
-
create(domainId: string, payload: CreateTrackingOptions, options?: CreateTrackingRequestOptions): Promise<CreateTrackingResponse>;
|
|
1270
|
-
list(domainId: string): Promise<ListTrackingResponse>;
|
|
1271
|
-
get(domainId: string, trackingId: string): Promise<GetTrackingResponse>;
|
|
1272
|
-
update(domainId: string, trackingId: string, payload: UpdateTrackingOptions): Promise<UpdateTrackingResponse>;
|
|
1273
|
-
remove(domainId: string, trackingId: string): Promise<RemoveTrackingResponse>;
|
|
1274
|
-
verify(domainId: string, trackingId: string): Promise<VerifyTrackingResponse>;
|
|
1275
|
-
}
|
|
1276
|
-
//#endregion
|
|
1277
1217
|
//#region src/domains/domains.d.ts
|
|
1278
1218
|
declare class Domains {
|
|
1279
1219
|
private readonly resend;
|
|
1280
|
-
readonly tracking: Tracking$1;
|
|
1281
1220
|
constructor(resend: Resend);
|
|
1282
1221
|
create(payload: CreateDomainOptions, options?: CreateDomainRequestOptions): Promise<CreateDomainResponse>;
|
|
1283
1222
|
list(options?: ListDomainsOptions): Promise<ListDomainsResponse>;
|
|
@@ -1329,6 +1268,14 @@ declare class Emails {
|
|
|
1329
1268
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1330
1269
|
}
|
|
1331
1270
|
//#endregion
|
|
1271
|
+
//#region src/logs/logs.d.ts
|
|
1272
|
+
declare class Logs {
|
|
1273
|
+
private readonly resend;
|
|
1274
|
+
constructor(resend: Resend);
|
|
1275
|
+
list(options?: ListLogsOptions): Promise<ListLogsResponse>;
|
|
1276
|
+
get(id: string): Promise<GetLogResponse>;
|
|
1277
|
+
}
|
|
1278
|
+
//#endregion
|
|
1332
1279
|
//#region src/segments/interfaces/create-segment-options.interface.d.ts
|
|
1333
1280
|
interface CreateSegmentOptions {
|
|
1334
1281
|
name: string;
|
|
@@ -1824,6 +1771,7 @@ declare class Resend {
|
|
|
1824
1771
|
readonly contactProperties: ContactProperties;
|
|
1825
1772
|
readonly domains: Domains;
|
|
1826
1773
|
readonly emails: Emails;
|
|
1774
|
+
readonly logs: Logs;
|
|
1827
1775
|
readonly webhooks: Webhooks;
|
|
1828
1776
|
readonly templates: Templates;
|
|
1829
1777
|
readonly topics: Topics;
|
|
@@ -1836,4 +1784,4 @@ declare class Resend {
|
|
|
1836
1784
|
delete<T>(path: string, query?: unknown): Promise<Response<T>>;
|
|
1837
1785
|
}
|
|
1838
1786
|
//#endregion
|
|
1839
|
-
export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess,
|
|
1787
|
+
export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, ForwardReceivingEmailOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetLogResponse, GetLogResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListLogsOptions, ListLogsResponse, ListLogsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, Log, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, Template, TemplateVariable, Topic, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, Webhook, WebhookEvent, WebhookEventPayload };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import PostalMime from "postal-mime";
|
|
2
2
|
import { Webhook } from "svix";
|
|
3
|
+
|
|
3
4
|
//#region package.json
|
|
4
|
-
var version = "6.10.0
|
|
5
|
+
var version = "6.10.0";
|
|
6
|
+
|
|
5
7
|
//#endregion
|
|
6
8
|
//#region src/common/utils/build-pagination-query.ts
|
|
7
9
|
/**
|
|
@@ -16,6 +18,7 @@ function buildPaginationQuery(options) {
|
|
|
16
18
|
if ("before" in options && options.before !== void 0) searchParams.set("before", options.before);
|
|
17
19
|
return searchParams.toString();
|
|
18
20
|
}
|
|
21
|
+
|
|
19
22
|
//#endregion
|
|
20
23
|
//#region src/api-keys/api-keys.ts
|
|
21
24
|
var ApiKeys = class {
|
|
@@ -34,6 +37,7 @@ var ApiKeys = class {
|
|
|
34
37
|
return await this.resend.delete(`/api-keys/${id}`);
|
|
35
38
|
}
|
|
36
39
|
};
|
|
40
|
+
|
|
37
41
|
//#endregion
|
|
38
42
|
//#region src/common/utils/parse-email-to-api-options.ts
|
|
39
43
|
function parseAttachments(attachments) {
|
|
@@ -66,6 +70,7 @@ function parseEmailToApiOptions(email) {
|
|
|
66
70
|
topic_id: email.topicId
|
|
67
71
|
};
|
|
68
72
|
}
|
|
73
|
+
|
|
69
74
|
//#endregion
|
|
70
75
|
//#region src/render.ts
|
|
71
76
|
async function render(node) {
|
|
@@ -77,6 +82,7 @@ async function render(node) {
|
|
|
77
82
|
}
|
|
78
83
|
return render(node);
|
|
79
84
|
}
|
|
85
|
+
|
|
80
86
|
//#endregion
|
|
81
87
|
//#region src/batch/batch.ts
|
|
82
88
|
var Batch = class {
|
|
@@ -104,6 +110,7 @@ var Batch = class {
|
|
|
104
110
|
});
|
|
105
111
|
}
|
|
106
112
|
};
|
|
113
|
+
|
|
107
114
|
//#endregion
|
|
108
115
|
//#region src/broadcasts/broadcasts.ts
|
|
109
116
|
var Broadcasts = class {
|
|
@@ -157,6 +164,7 @@ var Broadcasts = class {
|
|
|
157
164
|
});
|
|
158
165
|
}
|
|
159
166
|
};
|
|
167
|
+
|
|
160
168
|
//#endregion
|
|
161
169
|
//#region src/common/utils/parse-contact-properties-to-api-options.ts
|
|
162
170
|
function parseContactPropertyFromApi(contactProperty) {
|
|
@@ -176,6 +184,7 @@ function parseContactPropertyToApiOptions(contactProperty) {
|
|
|
176
184
|
};
|
|
177
185
|
return { fallback_value: contactProperty.fallbackValue };
|
|
178
186
|
}
|
|
187
|
+
|
|
179
188
|
//#endregion
|
|
180
189
|
//#region src/contact-properties/contact-properties.ts
|
|
181
190
|
var ContactProperties = class {
|
|
@@ -247,6 +256,7 @@ var ContactProperties = class {
|
|
|
247
256
|
return await this.resend.delete(`/contact-properties/${id}`);
|
|
248
257
|
}
|
|
249
258
|
};
|
|
259
|
+
|
|
250
260
|
//#endregion
|
|
251
261
|
//#region src/contacts/segments/contact-segments.ts
|
|
252
262
|
var ContactSegments = class {
|
|
@@ -295,6 +305,7 @@ var ContactSegments = class {
|
|
|
295
305
|
return this.resend.delete(`/contacts/${identifier}/segments/${options.segmentId}`);
|
|
296
306
|
}
|
|
297
307
|
};
|
|
308
|
+
|
|
298
309
|
//#endregion
|
|
299
310
|
//#region src/contacts/topics/contact-topics.ts
|
|
300
311
|
var ContactTopics = class {
|
|
@@ -330,6 +341,7 @@ var ContactTopics = class {
|
|
|
330
341
|
return this.resend.get(url);
|
|
331
342
|
}
|
|
332
343
|
};
|
|
344
|
+
|
|
333
345
|
//#endregion
|
|
334
346
|
//#region src/contacts/contacts.ts
|
|
335
347
|
var Contacts = class {
|
|
@@ -430,6 +442,7 @@ var Contacts = class {
|
|
|
430
442
|
return this.resend.delete(`/audiences/${payload.audienceId}/contacts/${payload?.email ? payload?.email : payload?.id}`);
|
|
431
443
|
}
|
|
432
444
|
};
|
|
445
|
+
|
|
433
446
|
//#endregion
|
|
434
447
|
//#region src/common/utils/parse-domain-to-api-options.ts
|
|
435
448
|
function parseDomainToApiOptions(domain) {
|
|
@@ -443,37 +456,12 @@ function parseDomainToApiOptions(domain) {
|
|
|
443
456
|
tls: domain.tls
|
|
444
457
|
};
|
|
445
458
|
}
|
|
446
|
-
|
|
447
|
-
//#region src/domains/tracking/tracking.ts
|
|
448
|
-
var Tracking = class {
|
|
449
|
-
constructor(resend) {
|
|
450
|
-
this.resend = resend;
|
|
451
|
-
}
|
|
452
|
-
async create(domainId, payload, options = {}) {
|
|
453
|
-
return this.resend.post(`/domains/${domainId}/tracking`, payload, options);
|
|
454
|
-
}
|
|
455
|
-
async list(domainId) {
|
|
456
|
-
return this.resend.get(`/domains/${domainId}/tracking`);
|
|
457
|
-
}
|
|
458
|
-
async get(domainId, trackingId) {
|
|
459
|
-
return this.resend.get(`/domains/${domainId}/tracking/${trackingId}`);
|
|
460
|
-
}
|
|
461
|
-
async update(domainId, trackingId, payload) {
|
|
462
|
-
return this.resend.patch(`/domains/${domainId}/tracking/${trackingId}`, payload);
|
|
463
|
-
}
|
|
464
|
-
async remove(domainId, trackingId) {
|
|
465
|
-
return this.resend.delete(`/domains/${domainId}/tracking/${trackingId}`);
|
|
466
|
-
}
|
|
467
|
-
async verify(domainId, trackingId) {
|
|
468
|
-
return this.resend.post(`/domains/${domainId}/tracking/${trackingId}/verify`);
|
|
469
|
-
}
|
|
470
|
-
};
|
|
459
|
+
|
|
471
460
|
//#endregion
|
|
472
461
|
//#region src/domains/domains.ts
|
|
473
462
|
var Domains = class {
|
|
474
463
|
constructor(resend) {
|
|
475
464
|
this.resend = resend;
|
|
476
|
-
this.tracking = new Tracking(resend);
|
|
477
465
|
}
|
|
478
466
|
async create(payload, options = {}) {
|
|
479
467
|
return await this.resend.post("/domains", parseDomainToApiOptions(payload), options);
|
|
@@ -501,6 +489,7 @@ var Domains = class {
|
|
|
501
489
|
return await this.resend.post(`/domains/${id}/verify`);
|
|
502
490
|
}
|
|
503
491
|
};
|
|
492
|
+
|
|
504
493
|
//#endregion
|
|
505
494
|
//#region src/emails/attachments/attachments.ts
|
|
506
495
|
var Attachments$1 = class {
|
|
@@ -518,6 +507,7 @@ var Attachments$1 = class {
|
|
|
518
507
|
return await this.resend.get(url);
|
|
519
508
|
}
|
|
520
509
|
};
|
|
510
|
+
|
|
521
511
|
//#endregion
|
|
522
512
|
//#region src/emails/receiving/attachments/attachments.ts
|
|
523
513
|
var Attachments = class {
|
|
@@ -535,6 +525,7 @@ var Attachments = class {
|
|
|
535
525
|
return await this.resend.get(url);
|
|
536
526
|
}
|
|
537
527
|
};
|
|
528
|
+
|
|
538
529
|
//#endregion
|
|
539
530
|
//#region src/emails/receiving/receiving.ts
|
|
540
531
|
var Receiving = class {
|
|
@@ -652,6 +643,7 @@ var Receiving = class {
|
|
|
652
643
|
});
|
|
653
644
|
}
|
|
654
645
|
};
|
|
646
|
+
|
|
655
647
|
//#endregion
|
|
656
648
|
//#region src/emails/emails.ts
|
|
657
649
|
var Emails = class {
|
|
@@ -682,6 +674,23 @@ var Emails = class {
|
|
|
682
674
|
return await this.resend.post(`/emails/${id}/cancel`);
|
|
683
675
|
}
|
|
684
676
|
};
|
|
677
|
+
|
|
678
|
+
//#endregion
|
|
679
|
+
//#region src/logs/logs.ts
|
|
680
|
+
var Logs = class {
|
|
681
|
+
constructor(resend) {
|
|
682
|
+
this.resend = resend;
|
|
683
|
+
}
|
|
684
|
+
async list(options = {}) {
|
|
685
|
+
const queryString = buildPaginationQuery(options);
|
|
686
|
+
const url = queryString ? `/logs?${queryString}` : "/logs";
|
|
687
|
+
return await this.resend.get(url);
|
|
688
|
+
}
|
|
689
|
+
async get(id) {
|
|
690
|
+
return await this.resend.get(`/logs/${id}`);
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
|
|
685
694
|
//#endregion
|
|
686
695
|
//#region src/segments/segments.ts
|
|
687
696
|
var Segments = class {
|
|
@@ -703,6 +712,7 @@ var Segments = class {
|
|
|
703
712
|
return await this.resend.delete(`/segments/${id}`);
|
|
704
713
|
}
|
|
705
714
|
};
|
|
715
|
+
|
|
706
716
|
//#endregion
|
|
707
717
|
//#region src/common/utils/get-pagination-query-properties.ts
|
|
708
718
|
function getPaginationQueryProperties(options = {}) {
|
|
@@ -712,6 +722,7 @@ function getPaginationQueryProperties(options = {}) {
|
|
|
712
722
|
if (options.limit) query.set("limit", options.limit.toString());
|
|
713
723
|
return query.size > 0 ? `?${query.toString()}` : "";
|
|
714
724
|
}
|
|
725
|
+
|
|
715
726
|
//#endregion
|
|
716
727
|
//#region src/common/utils/parse-template-to-api-options.ts
|
|
717
728
|
function parseVariables(variables) {
|
|
@@ -733,6 +744,7 @@ function parseTemplateToApiOptions(template) {
|
|
|
733
744
|
variables: parseVariables(template.variables)
|
|
734
745
|
};
|
|
735
746
|
}
|
|
747
|
+
|
|
736
748
|
//#endregion
|
|
737
749
|
//#region src/templates/chainable-template-result.ts
|
|
738
750
|
var ChainableTemplateResult = class {
|
|
@@ -753,6 +765,7 @@ var ChainableTemplateResult = class {
|
|
|
753
765
|
return this.publishFn(data.id);
|
|
754
766
|
}
|
|
755
767
|
};
|
|
768
|
+
|
|
756
769
|
//#endregion
|
|
757
770
|
//#region src/templates/templates.ts
|
|
758
771
|
var Templates = class {
|
|
@@ -793,6 +806,7 @@ var Templates = class {
|
|
|
793
806
|
return await this.resend.patch(`/templates/${identifier}`, parseTemplateToApiOptions(payload));
|
|
794
807
|
}
|
|
795
808
|
};
|
|
809
|
+
|
|
796
810
|
//#endregion
|
|
797
811
|
//#region src/topics/topics.ts
|
|
798
812
|
var Topics = class {
|
|
@@ -846,6 +860,7 @@ var Topics = class {
|
|
|
846
860
|
return await this.resend.delete(`/topics/${id}`);
|
|
847
861
|
}
|
|
848
862
|
};
|
|
863
|
+
|
|
849
864
|
//#endregion
|
|
850
865
|
//#region src/webhooks/webhooks.ts
|
|
851
866
|
var Webhooks = class {
|
|
@@ -877,6 +892,7 @@ var Webhooks = class {
|
|
|
877
892
|
});
|
|
878
893
|
}
|
|
879
894
|
};
|
|
895
|
+
|
|
880
896
|
//#endregion
|
|
881
897
|
//#region src/resend.ts
|
|
882
898
|
const defaultBaseUrl = "https://api.resend.com";
|
|
@@ -895,6 +911,7 @@ var Resend = class {
|
|
|
895
911
|
this.contactProperties = new ContactProperties(this);
|
|
896
912
|
this.domains = new Domains(this);
|
|
897
913
|
this.emails = new Emails(this);
|
|
914
|
+
this.logs = new Logs(this);
|
|
898
915
|
this.webhooks = new Webhooks(this);
|
|
899
916
|
this.templates = new Templates(this);
|
|
900
917
|
this.topics = new Topics(this);
|
|
@@ -1017,5 +1034,6 @@ var Resend = class {
|
|
|
1017
1034
|
return this.fetchRequest(path, requestOptions);
|
|
1018
1035
|
}
|
|
1019
1036
|
};
|
|
1037
|
+
|
|
1020
1038
|
//#endregion
|
|
1021
|
-
export { Resend };
|
|
1039
|
+
export { Resend };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend",
|
|
3
|
-
"version": "6.10.0
|
|
3
|
+
"version": "6.10.0",
|
|
4
4
|
"description": "Node.js library for the Resend API",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/resend/resend-node#readme",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"postal-mime": "2.7.
|
|
44
|
-
"svix": "1.
|
|
43
|
+
"postal-mime": "2.7.4",
|
|
44
|
+
"svix": "1.88.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@react-email/render": "*"
|
|
@@ -57,29 +57,29 @@
|
|
|
57
57
|
"@pollyjs/core": "6.0.6",
|
|
58
58
|
"@pollyjs/persister-fs": "6.0.6",
|
|
59
59
|
"@types/mailparser": "3.4.6",
|
|
60
|
-
"@types/node": "24.
|
|
60
|
+
"@types/node": "24.12.0",
|
|
61
61
|
"@types/react": "19.2.14",
|
|
62
62
|
"cross-env": "10.1.0",
|
|
63
63
|
"dotenv": "17.3.1",
|
|
64
|
-
"pkg-pr-new": "0.0.
|
|
64
|
+
"pkg-pr-new": "0.0.66",
|
|
65
65
|
"react": "19.2.4",
|
|
66
66
|
"react-dom": "19.2.4",
|
|
67
67
|
"rimraf": "6.1.3",
|
|
68
|
-
"tsdown": "0.21.
|
|
68
|
+
"tsdown": "0.21.4",
|
|
69
69
|
"typescript": "5.9.3",
|
|
70
|
-
"vitest": "4.0
|
|
70
|
+
"vitest": "4.1.0",
|
|
71
71
|
"vitest-fetch-mock": "0.4.5"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "tsdown src/index.ts --format esm,cjs --dts",
|
|
75
|
-
"integration:nextjs": "cd ./
|
|
75
|
+
"integration:nextjs": "cd ./e2e/nextjs && next build --turbopack",
|
|
76
76
|
"lint": "biome check .",
|
|
77
77
|
"lint:fix": "biome check . --write",
|
|
78
|
-
"test": "vitest run",
|
|
79
|
-
"test:dev": "cross-env TEST_MODE=dev vitest run",
|
|
80
|
-
"test:
|
|
81
|
-
"test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run",
|
|
82
|
-
"test:watch": "vitest",
|
|
78
|
+
"test": "vitest run --exclude e2e",
|
|
79
|
+
"test:dev": "cross-env TEST_MODE=dev vitest run --exclude e2e",
|
|
80
|
+
"test:e2e": "vitest run e2e",
|
|
81
|
+
"test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run --exclude e2e",
|
|
82
|
+
"test:watch": "vitest --exclude e2e",
|
|
83
83
|
"typecheck": "tsc --noEmit"
|
|
84
84
|
}
|
|
85
85
|
}
|