@vitnode/nodemailer 1.2.0-canary.74 → 1.2.0-canary.76

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.
@@ -1,10 +1,13 @@
1
- import type { EmailApiPlugin } from "@vitnode/core/api/models/email";
2
- export declare const NodemailerEmailAdapter: ({ host, port, secure, user, password, from, }: {
3
- from: string | undefined;
4
- host: string | undefined;
5
- password: string | undefined;
6
- port?: number;
7
- secure?: boolean;
8
- user: string | undefined;
1
+ import { EmailApiPlugin } from "@vitnode/core/api/models/email";
2
+ //#region src/index.d.ts
3
+ declare const NodemailerEmailAdapter: ({ host, port, secure, user, password, from }: {
4
+ from: string | undefined;
5
+ host: string | undefined;
6
+ password: string | undefined;
7
+ port?: number;
8
+ secure?: boolean;
9
+ user: string | undefined;
9
10
  }) => EmailApiPlugin;
11
+ //#endregion
12
+ export { NodemailerEmailAdapter };
10
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,eAAO,MAAM,sBAAsB,GAAI,+CAOpC;IACD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,KAAG,cAiCH,CAAC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;cAIa,2BAA0B,MAAA,MAAA,QAAA,MAAA,UAAA;EAQrC;EACA;EACA;EACA;EACA;EACA;MACE"}
package/dist/src/index.js CHANGED
@@ -1 +1,2 @@
1
- import{createTransport}from"nodemailer";export const NodemailerEmailAdapter=({host="",port=587,secure=false,user="",password="",from=""})=>{return{sendEmail:async({metadata,to,subject,html,replyTo})=>{if(!(host&&user&&password&&from)){throw new Error("Missing nodemailer configuration")}const transporter=createTransport({host,port,secure,auth:{user,pass:password}},{from:{name:metadata.shortTitle??metadata.title,address:from},replyTo});await transporter.sendMail({to,subject,html})}}};
1
+ import{createTransport as e}from"nodemailer";const t=({host:t=``,port:n=587,secure:r=!1,user:i=``,password:a=``,from:o=``})=>({sendEmail:async({metadata:s,to:c,subject:l,html:u,replyTo:d})=>{if(!(t&&i&&a&&o))throw Error(`Missing nodemailer configuration`);await e({host:t,port:n,secure:r,auth:{user:i,pass:a}},{from:{name:s.shortTitle??s.title,address:o},replyTo:d}).sendMail({to:c,subject:l,html:u})}});export{t as NodemailerEmailAdapter};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import type { EmailApiPlugin } from \"@vitnode/core/api/models/email\";\n\nimport { createTransport } from \"nodemailer\";\n\nexport const NodemailerEmailAdapter = ({\n host = \"\",\n port = 587,\n secure = false,\n user = \"\",\n password = \"\",\n from = \"\",\n}: {\n from: string | undefined;\n host: string | undefined;\n password: string | undefined;\n port?: number;\n secure?: boolean;\n user: string | undefined;\n}): EmailApiPlugin => {\n return {\n sendEmail: async ({ metadata, to, subject, html, replyTo }) => {\n if (!(host && user && password && from)) {\n throw new Error(\"Missing nodemailer configuration\");\n }\n\n const transporter = createTransport(\n {\n host,\n port,\n secure,\n auth: {\n user,\n pass: password,\n },\n },\n {\n from: {\n name: metadata.shortTitle ?? metadata.title,\n address: from,\n },\n replyTo,\n },\n );\n\n await transporter.sendMail({\n to,\n subject,\n html,\n });\n },\n };\n};\n"],"mappings":"6CAIA,MAAa,GAA0B,CACrC,OAAO,GACP,OAAO,IACP,SAAS,GACT,OAAO,GACP,WAAW,GACX,OAAO,OASA,CACL,UAAW,MAAO,CAAE,WAAU,KAAI,UAAS,OAAM,aAAc,CAC7D,GAAI,EAAE,GAAQ,GAAQ,GAAY,GAChC,MAAU,MAAM,kCAAkC,EAsBpD,MAnBoB,EAClB,CACE,OACA,OACA,SACA,KAAM,CACJ,OACA,KAAM,CACR,CACF,EACA,CACE,KAAM,CACJ,KAAM,EAAS,YAAc,EAAS,MACtC,QAAS,CACX,EACA,SACF,CAGc,CAAC,CAAC,SAAS,CACzB,KACA,UACA,MACF,CAAC,CACH,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitnode/nodemailer",
3
- "version": "1.2.0-canary.74",
3
+ "version": "1.2.0-canary.76",
4
4
  "description": "Nodemailer integration package for VitNode, enabling email functionalities.",
5
5
  "author": "VitNode Team",
6
6
  "license": "MIT",
@@ -24,22 +24,19 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "nodemailer": "^8.0.11"
27
+ "nodemailer": "^9.0.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@swc/cli": "^0.8.1",
31
- "@swc/core": "^1.15.41",
32
30
  "@types/nodemailer": "^8.0.1",
33
- "concurrently": "^10.0.3",
34
31
  "eslint": "^10.5.0",
35
- "tsc-alias": "^1.8.17",
32
+ "tsdown": "^0.22.4",
36
33
  "typescript": "^6.0.3",
37
- "@vitnode/core": "1.2.0-canary.74",
38
- "@vitnode/config": "1.2.0-canary.74"
34
+ "@vitnode/config": "1.2.0-canary.76",
35
+ "@vitnode/core": "1.2.0-canary.76"
39
36
  },
40
37
  "scripts": {
41
- "build:plugins": "tsc && swc src -d dist --config-file .swcrc && tsc-alias -p tsconfig.json",
42
- "dev:plugins": "concurrently \"tsc -w --preserveWatchOutput\" \"swc src -d dist --config-file .swcrc -w\" \"tsc-alias -w\"",
38
+ "build:plugins": "tsdown",
39
+ "dev:plugins": "tsdown --watch",
43
40
  "lint": "eslint .",
44
41
  "lint:fix": "eslint . --fix"
45
42
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./tsconfig.json",
4
+ "exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx"]
5
+ }