resend 6.5.2 → 6.7.0-canary.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 +9 -6
- package/dist/index.d.cts +182 -8
- package/dist/index.d.mts +182 -8
- package/dist/index.mjs +9 -6
- package/package.json +24 -20
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let svix = require("svix");
|
|
2
2
|
|
|
3
3
|
//#region package.json
|
|
4
|
-
var version = "6.
|
|
4
|
+
var version = "6.7.0-canary.0";
|
|
5
5
|
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/common/utils/build-pagination-query.ts
|
|
@@ -434,7 +434,10 @@ function parseDomainToApiOptions(domain) {
|
|
|
434
434
|
name: domain.name,
|
|
435
435
|
region: domain.region,
|
|
436
436
|
custom_return_path: domain.customReturnPath,
|
|
437
|
-
capabilities: domain.capabilities
|
|
437
|
+
capabilities: domain.capabilities,
|
|
438
|
+
open_tracking: domain.openTracking,
|
|
439
|
+
click_tracking: domain.clickTracking,
|
|
440
|
+
tls: domain.tls
|
|
438
441
|
};
|
|
439
442
|
}
|
|
440
443
|
|
|
@@ -473,7 +476,7 @@ var Domains = class {
|
|
|
473
476
|
|
|
474
477
|
//#endregion
|
|
475
478
|
//#region src/emails/attachments/attachments.ts
|
|
476
|
-
var Attachments = class {
|
|
479
|
+
var Attachments$1 = class {
|
|
477
480
|
constructor(resend) {
|
|
478
481
|
this.resend = resend;
|
|
479
482
|
}
|
|
@@ -491,7 +494,7 @@ var Attachments = class {
|
|
|
491
494
|
|
|
492
495
|
//#endregion
|
|
493
496
|
//#region src/emails/receiving/attachments/attachments.ts
|
|
494
|
-
var Attachments
|
|
497
|
+
var Attachments = class {
|
|
495
498
|
constructor(resend) {
|
|
496
499
|
this.resend = resend;
|
|
497
500
|
}
|
|
@@ -512,7 +515,7 @@ var Attachments$1 = class {
|
|
|
512
515
|
var Receiving = class {
|
|
513
516
|
constructor(resend) {
|
|
514
517
|
this.resend = resend;
|
|
515
|
-
this.attachments = new Attachments
|
|
518
|
+
this.attachments = new Attachments(resend);
|
|
516
519
|
}
|
|
517
520
|
async get(id) {
|
|
518
521
|
return await this.resend.get(`/emails/receiving/${id}`);
|
|
@@ -529,7 +532,7 @@ var Receiving = class {
|
|
|
529
532
|
var Emails = class {
|
|
530
533
|
constructor(resend) {
|
|
531
534
|
this.resend = resend;
|
|
532
|
-
this.attachments = new Attachments(resend);
|
|
535
|
+
this.attachments = new Attachments$1(resend);
|
|
533
536
|
this.receiving = new Receiving(resend);
|
|
534
537
|
}
|
|
535
538
|
async send(payload, options = {}) {
|
package/dist/index.d.cts
CHANGED
|
@@ -63,10 +63,13 @@ interface DomainApiOptions {
|
|
|
63
63
|
region?: string;
|
|
64
64
|
custom_return_path?: string;
|
|
65
65
|
capabilities?: Partial<DomainCapabilities>;
|
|
66
|
+
open_tracking?: boolean;
|
|
67
|
+
click_tracking?: boolean;
|
|
68
|
+
tls?: 'enforced' | 'opportunistic';
|
|
66
69
|
}
|
|
67
70
|
//#endregion
|
|
68
71
|
//#region src/interfaces.d.ts
|
|
69
|
-
type RESEND_ERROR_CODE_KEY = '
|
|
72
|
+
type RESEND_ERROR_CODE_KEY = 'invalid_idempotency_key' | 'validation_error' | 'missing_api_key' | 'restricted_api_key' | 'invalid_api_key' | 'not_found' | 'method_not_allowed' | 'invalid_idempotent_request' | 'concurrent_idempotent_requests' | 'invalid_attachment' | 'invalid_from_address' | 'invalid_access' | 'invalid_parameter' | 'invalid_region' | 'missing_required_field' | 'monthly_quota_exceeded' | 'daily_quota_exceeded' | 'rate_limit_exceeded' | 'security_error' | 'application_error' | 'internal_server_error';
|
|
70
73
|
type Response<T> = ({
|
|
71
74
|
data: T;
|
|
72
75
|
error: null;
|
|
@@ -668,6 +671,9 @@ interface CreateDomainOptions {
|
|
|
668
671
|
region?: DomainRegion;
|
|
669
672
|
customReturnPath?: string;
|
|
670
673
|
capabilities?: Partial<DomainCapabilities>;
|
|
674
|
+
openTracking?: boolean;
|
|
675
|
+
clickTracking?: boolean;
|
|
676
|
+
tls?: 'enforced' | 'opportunistic';
|
|
671
677
|
}
|
|
672
678
|
interface CreateDomainRequestOptions extends PostOptions {}
|
|
673
679
|
interface CreateDomainResponseSuccess extends Pick<Domain, 'name' | 'id' | 'status' | 'created_at' | 'region'> {
|
|
@@ -1055,7 +1061,7 @@ declare class Domains {
|
|
|
1055
1061
|
}
|
|
1056
1062
|
//#endregion
|
|
1057
1063
|
//#region src/emails/attachments/attachments.d.ts
|
|
1058
|
-
declare class Attachments {
|
|
1064
|
+
declare class Attachments$1 {
|
|
1059
1065
|
private readonly resend;
|
|
1060
1066
|
constructor(resend: Resend);
|
|
1061
1067
|
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
@@ -1073,7 +1079,7 @@ type ListEmailsResponseSuccess = {
|
|
|
1073
1079
|
type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
|
|
1074
1080
|
//#endregion
|
|
1075
1081
|
//#region src/emails/receiving/attachments/attachments.d.ts
|
|
1076
|
-
declare class Attachments
|
|
1082
|
+
declare class Attachments {
|
|
1077
1083
|
private readonly resend;
|
|
1078
1084
|
constructor(resend: Resend);
|
|
1079
1085
|
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
@@ -1083,7 +1089,7 @@ declare class Attachments$1 {
|
|
|
1083
1089
|
//#region src/emails/receiving/receiving.d.ts
|
|
1084
1090
|
declare class Receiving {
|
|
1085
1091
|
private readonly resend;
|
|
1086
|
-
readonly attachments: Attachments
|
|
1092
|
+
readonly attachments: Attachments;
|
|
1087
1093
|
constructor(resend: Resend);
|
|
1088
1094
|
get(id: string): Promise<GetReceivingEmailResponse>;
|
|
1089
1095
|
list(options?: ListReceivingEmailsOptions): Promise<ListReceivingEmailsResponse>;
|
|
@@ -1092,7 +1098,7 @@ declare class Receiving {
|
|
|
1092
1098
|
//#region src/emails/emails.d.ts
|
|
1093
1099
|
declare class Emails {
|
|
1094
1100
|
private readonly resend;
|
|
1095
|
-
readonly attachments: Attachments;
|
|
1101
|
+
readonly attachments: Attachments$1;
|
|
1096
1102
|
readonly receiving: Receiving;
|
|
1097
1103
|
constructor(resend: Resend);
|
|
1098
1104
|
send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
@@ -1325,7 +1331,175 @@ declare class Topics {
|
|
|
1325
1331
|
}
|
|
1326
1332
|
//#endregion
|
|
1327
1333
|
//#region src/webhooks/interfaces/webhook-event.interface.d.ts
|
|
1328
|
-
type WebhookEvent = 'email.sent' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
|
|
1334
|
+
type WebhookEvent = 'email.sent' | 'email.scheduled' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'email.suppressed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
|
|
1335
|
+
interface BaseEmailEventData {
|
|
1336
|
+
broadcast_id?: string;
|
|
1337
|
+
created_at: string;
|
|
1338
|
+
email_id: string;
|
|
1339
|
+
from: string;
|
|
1340
|
+
to: string[];
|
|
1341
|
+
subject: string;
|
|
1342
|
+
template_id?: string;
|
|
1343
|
+
tags?: Record<string, string>;
|
|
1344
|
+
}
|
|
1345
|
+
interface EmailBounce {
|
|
1346
|
+
message: string;
|
|
1347
|
+
subType: string;
|
|
1348
|
+
type: string;
|
|
1349
|
+
}
|
|
1350
|
+
interface EmailClick {
|
|
1351
|
+
ipAddress: string;
|
|
1352
|
+
link: string;
|
|
1353
|
+
timestamp: string;
|
|
1354
|
+
userAgent: string;
|
|
1355
|
+
}
|
|
1356
|
+
interface EmailFailed {
|
|
1357
|
+
reason: string;
|
|
1358
|
+
}
|
|
1359
|
+
interface EmailSuppressed {
|
|
1360
|
+
message: string;
|
|
1361
|
+
type: string;
|
|
1362
|
+
}
|
|
1363
|
+
interface ReceivedEmailAttachment {
|
|
1364
|
+
id: string;
|
|
1365
|
+
filename: string;
|
|
1366
|
+
content_type: string;
|
|
1367
|
+
content_disposition: string;
|
|
1368
|
+
content_id?: string;
|
|
1369
|
+
}
|
|
1370
|
+
interface ReceivedEmailEventData {
|
|
1371
|
+
email_id: string;
|
|
1372
|
+
created_at: string;
|
|
1373
|
+
from: string;
|
|
1374
|
+
to: string[];
|
|
1375
|
+
bcc: string[];
|
|
1376
|
+
cc: string[];
|
|
1377
|
+
message_id: string;
|
|
1378
|
+
subject: string;
|
|
1379
|
+
attachments: ReceivedEmailAttachment[];
|
|
1380
|
+
}
|
|
1381
|
+
interface ContactEventData {
|
|
1382
|
+
id: string;
|
|
1383
|
+
audience_id: string;
|
|
1384
|
+
segment_ids: string[];
|
|
1385
|
+
created_at: string;
|
|
1386
|
+
updated_at: string;
|
|
1387
|
+
email: string;
|
|
1388
|
+
first_name?: string;
|
|
1389
|
+
last_name?: string;
|
|
1390
|
+
unsubscribed: boolean;
|
|
1391
|
+
}
|
|
1392
|
+
interface DomainRecord {
|
|
1393
|
+
record: string;
|
|
1394
|
+
name: string;
|
|
1395
|
+
type: string;
|
|
1396
|
+
ttl: string;
|
|
1397
|
+
status: string;
|
|
1398
|
+
value: string;
|
|
1399
|
+
priority?: number;
|
|
1400
|
+
}
|
|
1401
|
+
interface DomainEventData {
|
|
1402
|
+
id: string;
|
|
1403
|
+
name: string;
|
|
1404
|
+
status: string;
|
|
1405
|
+
created_at: string;
|
|
1406
|
+
region: string;
|
|
1407
|
+
records: DomainRecord[];
|
|
1408
|
+
}
|
|
1409
|
+
interface EmailSentEvent {
|
|
1410
|
+
type: 'email.sent';
|
|
1411
|
+
created_at: string;
|
|
1412
|
+
data: BaseEmailEventData;
|
|
1413
|
+
}
|
|
1414
|
+
interface EmailScheduledEvent {
|
|
1415
|
+
type: 'email.scheduled';
|
|
1416
|
+
created_at: string;
|
|
1417
|
+
data: BaseEmailEventData;
|
|
1418
|
+
}
|
|
1419
|
+
interface EmailDeliveredEvent {
|
|
1420
|
+
type: 'email.delivered';
|
|
1421
|
+
created_at: string;
|
|
1422
|
+
data: BaseEmailEventData;
|
|
1423
|
+
}
|
|
1424
|
+
interface EmailDeliveryDelayedEvent {
|
|
1425
|
+
type: 'email.delivery_delayed';
|
|
1426
|
+
created_at: string;
|
|
1427
|
+
data: BaseEmailEventData;
|
|
1428
|
+
}
|
|
1429
|
+
interface EmailComplainedEvent {
|
|
1430
|
+
type: 'email.complained';
|
|
1431
|
+
created_at: string;
|
|
1432
|
+
data: BaseEmailEventData;
|
|
1433
|
+
}
|
|
1434
|
+
interface EmailBouncedEvent {
|
|
1435
|
+
type: 'email.bounced';
|
|
1436
|
+
created_at: string;
|
|
1437
|
+
data: BaseEmailEventData & {
|
|
1438
|
+
bounce: EmailBounce;
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
interface EmailOpenedEvent {
|
|
1442
|
+
type: 'email.opened';
|
|
1443
|
+
created_at: string;
|
|
1444
|
+
data: BaseEmailEventData;
|
|
1445
|
+
}
|
|
1446
|
+
interface EmailClickedEvent {
|
|
1447
|
+
type: 'email.clicked';
|
|
1448
|
+
created_at: string;
|
|
1449
|
+
data: BaseEmailEventData & {
|
|
1450
|
+
click: EmailClick;
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
interface EmailReceivedEvent {
|
|
1454
|
+
type: 'email.received';
|
|
1455
|
+
created_at: string;
|
|
1456
|
+
data: ReceivedEmailEventData;
|
|
1457
|
+
}
|
|
1458
|
+
interface EmailFailedEvent {
|
|
1459
|
+
type: 'email.failed';
|
|
1460
|
+
created_at: string;
|
|
1461
|
+
data: BaseEmailEventData & {
|
|
1462
|
+
failed: EmailFailed;
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
interface EmailSuppressedEvent {
|
|
1466
|
+
type: 'email.suppressed';
|
|
1467
|
+
created_at: string;
|
|
1468
|
+
data: BaseEmailEventData & {
|
|
1469
|
+
suppressed: EmailSuppressed;
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
interface ContactCreatedEvent {
|
|
1473
|
+
type: 'contact.created';
|
|
1474
|
+
created_at: string;
|
|
1475
|
+
data: ContactEventData;
|
|
1476
|
+
}
|
|
1477
|
+
interface ContactUpdatedEvent {
|
|
1478
|
+
type: 'contact.updated';
|
|
1479
|
+
created_at: string;
|
|
1480
|
+
data: ContactEventData;
|
|
1481
|
+
}
|
|
1482
|
+
interface ContactDeletedEvent {
|
|
1483
|
+
type: 'contact.deleted';
|
|
1484
|
+
created_at: string;
|
|
1485
|
+
data: ContactEventData;
|
|
1486
|
+
}
|
|
1487
|
+
interface DomainCreatedEvent {
|
|
1488
|
+
type: 'domain.created';
|
|
1489
|
+
created_at: string;
|
|
1490
|
+
data: DomainEventData;
|
|
1491
|
+
}
|
|
1492
|
+
interface DomainUpdatedEvent {
|
|
1493
|
+
type: 'domain.updated';
|
|
1494
|
+
created_at: string;
|
|
1495
|
+
data: DomainEventData;
|
|
1496
|
+
}
|
|
1497
|
+
interface DomainDeletedEvent {
|
|
1498
|
+
type: 'domain.deleted';
|
|
1499
|
+
created_at: string;
|
|
1500
|
+
data: DomainEventData;
|
|
1501
|
+
}
|
|
1502
|
+
type WebhookEventPayload = EmailSentEvent | EmailScheduledEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailComplainedEvent | EmailBouncedEvent | EmailOpenedEvent | EmailClickedEvent | EmailReceivedEvent | EmailFailedEvent | EmailSuppressedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | DomainCreatedEvent | DomainUpdatedEvent | DomainDeletedEvent;
|
|
1329
1503
|
//#endregion
|
|
1330
1504
|
//#region src/webhooks/interfaces/create-webhook-options.interface.d.ts
|
|
1331
1505
|
interface CreateWebhookOptions {
|
|
@@ -1406,7 +1580,7 @@ declare class Webhooks {
|
|
|
1406
1580
|
list(options?: ListWebhooksOptions): Promise<ListWebhooksResponse>;
|
|
1407
1581
|
update(id: string, payload: UpdateWebhookOptions): Promise<UpdateWebhookResponse>;
|
|
1408
1582
|
remove(id: string): Promise<RemoveWebhookResponse>;
|
|
1409
|
-
verify(payload: VerifyWebhookOptions):
|
|
1583
|
+
verify(payload: VerifyWebhookOptions): WebhookEventPayload;
|
|
1410
1584
|
}
|
|
1411
1585
|
//#endregion
|
|
1412
1586
|
//#region src/resend.d.ts
|
|
@@ -1437,4 +1611,4 @@ declare class Resend {
|
|
|
1437
1611
|
delete<T>(path: string, query?: unknown): Promise<Response<T>>;
|
|
1438
1612
|
}
|
|
1439
1613
|
//#endregion
|
|
1440
|
-
export { ApiKey, Attachment, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, EmailApiAttachment, EmailApiOptions, type ErrorResponse, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsApiResponse, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, Webhook, WebhookEvent };
|
|
1614
|
+
export { ApiKey, Attachment, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsApiResponse, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, Webhook, WebhookEvent, WebhookEventPayload };
|
package/dist/index.d.mts
CHANGED
|
@@ -63,10 +63,13 @@ interface DomainApiOptions {
|
|
|
63
63
|
region?: string;
|
|
64
64
|
custom_return_path?: string;
|
|
65
65
|
capabilities?: Partial<DomainCapabilities>;
|
|
66
|
+
open_tracking?: boolean;
|
|
67
|
+
click_tracking?: boolean;
|
|
68
|
+
tls?: 'enforced' | 'opportunistic';
|
|
66
69
|
}
|
|
67
70
|
//#endregion
|
|
68
71
|
//#region src/interfaces.d.ts
|
|
69
|
-
type RESEND_ERROR_CODE_KEY = '
|
|
72
|
+
type RESEND_ERROR_CODE_KEY = 'invalid_idempotency_key' | 'validation_error' | 'missing_api_key' | 'restricted_api_key' | 'invalid_api_key' | 'not_found' | 'method_not_allowed' | 'invalid_idempotent_request' | 'concurrent_idempotent_requests' | 'invalid_attachment' | 'invalid_from_address' | 'invalid_access' | 'invalid_parameter' | 'invalid_region' | 'missing_required_field' | 'monthly_quota_exceeded' | 'daily_quota_exceeded' | 'rate_limit_exceeded' | 'security_error' | 'application_error' | 'internal_server_error';
|
|
70
73
|
type Response<T> = ({
|
|
71
74
|
data: T;
|
|
72
75
|
error: null;
|
|
@@ -668,6 +671,9 @@ interface CreateDomainOptions {
|
|
|
668
671
|
region?: DomainRegion;
|
|
669
672
|
customReturnPath?: string;
|
|
670
673
|
capabilities?: Partial<DomainCapabilities>;
|
|
674
|
+
openTracking?: boolean;
|
|
675
|
+
clickTracking?: boolean;
|
|
676
|
+
tls?: 'enforced' | 'opportunistic';
|
|
671
677
|
}
|
|
672
678
|
interface CreateDomainRequestOptions extends PostOptions {}
|
|
673
679
|
interface CreateDomainResponseSuccess extends Pick<Domain, 'name' | 'id' | 'status' | 'created_at' | 'region'> {
|
|
@@ -1055,7 +1061,7 @@ declare class Domains {
|
|
|
1055
1061
|
}
|
|
1056
1062
|
//#endregion
|
|
1057
1063
|
//#region src/emails/attachments/attachments.d.ts
|
|
1058
|
-
declare class Attachments {
|
|
1064
|
+
declare class Attachments$1 {
|
|
1059
1065
|
private readonly resend;
|
|
1060
1066
|
constructor(resend: Resend);
|
|
1061
1067
|
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
@@ -1073,7 +1079,7 @@ type ListEmailsResponseSuccess = {
|
|
|
1073
1079
|
type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
|
|
1074
1080
|
//#endregion
|
|
1075
1081
|
//#region src/emails/receiving/attachments/attachments.d.ts
|
|
1076
|
-
declare class Attachments
|
|
1082
|
+
declare class Attachments {
|
|
1077
1083
|
private readonly resend;
|
|
1078
1084
|
constructor(resend: Resend);
|
|
1079
1085
|
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
@@ -1083,7 +1089,7 @@ declare class Attachments$1 {
|
|
|
1083
1089
|
//#region src/emails/receiving/receiving.d.ts
|
|
1084
1090
|
declare class Receiving {
|
|
1085
1091
|
private readonly resend;
|
|
1086
|
-
readonly attachments: Attachments
|
|
1092
|
+
readonly attachments: Attachments;
|
|
1087
1093
|
constructor(resend: Resend);
|
|
1088
1094
|
get(id: string): Promise<GetReceivingEmailResponse>;
|
|
1089
1095
|
list(options?: ListReceivingEmailsOptions): Promise<ListReceivingEmailsResponse>;
|
|
@@ -1092,7 +1098,7 @@ declare class Receiving {
|
|
|
1092
1098
|
//#region src/emails/emails.d.ts
|
|
1093
1099
|
declare class Emails {
|
|
1094
1100
|
private readonly resend;
|
|
1095
|
-
readonly attachments: Attachments;
|
|
1101
|
+
readonly attachments: Attachments$1;
|
|
1096
1102
|
readonly receiving: Receiving;
|
|
1097
1103
|
constructor(resend: Resend);
|
|
1098
1104
|
send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
@@ -1325,7 +1331,175 @@ declare class Topics {
|
|
|
1325
1331
|
}
|
|
1326
1332
|
//#endregion
|
|
1327
1333
|
//#region src/webhooks/interfaces/webhook-event.interface.d.ts
|
|
1328
|
-
type WebhookEvent = 'email.sent' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
|
|
1334
|
+
type WebhookEvent = 'email.sent' | 'email.scheduled' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'email.suppressed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
|
|
1335
|
+
interface BaseEmailEventData {
|
|
1336
|
+
broadcast_id?: string;
|
|
1337
|
+
created_at: string;
|
|
1338
|
+
email_id: string;
|
|
1339
|
+
from: string;
|
|
1340
|
+
to: string[];
|
|
1341
|
+
subject: string;
|
|
1342
|
+
template_id?: string;
|
|
1343
|
+
tags?: Record<string, string>;
|
|
1344
|
+
}
|
|
1345
|
+
interface EmailBounce {
|
|
1346
|
+
message: string;
|
|
1347
|
+
subType: string;
|
|
1348
|
+
type: string;
|
|
1349
|
+
}
|
|
1350
|
+
interface EmailClick {
|
|
1351
|
+
ipAddress: string;
|
|
1352
|
+
link: string;
|
|
1353
|
+
timestamp: string;
|
|
1354
|
+
userAgent: string;
|
|
1355
|
+
}
|
|
1356
|
+
interface EmailFailed {
|
|
1357
|
+
reason: string;
|
|
1358
|
+
}
|
|
1359
|
+
interface EmailSuppressed {
|
|
1360
|
+
message: string;
|
|
1361
|
+
type: string;
|
|
1362
|
+
}
|
|
1363
|
+
interface ReceivedEmailAttachment {
|
|
1364
|
+
id: string;
|
|
1365
|
+
filename: string;
|
|
1366
|
+
content_type: string;
|
|
1367
|
+
content_disposition: string;
|
|
1368
|
+
content_id?: string;
|
|
1369
|
+
}
|
|
1370
|
+
interface ReceivedEmailEventData {
|
|
1371
|
+
email_id: string;
|
|
1372
|
+
created_at: string;
|
|
1373
|
+
from: string;
|
|
1374
|
+
to: string[];
|
|
1375
|
+
bcc: string[];
|
|
1376
|
+
cc: string[];
|
|
1377
|
+
message_id: string;
|
|
1378
|
+
subject: string;
|
|
1379
|
+
attachments: ReceivedEmailAttachment[];
|
|
1380
|
+
}
|
|
1381
|
+
interface ContactEventData {
|
|
1382
|
+
id: string;
|
|
1383
|
+
audience_id: string;
|
|
1384
|
+
segment_ids: string[];
|
|
1385
|
+
created_at: string;
|
|
1386
|
+
updated_at: string;
|
|
1387
|
+
email: string;
|
|
1388
|
+
first_name?: string;
|
|
1389
|
+
last_name?: string;
|
|
1390
|
+
unsubscribed: boolean;
|
|
1391
|
+
}
|
|
1392
|
+
interface DomainRecord {
|
|
1393
|
+
record: string;
|
|
1394
|
+
name: string;
|
|
1395
|
+
type: string;
|
|
1396
|
+
ttl: string;
|
|
1397
|
+
status: string;
|
|
1398
|
+
value: string;
|
|
1399
|
+
priority?: number;
|
|
1400
|
+
}
|
|
1401
|
+
interface DomainEventData {
|
|
1402
|
+
id: string;
|
|
1403
|
+
name: string;
|
|
1404
|
+
status: string;
|
|
1405
|
+
created_at: string;
|
|
1406
|
+
region: string;
|
|
1407
|
+
records: DomainRecord[];
|
|
1408
|
+
}
|
|
1409
|
+
interface EmailSentEvent {
|
|
1410
|
+
type: 'email.sent';
|
|
1411
|
+
created_at: string;
|
|
1412
|
+
data: BaseEmailEventData;
|
|
1413
|
+
}
|
|
1414
|
+
interface EmailScheduledEvent {
|
|
1415
|
+
type: 'email.scheduled';
|
|
1416
|
+
created_at: string;
|
|
1417
|
+
data: BaseEmailEventData;
|
|
1418
|
+
}
|
|
1419
|
+
interface EmailDeliveredEvent {
|
|
1420
|
+
type: 'email.delivered';
|
|
1421
|
+
created_at: string;
|
|
1422
|
+
data: BaseEmailEventData;
|
|
1423
|
+
}
|
|
1424
|
+
interface EmailDeliveryDelayedEvent {
|
|
1425
|
+
type: 'email.delivery_delayed';
|
|
1426
|
+
created_at: string;
|
|
1427
|
+
data: BaseEmailEventData;
|
|
1428
|
+
}
|
|
1429
|
+
interface EmailComplainedEvent {
|
|
1430
|
+
type: 'email.complained';
|
|
1431
|
+
created_at: string;
|
|
1432
|
+
data: BaseEmailEventData;
|
|
1433
|
+
}
|
|
1434
|
+
interface EmailBouncedEvent {
|
|
1435
|
+
type: 'email.bounced';
|
|
1436
|
+
created_at: string;
|
|
1437
|
+
data: BaseEmailEventData & {
|
|
1438
|
+
bounce: EmailBounce;
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
interface EmailOpenedEvent {
|
|
1442
|
+
type: 'email.opened';
|
|
1443
|
+
created_at: string;
|
|
1444
|
+
data: BaseEmailEventData;
|
|
1445
|
+
}
|
|
1446
|
+
interface EmailClickedEvent {
|
|
1447
|
+
type: 'email.clicked';
|
|
1448
|
+
created_at: string;
|
|
1449
|
+
data: BaseEmailEventData & {
|
|
1450
|
+
click: EmailClick;
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
interface EmailReceivedEvent {
|
|
1454
|
+
type: 'email.received';
|
|
1455
|
+
created_at: string;
|
|
1456
|
+
data: ReceivedEmailEventData;
|
|
1457
|
+
}
|
|
1458
|
+
interface EmailFailedEvent {
|
|
1459
|
+
type: 'email.failed';
|
|
1460
|
+
created_at: string;
|
|
1461
|
+
data: BaseEmailEventData & {
|
|
1462
|
+
failed: EmailFailed;
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
interface EmailSuppressedEvent {
|
|
1466
|
+
type: 'email.suppressed';
|
|
1467
|
+
created_at: string;
|
|
1468
|
+
data: BaseEmailEventData & {
|
|
1469
|
+
suppressed: EmailSuppressed;
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
interface ContactCreatedEvent {
|
|
1473
|
+
type: 'contact.created';
|
|
1474
|
+
created_at: string;
|
|
1475
|
+
data: ContactEventData;
|
|
1476
|
+
}
|
|
1477
|
+
interface ContactUpdatedEvent {
|
|
1478
|
+
type: 'contact.updated';
|
|
1479
|
+
created_at: string;
|
|
1480
|
+
data: ContactEventData;
|
|
1481
|
+
}
|
|
1482
|
+
interface ContactDeletedEvent {
|
|
1483
|
+
type: 'contact.deleted';
|
|
1484
|
+
created_at: string;
|
|
1485
|
+
data: ContactEventData;
|
|
1486
|
+
}
|
|
1487
|
+
interface DomainCreatedEvent {
|
|
1488
|
+
type: 'domain.created';
|
|
1489
|
+
created_at: string;
|
|
1490
|
+
data: DomainEventData;
|
|
1491
|
+
}
|
|
1492
|
+
interface DomainUpdatedEvent {
|
|
1493
|
+
type: 'domain.updated';
|
|
1494
|
+
created_at: string;
|
|
1495
|
+
data: DomainEventData;
|
|
1496
|
+
}
|
|
1497
|
+
interface DomainDeletedEvent {
|
|
1498
|
+
type: 'domain.deleted';
|
|
1499
|
+
created_at: string;
|
|
1500
|
+
data: DomainEventData;
|
|
1501
|
+
}
|
|
1502
|
+
type WebhookEventPayload = EmailSentEvent | EmailScheduledEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailComplainedEvent | EmailBouncedEvent | EmailOpenedEvent | EmailClickedEvent | EmailReceivedEvent | EmailFailedEvent | EmailSuppressedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | DomainCreatedEvent | DomainUpdatedEvent | DomainDeletedEvent;
|
|
1329
1503
|
//#endregion
|
|
1330
1504
|
//#region src/webhooks/interfaces/create-webhook-options.interface.d.ts
|
|
1331
1505
|
interface CreateWebhookOptions {
|
|
@@ -1406,7 +1580,7 @@ declare class Webhooks {
|
|
|
1406
1580
|
list(options?: ListWebhooksOptions): Promise<ListWebhooksResponse>;
|
|
1407
1581
|
update(id: string, payload: UpdateWebhookOptions): Promise<UpdateWebhookResponse>;
|
|
1408
1582
|
remove(id: string): Promise<RemoveWebhookResponse>;
|
|
1409
|
-
verify(payload: VerifyWebhookOptions):
|
|
1583
|
+
verify(payload: VerifyWebhookOptions): WebhookEventPayload;
|
|
1410
1584
|
}
|
|
1411
1585
|
//#endregion
|
|
1412
1586
|
//#region src/resend.d.ts
|
|
@@ -1437,4 +1611,4 @@ declare class Resend {
|
|
|
1437
1611
|
delete<T>(path: string, query?: unknown): Promise<Response<T>>;
|
|
1438
1612
|
}
|
|
1439
1613
|
//#endregion
|
|
1440
|
-
export { ApiKey, Attachment, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, EmailApiAttachment, EmailApiOptions, type ErrorResponse, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsApiResponse, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, Webhook, WebhookEvent };
|
|
1614
|
+
export { ApiKey, Attachment, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsApiResponse, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, Webhook, WebhookEvent, WebhookEventPayload };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Webhook } from "svix";
|
|
2
2
|
|
|
3
3
|
//#region package.json
|
|
4
|
-
var version = "6.
|
|
4
|
+
var version = "6.7.0-canary.0";
|
|
5
5
|
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/common/utils/build-pagination-query.ts
|
|
@@ -434,7 +434,10 @@ function parseDomainToApiOptions(domain) {
|
|
|
434
434
|
name: domain.name,
|
|
435
435
|
region: domain.region,
|
|
436
436
|
custom_return_path: domain.customReturnPath,
|
|
437
|
-
capabilities: domain.capabilities
|
|
437
|
+
capabilities: domain.capabilities,
|
|
438
|
+
open_tracking: domain.openTracking,
|
|
439
|
+
click_tracking: domain.clickTracking,
|
|
440
|
+
tls: domain.tls
|
|
438
441
|
};
|
|
439
442
|
}
|
|
440
443
|
|
|
@@ -473,7 +476,7 @@ var Domains = class {
|
|
|
473
476
|
|
|
474
477
|
//#endregion
|
|
475
478
|
//#region src/emails/attachments/attachments.ts
|
|
476
|
-
var Attachments = class {
|
|
479
|
+
var Attachments$1 = class {
|
|
477
480
|
constructor(resend) {
|
|
478
481
|
this.resend = resend;
|
|
479
482
|
}
|
|
@@ -491,7 +494,7 @@ var Attachments = class {
|
|
|
491
494
|
|
|
492
495
|
//#endregion
|
|
493
496
|
//#region src/emails/receiving/attachments/attachments.ts
|
|
494
|
-
var Attachments
|
|
497
|
+
var Attachments = class {
|
|
495
498
|
constructor(resend) {
|
|
496
499
|
this.resend = resend;
|
|
497
500
|
}
|
|
@@ -512,7 +515,7 @@ var Attachments$1 = class {
|
|
|
512
515
|
var Receiving = class {
|
|
513
516
|
constructor(resend) {
|
|
514
517
|
this.resend = resend;
|
|
515
|
-
this.attachments = new Attachments
|
|
518
|
+
this.attachments = new Attachments(resend);
|
|
516
519
|
}
|
|
517
520
|
async get(id) {
|
|
518
521
|
return await this.resend.get(`/emails/receiving/${id}`);
|
|
@@ -529,7 +532,7 @@ var Receiving = class {
|
|
|
529
532
|
var Emails = class {
|
|
530
533
|
constructor(resend) {
|
|
531
534
|
this.resend = resend;
|
|
532
|
-
this.attachments = new Attachments(resend);
|
|
535
|
+
this.attachments = new Attachments$1(resend);
|
|
533
536
|
this.receiving = new Receiving(resend);
|
|
534
537
|
}
|
|
535
538
|
async send(payload, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0-canary.0",
|
|
4
4
|
"description": "Node.js library for the Resend API",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -29,6 +29,19 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsdown src/index.ts --format esm,cjs --dts",
|
|
34
|
+
"integration:nextjs": "cd ./integrations/nextjs && next build --turbopack",
|
|
35
|
+
"lint": "biome check .",
|
|
36
|
+
"lint:fix": "biome check . --write",
|
|
37
|
+
"prepublishOnly": "pnpm run build",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"test:dev": "cross-env TEST_MODE=dev vitest run",
|
|
40
|
+
"test:integrations": "vitest run integrations",
|
|
41
|
+
"test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run",
|
|
42
|
+
"test:watch": "vitest",
|
|
43
|
+
"typecheck": "tsc --noEmit"
|
|
44
|
+
},
|
|
32
45
|
"repository": {
|
|
33
46
|
"type": "git",
|
|
34
47
|
"url": "git+https://github.com/resend/resend-node.git"
|
|
@@ -40,7 +53,7 @@
|
|
|
40
53
|
},
|
|
41
54
|
"homepage": "https://github.com/resend/resend-node#readme",
|
|
42
55
|
"dependencies": {
|
|
43
|
-
"svix": "1.
|
|
56
|
+
"svix": "1.84.1"
|
|
44
57
|
},
|
|
45
58
|
"peerDependencies": {
|
|
46
59
|
"@react-email/render": "*"
|
|
@@ -51,29 +64,20 @@
|
|
|
51
64
|
}
|
|
52
65
|
},
|
|
53
66
|
"devDependencies": {
|
|
54
|
-
"@biomejs/biome": "2.
|
|
67
|
+
"@biomejs/biome": "2.3.11",
|
|
55
68
|
"@pollyjs/adapter-fetch": "6.0.7",
|
|
56
69
|
"@pollyjs/core": "6.0.6",
|
|
57
70
|
"@pollyjs/persister-fs": "6.0.6",
|
|
58
|
-
"@types/node": "24.10.
|
|
59
|
-
"@types/react": "19.2.
|
|
71
|
+
"@types/node": "24.10.4",
|
|
72
|
+
"@types/react": "19.2.7",
|
|
60
73
|
"cross-env": "10.1.0",
|
|
61
74
|
"dotenv": "17.2.3",
|
|
62
|
-
"pkg-pr-new": "0.0.
|
|
63
|
-
"rimraf": "6.1.
|
|
64
|
-
"tsdown": "0.
|
|
75
|
+
"pkg-pr-new": "0.0.62",
|
|
76
|
+
"rimraf": "6.1.2",
|
|
77
|
+
"tsdown": "0.18.4",
|
|
65
78
|
"typescript": "5.9.3",
|
|
66
|
-
"vitest": "
|
|
79
|
+
"vitest": "4.0.16",
|
|
67
80
|
"vitest-fetch-mock": "0.4.5"
|
|
68
81
|
},
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
"lint": "biome check .",
|
|
72
|
-
"lint:fix": "biome check . --write",
|
|
73
|
-
"test": "vitest run",
|
|
74
|
-
"test:dev": "cross-env TEST_MODE=dev vitest run",
|
|
75
|
-
"test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run",
|
|
76
|
-
"test:watch": "vitest",
|
|
77
|
-
"typecheck": "tsc --noEmit"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
82
|
+
"packageManager": "pnpm@10.27.0"
|
|
83
|
+
}
|