@upyo/lettermint 0.6.0-dev.325 → 0.6.0-dev.336
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 +4 -2
- package/dist/index.js +4 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
24
|
const __upyo_core = __toESM(require("@upyo/core"));
|
|
25
|
+
const __upyo_core_calendar = __toESM(require("@upyo/core/calendar"));
|
|
25
26
|
|
|
26
27
|
//#region src/config.ts
|
|
27
28
|
/**
|
|
@@ -266,6 +267,7 @@ const STANDARD_HEADERS = new Set([
|
|
|
266
267
|
*/
|
|
267
268
|
async function convertMessage(message, config, signal) {
|
|
268
269
|
if (message.tags.length > 1) throw new RangeError("Lettermint supports at most one tag per message.");
|
|
270
|
+
const attachments = message.calendar == null ? message.attachments : [(0, __upyo_core_calendar.createCalendarAttachment)(message.calendar), ...message.attachments];
|
|
269
271
|
const emailData = {
|
|
270
272
|
from: formatAddress(message.sender),
|
|
271
273
|
to: message.recipients.map(formatAddress),
|
|
@@ -298,11 +300,11 @@ async function convertMessage(message, config, signal) {
|
|
|
298
300
|
for (const [key, value] of message.headers.entries()) if (!isStandardHeader(key) && !ownedHeaders.has(key.toLowerCase())) headers[key] = value;
|
|
299
301
|
for (const [name, value] of threading) if (value != null) headers[name] = value;
|
|
300
302
|
if (Object.keys(headers).length > 0) emailData.headers = headers;
|
|
301
|
-
if (
|
|
303
|
+
if (attachments.length > 0) {
|
|
302
304
|
const cancellation = new AbortController();
|
|
303
305
|
const combined = (0, __upyo_core.combineSignals)(cancellation.signal, signal);
|
|
304
306
|
try {
|
|
305
|
-
emailData.attachments = await Promise.all(
|
|
307
|
+
emailData.attachments = await Promise.all(attachments.map((attachment) => convertAttachment(attachment, combined.signal)));
|
|
306
308
|
} finally {
|
|
307
309
|
cancellation.abort();
|
|
308
310
|
combined.cleanup();
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { combineSignals, createFailedReceipt, parseRetryAfter, readAttachmentContent, resolveThreadingHeaders } from "@upyo/core";
|
|
2
|
+
import { createCalendarAttachment } from "@upyo/core/calendar";
|
|
2
3
|
|
|
3
4
|
//#region src/config.ts
|
|
4
5
|
/**
|
|
@@ -243,6 +244,7 @@ const STANDARD_HEADERS = new Set([
|
|
|
243
244
|
*/
|
|
244
245
|
async function convertMessage(message, config, signal) {
|
|
245
246
|
if (message.tags.length > 1) throw new RangeError("Lettermint supports at most one tag per message.");
|
|
247
|
+
const attachments = message.calendar == null ? message.attachments : [createCalendarAttachment(message.calendar), ...message.attachments];
|
|
246
248
|
const emailData = {
|
|
247
249
|
from: formatAddress(message.sender),
|
|
248
250
|
to: message.recipients.map(formatAddress),
|
|
@@ -275,11 +277,11 @@ async function convertMessage(message, config, signal) {
|
|
|
275
277
|
for (const [key, value] of message.headers.entries()) if (!isStandardHeader(key) && !ownedHeaders.has(key.toLowerCase())) headers[key] = value;
|
|
276
278
|
for (const [name, value] of threading) if (value != null) headers[name] = value;
|
|
277
279
|
if (Object.keys(headers).length > 0) emailData.headers = headers;
|
|
278
|
-
if (
|
|
280
|
+
if (attachments.length > 0) {
|
|
279
281
|
const cancellation = new AbortController();
|
|
280
282
|
const combined = combineSignals(cancellation.signal, signal);
|
|
281
283
|
try {
|
|
282
|
-
emailData.attachments = await Promise.all(
|
|
284
|
+
emailData.attachments = await Promise.all(attachments.map((attachment) => convertAttachment(attachment, combined.signal)));
|
|
283
285
|
} finally {
|
|
284
286
|
cancellation.abort();
|
|
285
287
|
combined.cleanup();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upyo/lettermint",
|
|
3
|
-
"version": "0.6.0-dev.
|
|
3
|
+
"version": "0.6.0-dev.336",
|
|
4
4
|
"description": "Lettermint transport for Upyo email library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@upyo/core": "0.6.0-dev.
|
|
56
|
+
"@upyo/core": "0.6.0-dev.336+ec6e189b"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"tsdown": "^0.12.7",
|