@mysetup/nodemailer 1.5.3 → 2.0.0
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/nodemailer.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { type SendEmailEnv, type SendEmailInput } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Connects to the NodeMailer service and sends an email.
|
|
4
|
+
* @param data - The email data to send.
|
|
5
|
+
* @param config - The email configuration.
|
|
6
|
+
* @returns A promise that resolves to the result of the email sending operation.
|
|
7
|
+
*/
|
|
2
8
|
export declare const connectNodeMailer: (data: SendEmailInput, config: SendEmailEnv) => Promise<string>;
|
|
3
9
|
//# sourceMappingURL=nodemailer.d.ts.map
|
package/dist/nodemailer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodemailer.d.ts","sourceRoot":"","sources":["../nodemailer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAgCjE,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"nodemailer.d.ts","sourceRoot":"","sources":["../nodemailer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAgCjE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,SACpB,cAAc,UACZ,YAAY,oBAqCvB,CAAC"}
|
package/dist/nodemailer.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -77,23 +77,35 @@ var sendMail = function (mailOptions, env) { return __awaiter(void 0, void 0, vo
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
}); };
|
|
80
|
+
/**
|
|
81
|
+
* Connects to the NodeMailer service and sends an email.
|
|
82
|
+
* @param data - The email data to send.
|
|
83
|
+
* @param config - The email configuration.
|
|
84
|
+
* @returns A promise that resolves to the result of the email sending operation.
|
|
85
|
+
*/
|
|
80
86
|
var connectNodeMailer = function (data, config) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
-
var templatePath, htmlTemplate, mailOptions, error_2;
|
|
82
|
-
var
|
|
83
|
-
return __generator(this, function (
|
|
84
|
-
switch (
|
|
87
|
+
var templatePath, htmlTemplate, _a, mailOptions, error_2;
|
|
88
|
+
var _b;
|
|
89
|
+
return __generator(this, function (_c) {
|
|
90
|
+
switch (_c.label) {
|
|
85
91
|
case 0:
|
|
86
|
-
|
|
92
|
+
_c.trys.push([0, 5, , 6]);
|
|
87
93
|
templatePath = node_path_1.default.join(__dirname, "views", "".concat(data.template, ".ejs"));
|
|
88
|
-
return [
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
if (!data.htmlTemplate) return [3 /*break*/, 1];
|
|
95
|
+
_a = data.htmlTemplate;
|
|
96
|
+
return [3 /*break*/, 3];
|
|
97
|
+
case 1: return [4 /*yield*/, ejs_1.default.renderFile(templatePath, data.value)];
|
|
98
|
+
case 2:
|
|
99
|
+
_a = _c.sent();
|
|
100
|
+
_c.label = 3;
|
|
101
|
+
case 3:
|
|
102
|
+
htmlTemplate = _a;
|
|
91
103
|
mailOptions = {
|
|
92
104
|
to: config.from,
|
|
93
105
|
bcc: data.toEmail,
|
|
94
106
|
subject: data.subject,
|
|
95
107
|
html: htmlTemplate,
|
|
96
|
-
attachments: (
|
|
108
|
+
attachments: (_b = data.attachments) === null || _b === void 0 ? void 0 : _b.map(function (attachment) { return ({
|
|
97
109
|
filename: attachment.filename,
|
|
98
110
|
content: attachment.content,
|
|
99
111
|
path: attachment.path,
|
|
@@ -104,12 +116,12 @@ var connectNodeMailer = function (data, config) { return __awaiter(void 0, void
|
|
|
104
116
|
}); }),
|
|
105
117
|
};
|
|
106
118
|
return [4 /*yield*/, sendMail(mailOptions, config)];
|
|
107
|
-
case
|
|
108
|
-
case
|
|
109
|
-
error_2 =
|
|
119
|
+
case 4: return [2 /*return*/, _c.sent()];
|
|
120
|
+
case 5:
|
|
121
|
+
error_2 = _c.sent();
|
|
110
122
|
logger_1.logger.error(error_2);
|
|
111
123
|
throw error_2; // rethrow so caller can handle
|
|
112
|
-
case
|
|
124
|
+
case 6: return [2 /*return*/];
|
|
113
125
|
}
|
|
114
126
|
});
|
|
115
127
|
}); };
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE;QACV,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;QACrC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;KACpC,EAAE,CAAC;CACP"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE;QACV,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;QACrC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;KACpC,EAAE,CAAC;CACP"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysetup/nodemailer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"nodemailer": "^6.10.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
32
|
+
"@eslint/js": "^9.36.0",
|
|
31
33
|
"@mysetup/eslint-config": "latest",
|
|
32
34
|
"@mysetup/logger": "latest",
|
|
33
35
|
"@mysetup/prettier-config": "latest",
|
|
@@ -35,10 +37,10 @@
|
|
|
35
37
|
"@types/ejs": "^3.1.5",
|
|
36
38
|
"@types/node": "^22.13.1",
|
|
37
39
|
"@types/nodemailer": "^6.4.17",
|
|
38
|
-
"eslint": "
|
|
40
|
+
"eslint": "9.32.0",
|
|
39
41
|
"nodemon": "3.1.7",
|
|
40
42
|
"ts-node": "^10.9.2",
|
|
41
|
-
"typescript": "
|
|
43
|
+
"typescript": "5.5.4"
|
|
42
44
|
},
|
|
43
45
|
"prettier": "@mysetup/prettier-config",
|
|
44
46
|
"engines": {
|