@pixelplex/mail-service 0.1.17 → 0.1.21
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/.husky/pre-commit +9 -0
- package/README.md +22 -14
- package/dist/connect/app.service.js +4 -2
- package/dist/connect/app.service.js.map +1 -1
- package/dist/connect/retry.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/service/app.controller.d.ts +1 -1
- package/dist/service/app.controller.js.map +1 -1
- package/dist/service/sender.service.js +23 -7
- package/dist/service/sender.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +20 -15
- package/package.json +18 -16
package/README.md
CHANGED
|
@@ -22,6 +22,18 @@ TL;DR
|
|
|
22
22
|
|
|
23
23
|
Didn't understand anything? Okay, let's see more details
|
|
24
24
|
|
|
25
|
+
### Local development
|
|
26
|
+
|
|
27
|
+
To use the package locally, pass the follow config:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
- MAIL_SERVICE_SMTP_HOST=smtp.ethereal.email
|
|
31
|
+
- MAIL_SERVICE_SMTP_PORT=587
|
|
32
|
+
- MAIL_SERVICE_SMTP_SENDER=postmail@pixelplex.io
|
|
33
|
+
- MAIL_SERVICE_SMTP_USERNAME=
|
|
34
|
+
- MAIL_SERVICE_SMTP_PASSWORD=
|
|
35
|
+
```
|
|
36
|
+
|
|
25
37
|
### Prepare templates
|
|
26
38
|
|
|
27
39
|
The service uses Handlebars as template engine. So all your email templates should be prepared as handlebars templates.
|
|
@@ -32,7 +44,7 @@ For sending message your templates folder should include at least 3 files:
|
|
|
32
44
|
- `{type}.handlebars` - body of your email where `{type}` is just your unique key for a unique type of email. For example `welcome.handlebars` for the welcome use email
|
|
33
45
|
- `{type}.subject.handlebars` - subject (title) of yur email
|
|
34
46
|
|
|
35
|
-
For example our project will store files in `templates` folder.
|
|
47
|
+
For example our project will store files in `templates` folder.
|
|
36
48
|
|
|
37
49
|
```
|
|
38
50
|
├── docker-compose.yml
|
|
@@ -52,9 +64,7 @@ For example our project will store files in `templates` folder.
|
|
|
52
64
|
```
|
|
53
65
|
|
|
54
66
|
```handlebars
|
|
55
|
-
# welcome.subject.handlebars
|
|
56
|
-
|
|
57
|
-
Welcome, {{name}}!
|
|
67
|
+
# welcome.subject.handlebars Welcome, {{name}}!
|
|
58
68
|
```
|
|
59
69
|
|
|
60
70
|
```handlebars
|
|
@@ -69,16 +79,16 @@ Welcome, {{name}}!
|
|
|
69
79
|
Then you need to run this service and connect it to RMQ. For example, you can use Docker Compose:
|
|
70
80
|
|
|
71
81
|
```yaml
|
|
72
|
-
version:
|
|
82
|
+
version: '3'
|
|
73
83
|
services:
|
|
74
84
|
rabbitmq:
|
|
75
|
-
image:
|
|
85
|
+
image: 'rabbitmq:3-management'
|
|
76
86
|
ports:
|
|
77
|
-
-
|
|
78
|
-
-
|
|
87
|
+
- '127.0.0.1:5672:5672'
|
|
88
|
+
- '127.0.0.1:15672:15672'
|
|
79
89
|
|
|
80
90
|
mail-service:
|
|
81
|
-
image:
|
|
91
|
+
image: 'pixelplex/mail-service:0.1.18'
|
|
82
92
|
environment:
|
|
83
93
|
- MAIL_SERVICE_RMQ_URL=amqp://rabbitmq:5672
|
|
84
94
|
- MAIL_SERVICE_RMQ_QUEUE=test_queue
|
|
@@ -89,8 +99,8 @@ services:
|
|
|
89
99
|
- MAIL_SERVICE_SMTP_PASSWORD=$MAIL_SERVICE_SMTP_PASSWORD
|
|
90
100
|
- MAIL_SERVICE_SENTRY_DNS=$MAIL_SERVICE_SENTRY_DNS
|
|
91
101
|
volumes:
|
|
92
|
-
- ./templates:/app/templates # note that we attach our template folder as /app/templates
|
|
93
|
-
```
|
|
102
|
+
- ./templates:/app/templates # note that we attach our template folder as /app/templates
|
|
103
|
+
```
|
|
94
104
|
|
|
95
105
|
### Trigger new message sending
|
|
96
106
|
|
|
@@ -150,13 +160,11 @@ import { MailService } from '@pixelplex/mail-service';
|
|
|
150
160
|
|
|
151
161
|
@Injectable()
|
|
152
162
|
export class AppService {
|
|
153
|
-
|
|
154
163
|
constructor(private mailService: MailService) {}
|
|
155
164
|
|
|
156
165
|
async onModuleInit() {
|
|
157
166
|
this.mailService.sendMail('test@gmail.com', 'welcome', { name: 'Афанасий' }, 20);
|
|
158
167
|
}
|
|
159
|
-
|
|
160
168
|
}
|
|
161
169
|
```
|
|
162
170
|
|
|
@@ -164,5 +172,5 @@ In the example below we'll send email to `test@gmail.com` with type `welcome` (`
|
|
|
164
172
|
|
|
165
173
|
`{name: 'Афанасий'}` is the object with data which will used as payload data during processing your handlebars template.
|
|
166
174
|
|
|
167
|
-
The last argument, `20`, is the number of seconds after which the message will be rejected from the queue if, but only if it was processed with an error.
|
|
175
|
+
The last argument, `20`, is the number of seconds after which the message will be rejected from the queue if, but only if it was processed with an error.
|
|
168
176
|
If you think your message should live until it is successfully sent use `0`.
|
|
@@ -13,8 +13,8 @@ exports.MailService = void 0;
|
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const microservices_1 = require("@nestjs/microservices");
|
|
15
15
|
const rxjs_1 = require("rxjs");
|
|
16
|
-
const retry_1 = require("./retry");
|
|
17
16
|
const connection_1 = require("../connection");
|
|
17
|
+
const retry_1 = require("./retry");
|
|
18
18
|
let MailService = class MailService {
|
|
19
19
|
constructor() {
|
|
20
20
|
this.logger = new common_1.Logger('Mail::MailService');
|
|
@@ -23,7 +23,9 @@ let MailService = class MailService {
|
|
|
23
23
|
await rxjs_1.defer(async () => {
|
|
24
24
|
await this.client.connect();
|
|
25
25
|
await this.clientRecovery.connect();
|
|
26
|
-
})
|
|
26
|
+
})
|
|
27
|
+
.pipe(retry_1.default(10, 5000))
|
|
28
|
+
.toPromise();
|
|
27
29
|
this.logger.log('RMQ Connected');
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/connect/app.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4E;AAC5E,yDAA4D;AAC5D,+BAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/connect/app.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4E;AAC5E,yDAA4D;AAC5D,+BAAyC;AACzC,8CAAwD;AAExD,mCAA4B;AAG5B,IAAa,WAAW,GAAxB,MAAa,WAAW;IAAxB;QACU,WAAM,GAAW,IAAI,eAAM,CAAC,mBAAmB,CAAC,CAAC;IAwC3D,CAAC;IAhCC,KAAK,CAAC,sBAAsB;QAC1B,MAAM,YAAK,CAAC,KAAK,IAAI,EAAE;YACrB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC,CAAC;aACC,IAAI,CAAC,eAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;aACrB,SAAS,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CACN,EAAU,EACV,IAAY,EACZ,OAAoC,EACpC,MAAc,CAAC;QAEf,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAuB,UAAU,EAAE;YACxD,IAAI;YACJ,OAAO;YACP,EAAE;YACF,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;YAC/B,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AArCC;IADC,sBAAM,CAAC,0BAAa,CAAC;8BACd,2BAAW;2CAAC;AAGpB;IADC,sBAAM,CAAC,qBAAQ,CAAC;8BACD,2BAAW;mDAAC;AAPjB,WAAW;IADvB,mBAAU,EAAE;GACA,WAAW,CAyCvB;AAzCY,kCAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/connect/retry.ts"],"names":[],"mappings":";;AACA,8CAAwD;AAExD,SAAwB,KAAK,
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/connect/retry.ts"],"names":[],"mappings":";;AACA,8CAAwD;AAExD,SAAwB,KAAK,CAAC,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,KAAK;IAClE,OAAO,CAAI,MAAqB,EAAE,EAAE,CAClC,MAAM,CAAC,IAAI,CACT,qBAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CACd,CAAC,CAAC,IAAI,CACJ,gBAAI,CAAC,CAAC,GAAW,EAAE,KAAY,EAAE,EAAE;QACjC,IAAI,GAAG,GAAG,CAAC,IAAI,aAAa,EAAE;YAC5B,MAAM,KAAK,CAAC;SACb;QACD,OAAO,GAAG,GAAG,CAAC,CAAC;IACjB,CAAC,EAAE,CAAC,CAAC,EACL,iBAAK,CAAC,UAAU,CAAC,CAClB,CACF,CACF,CAAC;AACN,CAAC;AAfD,wBAeC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAGzC,2FAHA,uBAAU,OAGA;AAFnB,uDAAoD;AAE/B,4FAFZ,yBAAW,OAEY"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RmqContext } from '@nestjs/microservices';
|
|
2
|
-
import { SenderService } from './sender.service';
|
|
3
2
|
import { MailMessage } from '../mail';
|
|
3
|
+
import { SenderService } from './sender.service';
|
|
4
4
|
export declare class AppController {
|
|
5
5
|
private readonly senderService;
|
|
6
6
|
private logger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../src/service/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,yDAA+E;AAC/E,uCAAuC;
|
|
1
|
+
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../src/service/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,yDAA+E;AAC/E,uCAAuC;AAEvC,qDAAiD;AAGjD,IAAa,aAAa,GAA1B,MAAa,aAAa;IAExB,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QADjD,WAAM,GAAG,IAAI,eAAM,CAAC,qBAAqB,CAAC,CAAC;IACS,CAAC;IAG7D,KAAK,CAAC,QAAQ,CAAY,IAAiB,EAAS,OAAmB;QACrE,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QACxC,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,IAAI;YACF,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACpE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;SAC1B;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE;gBAC7E,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,eAAe,IAAI,CAAC,EAAE,oBAAoB,IAAI,CAAC,IAAI,gDAAgD,CACpG,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBACzB,OAAO;aACR;YACD,MAAM,CAAC,gBAAgB,CAAC,CAAC,EAAE;gBACzB,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SACzC;IACH,CAAC;CACF,CAAA;AAtBC;IADC,4BAAY,CAAC,UAAU,CAAC;IACT,WAAA,uBAAO,EAAE,CAAA,EAAqB,WAAA,mBAAG,EAAE,CAAA;;6CAAU,0BAAU;;6CAqBtE;AA1BU,aAAa;IADzB,mBAAU,EAAE;qCAGiC,8BAAa;GAF9C,aAAa,CA2BzB;AA3BY,sCAAa"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SenderService = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
4
5
|
const common_1 = require("@nestjs/common");
|
|
5
6
|
const config_1 = require("config");
|
|
6
|
-
const fs = require("fs");
|
|
7
7
|
const Handlebars = require("handlebars");
|
|
8
8
|
const nodemailer_1 = require("nodemailer");
|
|
9
9
|
const hbs = require("nodemailer-express-handlebars");
|
|
@@ -21,16 +21,22 @@ class SenderService {
|
|
|
21
21
|
await this.connect();
|
|
22
22
|
}
|
|
23
23
|
async connect() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const isEthereal = config_1.MAIL_SERVICE.SMTP.HOST === 'smtp.ethereal.email';
|
|
25
|
+
if (!config_1.MAIL_SERVICE.SMTP.PASSWORD && !isEthereal) {
|
|
26
|
+
throw new Error(`[NodemailerConnector Error] Password wasn\'t provided.
|
|
27
|
+
You should provide the password in ENV Variable or in local.json config file`);
|
|
28
|
+
}
|
|
29
|
+
let testAccount;
|
|
30
|
+
if (isEthereal) {
|
|
31
|
+
this.logger.warn('Run in ethereal.email mode');
|
|
32
|
+
testAccount = await nodemailer_1.createTestAccount();
|
|
27
33
|
}
|
|
28
34
|
this.transporter = nodemailer_1.createTransport({
|
|
29
35
|
host: config_1.MAIL_SERVICE.SMTP.HOST,
|
|
30
36
|
port: config_1.MAIL_SERVICE.SMTP.PORT,
|
|
31
37
|
auth: {
|
|
32
|
-
user: config_1.MAIL_SERVICE.SMTP.USERNAME,
|
|
33
|
-
pass: config_1.MAIL_SERVICE.SMTP.PASSWORD,
|
|
38
|
+
user: config_1.MAIL_SERVICE.SMTP.USERNAME || testAccount.user,
|
|
39
|
+
pass: config_1.MAIL_SERVICE.SMTP.PASSWORD || testAccount.pass,
|
|
34
40
|
},
|
|
35
41
|
});
|
|
36
42
|
this.transporter.use('compile', hbs(hbsOptions));
|
|
@@ -39,8 +45,18 @@ class SenderService {
|
|
|
39
45
|
async sendMail(to, template, context = {}) {
|
|
40
46
|
this.logger.debug(`New message to "${to}" with template "${template}"`);
|
|
41
47
|
const subjectTpl = Handlebars.compile(fs.readFileSync(`templates/${template}.subject.handlebars`).toString());
|
|
42
|
-
const info = await this.transporter.sendMail({
|
|
48
|
+
const info = await this.transporter.sendMail({
|
|
49
|
+
from: config_1.MAIL_SERVICE.SMTP.SENDER,
|
|
50
|
+
to,
|
|
51
|
+
subject: subjectTpl(context),
|
|
52
|
+
template,
|
|
53
|
+
context,
|
|
54
|
+
});
|
|
43
55
|
this.logger.debug(`Message sent: ${info.messageId}, ${info.response}`);
|
|
56
|
+
const isEthereal = config_1.MAIL_SERVICE.SMTP.HOST === 'smtp.ethereal.email';
|
|
57
|
+
if (isEthereal) {
|
|
58
|
+
this.logger.debug(`Preview URL: ${nodemailer_1.getTestMessageUrl(info)}`);
|
|
59
|
+
}
|
|
44
60
|
}
|
|
45
61
|
}
|
|
46
62
|
exports.SenderService = SenderService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sender.service.js","sourceRoot":"","sources":["../../src/service/sender.service.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,mCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"sender.service.js","sourceRoot":"","sources":["../../src/service/sender.service.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,2CAAwC;AACxC,mCAAsC;AACtC,yCAAyC;AACzC,2CAAgG;AAChG,qDAAqD;AAErD,MAAM,UAAU,GAAG;IACjB,UAAU,EAAE;QACV,UAAU,EAAE,YAAY;KACzB;IACD,QAAQ,EAAE,YAAY;CACvB,CAAC;AAEF,MAAa,aAAa;IAA1B;QAEmB,WAAM,GAAW,IAAI,eAAM,CAAC,qBAAqB,CAAC,CAAC;IAgDtE,CAAC;IA9CC,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,UAAU,GAAG,qBAAY,CAAC,IAAI,CAAC,IAAI,KAAK,qBAAqB,CAAC;QACpE,IAAI,CAAC,qBAAY,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,EAAE;YAC9C,MAAM,IAAI,KAAK,CACb;qFAC6E,CAC9E,CAAC;SACH;QAED,IAAI,WAAW,CAAC;QAChB,IAAI,UAAU,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;YAC/C,WAAW,GAAG,MAAM,8BAAiB,EAAE,CAAC;SACzC;QACD,IAAI,CAAC,WAAW,GAAG,4BAAe,CAAC;YACjC,IAAI,EAAE,qBAAY,CAAC,IAAI,CAAC,IAAI;YAC5B,IAAI,EAAE,qBAAY,CAAC,IAAI,CAAC,IAAI;YAC5B,IAAI,EAAE;gBACJ,IAAI,EAAE,qBAAY,CAAC,IAAI,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI;gBACpD,IAAI,EAAE,qBAAY,CAAC,IAAI,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI;aACrD;SACF,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;QACjD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU,EAAE,QAAgB,EAAE,OAAO,GAAG,EAAE;QACvD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,QAAQ,GAAG,CAAC,CAAC;QACxE,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,aAAa,QAAQ,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9G,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;YAC3C,IAAI,EAAE,qBAAY,CAAC,IAAI,CAAC,MAAM;YAC9B,EAAE;YACF,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;YAC5B,QAAQ;YACR,OAAO;SACR,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,qBAAY,CAAC,IAAI,CAAC,IAAI,KAAK,qBAAqB,CAAC;QACpE,IAAI,UAAU,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,8BAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC9D;IACH,CAAC;CACF;AAlDD,sCAkDC"}
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
"affectsGlobalScope": false
|
|
163
163
|
},
|
|
164
164
|
"../config/config.d.ts": {
|
|
165
|
-
"version": "
|
|
166
|
-
"signature": "
|
|
165
|
+
"version": "a11b8b28e405cdf8818fc053f80ca0d46ae55cfecd39d6dfb0ac89f4b7965ade",
|
|
166
|
+
"signature": "a11b8b28e405cdf8818fc053f80ca0d46ae55cfecd39d6dfb0ac89f4b7965ade",
|
|
167
167
|
"affectsGlobalScope": false
|
|
168
168
|
},
|
|
169
169
|
"../node_modules/reflect-metadata/index.d.ts": {
|
|
@@ -1966,6 +1966,11 @@
|
|
|
1966
1966
|
"signature": "d0e844f8d00a27b4afd839f57ddabff3f457f8ed98e670c3f17cf61407576906",
|
|
1967
1967
|
"affectsGlobalScope": false
|
|
1968
1968
|
},
|
|
1969
|
+
"../src/mail.d.ts": {
|
|
1970
|
+
"version": "5f3399155258696fcde2116d01c07bf803f4c6c7d9de3708aa35d80995ce7d19",
|
|
1971
|
+
"signature": "5f3399155258696fcde2116d01c07bf803f4c6c7d9de3708aa35d80995ce7d19",
|
|
1972
|
+
"affectsGlobalScope": false
|
|
1973
|
+
},
|
|
1969
1974
|
"../node_modules/rxjs/internal/operators/audit.d.ts": {
|
|
1970
1975
|
"version": "fe936a68d281ccc2060f8c3de69a0682a807c8fd1b8abccc0a91b83195ca0f94",
|
|
1971
1976
|
"signature": "fe936a68d281ccc2060f8c3de69a0682a807c8fd1b8abccc0a91b83195ca0f94",
|
|
@@ -2487,28 +2492,23 @@
|
|
|
2487
2492
|
"affectsGlobalScope": false
|
|
2488
2493
|
},
|
|
2489
2494
|
"../src/connect/retry.ts": {
|
|
2490
|
-
"version": "
|
|
2495
|
+
"version": "42b8e65e9e160a7e9bb0c559205007efdff041c9501ef6d8114edb557e0db5ad",
|
|
2491
2496
|
"signature": "f70a6637f85c35150334dd3eab81fd249c48e434ec73281b27ee651200814ffc",
|
|
2492
2497
|
"affectsGlobalScope": false
|
|
2493
2498
|
},
|
|
2494
|
-
"../src/mail.d.ts": {
|
|
2495
|
-
"version": "5f3399155258696fcde2116d01c07bf803f4c6c7d9de3708aa35d80995ce7d19",
|
|
2496
|
-
"signature": "5f3399155258696fcde2116d01c07bf803f4c6c7d9de3708aa35d80995ce7d19",
|
|
2497
|
-
"affectsGlobalScope": false
|
|
2498
|
-
},
|
|
2499
2499
|
"../src/connect/app.service.ts": {
|
|
2500
|
-
"version": "
|
|
2500
|
+
"version": "432256fad9934c875d9951fb289aca55f7af9c229ac4d95007644da6c009377d",
|
|
2501
2501
|
"signature": "3a2a5a3ae4859ce6e5b358b7e3fd8924a91d3337e94c00a92f247883c7ad3823",
|
|
2502
2502
|
"affectsGlobalScope": false
|
|
2503
2503
|
},
|
|
2504
2504
|
"../src/connect/app.module.ts": {
|
|
2505
|
-
"version": "
|
|
2505
|
+
"version": "e54f2fd0be8dcdc83252ba372c97c8eef27cfc3eb5ec6f50426075f958d2dbec",
|
|
2506
2506
|
"signature": "447b753b3e76578ef29631d0bcca78bac6ce0b377c4ca60923c08c835f09e01e",
|
|
2507
2507
|
"affectsGlobalScope": false
|
|
2508
2508
|
},
|
|
2509
2509
|
"../src/index.ts": {
|
|
2510
|
-
"version": "
|
|
2511
|
-
"signature": "
|
|
2510
|
+
"version": "e1b28ebbced0520af911163e9cebd9d17ec40a08b08299ee49190f9cf2f43d9a",
|
|
2511
|
+
"signature": "9ea9eb6ec27a350c86cadf8abac728ddb46d6fd294c9f50fb917ed6e152381d0",
|
|
2512
2512
|
"affectsGlobalScope": false
|
|
2513
2513
|
},
|
|
2514
2514
|
"../node_modules/@sentry/types/dist/severity.d.ts": {
|
|
@@ -2947,13 +2947,13 @@
|
|
|
2947
2947
|
"affectsGlobalScope": true
|
|
2948
2948
|
},
|
|
2949
2949
|
"../src/service/sender.service.ts": {
|
|
2950
|
-
"version": "
|
|
2950
|
+
"version": "8c1f696259807a8d38e5b9c065873161564d438b1c3b4a56ebf01976e9000fc6",
|
|
2951
2951
|
"signature": "5e96a95ffb4d84a38bd2e97153d2e1f92eb116d00d9e52791b51a5b09933e527",
|
|
2952
2952
|
"affectsGlobalScope": false
|
|
2953
2953
|
},
|
|
2954
2954
|
"../src/service/app.controller.ts": {
|
|
2955
|
-
"version": "
|
|
2956
|
-
"signature": "
|
|
2955
|
+
"version": "0d1518d10f6c44c45ad4645475c8ef37455674fed03902af74961a72f15494d1",
|
|
2956
|
+
"signature": "aea0ee31c1f217cc949e3d2a97ba74a9117869048f9f703c18742696ed4d2eec",
|
|
2957
2957
|
"affectsGlobalScope": false
|
|
2958
2958
|
},
|
|
2959
2959
|
"../src/service/app.module.ts": {
|
|
@@ -3136,6 +3136,11 @@
|
|
|
3136
3136
|
"signature": "96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538",
|
|
3137
3137
|
"affectsGlobalScope": false
|
|
3138
3138
|
},
|
|
3139
|
+
"../node_modules/@types/minimatch/index.d.ts": {
|
|
3140
|
+
"version": "8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649",
|
|
3141
|
+
"signature": "8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649",
|
|
3142
|
+
"affectsGlobalScope": false
|
|
3143
|
+
},
|
|
3139
3144
|
"../node_modules/@types/normalize-package-data/index.d.ts": {
|
|
3140
3145
|
"version": "c9ad058b2cc9ce6dc2ed92960d6d009e8c04bef46d3f5312283debca6869f613",
|
|
3141
3146
|
"signature": "c9ad058b2cc9ce6dc2ed92960d6d009e8c04bef46d3f5312283debca6869f613",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixelplex/mail-service",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "Mail service",
|
|
5
5
|
"author": "dev@pixelplex.io",
|
|
6
6
|
"private": false,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"prebuild": "rimraf dist",
|
|
11
11
|
"build": "nest build",
|
|
12
|
-
"format": "prettier --write \"src/**/*.ts\"
|
|
12
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
13
13
|
"start": "nest start",
|
|
14
14
|
"start:dev": "nest start --watch",
|
|
15
15
|
"start:debug": "nest start --debug --watch",
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"test:watch": "jest --watch",
|
|
20
20
|
"test:cov": "jest --coverage",
|
|
21
21
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
22
|
-
"test:e2e": "jest --config ./test/jest-e2e.json"
|
|
22
|
+
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
23
|
+
"audit": "audit-ci --config audit-ci.json",
|
|
24
|
+
"prepare": "husky install"
|
|
23
25
|
},
|
|
24
26
|
"dependencies": {
|
|
25
27
|
"@nestjs/common": "^7.5.1",
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
"config": "^3.3.2",
|
|
33
35
|
"express-handlebars": "^5.2.0",
|
|
34
36
|
"handlebars": "^4.7.6",
|
|
35
|
-
"nodemailer": "^6.
|
|
37
|
+
"nodemailer": "^6.7.2",
|
|
36
38
|
"nodemailer-express-handlebars": "^4.0.0",
|
|
37
39
|
"reflect-metadata": "^0.1.13",
|
|
38
40
|
"rimraf": "^3.0.2",
|
|
@@ -46,14 +48,19 @@
|
|
|
46
48
|
"@types/jest": "^26.0.15",
|
|
47
49
|
"@types/node": "^14.14.6",
|
|
48
50
|
"@types/supertest": "^2.0.10",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
50
|
-
"@typescript-eslint/
|
|
51
|
-
"eslint": "^
|
|
52
|
-
"
|
|
53
|
-
"eslint
|
|
54
|
-
"
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
|
52
|
+
"@typescript-eslint/eslint-plugin-tslint": "^5.3.0",
|
|
53
|
+
"@typescript-eslint/parser": "^5.3.0",
|
|
54
|
+
"audit-ci": "^5.1.2",
|
|
55
|
+
"eslint": "^8.2.0",
|
|
56
|
+
"eslint-config-prettier": "^8.3.0",
|
|
57
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
|
58
|
+
"eslint-plugin-import": "^2.25.2",
|
|
59
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
60
|
+
"husky": "^7.0.2",
|
|
55
61
|
"jest": "^26.6.3",
|
|
56
|
-
"prettier": "^2.1
|
|
62
|
+
"prettier": "^2.5.1",
|
|
63
|
+
"pretty-quick": "^3.1.3",
|
|
57
64
|
"supertest": "^6.0.0",
|
|
58
65
|
"ts-jest": "^26.4.3",
|
|
59
66
|
"ts-loader": "^8.0.8",
|
|
@@ -77,10 +84,5 @@
|
|
|
77
84
|
],
|
|
78
85
|
"coverageDirectory": "../coverage",
|
|
79
86
|
"testEnvironment": "node"
|
|
80
|
-
},
|
|
81
|
-
"husky": {
|
|
82
|
-
"hooks": {
|
|
83
|
-
"pre-commit": "yarn lint"
|
|
84
|
-
}
|
|
85
87
|
}
|
|
86
88
|
}
|