@nestjs-modules/mailer 1.6.0 → 1.6.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/.github/workflows/codeql-analysis.yml +71 -0
- package/CHANGELOG.md +18 -0
- package/dist/adapters/ejs.adapter.js +2 -2
- package/dist/adapters/handlebars.adapter.js +6 -3
- package/dist/adapters/pug.adapter.js +2 -2
- package/dist/interfaces/send-mail-options.interface.d.ts +0 -7
- package/package.json +31 -30
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
+
# to commit it to your repository.
|
|
3
|
+
#
|
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
+
# or to provide custom queries or build logic.
|
|
6
|
+
#
|
|
7
|
+
# ******** NOTE ********
|
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
+
# supported CodeQL languages.
|
|
11
|
+
#
|
|
12
|
+
name: "CodeQL"
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
push:
|
|
16
|
+
branches: [ master ]
|
|
17
|
+
pull_request:
|
|
18
|
+
# The branches below must be a subset of the branches above
|
|
19
|
+
branches: [ master ]
|
|
20
|
+
schedule:
|
|
21
|
+
- cron: '36 11 * * 1'
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
analyze:
|
|
25
|
+
name: Analyze
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
permissions:
|
|
28
|
+
actions: read
|
|
29
|
+
contents: read
|
|
30
|
+
security-events: write
|
|
31
|
+
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
language: [ 'javascript' ]
|
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
|
37
|
+
# Learn more:
|
|
38
|
+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
|
39
|
+
|
|
40
|
+
steps:
|
|
41
|
+
- name: Checkout repository
|
|
42
|
+
uses: actions/checkout@v2
|
|
43
|
+
|
|
44
|
+
# Initializes the CodeQL tools for scanning.
|
|
45
|
+
- name: Initialize CodeQL
|
|
46
|
+
uses: github/codeql-action/init@v1
|
|
47
|
+
with:
|
|
48
|
+
languages: ${{ matrix.language }}
|
|
49
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
50
|
+
# By default, queries listed here will override any specified in a config file.
|
|
51
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
52
|
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
53
|
+
|
|
54
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
55
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
|
56
|
+
- name: Autobuild
|
|
57
|
+
uses: github/codeql-action/autobuild@v1
|
|
58
|
+
|
|
59
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
60
|
+
# 📚 https://git.io/JvXDl
|
|
61
|
+
|
|
62
|
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
63
|
+
# and modify them (or add more) to build your code if your project
|
|
64
|
+
# uses a compiled language
|
|
65
|
+
|
|
66
|
+
#- run: |
|
|
67
|
+
# make bootstrap
|
|
68
|
+
# make release
|
|
69
|
+
|
|
70
|
+
- name: Perform CodeQL Analysis
|
|
71
|
+
uses: github/codeql-action/analyze@v1
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
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.6.1](https://github.com/nest-modules/mailer/compare/v1.6.0...v1.6.1) (2021-12-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* register partials in handlebars ([#715](https://github.com/nest-modules/mailer/issues/715)) ([7f2cbae](https://github.com/nest-modules/mailer/commit/7f2cbae49858f88e686534e43dd45ec63d2256ca))
|
|
11
|
+
* **adapters:** resolving correct templateDir ([9bee48b](https://github.com/nest-modules/mailer/commit/9bee48b0e630c71c3702b83747dc41152670947e))
|
|
12
|
+
* **deps:** update dependency dotenv to v10 ([8dcb4e0](https://github.com/nest-modules/mailer/commit/8dcb4e0b563461d0d1b8ab90419992e434197bd9))
|
|
13
|
+
* **deps:** update dependency dotenv to v8.6.0 ([8cd1094](https://github.com/nest-modules/mailer/commit/8cd10947722a4c74ec841814118dcc535024e042))
|
|
14
|
+
* **deps:** update dependency glob to v7.1.7 ([cba34c6](https://github.com/nest-modules/mailer/commit/cba34c682992331895c43224fdc3686daa29c05e))
|
|
15
|
+
* **deps:** update dependency nodemailer to v6.6.1 ([ec1eec9](https://github.com/nest-modules/mailer/commit/ec1eec95696c958eff8f02ad6a210f771ffdf624))
|
|
16
|
+
* **deps:** update dependency nodemailer to v6.6.2 ([fc92ddd](https://github.com/nest-modules/mailer/commit/fc92ddd9852876306a3a5c87649f3d27806b7853))
|
|
17
|
+
* **deps:** update dependency nodemailer to v6.6.5 ([d68d341](https://github.com/nest-modules/mailer/commit/d68d34120fd7028f260e8b914d455859e0469f88))
|
|
18
|
+
* **deps:** update dependency rxjs to v7 ([efcc64e](https://github.com/nest-modules/mailer/commit/efcc64e3eb8d8b110a2aa0fa4b352c34d9e6154f))
|
|
19
|
+
* **deps:** update dependency rxjs to v7.3.1 ([a5aa0ae](https://github.com/nest-modules/mailer/commit/a5aa0ae646395db2d87c74130bf25c9214624c43))
|
|
20
|
+
* **deps:** update dependency twing to v5.1.0 ([7d45c53](https://github.com/nest-modules/mailer/commit/7d45c53132c5d81e5042887db782fe0878973d1b))
|
|
21
|
+
* **deps:** update nest monorepo to v7.6.18 ([6f7bdf8](https://github.com/nest-modules/mailer/commit/6f7bdf8ce793821888e22ee12c73cd204619cbd8))
|
|
22
|
+
|
|
5
23
|
## [1.6.0](https://github.com/nest-modules/mailer/compare/v1.5.1...v1.6.0) (2021-04-14)
|
|
6
24
|
|
|
7
25
|
|
|
@@ -19,8 +19,8 @@ class EjsAdapter {
|
|
|
19
19
|
const templateExt = path.extname(mail.data.template) || '.ejs';
|
|
20
20
|
const templateName = path.basename(mail.data.template, path.extname(mail.data.template));
|
|
21
21
|
const templateDir = mail.data.template.startsWith('./')
|
|
22
|
-
?
|
|
23
|
-
:
|
|
22
|
+
? path.dirname(mail.data.template)
|
|
23
|
+
: lodash_1.get(mailerOptions, 'template.dir', '');
|
|
24
24
|
const templatePath = path.join(templateDir, templateName + templateExt);
|
|
25
25
|
if (!this.precompiledTemplates[templateName]) {
|
|
26
26
|
try {
|
|
@@ -26,8 +26,8 @@ class HandlebarsAdapter {
|
|
|
26
26
|
const templateExt = path.extname(template) || '.hbs';
|
|
27
27
|
const templateName = path.basename(template, path.extname(template));
|
|
28
28
|
const templateDir = template.startsWith('./')
|
|
29
|
-
?
|
|
30
|
-
:
|
|
29
|
+
? path.dirname(template)
|
|
30
|
+
: lodash_1.get(options, 'dir', '');
|
|
31
31
|
const templatePath = path.join(templateDir, templateName + templateExt);
|
|
32
32
|
if (!this.precompiledTemplates[templateName]) {
|
|
33
33
|
try {
|
|
@@ -52,7 +52,10 @@ class HandlebarsAdapter {
|
|
|
52
52
|
});
|
|
53
53
|
if (runtimeOptions.partials) {
|
|
54
54
|
const files = glob.sync(path.join(runtimeOptions.partials.dir, '*.hbs'));
|
|
55
|
-
files.forEach((file) =>
|
|
55
|
+
files.forEach((file) => {
|
|
56
|
+
const { templateName, templatePath } = precompile(file, () => { }, runtimeOptions.partials);
|
|
57
|
+
handlebars.registerPartial(templateName, fs.readFileSync(templatePath, 'utf-8'));
|
|
58
|
+
});
|
|
56
59
|
}
|
|
57
60
|
const rendered = this.precompiledTemplates[templateName](mail.data.context, Object.assign(Object.assign({}, runtimeOptions), { partials: this.precompiledTemplates }));
|
|
58
61
|
if (this.config.inlineCssEnabled) {
|
|
@@ -17,8 +17,8 @@ class PugAdapter {
|
|
|
17
17
|
const templateExt = path.extname(mail.data.template) || '.pug';
|
|
18
18
|
const templateName = path.basename(mail.data.template, path.extname(mail.data.template));
|
|
19
19
|
const templateDir = mail.data.template.startsWith('./')
|
|
20
|
-
?
|
|
21
|
-
:
|
|
20
|
+
? path.dirname(mail.data.template)
|
|
21
|
+
: lodash_1.get(mailerOptions, 'template.dir', '');
|
|
22
22
|
const templatePath = path.join(templateDir, templateName + templateExt);
|
|
23
23
|
const options = Object.assign(Object.assign({}, mail.data.context), lodash_1.get(mailerOptions, 'template.options', {}));
|
|
24
24
|
pug_1.renderFile(templatePath, options, (err, body) => {
|
|
@@ -40,12 +40,5 @@ export interface ISendMailOptions extends SendMailOptions {
|
|
|
40
40
|
};
|
|
41
41
|
transporterName?: string;
|
|
42
42
|
template?: string;
|
|
43
|
-
attachments?: {
|
|
44
|
-
filename: string;
|
|
45
|
-
content?: any;
|
|
46
|
-
path?: string;
|
|
47
|
-
contentType?: string;
|
|
48
|
-
cid?: string;
|
|
49
|
-
}[];
|
|
50
43
|
dkim?: DKIM.Options;
|
|
51
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-modules/mailer",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "NestJS - a mailer module (@mailer)",
|
|
6
6
|
"keywords": [
|
|
@@ -49,52 +49,53 @@
|
|
|
49
49
|
]
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"glob": "7.1.
|
|
52
|
+
"glob": "7.1.7",
|
|
53
53
|
"inline-css": "3.0.0",
|
|
54
54
|
"preview-email": "3.0.4"
|
|
55
55
|
},
|
|
56
56
|
"optionalDependencies": {
|
|
57
57
|
"@types/ejs": "^3.0.3",
|
|
58
|
-
"@types/pug": "2.0.
|
|
58
|
+
"@types/pug": "2.0.5",
|
|
59
59
|
"ejs": "^3.1.2",
|
|
60
60
|
"handlebars": "^4.7.6",
|
|
61
61
|
"pug": "^3.0.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@commitlint/cli": "
|
|
65
|
-
"@commitlint/config-angular": "
|
|
66
|
-
"@nestjs/common": "
|
|
67
|
-
"@nestjs/core": "
|
|
68
|
-
"@nestjs/testing": "
|
|
69
|
-
"@types/glob": "7.1.
|
|
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": "4.
|
|
76
|
-
"@typescript-eslint/parser": "4.
|
|
77
|
-
"husky": "
|
|
78
|
-
"lint-staged": "
|
|
79
|
-
"jest": "
|
|
80
|
-
"nodemailer": "6.5
|
|
81
|
-
"nodemailer-mock": "1.5.
|
|
82
|
-
"prettier": "2.2
|
|
64
|
+
"@commitlint/cli": "13.2.1",
|
|
65
|
+
"@commitlint/config-angular": "13.2.0",
|
|
66
|
+
"@nestjs/common": "8.0.10",
|
|
67
|
+
"@nestjs/core": "8.0.10",
|
|
68
|
+
"@nestjs/testing": "8.0.10",
|
|
69
|
+
"@types/glob": "7.1.4",
|
|
70
|
+
"@types/inline-css": "3.0.1",
|
|
71
|
+
"@types/jest": "26.0.24",
|
|
72
|
+
"@types/lodash": "4.14.176",
|
|
73
|
+
"@types/nodemailer": "6.4.4",
|
|
74
|
+
"@types/pug": "2.0.5",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "4.31.1",
|
|
76
|
+
"@typescript-eslint/parser": "4.31.1",
|
|
77
|
+
"husky": "7.0.4",
|
|
78
|
+
"lint-staged": "11.2.4",
|
|
79
|
+
"jest": "27.0.6",
|
|
80
|
+
"nodemailer": "6.6.5",
|
|
81
|
+
"nodemailer-mock": "1.5.11",
|
|
82
|
+
"prettier": "2.3.2",
|
|
83
83
|
"reflect-metadata": "0.1.13",
|
|
84
84
|
"rimraf": "3.0.2",
|
|
85
|
-
"standard-version": "9.2
|
|
86
|
-
"ts-jest": "
|
|
87
|
-
"ts-node": "
|
|
88
|
-
"typescript": "4.
|
|
85
|
+
"standard-version": "9.3.2",
|
|
86
|
+
"ts-jest": "27.0.5",
|
|
87
|
+
"ts-node": "10.2.1",
|
|
88
|
+
"typescript": "4.3.5",
|
|
89
|
+
"rxjs": "7.3.1"
|
|
89
90
|
},
|
|
90
91
|
"peerDependencies": {
|
|
91
|
-
"@nestjs/common": "^7.0.9",
|
|
92
|
-
"@nestjs/core": "^7.0.9",
|
|
92
|
+
"@nestjs/common": "^7.0.9 || ^8.0.0",
|
|
93
|
+
"@nestjs/core": "^7.0.9 || ^8.0.0",
|
|
93
94
|
"@types/ejs": "^3.0.3",
|
|
94
|
-
"@types/pug": "2.0.
|
|
95
|
+
"@types/pug": "2.0.5",
|
|
95
96
|
"ejs": "^3.1.2",
|
|
96
97
|
"handlebars": "^4.7.6",
|
|
97
98
|
"nodemailer": "^6.4.6",
|
|
98
|
-
"pug": "^2.0.4
|
|
99
|
+
"pug": "^2.0.4"
|
|
99
100
|
}
|
|
100
101
|
}
|