@nestjs-modules/mailer 1.6.0 → 1.7.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/CHANGELOG.md +52 -0
- package/SECURITY.md +21 -0
- package/dist/adapters/ejs.adapter.js +13 -10
- package/dist/adapters/handlebars.adapter.js +16 -10
- package/dist/adapters/mjml.adapter.d.ts +12 -0
- package/dist/adapters/mjml.adapter.js +34 -0
- package/dist/adapters/pug.adapter.js +12 -9
- package/dist/interfaces/mailer-async-options.interface.d.ts +2 -0
- package/dist/interfaces/send-mail-options.interface.d.ts +3 -0
- package/dist/mailer-core.module.js +3 -2
- package/dist/mailer-transport.factory.js +2 -2
- package/dist/mailer.module.js +1 -1
- package/dist/mailer.service.js +6 -6
- package/package.json +37 -31
- package/.dockerignore +0 -2
- package/Dockerfile +0 -10
- package/docker-compose.yml +0 -18
- package/jest.config.js +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.7.1](https://github.com/nest-modules/mailer/compare/v1.7.0...v1.7.1) (2022-06-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* corrects dependency with security problems ([6076fca](https://github.com/nest-modules/mailer/commit/6076fca3b9992e7d2bbf373717de4332070b7900))
|
|
11
|
+
|
|
12
|
+
## [1.7.0](https://github.com/nest-modules/mailer/compare/v1.6.0...v1.7.0) (2022-06-19)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* Add possibility to specify extra providers ([#762](https://github.com/nest-modules/mailer/issues/762)) ([680c67f](https://github.com/nest-modules/mailer/commit/680c67fd5618909b6705eb1c73bd55d6b94ac76c))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **adapters:** resolving correct templateDir ([9bee48b](https://github.com/nest-modules/mailer/commit/9bee48b0e630c71c3702b83747dc41152670947e))
|
|
23
|
+
* **deps:** update dependency dotenv to v10 ([8dcb4e0](https://github.com/nest-modules/mailer/commit/8dcb4e0b563461d0d1b8ab90419992e434197bd9))
|
|
24
|
+
* **deps:** update dependency dotenv to v8.6.0 ([8cd1094](https://github.com/nest-modules/mailer/commit/8cd10947722a4c74ec841814118dcc535024e042))
|
|
25
|
+
* **deps:** update dependency glob to v7.1.7 ([cba34c6](https://github.com/nest-modules/mailer/commit/cba34c682992331895c43224fdc3686daa29c05e))
|
|
26
|
+
* **deps:** update dependency glob to v7.2.0 ([222e701](https://github.com/nest-modules/mailer/commit/222e701642b93d5d90d023307a4c0bdf0a533944))
|
|
27
|
+
* **deps:** update dependency nodemailer to v6.6.1 ([ec1eec9](https://github.com/nest-modules/mailer/commit/ec1eec95696c958eff8f02ad6a210f771ffdf624))
|
|
28
|
+
* **deps:** update dependency nodemailer to v6.6.2 ([fc92ddd](https://github.com/nest-modules/mailer/commit/fc92ddd9852876306a3a5c87649f3d27806b7853))
|
|
29
|
+
* **deps:** update dependency nodemailer to v6.6.5 ([d68d341](https://github.com/nest-modules/mailer/commit/d68d34120fd7028f260e8b914d455859e0469f88))
|
|
30
|
+
* **deps:** update dependency nodemailer to v6.7.2 ([7638b01](https://github.com/nest-modules/mailer/commit/7638b01f9ec8bcded5b320766be65477adab024d))
|
|
31
|
+
* **deps:** update dependency rxjs to v7 ([efcc64e](https://github.com/nest-modules/mailer/commit/efcc64e3eb8d8b110a2aa0fa4b352c34d9e6154f))
|
|
32
|
+
* **deps:** update dependency rxjs to v7.3.1 ([a5aa0ae](https://github.com/nest-modules/mailer/commit/a5aa0ae646395db2d87c74130bf25c9214624c43))
|
|
33
|
+
* **deps:** update dependency rxjs to v7.4.0 ([8fb17f1](https://github.com/nest-modules/mailer/commit/8fb17f17f7ab0253f3c0620fe91c6dbbd578d9f2))
|
|
34
|
+
* **deps:** update dependency twing to v5.1.0 ([7d45c53](https://github.com/nest-modules/mailer/commit/7d45c53132c5d81e5042887db782fe0878973d1b))
|
|
35
|
+
* **deps:** update nest monorepo to v7.6.18 ([6f7bdf8](https://github.com/nest-modules/mailer/commit/6f7bdf8ce793821888e22ee12c73cd204619cbd8))
|
|
36
|
+
* no error handling for inlineCss ([c232e75](https://github.com/nest-modules/mailer/commit/c232e752d77c521076583a489a7ccc214df13803))
|
|
37
|
+
* register partials in handlebars ([#715](https://github.com/nest-modules/mailer/issues/715)) ([7f2cbae](https://github.com/nest-modules/mailer/commit/7f2cbae49858f88e686534e43dd45ec63d2256ca))
|
|
38
|
+
|
|
39
|
+
### [1.6.1](https://github.com/nest-modules/mailer/compare/v1.6.0...v1.6.1) (2021-12-30)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* register partials in handlebars ([#715](https://github.com/nest-modules/mailer/issues/715)) ([7f2cbae](https://github.com/nest-modules/mailer/commit/7f2cbae49858f88e686534e43dd45ec63d2256ca))
|
|
45
|
+
* **adapters:** resolving correct templateDir ([9bee48b](https://github.com/nest-modules/mailer/commit/9bee48b0e630c71c3702b83747dc41152670947e))
|
|
46
|
+
* **deps:** update dependency dotenv to v10 ([8dcb4e0](https://github.com/nest-modules/mailer/commit/8dcb4e0b563461d0d1b8ab90419992e434197bd9))
|
|
47
|
+
* **deps:** update dependency dotenv to v8.6.0 ([8cd1094](https://github.com/nest-modules/mailer/commit/8cd10947722a4c74ec841814118dcc535024e042))
|
|
48
|
+
* **deps:** update dependency glob to v7.1.7 ([cba34c6](https://github.com/nest-modules/mailer/commit/cba34c682992331895c43224fdc3686daa29c05e))
|
|
49
|
+
* **deps:** update dependency nodemailer to v6.6.1 ([ec1eec9](https://github.com/nest-modules/mailer/commit/ec1eec95696c958eff8f02ad6a210f771ffdf624))
|
|
50
|
+
* **deps:** update dependency nodemailer to v6.6.2 ([fc92ddd](https://github.com/nest-modules/mailer/commit/fc92ddd9852876306a3a5c87649f3d27806b7853))
|
|
51
|
+
* **deps:** update dependency nodemailer to v6.6.5 ([d68d341](https://github.com/nest-modules/mailer/commit/d68d34120fd7028f260e8b914d455859e0469f88))
|
|
52
|
+
* **deps:** update dependency rxjs to v7 ([efcc64e](https://github.com/nest-modules/mailer/commit/efcc64e3eb8d8b110a2aa0fa4b352c34d9e6154f))
|
|
53
|
+
* **deps:** update dependency rxjs to v7.3.1 ([a5aa0ae](https://github.com/nest-modules/mailer/commit/a5aa0ae646395db2d87c74130bf25c9214624c43))
|
|
54
|
+
* **deps:** update dependency twing to v5.1.0 ([7d45c53](https://github.com/nest-modules/mailer/commit/7d45c53132c5d81e5042887db782fe0878973d1b))
|
|
55
|
+
* **deps:** update nest monorepo to v7.6.18 ([6f7bdf8](https://github.com/nest-modules/mailer/commit/6f7bdf8ce793821888e22ee12c73cd204619cbd8))
|
|
56
|
+
|
|
5
57
|
## [1.6.0](https://github.com/nest-modules/mailer/compare/v1.5.1...v1.6.0) (2021-04-14)
|
|
6
58
|
|
|
7
59
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Use this section to tell people about which versions of your project are
|
|
6
|
+
currently being supported with security updates.
|
|
7
|
+
|
|
8
|
+
| Version | Supported |
|
|
9
|
+
| ------- | ------------------ |
|
|
10
|
+
| 5.1.x | :white_check_mark: |
|
|
11
|
+
| 5.0.x | :x: |
|
|
12
|
+
| 4.0.x | :white_check_mark: |
|
|
13
|
+
| < 4.0 | :x: |
|
|
14
|
+
|
|
15
|
+
## Reporting a Vulnerability
|
|
16
|
+
|
|
17
|
+
Use this section to tell people how to report a vulnerability.
|
|
18
|
+
|
|
19
|
+
Tell them where to go, how often they can expect to get an update on a
|
|
20
|
+
reported vulnerability, what to expect if the vulnerability is accepted or
|
|
21
|
+
declined, etc.
|
|
@@ -16,28 +16,31 @@ class EjsAdapter {
|
|
|
16
16
|
Object.assign(this.config, config);
|
|
17
17
|
}
|
|
18
18
|
compile(mail, callback, mailerOptions) {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const { context, template } = mail.data;
|
|
20
|
+
const templateExt = path.extname(template) || '.ejs';
|
|
21
|
+
const templateName = path.basename(template, path.extname(template));
|
|
22
|
+
const templateDir = path.isAbsolute(template)
|
|
23
|
+
? path.dirname(template)
|
|
24
|
+
: path.join((0, lodash_1.get)(mailerOptions, 'template.dir', ''), path.dirname(template));
|
|
24
25
|
const templatePath = path.join(templateDir, templateName + templateExt);
|
|
25
26
|
if (!this.precompiledTemplates[templateName]) {
|
|
26
27
|
try {
|
|
27
|
-
const template = fs.readFileSync(templatePath, '
|
|
28
|
-
this.precompiledTemplates[templateName] = ejs_1.compile(template, Object.assign(Object.assign({}, lodash_1.get(mailerOptions, 'template.options', {})), { filename: templatePath }));
|
|
28
|
+
const template = fs.readFileSync(templatePath, 'utf-8');
|
|
29
|
+
this.precompiledTemplates[templateName] = (0, ejs_1.compile)(template, Object.assign(Object.assign({}, (0, lodash_1.get)(mailerOptions, 'template.options', {})), { filename: templatePath }));
|
|
29
30
|
}
|
|
30
31
|
catch (err) {
|
|
31
32
|
return callback(err);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
const rendered = this.precompiledTemplates[templateName](
|
|
35
|
+
const rendered = this.precompiledTemplates[templateName](context);
|
|
35
36
|
const render = (html) => {
|
|
36
37
|
if (this.config.inlineCssEnabled) {
|
|
37
|
-
inlineCss(html, this.config.inlineCssOptions)
|
|
38
|
+
inlineCss(html, this.config.inlineCssOptions)
|
|
39
|
+
.then((html) => {
|
|
38
40
|
mail.data.html = html;
|
|
39
41
|
return callback();
|
|
40
|
-
})
|
|
42
|
+
})
|
|
43
|
+
.catch(callback);
|
|
41
44
|
}
|
|
42
45
|
else {
|
|
43
46
|
mail.data.html = html;
|
|
@@ -25,14 +25,14 @@ class HandlebarsAdapter {
|
|
|
25
25
|
const precompile = (template, callback, options) => {
|
|
26
26
|
const templateExt = path.extname(template) || '.hbs';
|
|
27
27
|
const templateName = path.basename(template, path.extname(template));
|
|
28
|
-
const templateDir =
|
|
29
|
-
?
|
|
30
|
-
: path.dirname(template);
|
|
28
|
+
const templateDir = path.isAbsolute(template)
|
|
29
|
+
? path.dirname(template)
|
|
30
|
+
: path.join((0, lodash_1.get)(options, 'dir', ''), path.dirname(template));
|
|
31
31
|
const templatePath = path.join(templateDir, templateName + templateExt);
|
|
32
32
|
if (!this.precompiledTemplates[templateName]) {
|
|
33
33
|
try {
|
|
34
|
-
const template = fs.readFileSync(templatePath, '
|
|
35
|
-
this.precompiledTemplates[templateName] = handlebars.compile(template, lodash_1.get(options, 'options', {}));
|
|
34
|
+
const template = fs.readFileSync(templatePath, 'utf-8');
|
|
35
|
+
this.precompiledTemplates[templateName] = handlebars.compile(template, (0, lodash_1.get)(options, 'options', {}));
|
|
36
36
|
}
|
|
37
37
|
catch (err) {
|
|
38
38
|
return callback(err);
|
|
@@ -46,20 +46,26 @@ class HandlebarsAdapter {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
const { templateName } = precompile(mail.data.template, callback, mailerOptions.template);
|
|
49
|
-
const runtimeOptions = lodash_1.get(mailerOptions, 'options', {
|
|
49
|
+
const runtimeOptions = (0, lodash_1.get)(mailerOptions, 'options', {
|
|
50
50
|
partials: false,
|
|
51
51
|
data: {},
|
|
52
52
|
});
|
|
53
53
|
if (runtimeOptions.partials) {
|
|
54
|
-
const files = glob.sync(path.join(runtimeOptions.partials.dir, '*.hbs'));
|
|
55
|
-
files.forEach((file) =>
|
|
54
|
+
const files = glob.sync(path.join(runtimeOptions.partials.dir, '**', '*.hbs'));
|
|
55
|
+
files.forEach((file) => {
|
|
56
|
+
const { templateName, templatePath } = precompile(file, () => { }, runtimeOptions.partials);
|
|
57
|
+
const templateDir = path.relative(runtimeOptions.partials.dir, path.dirname(templatePath));
|
|
58
|
+
handlebars.registerPartial(path.join(templateDir, templateName), fs.readFileSync(templatePath, 'utf-8'));
|
|
59
|
+
});
|
|
56
60
|
}
|
|
57
61
|
const rendered = this.precompiledTemplates[templateName](mail.data.context, Object.assign(Object.assign({}, runtimeOptions), { partials: this.precompiledTemplates }));
|
|
58
62
|
if (this.config.inlineCssEnabled) {
|
|
59
|
-
inlineCss(rendered, this.config.inlineCssOptions)
|
|
63
|
+
inlineCss(rendered, this.config.inlineCssOptions)
|
|
64
|
+
.then((html) => {
|
|
60
65
|
mail.data.html = html;
|
|
61
66
|
return callback();
|
|
62
|
-
})
|
|
67
|
+
})
|
|
68
|
+
.catch(callback);
|
|
63
69
|
}
|
|
64
70
|
else {
|
|
65
71
|
mail.data.html = rendered;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TemplateAdapterConfig } from '../interfaces/template-adapter-config.interface';
|
|
2
|
+
import { TemplateAdapter } from '../interfaces/template-adapter.interface';
|
|
3
|
+
import { MailerOptions } from '../interfaces/mailer-options.interface';
|
|
4
|
+
export declare class MjmlAdapter implements TemplateAdapter {
|
|
5
|
+
private engine;
|
|
6
|
+
constructor(engine: TemplateAdapter | '' | 'pug' | 'handlebars' | 'ejs', config?: TemplateAdapterConfig, others?: {
|
|
7
|
+
handlebar?: {
|
|
8
|
+
helper?: any;
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
compile(mail: any, callback: any, mailerOptions: MailerOptions): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MjmlAdapter = void 0;
|
|
4
|
+
const handlebars_adapter_1 = require("./handlebars.adapter");
|
|
5
|
+
const ejs_adapter_1 = require("./ejs.adapter");
|
|
6
|
+
const pug_adapter_1 = require("./pug.adapter");
|
|
7
|
+
const mjml_1 = require("mjml");
|
|
8
|
+
class MjmlAdapter {
|
|
9
|
+
constructor(engine, config, others) {
|
|
10
|
+
this.engine = engine;
|
|
11
|
+
if (typeof engine == 'string') {
|
|
12
|
+
if (engine === 'pug') {
|
|
13
|
+
this.engine = new pug_adapter_1.PugAdapter(config);
|
|
14
|
+
}
|
|
15
|
+
else if (engine === 'handlebars') {
|
|
16
|
+
this.engine = new handlebars_adapter_1.HandlebarsAdapter(others.handlebar.helper, config);
|
|
17
|
+
}
|
|
18
|
+
else if (engine === 'ejs') {
|
|
19
|
+
this.engine = new ejs_adapter_1.EjsAdapter(config);
|
|
20
|
+
}
|
|
21
|
+
else if (engine === '') {
|
|
22
|
+
engine = null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
compile(mail, callback, mailerOptions) {
|
|
27
|
+
var _a;
|
|
28
|
+
(_a = this === null || this === void 0 ? void 0 : this.engine) === null || _a === void 0 ? void 0 : _a.compile(mail, () => {
|
|
29
|
+
mail.data.html = (0, mjml_1.default)(mail.data.html).html;
|
|
30
|
+
callback();
|
|
31
|
+
}, mailerOptions);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.MjmlAdapter = MjmlAdapter;
|
|
@@ -14,22 +14,25 @@ class PugAdapter {
|
|
|
14
14
|
Object.assign(this.config, config);
|
|
15
15
|
}
|
|
16
16
|
compile(mail, callback, mailerOptions) {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const { context, template } = mail.data;
|
|
18
|
+
const templateExt = path.extname(template) || '.pug';
|
|
19
|
+
const templateName = path.basename(template, path.extname(template));
|
|
20
|
+
const templateDir = path.isAbsolute(template)
|
|
21
|
+
? path.dirname(template)
|
|
22
|
+
: path.join((0, lodash_1.get)(mailerOptions, 'template.dir', ''), path.dirname(template));
|
|
22
23
|
const templatePath = path.join(templateDir, templateName + templateExt);
|
|
23
|
-
const options = Object.assign(Object.assign({},
|
|
24
|
-
pug_1.renderFile(templatePath, options, (err, body) => {
|
|
24
|
+
const options = Object.assign(Object.assign({}, context), (0, lodash_1.get)(mailerOptions, 'template.options', {}));
|
|
25
|
+
(0, pug_1.renderFile)(templatePath, options, (err, body) => {
|
|
25
26
|
if (err) {
|
|
26
27
|
return callback(err);
|
|
27
28
|
}
|
|
28
29
|
if (this.config.inlineCssEnabled) {
|
|
29
|
-
inlineCss(body, this.config.inlineCssOptions)
|
|
30
|
+
inlineCss(body, this.config.inlineCssOptions)
|
|
31
|
+
.then((html) => {
|
|
30
32
|
mail.data.html = html;
|
|
31
33
|
return callback();
|
|
32
|
-
})
|
|
34
|
+
})
|
|
35
|
+
.catch(callback);
|
|
33
36
|
}
|
|
34
37
|
else {
|
|
35
38
|
mail.data.html = body;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
|
2
|
+
import { Provider } from '@nestjs/common';
|
|
2
3
|
import { MailerOptions } from './mailer-options.interface';
|
|
3
4
|
import { MailerOptionsFactory } from './mailer-options-factory.interface';
|
|
4
5
|
export interface MailerAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
@@ -6,4 +7,5 @@ export interface MailerAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
|
6
7
|
useClass?: Type<MailerOptionsFactory>;
|
|
7
8
|
useExisting?: Type<MailerOptionsFactory>;
|
|
8
9
|
useFactory?: (...args: any[]) => Promise<MailerOptions> | MailerOptions;
|
|
10
|
+
extraProviders?: Provider[];
|
|
9
11
|
}
|
|
@@ -30,6 +30,7 @@ let MailerCoreModule = MailerCoreModule_1 = class MailerCoreModule {
|
|
|
30
30
|
providers: [
|
|
31
31
|
...providers,
|
|
32
32
|
mailer_service_1.MailerService,
|
|
33
|
+
...(options.extraProviders || []),
|
|
33
34
|
],
|
|
34
35
|
imports: options.imports,
|
|
35
36
|
exports: [
|
|
@@ -67,7 +68,7 @@ let MailerCoreModule = MailerCoreModule_1 = class MailerCoreModule {
|
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
70
|
MailerCoreModule = MailerCoreModule_1 = tslib_1.__decorate([
|
|
70
|
-
common_1.Global(),
|
|
71
|
-
common_1.Module({})
|
|
71
|
+
(0, common_1.Global)(),
|
|
72
|
+
(0, common_1.Module)({})
|
|
72
73
|
], MailerCoreModule);
|
|
73
74
|
exports.MailerCoreModule = MailerCoreModule;
|
|
@@ -10,11 +10,11 @@ let MailerTransportFactory = class MailerTransportFactory {
|
|
|
10
10
|
this.options = options;
|
|
11
11
|
}
|
|
12
12
|
createTransport(opts) {
|
|
13
|
-
return nodemailer_1.createTransport(opts || this.options.transport, this.options.defaults);
|
|
13
|
+
return (0, nodemailer_1.createTransport)(opts || this.options.transport, this.options.defaults);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
MailerTransportFactory = tslib_1.__decorate([
|
|
17
|
-
tslib_1.__param(0, common_1.Inject(mailer_constant_1.MAILER_OPTIONS)),
|
|
17
|
+
tslib_1.__param(0, (0, common_1.Inject)(mailer_constant_1.MAILER_OPTIONS)),
|
|
18
18
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
19
19
|
], MailerTransportFactory);
|
|
20
20
|
exports.MailerTransportFactory = MailerTransportFactory;
|
package/dist/mailer.module.js
CHANGED
package/dist/mailer.service.js
CHANGED
|
@@ -20,13 +20,13 @@ let MailerService = class MailerService {
|
|
|
20
20
|
!mailerOptions.transports) {
|
|
21
21
|
throw new Error('Make sure to provide a nodemailer transport configuration object, connection url or a transport plugin instance.');
|
|
22
22
|
}
|
|
23
|
-
const templateAdapter = lodash_1.get(this.mailerOptions, 'template.adapter');
|
|
23
|
+
const templateAdapter = (0, lodash_1.get)(this.mailerOptions, 'template.adapter');
|
|
24
24
|
if (this.mailerOptions.preview) {
|
|
25
25
|
const defaults = { open: { wait: false } };
|
|
26
26
|
this.mailerOptions.preview =
|
|
27
27
|
typeof this.mailerOptions.preview === 'boolean'
|
|
28
28
|
? defaults
|
|
29
|
-
: lodash_1.defaultsDeep(this.mailerOptions.preview, defaults);
|
|
29
|
+
: (0, lodash_1.defaultsDeep)(this.mailerOptions.preview, defaults);
|
|
30
30
|
}
|
|
31
31
|
if (mailerOptions.transports) {
|
|
32
32
|
Object.keys(mailerOptions.transports).forEach((name) => {
|
|
@@ -81,10 +81,10 @@ let MailerService = class MailerService {
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
MailerService = tslib_1.__decorate([
|
|
84
|
-
common_1.Injectable(),
|
|
85
|
-
tslib_1.__param(0, common_1.Inject(mailer_constant_1.MAILER_OPTIONS)),
|
|
86
|
-
tslib_1.__param(1, common_1.Optional()),
|
|
87
|
-
tslib_1.__param(1, common_1.Inject(mailer_constant_1.MAILER_TRANSPORT_FACTORY)),
|
|
84
|
+
(0, common_1.Injectable)(),
|
|
85
|
+
tslib_1.__param(0, (0, common_1.Inject)(mailer_constant_1.MAILER_OPTIONS)),
|
|
86
|
+
tslib_1.__param(1, (0, common_1.Optional)()),
|
|
87
|
+
tslib_1.__param(1, (0, common_1.Inject)(mailer_constant_1.MAILER_TRANSPORT_FACTORY)),
|
|
88
88
|
tslib_1.__metadata("design:paramtypes", [Object, Object])
|
|
89
89
|
], MailerService);
|
|
90
90
|
exports.MailerService = MailerService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-modules/mailer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "NestJS - a mailer module (@mailer)",
|
|
6
6
|
"keywords": [
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
"build": "tsc -p tsconfig.json",
|
|
32
32
|
"deploy": "sh ./publish.sh",
|
|
33
33
|
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write",
|
|
34
|
+
"audit:convert": "yarn-audit-fix --flow=convert",
|
|
35
|
+
"audit:patch": "yarn-audit-fix --flow=patch",
|
|
36
|
+
"audit:fix": "npx yarn-audit-fix --package-lock-only=false --force --legacy-peer-deps --flow=convert",
|
|
34
37
|
"major": "npm run release -- --release-as major",
|
|
35
38
|
"minor": "npm run release -- --release-as minor",
|
|
36
39
|
"patch": "npm run release -- --release-as patch",
|
|
@@ -49,52 +52,55 @@
|
|
|
49
52
|
]
|
|
50
53
|
},
|
|
51
54
|
"dependencies": {
|
|
52
|
-
"glob": "
|
|
55
|
+
"glob": "8.0.3",
|
|
53
56
|
"inline-css": "3.0.0",
|
|
54
|
-
"
|
|
57
|
+
"mjml": "^4.12.0",
|
|
58
|
+
"preview-email": "3.0.5"
|
|
55
59
|
},
|
|
56
60
|
"optionalDependencies": {
|
|
57
61
|
"@types/ejs": "^3.0.3",
|
|
58
|
-
"@types/pug": "2.0.
|
|
62
|
+
"@types/pug": "2.0.5",
|
|
59
63
|
"ejs": "^3.1.2",
|
|
60
64
|
"handlebars": "^4.7.6",
|
|
61
65
|
"pug": "^3.0.1"
|
|
62
66
|
},
|
|
63
67
|
"devDependencies": {
|
|
64
|
-
"@commitlint/cli": "
|
|
65
|
-
"@commitlint/config-angular": "
|
|
66
|
-
"@nestjs/common": "
|
|
67
|
-
"@nestjs/core": "
|
|
68
|
-
"@nestjs/testing": "
|
|
69
|
-
"@types/glob": "7.
|
|
70
|
-
"@types/inline-css": "
|
|
71
|
-
"@types/jest": "26.0.
|
|
72
|
-
"@types/lodash": "4.14.
|
|
73
|
-
"@types/nodemailer": "6.4.
|
|
74
|
-
"@types/pug": "2.0.
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "
|
|
76
|
-
"@typescript-eslint/parser": "
|
|
77
|
-
"husky": "
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"nodemailer": "6.5
|
|
81
|
-
"nodemailer-mock": "1.5.
|
|
82
|
-
"prettier": "2.
|
|
68
|
+
"@commitlint/cli": "13.2.1",
|
|
69
|
+
"@commitlint/config-angular": "13.2.0",
|
|
70
|
+
"@nestjs/common": "8.2.4",
|
|
71
|
+
"@nestjs/core": "8.4.7",
|
|
72
|
+
"@nestjs/testing": "8.4.7",
|
|
73
|
+
"@types/glob": "7.2.0",
|
|
74
|
+
"@types/inline-css": "3.0.1",
|
|
75
|
+
"@types/jest": "26.0.24",
|
|
76
|
+
"@types/lodash": "4.14.182",
|
|
77
|
+
"@types/nodemailer": "6.4.4",
|
|
78
|
+
"@types/pug": "2.0.5",
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "5.28.0",
|
|
80
|
+
"@typescript-eslint/parser": "5.8.0",
|
|
81
|
+
"husky": "7.0.4",
|
|
82
|
+
"jest": "27.0.6",
|
|
83
|
+
"lint-staged": "13.0.2",
|
|
84
|
+
"nodemailer": "6.7.5",
|
|
85
|
+
"nodemailer-mock": "1.5.12",
|
|
86
|
+
"prettier": "2.7.1",
|
|
83
87
|
"reflect-metadata": "0.1.13",
|
|
84
88
|
"rimraf": "3.0.2",
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"ts-
|
|
88
|
-
"
|
|
89
|
+
"rxjs": "7.4.0",
|
|
90
|
+
"standard-version": "9.3.2",
|
|
91
|
+
"ts-jest": "27.1.2",
|
|
92
|
+
"ts-node": "10.8.1",
|
|
93
|
+
"typescript": "4.7.4",
|
|
94
|
+
"yarn-audit-fix": "^9.3.2"
|
|
89
95
|
},
|
|
90
96
|
"peerDependencies": {
|
|
91
|
-
"@nestjs/common": "^7.0.9",
|
|
92
|
-
"@nestjs/core": "^7.0.9",
|
|
97
|
+
"@nestjs/common": "^7.0.9 || ^8.0.0",
|
|
98
|
+
"@nestjs/core": "^7.0.9 || ^8.0.0",
|
|
93
99
|
"@types/ejs": "^3.0.3",
|
|
94
|
-
"@types/pug": "2.0.
|
|
100
|
+
"@types/pug": "2.0.5",
|
|
95
101
|
"ejs": "^3.1.2",
|
|
96
102
|
"handlebars": "^4.7.6",
|
|
97
103
|
"nodemailer": "^6.4.6",
|
|
98
|
-
"pug": "^
|
|
104
|
+
"pug": "^3.0.1"
|
|
99
105
|
}
|
|
100
106
|
}
|
package/.dockerignore
DELETED
package/Dockerfile
DELETED
package/docker-compose.yml
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
version: "3"
|
|
2
|
-
|
|
3
|
-
services:
|
|
4
|
-
docusaurus:
|
|
5
|
-
build: .
|
|
6
|
-
ports:
|
|
7
|
-
- 3000:3000
|
|
8
|
-
- 35729:35729
|
|
9
|
-
volumes:
|
|
10
|
-
- ./docs:/app/docs
|
|
11
|
-
- ./website/blog:/app/website/blog
|
|
12
|
-
- ./website/core:/app/website/core
|
|
13
|
-
- ./website/i18n:/app/website/i18n
|
|
14
|
-
- ./website/pages:/app/website/pages
|
|
15
|
-
- ./website/static:/app/website/static
|
|
16
|
-
- ./website/sidebars.json:/app/website/sidebars.json
|
|
17
|
-
- ./website/siteConfig.js:/app/website/siteConfig.js
|
|
18
|
-
working_dir: /app/website
|
package/jest.config.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
require('ts-node/register');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
'moduleFileExtensions': [
|
|
5
|
-
'js',
|
|
6
|
-
'json',
|
|
7
|
-
'ts',
|
|
8
|
-
],
|
|
9
|
-
'rootDir': 'lib',
|
|
10
|
-
'testRegex': '/lib/.*\\.spec\\.(ts|js)$',
|
|
11
|
-
'globals': {
|
|
12
|
-
'ts-jest': {
|
|
13
|
-
'tsConfig': 'tsconfig.json'
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
'preset': 'ts-jest',
|
|
17
|
-
};
|