@strapi/provider-email-nodemailer 0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71 → 0.0.0-next.f5b09a8e61e059f02784478e27c310c6290be088
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 +3 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +11 -9
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface SendOptions {
|
|
|
14
14
|
html: string;
|
|
15
15
|
[key: string]: unknown;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
type ProviderOptions = Parameters<typeof nodemailer.createTransport>[0];
|
|
18
18
|
declare const _default: {
|
|
19
19
|
provider: string;
|
|
20
20
|
name: string;
|
|
@@ -22,4 +22,5 @@ declare const _default: {
|
|
|
22
22
|
send(options: SendOptions): Promise<unknown>;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
export
|
|
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
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
const
|
|
6
|
-
const
|
|
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
7
|
const emailFields = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
"from",
|
|
9
|
+
"replyTo",
|
|
10
|
+
"to",
|
|
11
|
+
"cc",
|
|
12
|
+
"bcc",
|
|
13
|
+
"subject",
|
|
14
|
+
"text",
|
|
15
|
+
"html",
|
|
16
|
+
"attachments"
|
|
17
17
|
];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
html: options.html || options.text,
|
|
32
|
-
};
|
|
33
|
-
return transporter.sendMail(emailOptions);
|
|
34
|
-
},
|
|
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
|
|
35
31
|
};
|
|
36
|
-
|
|
32
|
+
return transporter.sendMail(emailOptions);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
37
36
|
};
|
|
38
|
-
|
|
37
|
+
module.exports = index;
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
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;;"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import nodemailer from "nodemailer";
|
|
3
|
+
const emailFields = [
|
|
4
|
+
"from",
|
|
5
|
+
"replyTo",
|
|
6
|
+
"to",
|
|
7
|
+
"cc",
|
|
8
|
+
"bcc",
|
|
9
|
+
"subject",
|
|
10
|
+
"text",
|
|
11
|
+
"html",
|
|
12
|
+
"attachments"
|
|
13
|
+
];
|
|
14
|
+
const index = {
|
|
15
|
+
provider: "nodemailer",
|
|
16
|
+
name: "Nodemailer",
|
|
17
|
+
init(providerOptions, settings) {
|
|
18
|
+
const transporter = nodemailer.createTransport(providerOptions);
|
|
19
|
+
return {
|
|
20
|
+
send(options) {
|
|
21
|
+
const emailOptions = {
|
|
22
|
+
..._.pick(options, emailFields),
|
|
23
|
+
from: options.from || settings.defaultFrom,
|
|
24
|
+
replyTo: options.replyTo || settings.defaultReplyTo,
|
|
25
|
+
text: options.text || options.html,
|
|
26
|
+
html: options.html || options.text
|
|
27
|
+
};
|
|
28
|
+
return transporter.sendMail(emailOptions);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
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.f5b09a8e61e059f02784478e27c310c6290be088",
|
|
4
4
|
"description": "Nodemailer provider for Strapi 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -42,30 +42,32 @@
|
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
44
|
"main": "./dist/index.js",
|
|
45
|
+
"module": "./dist/index.mjs",
|
|
46
|
+
"source": "./src/index.ts",
|
|
45
47
|
"types": "./dist/index.d.ts",
|
|
46
48
|
"files": [
|
|
47
49
|
"./dist"
|
|
48
50
|
],
|
|
49
51
|
"scripts": {
|
|
50
|
-
"build": "
|
|
51
|
-
"build:ts": "run -T tsc",
|
|
52
|
-
"watch": "run -T tsc -w --preserveWatchOutput",
|
|
52
|
+
"build": "pack-up build",
|
|
53
53
|
"clean": "run -T rimraf ./dist",
|
|
54
|
+
"lint": "run -T eslint .",
|
|
54
55
|
"prepublishOnly": "yarn clean && yarn build",
|
|
55
|
-
"
|
|
56
|
+
"watch": "pack-up watch"
|
|
56
57
|
},
|
|
57
58
|
"dependencies": {
|
|
58
59
|
"lodash": "4.17.21",
|
|
59
60
|
"nodemailer": "6.9.1"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
63
|
+
"@strapi/pack-up": "0.0.0-next.f5b09a8e61e059f02784478e27c310c6290be088",
|
|
62
64
|
"@types/nodemailer": "6.4.7",
|
|
63
|
-
"eslint-config-custom": "0.0.0-next.
|
|
64
|
-
"tsconfig": "0.0.0-next.
|
|
65
|
+
"eslint-config-custom": "0.0.0-next.f5b09a8e61e059f02784478e27c310c6290be088",
|
|
66
|
+
"tsconfig": "0.0.0-next.f5b09a8e61e059f02784478e27c310c6290be088"
|
|
65
67
|
},
|
|
66
68
|
"engines": {
|
|
67
|
-
"node": ">=
|
|
69
|
+
"node": ">=18.0.0 <=20.x.x",
|
|
68
70
|
"npm": ">=6.0.0"
|
|
69
71
|
},
|
|
70
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f5b09a8e61e059f02784478e27c310c6290be088"
|
|
71
73
|
}
|