resend 4.1.1 → 4.1.2
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +23 -16
- package/dist/index.mjs +23 -16
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -724,4 +724,4 @@ declare class Resend {
|
|
|
724
724
|
}>;
|
|
725
725
|
}
|
|
726
726
|
|
|
727
|
-
export { CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateAudienceOptions, CreateAudienceRequestOptions, CreateAudienceResponse, CreateAudienceResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, ErrorResponse, GetAudienceResponse, GetAudienceResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAudiencesResponse, ListAudiencesResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsResponse, ListDomainsResponseSuccess, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveAudiencesResponse, RemoveAudiencesResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, Resend, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess };
|
|
727
|
+
export { Attachment, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateAudienceOptions, CreateAudienceRequestOptions, CreateAudienceResponse, CreateAudienceResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, ErrorResponse, GetAudienceResponse, GetAudienceResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAudiencesResponse, ListAudiencesResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsResponse, ListDomainsResponseSuccess, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveAudiencesResponse, RemoveAudiencesResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, Resend, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess };
|
package/dist/index.d.ts
CHANGED
|
@@ -724,4 +724,4 @@ declare class Resend {
|
|
|
724
724
|
}>;
|
|
725
725
|
}
|
|
726
726
|
|
|
727
|
-
export { CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateAudienceOptions, CreateAudienceRequestOptions, CreateAudienceResponse, CreateAudienceResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, ErrorResponse, GetAudienceResponse, GetAudienceResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAudiencesResponse, ListAudiencesResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsResponse, ListDomainsResponseSuccess, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveAudiencesResponse, RemoveAudiencesResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, Resend, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess };
|
|
727
|
+
export { Attachment, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateAudienceOptions, CreateAudienceRequestOptions, CreateAudienceResponse, CreateAudienceResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, ErrorResponse, GetAudienceResponse, GetAudienceResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAudiencesResponse, ListAudiencesResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsResponse, ListDomainsResponseSuccess, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveAudiencesResponse, RemoveAudiencesResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, Resend, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess };
|
package/dist/index.js
CHANGED
|
@@ -72,7 +72,7 @@ __export(src_exports, {
|
|
|
72
72
|
module.exports = __toCommonJS(src_exports);
|
|
73
73
|
|
|
74
74
|
// package.json
|
|
75
|
-
var version = "4.1.
|
|
75
|
+
var version = "4.1.2";
|
|
76
76
|
|
|
77
77
|
// src/api-keys/api-keys.ts
|
|
78
78
|
var ApiKeys = class {
|
|
@@ -144,6 +144,24 @@ var Audiences = class {
|
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
+
// src/common/utils/parse-email-to-api-options.ts
|
|
148
|
+
function parseEmailToApiOptions(email) {
|
|
149
|
+
return {
|
|
150
|
+
attachments: email.attachments,
|
|
151
|
+
bcc: email.bcc,
|
|
152
|
+
cc: email.cc,
|
|
153
|
+
from: email.from,
|
|
154
|
+
headers: email.headers,
|
|
155
|
+
html: email.html,
|
|
156
|
+
reply_to: email.replyTo,
|
|
157
|
+
scheduled_at: email.scheduledAt,
|
|
158
|
+
subject: email.subject,
|
|
159
|
+
tags: email.tags,
|
|
160
|
+
text: email.text,
|
|
161
|
+
to: email.to
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
147
165
|
// src/batch/batch.ts
|
|
148
166
|
var Batch = class {
|
|
149
167
|
constructor(resend) {
|
|
@@ -156,6 +174,7 @@ var Batch = class {
|
|
|
156
174
|
}
|
|
157
175
|
create(_0) {
|
|
158
176
|
return __async(this, arguments, function* (payload, options = {}) {
|
|
177
|
+
const emails = [];
|
|
159
178
|
for (const email of payload) {
|
|
160
179
|
if (email.react) {
|
|
161
180
|
if (!this.renderAsync) {
|
|
@@ -171,10 +190,11 @@ var Batch = class {
|
|
|
171
190
|
email.html = yield this.renderAsync(email.react);
|
|
172
191
|
email.react = void 0;
|
|
173
192
|
}
|
|
193
|
+
emails.push(parseEmailToApiOptions(email));
|
|
174
194
|
}
|
|
175
195
|
const data = yield this.resend.post(
|
|
176
196
|
"/emails/batch",
|
|
177
|
-
|
|
197
|
+
emails,
|
|
178
198
|
options
|
|
179
199
|
);
|
|
180
200
|
return data;
|
|
@@ -420,20 +440,7 @@ var Emails = class {
|
|
|
420
440
|
}
|
|
421
441
|
const data = yield this.resend.post(
|
|
422
442
|
"/emails",
|
|
423
|
-
|
|
424
|
-
attachments: payload.attachments,
|
|
425
|
-
bcc: payload.bcc,
|
|
426
|
-
cc: payload.cc,
|
|
427
|
-
from: payload.from,
|
|
428
|
-
headers: payload.headers,
|
|
429
|
-
html: payload.html,
|
|
430
|
-
reply_to: payload.replyTo,
|
|
431
|
-
scheduled_at: payload.scheduledAt,
|
|
432
|
-
subject: payload.subject,
|
|
433
|
-
tags: payload.tags,
|
|
434
|
-
text: payload.text,
|
|
435
|
-
to: payload.to
|
|
436
|
-
},
|
|
443
|
+
parseEmailToApiOptions(payload),
|
|
437
444
|
options
|
|
438
445
|
);
|
|
439
446
|
return data;
|
package/dist/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
// package.json
|
|
42
|
-
var version = "4.1.
|
|
42
|
+
var version = "4.1.2";
|
|
43
43
|
|
|
44
44
|
// src/api-keys/api-keys.ts
|
|
45
45
|
var ApiKeys = class {
|
|
@@ -111,6 +111,24 @@ var Audiences = class {
|
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
+
// src/common/utils/parse-email-to-api-options.ts
|
|
115
|
+
function parseEmailToApiOptions(email) {
|
|
116
|
+
return {
|
|
117
|
+
attachments: email.attachments,
|
|
118
|
+
bcc: email.bcc,
|
|
119
|
+
cc: email.cc,
|
|
120
|
+
from: email.from,
|
|
121
|
+
headers: email.headers,
|
|
122
|
+
html: email.html,
|
|
123
|
+
reply_to: email.replyTo,
|
|
124
|
+
scheduled_at: email.scheduledAt,
|
|
125
|
+
subject: email.subject,
|
|
126
|
+
tags: email.tags,
|
|
127
|
+
text: email.text,
|
|
128
|
+
to: email.to
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
114
132
|
// src/batch/batch.ts
|
|
115
133
|
var Batch = class {
|
|
116
134
|
constructor(resend) {
|
|
@@ -123,6 +141,7 @@ var Batch = class {
|
|
|
123
141
|
}
|
|
124
142
|
create(_0) {
|
|
125
143
|
return __async(this, arguments, function* (payload, options = {}) {
|
|
144
|
+
const emails = [];
|
|
126
145
|
for (const email of payload) {
|
|
127
146
|
if (email.react) {
|
|
128
147
|
if (!this.renderAsync) {
|
|
@@ -138,10 +157,11 @@ var Batch = class {
|
|
|
138
157
|
email.html = yield this.renderAsync(email.react);
|
|
139
158
|
email.react = void 0;
|
|
140
159
|
}
|
|
160
|
+
emails.push(parseEmailToApiOptions(email));
|
|
141
161
|
}
|
|
142
162
|
const data = yield this.resend.post(
|
|
143
163
|
"/emails/batch",
|
|
144
|
-
|
|
164
|
+
emails,
|
|
145
165
|
options
|
|
146
166
|
);
|
|
147
167
|
return data;
|
|
@@ -387,20 +407,7 @@ var Emails = class {
|
|
|
387
407
|
}
|
|
388
408
|
const data = yield this.resend.post(
|
|
389
409
|
"/emails",
|
|
390
|
-
|
|
391
|
-
attachments: payload.attachments,
|
|
392
|
-
bcc: payload.bcc,
|
|
393
|
-
cc: payload.cc,
|
|
394
|
-
from: payload.from,
|
|
395
|
-
headers: payload.headers,
|
|
396
|
-
html: payload.html,
|
|
397
|
-
reply_to: payload.replyTo,
|
|
398
|
-
scheduled_at: payload.scheduledAt,
|
|
399
|
-
subject: payload.subject,
|
|
400
|
-
tags: payload.tags,
|
|
401
|
-
text: payload.text,
|
|
402
|
-
to: payload.to
|
|
403
|
-
},
|
|
410
|
+
parseEmailToApiOptions(payload),
|
|
404
411
|
options
|
|
405
412
|
);
|
|
406
413
|
return data;
|