@talosjs/mailer 1.1.1 → 1.2.1

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.ts CHANGED
@@ -1,5 +1,20 @@
1
1
  import { EContainerScope } from "@talosjs/container";
2
2
  type MailerClassType = new (...args: any[]) => IMailer;
3
+ interface MailerAttachmentType {
4
+ /** Name of the attached file. */
5
+ filename: string;
6
+ /** Content of the attached file, as a base64 string or Buffer. */
7
+ content?: string | Buffer;
8
+ /** Remote path the attachment is hosted at, used instead of `content`. */
9
+ path?: string;
10
+ /** Content type of the attachment. Derived from `filename` when omitted. */
11
+ contentType?: string;
12
+ /**
13
+ * Content ID for an inline attachment, referenced in the HTML content
14
+ * using the `cid:` prefix.
15
+ */
16
+ contentId?: string;
17
+ }
3
18
  interface IMailer {
4
19
  send: (config: {
5
20
  to: string[];
@@ -9,6 +24,7 @@ interface IMailer {
9
24
  name: string;
10
25
  address: string;
11
26
  };
27
+ attachments?: MailerAttachmentType[];
12
28
  }) => Promise<void>;
13
29
  }
14
30
  declare const decorator: {
@@ -61,6 +77,7 @@ declare class ResendMailer implements IMailer {
61
77
  name: string;
62
78
  address: string;
63
79
  };
80
+ attachments?: MailerAttachmentType[];
64
81
  }): Promise<void>;
65
82
  }
66
- export { decorator, ResendMailer, MailerLayout, MailerException, MailerClassType, IMailer };
83
+ export { decorator, ResendMailer, MailerLayout, MailerException, MailerClassType, MailerAttachmentType, IMailer };
package/dist/index.js CHANGED
@@ -19,14 +19,12 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  }
20
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- if (mod && typeof mod === "object" || typeof mod === "function") {
23
- for (let key of __getOwnPropNames(mod))
24
- if (!__hasOwnProp.call(to, key))
25
- __defProp(to, key, {
26
- get: __accessProp.bind(mod, key),
27
- enumerable: true
28
- });
29
- }
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
30
28
  if (canCache)
31
29
  cache.set(mod, to);
32
30
  return to;
@@ -62,7 +60,7 @@ var __legacyMetadataTS = (k, v) => {
62
60
  };
63
61
 
64
62
  // ../../node_modules/.bun/react@19.2.7/node_modules/react/cjs/react.development.js
65
- var require_react_development = __commonJS(function(exports, module) {
63
+ var require_react_development = __commonJS((exports, module) => {
66
64
  (function() {
67
65
  function defineDeprecationWarning(methodName, info) {
68
66
  Object.defineProperty(Component.prototype, methodName, {
@@ -869,7 +867,7 @@ var require_react_development = __commonJS(function(exports, module) {
869
867
  });
870
868
 
871
869
  // ../../node_modules/.bun/react@19.2.7/node_modules/react/index.js
872
- var require_react = __commonJS(function(exports, module) {
870
+ var require_react = __commonJS((exports, module) => {
873
871
  var react_development = __toESM(require_react_development());
874
872
  if (false) {} else {
875
873
  module.exports = react_development;
@@ -877,7 +875,7 @@ var require_react = __commonJS(function(exports, module) {
877
875
  });
878
876
 
879
877
  // ../../node_modules/.bun/react@19.2.7/node_modules/react/cjs/react-jsx-dev-runtime.development.js
880
- var require_react_jsx_dev_runtime_development = __commonJS(function(exports) {
878
+ var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
881
879
  var React = __toESM(require_react());
882
880
  (function() {
883
881
  function getComponentNameFromType(type) {
@@ -1086,7 +1084,7 @@ var require_react_jsx_dev_runtime_development = __commonJS(function(exports) {
1086
1084
  });
1087
1085
 
1088
1086
  // ../../node_modules/.bun/react@19.2.7/node_modules/react/jsx-dev-runtime.js
1089
- var require_jsx_dev_runtime = __commonJS(function(exports, module) {
1087
+ var require_jsx_dev_runtime = __commonJS((exports, module) => {
1090
1088
  var react_jsx_dev_runtime_development = __toESM(require_react_jsx_dev_runtime_development());
1091
1089
  if (false) {} else {
1092
1090
  module.exports = react_jsx_dev_runtime_development;
@@ -1094,7 +1092,7 @@ var require_jsx_dev_runtime = __commonJS(function(exports, module) {
1094
1092
  });
1095
1093
 
1096
1094
  // ../../node_modules/.bun/react-dom@19.2.7+e14d3f224186685e/node_modules/react-dom/cjs/react-dom.development.js
1097
- var require_react_dom_development = __commonJS(function(exports) {
1095
+ var require_react_dom_development = __commonJS((exports) => {
1098
1096
  var React = __toESM(require_react());
1099
1097
  (function() {
1100
1098
  function noop() {}
@@ -1270,7 +1268,7 @@ var require_react_dom_development = __commonJS(function(exports) {
1270
1268
  });
1271
1269
 
1272
1270
  // ../../node_modules/.bun/react-dom@19.2.7+e14d3f224186685e/node_modules/react-dom/index.js
1273
- var require_react_dom = __commonJS(function(exports, module) {
1271
+ var require_react_dom = __commonJS((exports, module) => {
1274
1272
  var react_dom_development = __toESM(require_react_dom_development());
1275
1273
  if (false) {} else {
1276
1274
  module.exports = react_dom_development;
@@ -1278,7 +1276,7 @@ var require_react_dom = __commonJS(function(exports, module) {
1278
1276
  });
1279
1277
 
1280
1278
  // ../../node_modules/.bun/react-dom@19.2.7+e14d3f224186685e/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js
1281
- var require_react_dom_server_legacy_browser_development = __commonJS(function(exports) {
1279
+ var require_react_dom_server_legacy_browser_development = __commonJS((exports) => {
1282
1280
  var React2 = __toESM(require_react());
1283
1281
  var ReactDOM2 = __toESM(require_react_dom());
1284
1282
  (function() {
@@ -13242,7 +13240,8 @@ class ResendMailer {
13242
13240
  to: config.to,
13243
13241
  from: `${senderName} <${senderAddress}>`,
13244
13242
  subject: `${config.subject}`,
13245
- html: $renderToString(config.content)
13243
+ html: $renderToString(config.content),
13244
+ ...config.attachments && { attachments: config.attachments }
13246
13245
  });
13247
13246
  }
13248
13247
  }
@@ -13260,4 +13259,4 @@ export {
13260
13259
  MailerException
13261
13260
  };
13262
13261
 
13263
- //# debugId=2D2A55E6DE7B921964756E2164756E21
13262
+ //# debugId=E1D310FFD666362A64756E2164756E21