@tomei/mailer 0.4.0 → 0.5.0
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/__tests__/unit/mailer/mailer.spec.ts +182 -43
- package/dist/__tests__/nodemailer.d.ts +1 -0
- package/dist/__tests__/nodemailer.js +6 -0
- package/dist/__tests__/nodemailer.js.map +1 -0
- package/dist/__tests__/unit/mailer/mailer.spec.js +162 -45
- package/dist/__tests__/unit/mailer/mailer.spec.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/src/enum/email-status.enum.d.ts +4 -0
- package/dist/src/enum/email-status.enum.js +9 -0
- package/dist/src/enum/email-status.enum.js.map +1 -0
- package/dist/src/enum/index.d.ts +1 -0
- package/dist/src/enum/index.js +6 -0
- package/dist/src/enum/index.js.map +1 -0
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +17 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces/index.d.ts +3 -2
- package/dist/src/{mailer/dto/logOptions.d.ts → interfaces/log-transaction-options.interface.d.ts} +2 -2
- package/dist/src/interfaces/log-transaction-options.interface.js +3 -0
- package/dist/src/interfaces/log-transaction-options.interface.js.map +1 -0
- package/dist/src/interfaces/mail-config.interface.d.ts +8 -0
- package/dist/{interfaces/mail-configuration.interface.js → src/interfaces/mail-config.interface.js} +1 -1
- package/dist/src/interfaces/mail-config.interface.js.map +1 -0
- package/dist/src/interfaces/mail-log.interface.d.ts +11 -0
- package/dist/src/{mailer/dto/logOptions.js → interfaces/mail-log.interface.js} +1 -1
- package/dist/src/interfaces/mail-log.interface.js.map +1 -0
- package/dist/src/mailer/index.d.ts +2 -1
- package/dist/src/mailer/index.js +5 -15
- package/dist/src/mailer/index.js.map +1 -1
- package/dist/src/mailer/mailer.base.d.ts +9 -0
- package/dist/src/mailer/mailer.base.js +109 -0
- package/dist/src/mailer/mailer.base.js.map +1 -0
- package/dist/src/mailer/mailer.d.ts +0 -3
- package/dist/src/mailer/mailer.js +0 -32
- package/dist/src/mailer/mailer.js.map +1 -1
- package/dist/src/mailer/smtp-mailer.d.ts +7 -0
- package/dist/src/mailer/smtp-mailer.js +53 -0
- package/dist/src/mailer/smtp-mailer.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/index.ts +1 -0
- package/package.json +43 -42
- package/src/enum/email-status.enum.ts +4 -0
- package/src/enum/index.ts +1 -0
- package/src/index.ts +3 -4
- package/src/interfaces/index.ts +4 -2
- package/src/{mailer/dto/logOptions.ts → interfaces/log-transaction-options.interface.ts} +2 -2
- package/src/interfaces/mail-config.interface.ts +9 -0
- package/src/interfaces/mail-log.interface.ts +12 -0
- package/src/mailer/index.ts +2 -1
- package/src/mailer/mailer.base.ts +106 -0
- package/src/mailer/smtp-mailer.ts +59 -0
- package/dist/interfaces/index.d.ts +0 -1
- package/dist/interfaces/index.js +0 -18
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/mail-configuration.interface.d.ts +0 -9
- package/dist/interfaces/mail-configuration.interface.js.map +0 -1
- package/dist/mailer/index.d.ts +0 -1
- package/dist/mailer/index.js +0 -18
- package/dist/mailer/index.js.map +0 -1
- package/dist/mailer/mailer.d.ts +0 -8
- package/dist/mailer/mailer.js +0 -55
- package/dist/mailer/mailer.js.map +0 -1
- package/dist/src/mailer/dto/logOptions.js.map +0 -1
- package/src/interfaces/mail-configuration.interface.ts +0 -9
- package/src/mailer/mailer.ts +0 -105
|
@@ -1,52 +1,167 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { EmailStatus, MailerBase, SMTPMailer } from '../../../src';
|
|
2
|
+
import { ComponentConfig } from '@tomei/config';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { nodemailer } from '../../../src/mailer/smtp-mailer'
|
|
2
6
|
|
|
3
7
|
describe('Mailer', () => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
const mailer = new SMTPMailer();
|
|
9
|
+
const from = 'test@test.com';
|
|
10
|
+
const to = 'recipients@mail.com';
|
|
11
|
+
const subject = 'Test Subject';
|
|
12
|
+
const html = 'Test Message';
|
|
13
|
+
const expectedResult = {
|
|
14
|
+
from,
|
|
15
|
+
cc: '',
|
|
16
|
+
to: 'recipients@mail.com',
|
|
17
|
+
subject: 'test email',
|
|
18
|
+
html: '<div>{"systemCode":"SSO","apiUrl":"user/hello","transactionName":"add user","dbName":"Prod","tableName":"sso_users","dataBefore":"{\\"users\\":[]}","dataAfter":"{\\"users\\":[\\"budi\\",\\"rudi\\",\\"dido\\"]}","performAt":"2023-07-04T00:00:00.000Z","note":"test"}</div>',
|
|
19
|
+
};
|
|
7
20
|
|
|
8
|
-
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
jest.clearAllMocks();
|
|
23
|
+
});
|
|
9
24
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
describe('log', () => {
|
|
26
|
+
const logData = {
|
|
27
|
+
duration: 1000,
|
|
28
|
+
from: from,
|
|
29
|
+
to: 'to@to.com',
|
|
30
|
+
cc: '',
|
|
31
|
+
subject: 'test email',
|
|
32
|
+
rawContent: 'test',
|
|
33
|
+
date: new Date(),
|
|
34
|
+
status: EmailStatus.Sent,
|
|
15
35
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
|
|
37
|
+
it('should create new log folder if none exist', async () => {
|
|
38
|
+
jest.spyOn(fs, 'existsSync').mockReturnValueOnce(false);
|
|
39
|
+
jest.spyOn(fs, 'mkdirSync').mockReturnValueOnce(null);
|
|
40
|
+
jest.spyOn(fs, 'appendFileSync').mockReturnValueOnce(null);
|
|
41
|
+
|
|
42
|
+
MailerBase.log(logData);
|
|
43
|
+
|
|
44
|
+
expect(fs.existsSync).toHaveBeenCalledTimes(1);
|
|
45
|
+
expect(fs.existsSync).toHaveBeenCalledWith(
|
|
46
|
+
path.join(process.cwd(), 'mail-log'),
|
|
47
|
+
);
|
|
48
|
+
expect(fs.mkdirSync).toHaveBeenCalledTimes(1);
|
|
49
|
+
expect(fs.mkdirSync).toHaveBeenCalledWith(
|
|
50
|
+
path.join(process.cwd(), 'mail-log'),
|
|
51
|
+
);
|
|
52
|
+
expect(fs.appendFileSync).toHaveBeenCalledTimes(1);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should create new log file in existing log folder', async () => {
|
|
56
|
+
const existSyncMock = jest
|
|
57
|
+
.spyOn(fs, 'existsSync')
|
|
58
|
+
.mockReturnValueOnce(true);
|
|
59
|
+
jest.spyOn(fs, 'mkdirSync').mockReturnValueOnce(null);
|
|
60
|
+
jest.spyOn(fs, 'appendFileSync').mockReturnValueOnce(null);
|
|
61
|
+
|
|
62
|
+
MailerBase.log(logData);
|
|
63
|
+
|
|
64
|
+
expect(existSyncMock).toHaveBeenCalledTimes(1);
|
|
65
|
+
expect(fs.mkdirSync).toHaveBeenCalledTimes(0);
|
|
24
66
|
});
|
|
25
67
|
});
|
|
26
68
|
|
|
27
|
-
|
|
28
|
-
|
|
69
|
+
describe('send', () => {
|
|
70
|
+
it('should send email successfully and create log transaction', async () => {
|
|
71
|
+
jest
|
|
72
|
+
.spyOn(ComponentConfig, 'getComponentConfigValue')
|
|
73
|
+
.mockImplementationOnce(() => true);
|
|
74
|
+
const sendMailMock = jest
|
|
75
|
+
.spyOn(mailer, 'sendMail')
|
|
76
|
+
.mockResolvedValueOnce();
|
|
77
|
+
const log = jest
|
|
78
|
+
.spyOn(MailerBase, 'log')
|
|
79
|
+
.mockImplementationOnce(() => Promise.resolve());
|
|
80
|
+
|
|
81
|
+
const options = {
|
|
82
|
+
from,
|
|
83
|
+
to,
|
|
84
|
+
subject,
|
|
85
|
+
html,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
await mailer.send({
|
|
89
|
+
from: from,
|
|
90
|
+
to: to,
|
|
91
|
+
subject: subject,
|
|
92
|
+
html: html,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
expect(sendMailMock).toHaveBeenCalledTimes(1);
|
|
96
|
+
expect(sendMailMock).toHaveBeenCalledWith(options);
|
|
97
|
+
expect(log).toHaveBeenCalledTimes(1);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should send email successfully and not create log transaction', async () => {
|
|
101
|
+
jest
|
|
102
|
+
.spyOn(ComponentConfig, 'getComponentConfigValue')
|
|
103
|
+
.mockImplementationOnce(() => false);
|
|
104
|
+
const sendMailMock = jest
|
|
105
|
+
.spyOn(mailer, 'sendMail')
|
|
106
|
+
.mockResolvedValueOnce();
|
|
107
|
+
const log = jest
|
|
108
|
+
.spyOn(MailerBase, 'log')
|
|
109
|
+
.mockImplementationOnce(() => Promise.resolve());
|
|
110
|
+
|
|
111
|
+
const options = {
|
|
112
|
+
from,
|
|
113
|
+
to,
|
|
114
|
+
subject,
|
|
115
|
+
html,
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
await mailer.send({
|
|
119
|
+
from: from,
|
|
120
|
+
to: to,
|
|
121
|
+
subject: subject,
|
|
122
|
+
html: html,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
expect(sendMailMock).toHaveBeenCalledTimes(1);
|
|
126
|
+
expect(sendMailMock).toHaveBeenCalledWith(options);
|
|
127
|
+
expect(log).toHaveBeenCalledTimes(0);
|
|
128
|
+
});
|
|
29
129
|
});
|
|
30
130
|
|
|
31
|
-
|
|
32
|
-
const to = 'recipients@mail.com';
|
|
33
|
-
const subject = 'Test Subject';
|
|
34
|
-
const html = 'Test Message';
|
|
131
|
+
describe('sendMail', () => {
|
|
35
132
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
133
|
+
it('should send email successfully', async () => {
|
|
134
|
+
const sendMailMock = jest.fn()
|
|
135
|
+
|
|
136
|
+
jest.spyOn(nodemailer, 'createTransport').mockReturnValueOnce({
|
|
137
|
+
sendMail: sendMailMock
|
|
138
|
+
} as any)
|
|
139
|
+
|
|
140
|
+
jest
|
|
141
|
+
.spyOn(ComponentConfig, 'getComponentConfigValue')
|
|
142
|
+
.mockImplementation((componentName, configKey) => {
|
|
143
|
+
if (componentName !== '@tomei/mailer') {
|
|
144
|
+
throw new Error('Invalid component name');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (configKey == 'port') {
|
|
148
|
+
return 587;
|
|
149
|
+
} else if (configKey == 'secure') {
|
|
150
|
+
return true;
|
|
151
|
+
} else {
|
|
152
|
+
return 'smtp.gmail.com';
|
|
153
|
+
}
|
|
154
|
+
});
|
|
42
155
|
|
|
43
|
-
|
|
156
|
+
await mailer.sendMail(expectedResult);
|
|
44
157
|
|
|
45
|
-
|
|
46
|
-
|
|
158
|
+
expect(sendMailMock).toHaveBeenCalledTimes(1);
|
|
159
|
+
expect(sendMailMock).toHaveBeenCalledWith(expectedResult);
|
|
160
|
+
});
|
|
47
161
|
});
|
|
48
162
|
|
|
49
|
-
|
|
163
|
+
|
|
164
|
+
describe('logTransaction', () => {
|
|
50
165
|
const before = { users: [] };
|
|
51
166
|
const after = { users: ['budi', 'rudi', 'dido'] };
|
|
52
167
|
|
|
@@ -69,16 +184,40 @@ describe('Mailer', () => {
|
|
|
69
184
|
},
|
|
70
185
|
};
|
|
71
186
|
|
|
72
|
-
|
|
187
|
+
it('should send transactionLog successfully', async () => {
|
|
188
|
+
const sendMailMock = jest
|
|
189
|
+
.spyOn(mailer, 'sendMail')
|
|
190
|
+
.mockResolvedValueOnce();
|
|
191
|
+
const log = jest
|
|
192
|
+
.spyOn(MailerBase, 'log')
|
|
193
|
+
.mockImplementationOnce(() => Promise.resolve());
|
|
73
194
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
195
|
+
await mailer.logTransaction(options);
|
|
196
|
+
|
|
197
|
+
const expectedResult = {
|
|
198
|
+
from,
|
|
199
|
+
cc: '',
|
|
200
|
+
to: 'recipients@mail.com',
|
|
201
|
+
subject: 'test email',
|
|
202
|
+
html: '<div>{"systemCode":"SSO","apiUrl":"user/hello","transactionName":"add user","dbName":"Prod","tableName":"sso_users","dataBefore":"{\\"users\\":[]}","dataAfter":"{\\"users\\":[\\"budi\\",\\"rudi\\",\\"dido\\"]}","performAt":"2023-07-04T00:00:00.000Z","note":"test"}</div>',
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
expect(sendMailMock).toHaveBeenCalledTimes(1);
|
|
206
|
+
expect(sendMailMock).toHaveBeenCalledWith(expectedResult);
|
|
207
|
+
expect(log).toBeCalledTimes(1);
|
|
208
|
+
});
|
|
80
209
|
|
|
81
|
-
|
|
82
|
-
|
|
210
|
+
it('should retry send when the first one failed', async () => {
|
|
211
|
+
const sendMailMock = jest
|
|
212
|
+
.spyOn(mailer, 'sendMail')
|
|
213
|
+
.mockRejectedValue(new Error('error'));
|
|
214
|
+
const log = jest
|
|
215
|
+
.spyOn(MailerBase, 'log')
|
|
216
|
+
.mockImplementationOnce(() => Promise.resolve());
|
|
217
|
+
|
|
218
|
+
await mailer.logTransaction(options);
|
|
219
|
+
expect(sendMailMock).toHaveBeenCalledTimes(2);
|
|
220
|
+
expect(log).toBeCalledTimes(1);
|
|
221
|
+
});
|
|
83
222
|
});
|
|
84
223
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const nodemailer = require("nodemailer");
|
|
4
|
+
const nodemailermock = require('nodemailer-mock').getMockFor(nodemailer);
|
|
5
|
+
module.exports = nodemailermock;
|
|
6
|
+
//# sourceMappingURL=nodemailer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodemailer.js","sourceRoot":"","sources":["../../__tests__/nodemailer.ts"],"names":[],"mappings":";;AAAA,yCAAyC;AACzC,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAEzE,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC"}
|
|
@@ -9,46 +9,142 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
12
|
+
const src_1 = require("../../../src");
|
|
13
|
+
const config_1 = require("@tomei/config");
|
|
14
|
+
const fs = require("fs");
|
|
15
|
+
const path = require("path");
|
|
16
|
+
const smtp_mailer_1 = require("../../../src/mailer/smtp-mailer");
|
|
13
17
|
describe('Mailer', () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
port: Number(process.env.SMTP_PORT),
|
|
27
|
-
secure: Number(process.env.SMTP_PORT) === 465,
|
|
28
|
-
auth: {
|
|
29
|
-
user: process.env.EMAIL_SENDER,
|
|
30
|
-
pass: process.env.EMAIL_PASSWORD,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
});
|
|
18
|
+
const mailer = new src_1.SMTPMailer();
|
|
19
|
+
const from = 'test@test.com';
|
|
20
|
+
const to = 'recipients@mail.com';
|
|
21
|
+
const subject = 'Test Subject';
|
|
22
|
+
const html = 'Test Message';
|
|
23
|
+
const expectedResult = {
|
|
24
|
+
from,
|
|
25
|
+
cc: '',
|
|
26
|
+
to: 'recipients@mail.com',
|
|
27
|
+
subject: 'test email',
|
|
28
|
+
html: '<div>{"systemCode":"SSO","apiUrl":"user/hello","transactionName":"add user","dbName":"Prod","tableName":"sso_users","dataBefore":"{\\"users\\":[]}","dataAfter":"{\\"users\\":[\\"budi\\",\\"rudi\\",\\"dido\\"]}","performAt":"2023-07-04T00:00:00.000Z","note":"test"}</div>',
|
|
29
|
+
};
|
|
34
30
|
afterEach(() => {
|
|
35
31
|
jest.clearAllMocks();
|
|
36
32
|
});
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
describe('log', () => {
|
|
34
|
+
const logData = {
|
|
35
|
+
duration: 1000,
|
|
36
|
+
from: from,
|
|
37
|
+
to: 'to@to.com',
|
|
38
|
+
cc: '',
|
|
39
|
+
subject: 'test email',
|
|
40
|
+
rawContent: 'test',
|
|
41
|
+
date: new Date(),
|
|
42
|
+
status: src_1.EmailStatus.Sent,
|
|
46
43
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
it('should create new log folder if none exist', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
jest.spyOn(fs, 'existsSync').mockReturnValueOnce(false);
|
|
46
|
+
jest.spyOn(fs, 'mkdirSync').mockReturnValueOnce(null);
|
|
47
|
+
jest.spyOn(fs, 'appendFileSync').mockReturnValueOnce(null);
|
|
48
|
+
src_1.MailerBase.log(logData);
|
|
49
|
+
expect(fs.existsSync).toHaveBeenCalledTimes(1);
|
|
50
|
+
expect(fs.existsSync).toHaveBeenCalledWith(path.join(process.cwd(), 'mail-log'));
|
|
51
|
+
expect(fs.mkdirSync).toHaveBeenCalledTimes(1);
|
|
52
|
+
expect(fs.mkdirSync).toHaveBeenCalledWith(path.join(process.cwd(), 'mail-log'));
|
|
53
|
+
expect(fs.appendFileSync).toHaveBeenCalledTimes(1);
|
|
54
|
+
}));
|
|
55
|
+
it('should create new log file in existing log folder', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
const existSyncMock = jest
|
|
57
|
+
.spyOn(fs, 'existsSync')
|
|
58
|
+
.mockReturnValueOnce(true);
|
|
59
|
+
jest.spyOn(fs, 'mkdirSync').mockReturnValueOnce(null);
|
|
60
|
+
jest.spyOn(fs, 'appendFileSync').mockReturnValueOnce(null);
|
|
61
|
+
src_1.MailerBase.log(logData);
|
|
62
|
+
expect(existSyncMock).toHaveBeenCalledTimes(1);
|
|
63
|
+
expect(fs.mkdirSync).toHaveBeenCalledTimes(0);
|
|
64
|
+
}));
|
|
65
|
+
});
|
|
66
|
+
describe('send', () => {
|
|
67
|
+
it('should send email successfully and create log transaction', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
+
jest
|
|
69
|
+
.spyOn(config_1.ComponentConfig, 'getComponentConfigValue')
|
|
70
|
+
.mockImplementationOnce(() => true);
|
|
71
|
+
const sendMailMock = jest
|
|
72
|
+
.spyOn(mailer, 'sendMail')
|
|
73
|
+
.mockResolvedValueOnce();
|
|
74
|
+
const log = jest
|
|
75
|
+
.spyOn(src_1.MailerBase, 'log')
|
|
76
|
+
.mockImplementationOnce(() => Promise.resolve());
|
|
77
|
+
const options = {
|
|
78
|
+
from,
|
|
79
|
+
to,
|
|
80
|
+
subject,
|
|
81
|
+
html,
|
|
82
|
+
};
|
|
83
|
+
yield mailer.send({
|
|
84
|
+
from: from,
|
|
85
|
+
to: to,
|
|
86
|
+
subject: subject,
|
|
87
|
+
html: html,
|
|
88
|
+
});
|
|
89
|
+
expect(sendMailMock).toHaveBeenCalledTimes(1);
|
|
90
|
+
expect(sendMailMock).toHaveBeenCalledWith(options);
|
|
91
|
+
expect(log).toHaveBeenCalledTimes(1);
|
|
92
|
+
}));
|
|
93
|
+
it('should send email successfully and not create log transaction', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
+
jest
|
|
95
|
+
.spyOn(config_1.ComponentConfig, 'getComponentConfigValue')
|
|
96
|
+
.mockImplementationOnce(() => false);
|
|
97
|
+
const sendMailMock = jest
|
|
98
|
+
.spyOn(mailer, 'sendMail')
|
|
99
|
+
.mockResolvedValueOnce();
|
|
100
|
+
const log = jest
|
|
101
|
+
.spyOn(src_1.MailerBase, 'log')
|
|
102
|
+
.mockImplementationOnce(() => Promise.resolve());
|
|
103
|
+
const options = {
|
|
104
|
+
from,
|
|
105
|
+
to,
|
|
106
|
+
subject,
|
|
107
|
+
html,
|
|
108
|
+
};
|
|
109
|
+
yield mailer.send({
|
|
110
|
+
from: from,
|
|
111
|
+
to: to,
|
|
112
|
+
subject: subject,
|
|
113
|
+
html: html,
|
|
114
|
+
});
|
|
115
|
+
expect(sendMailMock).toHaveBeenCalledTimes(1);
|
|
116
|
+
expect(sendMailMock).toHaveBeenCalledWith(options);
|
|
117
|
+
expect(log).toHaveBeenCalledTimes(0);
|
|
118
|
+
}));
|
|
119
|
+
});
|
|
120
|
+
describe('sendMail', () => {
|
|
121
|
+
it('should send email successfully', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
+
const sendMailMock = jest.fn();
|
|
123
|
+
jest.spyOn(smtp_mailer_1.nodemailer, 'createTransport').mockReturnValueOnce({
|
|
124
|
+
sendMail: sendMailMock
|
|
125
|
+
});
|
|
126
|
+
jest
|
|
127
|
+
.spyOn(config_1.ComponentConfig, 'getComponentConfigValue')
|
|
128
|
+
.mockImplementation((componentName, configKey) => {
|
|
129
|
+
if (componentName !== '@tomei/mailer') {
|
|
130
|
+
throw new Error('Invalid component name');
|
|
131
|
+
}
|
|
132
|
+
if (configKey == 'port') {
|
|
133
|
+
return 587;
|
|
134
|
+
}
|
|
135
|
+
else if (configKey == 'secure') {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return 'smtp.gmail.com';
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
yield mailer.sendMail(expectedResult);
|
|
143
|
+
expect(sendMailMock).toHaveBeenCalledTimes(1);
|
|
144
|
+
expect(sendMailMock).toHaveBeenCalledWith(expectedResult);
|
|
145
|
+
}));
|
|
146
|
+
});
|
|
147
|
+
describe('logTransaction', () => {
|
|
52
148
|
const before = { users: [] };
|
|
53
149
|
const after = { users: ['budi', 'rudi', 'dido'] };
|
|
54
150
|
const options = {
|
|
@@ -69,15 +165,36 @@ describe('Mailer', () => {
|
|
|
69
165
|
note: 'test',
|
|
70
166
|
},
|
|
71
167
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
168
|
+
it('should send transactionLog successfully', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
169
|
+
const sendMailMock = jest
|
|
170
|
+
.spyOn(mailer, 'sendMail')
|
|
171
|
+
.mockResolvedValueOnce();
|
|
172
|
+
const log = jest
|
|
173
|
+
.spyOn(src_1.MailerBase, 'log')
|
|
174
|
+
.mockImplementationOnce(() => Promise.resolve());
|
|
175
|
+
yield mailer.logTransaction(options);
|
|
176
|
+
const expectedResult = {
|
|
177
|
+
from,
|
|
178
|
+
cc: '',
|
|
179
|
+
to: 'recipients@mail.com',
|
|
180
|
+
subject: 'test email',
|
|
181
|
+
html: '<div>{"systemCode":"SSO","apiUrl":"user/hello","transactionName":"add user","dbName":"Prod","tableName":"sso_users","dataBefore":"{\\"users\\":[]}","dataAfter":"{\\"users\\":[\\"budi\\",\\"rudi\\",\\"dido\\"]}","performAt":"2023-07-04T00:00:00.000Z","note":"test"}</div>',
|
|
182
|
+
};
|
|
183
|
+
expect(sendMailMock).toHaveBeenCalledTimes(1);
|
|
184
|
+
expect(sendMailMock).toHaveBeenCalledWith(expectedResult);
|
|
185
|
+
expect(log).toBeCalledTimes(1);
|
|
186
|
+
}));
|
|
187
|
+
it('should retry send when the first one failed', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
188
|
+
const sendMailMock = jest
|
|
189
|
+
.spyOn(mailer, 'sendMail')
|
|
190
|
+
.mockRejectedValue(new Error('error'));
|
|
191
|
+
const log = jest
|
|
192
|
+
.spyOn(src_1.MailerBase, 'log')
|
|
193
|
+
.mockImplementationOnce(() => Promise.resolve());
|
|
194
|
+
yield mailer.logTransaction(options);
|
|
195
|
+
expect(sendMailMock).toHaveBeenCalledTimes(2);
|
|
196
|
+
expect(log).toBeCalledTimes(1);
|
|
197
|
+
}));
|
|
198
|
+
});
|
|
82
199
|
});
|
|
83
200
|
//# sourceMappingURL=mailer.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailer.spec.js","sourceRoot":"","sources":["../../../../__tests__/unit/mailer/mailer.spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"mailer.spec.js","sourceRoot":"","sources":["../../../../__tests__/unit/mailer/mailer.spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAmE;AACnE,0CAAgD;AAChD,yBAAyB;AACzB,6BAA6B;AAC7B,iEAA4D;AAE5D,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,MAAM,MAAM,GAAG,IAAI,gBAAU,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,eAAe,CAAC;IAC7B,MAAM,EAAE,GAAG,qBAAqB,CAAC;IACjC,MAAM,OAAO,GAAG,cAAc,CAAC;IAC/B,MAAM,IAAI,GAAG,cAAc,CAAC;IAC5B,MAAM,cAAc,GAAG;QACrB,IAAI;QACJ,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,qBAAqB;QACzB,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,gRAAgR;KACvR,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG;YACd,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,IAAI;YACV,EAAE,EAAE,WAAW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AAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YAEnD,MAAM,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YACrC,MAAM,CAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC9C,MAAM,CAAC,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,8 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Mailer = void 0;
|
|
18
|
-
const mailer_1 = require("./src/mailer/mailer");
|
|
19
|
-
exports.Mailer = mailer_1.default;
|
|
20
17
|
__exportStar(require("./src"), exports);
|
|
21
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailStatus = void 0;
|
|
4
|
+
var EmailStatus;
|
|
5
|
+
(function (EmailStatus) {
|
|
6
|
+
EmailStatus["Sent"] = "Sent";
|
|
7
|
+
EmailStatus["Failed"] = "Failed";
|
|
8
|
+
})(EmailStatus || (exports.EmailStatus = EmailStatus = {}));
|
|
9
|
+
//# sourceMappingURL=email-status.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-status.enum.js","sourceRoot":"","sources":["../../../src/enum/email-status.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EmailStatus } from './email-status.enum';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailStatus = void 0;
|
|
4
|
+
var email_status_enum_1 = require("./email-status.enum");
|
|
5
|
+
Object.defineProperty(exports, "EmailStatus", { enumerable: true, get: function () { return email_status_enum_1.EmailStatus; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":";;;AAAA,yDAAkD;AAAzC,gHAAA,WAAW,OAAA"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export *
|
|
1
|
+
export * from './enum';
|
|
2
|
+
export * from './mailer';
|
|
3
|
+
export * from './interfaces';
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports
|
|
6
|
-
exports.MailerInterfaces = require("./interfaces");
|
|
17
|
+
__exportStar(require("./enum"), exports);
|
|
18
|
+
__exportStar(require("./mailer"), exports);
|
|
19
|
+
__exportStar(require("./interfaces"), exports);
|
|
7
20
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
export { ILogTransactionOption } from './log-transaction-options.interface';
|
|
2
|
+
export { IMailLog } from './mail-log.interface';
|
|
3
|
+
export { ISendMailConfig } from './mail-config.interface';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-transaction-options.interface.js","sourceRoot":"","sources":["../../../src/interfaces/log-transaction-options.interface.ts"],"names":[],"mappings":""}
|