@strapi/provider-email-nodemailer 0.0.0-next.c58b405b44c71a93df733024d1f15c069cb6bdca → 0.0.0-next.c5f067b5650921187770124e9b6c8186e805e242
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 +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/{lib/index.js → dist/index.mjs} +22 -30
- package/dist/index.mjs.map +1 -0
- package/package.json +20 -8
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import nodemailer from 'nodemailer';
|
|
2
|
+
interface Settings {
|
|
3
|
+
defaultFrom: string;
|
|
4
|
+
defaultReplyTo: string;
|
|
5
|
+
}
|
|
6
|
+
interface SendOptions {
|
|
7
|
+
from?: string;
|
|
8
|
+
to: string;
|
|
9
|
+
cc: string;
|
|
10
|
+
bcc: string;
|
|
11
|
+
replyTo?: string;
|
|
12
|
+
subject: string;
|
|
13
|
+
text: string;
|
|
14
|
+
html: string;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
type ProviderOptions = Parameters<typeof nodemailer.createTransport>[0];
|
|
18
|
+
declare const _default: {
|
|
19
|
+
provider: string;
|
|
20
|
+
name: string;
|
|
21
|
+
init(providerOptions: ProviderOptions, settings: Settings): {
|
|
22
|
+
send(options: SendOptions): Promise<unknown>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,UAA+B,MAAM,YAAY,CAAC;AAEzD,UAAU,QAAQ;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;;;;0BAkBhD,eAAe,YAAY,QAAQ;sBAIvC,WAAW;;;AAR/B,wBAsBE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const _ = require("lodash");
|
|
3
|
+
const nodemailer = require("nodemailer");
|
|
4
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
5
|
+
const ___default = /* @__PURE__ */ _interopDefault(_);
|
|
6
|
+
const nodemailer__default = /* @__PURE__ */ _interopDefault(nodemailer);
|
|
7
|
+
const emailFields = [
|
|
8
|
+
"from",
|
|
9
|
+
"replyTo",
|
|
10
|
+
"to",
|
|
11
|
+
"cc",
|
|
12
|
+
"bcc",
|
|
13
|
+
"subject",
|
|
14
|
+
"text",
|
|
15
|
+
"html",
|
|
16
|
+
"attachments"
|
|
17
|
+
];
|
|
18
|
+
const index = {
|
|
19
|
+
provider: "nodemailer",
|
|
20
|
+
name: "Nodemailer",
|
|
21
|
+
init(providerOptions, settings) {
|
|
22
|
+
const transporter = nodemailer__default.default.createTransport(providerOptions);
|
|
23
|
+
return {
|
|
24
|
+
send(options) {
|
|
25
|
+
const emailOptions = {
|
|
26
|
+
...___default.default.pick(options, emailFields),
|
|
27
|
+
from: options.from || settings.defaultFrom,
|
|
28
|
+
replyTo: options.replyTo || settings.defaultReplyTo,
|
|
29
|
+
text: options.text || options.html,
|
|
30
|
+
html: options.html || options.text
|
|
31
|
+
};
|
|
32
|
+
return transporter.sendMail(emailOptions);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
module.exports = index;
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import _ from 'lodash';\nimport nodemailer, { SendMailOptions } from 'nodemailer';\n\ninterface Settings {\n defaultFrom: string;\n defaultReplyTo: string;\n}\n\ninterface SendOptions {\n from?: string;\n to: string;\n cc: string;\n bcc: string;\n replyTo?: string;\n subject: string;\n text: string;\n html: string;\n [key: string]: unknown;\n}\n\ntype ProviderOptions = Parameters<typeof nodemailer.createTransport>[0];\n\nconst emailFields = [\n 'from',\n 'replyTo',\n 'to',\n 'cc',\n 'bcc',\n 'subject',\n 'text',\n 'html',\n 'attachments',\n];\n\nexport default {\n provider: 'nodemailer',\n name: 'Nodemailer',\n\n init(providerOptions: ProviderOptions, settings: Settings) {\n const transporter = nodemailer.createTransport(providerOptions);\n\n return {\n send(options: SendOptions) {\n // Default values.\n const emailOptions: SendMailOptions = {\n ..._.pick(options, emailFields),\n from: options.from || settings.defaultFrom,\n replyTo: options.replyTo || settings.defaultReplyTo,\n text: options.text || options.html,\n html: options.html || options.text,\n };\n\n return transporter.sendMail(emailOptions);\n },\n };\n },\n};\n"],"names":["nodemailer","_"],"mappings":";;;;;;AAsBA,MAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAe,QAAA;AAAA,EACb,UAAU;AAAA,EACV,MAAM;AAAA,EAEN,KAAK,iBAAkC,UAAoB;AACnD,UAAA,cAAcA,oBAAAA,QAAW,gBAAgB,eAAe;AAEvD,WAAA;AAAA,MACL,KAAK,SAAsB;AAEzB,cAAM,eAAgC;AAAA,UACpC,GAAGC,mBAAE,KAAK,SAAS,WAAW;AAAA,UAC9B,MAAM,QAAQ,QAAQ,SAAS;AAAA,UAC/B,SAAS,QAAQ,WAAW,SAAS;AAAA,UACrC,MAAM,QAAQ,QAAQ,QAAQ;AAAA,UAC9B,MAAM,QAAQ,QAAQ,QAAQ;AAAA,QAAA;AAGzB,eAAA,YAAY,SAAS,YAAY;AAAA,MAC1C;AAAA,IAAA;AAAA,EAEJ;AACF;;"}
|
|
@@ -1,44 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Module dependencies
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const _ = require('lodash');
|
|
8
|
-
const nodemailer = require('nodemailer');
|
|
9
|
-
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import nodemailer from "nodemailer";
|
|
10
3
|
const emailFields = [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
"from",
|
|
5
|
+
"replyTo",
|
|
6
|
+
"to",
|
|
7
|
+
"cc",
|
|
8
|
+
"bcc",
|
|
9
|
+
"subject",
|
|
10
|
+
"text",
|
|
11
|
+
"html",
|
|
12
|
+
"attachments"
|
|
20
13
|
];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
init(providerOptions = {}, settings = {}) {
|
|
14
|
+
const index = {
|
|
15
|
+
provider: "nodemailer",
|
|
16
|
+
name: "Nodemailer",
|
|
17
|
+
init(providerOptions, settings) {
|
|
27
18
|
const transporter = nodemailer.createTransport(providerOptions);
|
|
28
|
-
|
|
29
19
|
return {
|
|
30
20
|
send(options) {
|
|
31
|
-
// Default values.
|
|
32
21
|
const emailOptions = {
|
|
33
22
|
..._.pick(options, emailFields),
|
|
34
23
|
from: options.from || settings.defaultFrom,
|
|
35
24
|
replyTo: options.replyTo || settings.defaultReplyTo,
|
|
36
25
|
text: options.text || options.html,
|
|
37
|
-
html: options.html || options.text
|
|
26
|
+
html: options.html || options.text
|
|
38
27
|
};
|
|
39
|
-
|
|
40
28
|
return transporter.sendMail(emailOptions);
|
|
41
|
-
}
|
|
29
|
+
}
|
|
42
30
|
};
|
|
43
|
-
}
|
|
31
|
+
}
|
|
44
32
|
};
|
|
33
|
+
export {
|
|
34
|
+
index as default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import _ from 'lodash';\nimport nodemailer, { SendMailOptions } from 'nodemailer';\n\ninterface Settings {\n defaultFrom: string;\n defaultReplyTo: string;\n}\n\ninterface SendOptions {\n from?: string;\n to: string;\n cc: string;\n bcc: string;\n replyTo?: string;\n subject: string;\n text: string;\n html: string;\n [key: string]: unknown;\n}\n\ntype ProviderOptions = Parameters<typeof nodemailer.createTransport>[0];\n\nconst emailFields = [\n 'from',\n 'replyTo',\n 'to',\n 'cc',\n 'bcc',\n 'subject',\n 'text',\n 'html',\n 'attachments',\n];\n\nexport default {\n provider: 'nodemailer',\n name: 'Nodemailer',\n\n init(providerOptions: ProviderOptions, settings: Settings) {\n const transporter = nodemailer.createTransport(providerOptions);\n\n return {\n send(options: SendOptions) {\n // Default values.\n const emailOptions: SendMailOptions = {\n ..._.pick(options, emailFields),\n from: options.from || settings.defaultFrom,\n replyTo: options.replyTo || settings.defaultReplyTo,\n text: options.text || options.html,\n html: options.html || options.text,\n };\n\n return transporter.sendMail(emailOptions);\n },\n };\n },\n};\n"],"names":[],"mappings":";;AAsBA,MAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAe,QAAA;AAAA,EACb,UAAU;AAAA,EACV,MAAM;AAAA,EAEN,KAAK,iBAAkC,UAAoB;AACnD,UAAA,cAAc,WAAW,gBAAgB,eAAe;AAEvD,WAAA;AAAA,MACL,KAAK,SAAsB;AAEzB,cAAM,eAAgC;AAAA,UACpC,GAAG,EAAE,KAAK,SAAS,WAAW;AAAA,UAC9B,MAAM,QAAQ,QAAQ,SAAS;AAAA,UAC/B,SAAS,QAAQ,WAAW,SAAS;AAAA,UACrC,MAAM,QAAQ,QAAQ,QAAQ;AAAA,UAC9B,MAAM,QAAQ,QAAQ,QAAQ;AAAA,QAAA;AAGzB,eAAA,YAAY,SAAS,YAAY;AAAA,MAC1C;AAAA,IAAA;AAAA,EAEJ;AACF;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/provider-email-nodemailer",
|
|
3
|
-
"version": "0.0.0-next.
|
|
3
|
+
"version": "0.0.0-next.c5f067b5650921187770124e9b6c8186e805e242",
|
|
4
4
|
"description": "Nodemailer provider for Strapi 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -41,20 +41,32 @@
|
|
|
41
41
|
"email": "git@roschaefer.de"
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
|
-
"main": "./
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
"main": "./dist/index.js",
|
|
45
|
+
"module": "./dist/index.mjs",
|
|
46
|
+
"source": "./src/index.ts",
|
|
47
|
+
"types": "./dist/index.d.ts",
|
|
48
|
+
"files": [
|
|
49
|
+
"./dist"
|
|
50
|
+
],
|
|
48
51
|
"scripts": {
|
|
49
|
-
"
|
|
52
|
+
"build": "pack-up build",
|
|
53
|
+
"clean": "run -T rimraf ./dist",
|
|
54
|
+
"lint": "run -T eslint .",
|
|
55
|
+
"watch": "pack-up watch"
|
|
50
56
|
},
|
|
51
57
|
"dependencies": {
|
|
52
58
|
"lodash": "4.17.21",
|
|
53
59
|
"nodemailer": "6.9.1"
|
|
54
60
|
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@strapi/pack-up": "0.0.0-next.c5f067b5650921187770124e9b6c8186e805e242",
|
|
63
|
+
"@types/nodemailer": "6.4.7",
|
|
64
|
+
"eslint-config-custom": "0.0.0-next.c5f067b5650921187770124e9b6c8186e805e242",
|
|
65
|
+
"tsconfig": "0.0.0-next.c5f067b5650921187770124e9b6c8186e805e242"
|
|
66
|
+
},
|
|
55
67
|
"engines": {
|
|
56
|
-
"node": ">=
|
|
68
|
+
"node": ">=18.0.0 <=20.x.x",
|
|
57
69
|
"npm": ">=6.0.0"
|
|
58
70
|
},
|
|
59
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "c5f067b5650921187770124e9b6c8186e805e242"
|
|
60
72
|
}
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED