@upyo/maileroo 0.6.0-dev.327 → 0.6.0-dev.338

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 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
  /**
@@ -278,6 +279,7 @@ const STANDARD_HEADERS = new Set([
278
279
  */
279
280
  async function convertMessage(message, config, signal) {
280
281
  signal?.throwIfAborted();
282
+ const attachments = message.calendar == null ? message.attachments : [(0, __upyo_core_calendar.createCalendarAttachment)(message.calendar), ...message.attachments];
281
283
  const emailData = {
282
284
  from: convertAddress(message.sender),
283
285
  to: convertAddressList(message.recipients),
@@ -300,11 +302,11 @@ async function convertMessage(message, config, signal) {
300
302
  if (Object.keys(tags).length > 0) emailData.tags = tags;
301
303
  const headers = convertHeaders(message);
302
304
  if (Object.keys(headers).length > 0) emailData.headers = headers;
303
- if (message.attachments.length > 0) {
305
+ if (attachments.length > 0) {
304
306
  const cancellation = new AbortController();
305
307
  const combined = (0, __upyo_core.combineSignals)(cancellation.signal, signal);
306
308
  try {
307
- emailData.attachments = await Promise.all(message.attachments.map((attachment) => convertAttachment(attachment, combined.signal)));
309
+ emailData.attachments = await Promise.all(attachments.map((attachment) => convertAttachment(attachment, combined.signal)));
308
310
  } finally {
309
311
  cancellation.abort();
310
312
  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
  /**
@@ -255,6 +256,7 @@ const STANDARD_HEADERS = new Set([
255
256
  */
256
257
  async function convertMessage(message, config, signal) {
257
258
  signal?.throwIfAborted();
259
+ const attachments = message.calendar == null ? message.attachments : [createCalendarAttachment(message.calendar), ...message.attachments];
258
260
  const emailData = {
259
261
  from: convertAddress(message.sender),
260
262
  to: convertAddressList(message.recipients),
@@ -277,11 +279,11 @@ async function convertMessage(message, config, signal) {
277
279
  if (Object.keys(tags).length > 0) emailData.tags = tags;
278
280
  const headers = convertHeaders(message);
279
281
  if (Object.keys(headers).length > 0) emailData.headers = headers;
280
- if (message.attachments.length > 0) {
282
+ if (attachments.length > 0) {
281
283
  const cancellation = new AbortController();
282
284
  const combined = combineSignals(cancellation.signal, signal);
283
285
  try {
284
- emailData.attachments = await Promise.all(message.attachments.map((attachment) => convertAttachment(attachment, combined.signal)));
286
+ emailData.attachments = await Promise.all(attachments.map((attachment) => convertAttachment(attachment, combined.signal)));
285
287
  } finally {
286
288
  cancellation.abort();
287
289
  combined.cleanup();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upyo/maileroo",
3
- "version": "0.6.0-dev.327",
3
+ "version": "0.6.0-dev.338",
4
4
  "description": "Maileroo 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.327+0aa1111f"
56
+ "@upyo/core": "0.6.0-dev.338+cae9af76"
57
57
  },
58
58
  "devDependencies": {
59
59
  "tsdown": "^0.12.7",