@adaptivestone/framework 3.0.9 → 3.0.12
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 +15 -0
- package/config/mail.js +1 -1
- package/modules/AbstractController.js +4 -2
- package/package.json +1 -1
- package/services/messaging/email/index.js +3 -1
- package/tests/setup.js +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
### 3.0.12
|
|
2
|
+
|
|
3
|
+
[NEW] ability to pass "mergeParams" options to express
|
|
4
|
+
[UPDATE] update deps
|
|
5
|
+
|
|
6
|
+
### 3.0.11
|
|
7
|
+
|
|
8
|
+
[UPDATE] more verbose email error
|
|
9
|
+
|
|
10
|
+
### 3.0.10
|
|
11
|
+
|
|
12
|
+
[UPDATE] update deps
|
|
13
|
+
[CHANGE] tests afterAll not using timeout anymore (conflict with jest 28-alpha)
|
|
14
|
+
[NEW] config for mail now supports "EMAIL_TRANSPORT" env variable. SMTP by default (as was)
|
|
15
|
+
|
|
1
16
|
### 3.0.9
|
|
2
17
|
|
|
3
18
|
[UPDATE] update deps
|
package/config/mail.js
CHANGED
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
|
17
17
|
connectionTimeout: 10000, // timeout to 10 seconds
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
|
-
transport: 'smtp',
|
|
20
|
+
transport: process.env.EMAIL_TRANSPORT || 'smtp',
|
|
21
21
|
webResources: {
|
|
22
22
|
// https://github.com/jrit/web-resource-inliner path to find resources
|
|
23
23
|
relativeTo: 'build',
|
|
@@ -16,13 +16,15 @@ const Auth = require('../services/http/middleware/Auth');
|
|
|
16
16
|
* In most cases you will want to have a 'home' route that not include controller name. For this case please check 'getExpressPath'
|
|
17
17
|
*/
|
|
18
18
|
class AbstractController extends Base {
|
|
19
|
-
constructor(app, prefix) {
|
|
19
|
+
constructor(app, prefix, isExpressMergeParams = false) {
|
|
20
20
|
const time = Date.now();
|
|
21
21
|
super(app);
|
|
22
22
|
this.prefix = prefix;
|
|
23
23
|
this.router = express.Router();
|
|
24
24
|
const { routes } = this;
|
|
25
|
-
const expressPath = this.getExpressPath(
|
|
25
|
+
const expressPath = this.getExpressPath({
|
|
26
|
+
mergeParams: isExpressMergeParams,
|
|
27
|
+
});
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
* Grab route middleware onlo one Map
|
package/package.json
CHANGED
|
@@ -32,7 +32,9 @@ class Mail extends Base {
|
|
|
32
32
|
this.template = `${__dirname}/templates/${path.basename(template)}`;
|
|
33
33
|
} else {
|
|
34
34
|
this.template = `${__dirname}/templates/emptyTemplate`;
|
|
35
|
-
this.logger.error(
|
|
35
|
+
this.logger.error(
|
|
36
|
+
`Template '${template}' not found. Using 'emptyTemplate' as a fallback`,
|
|
37
|
+
);
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
this.templateData = templateData;
|
package/tests/setup.js
CHANGED
|
@@ -67,11 +67,11 @@ afterAll(async () => {
|
|
|
67
67
|
global.server.app.httpServer.shutdown();
|
|
68
68
|
global.server.app.events.emit('shutdown');
|
|
69
69
|
}
|
|
70
|
-
setTimeout(async () => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, 2000);
|
|
70
|
+
// setTimeout(async () => {
|
|
71
|
+
if (typeof global.testSetup.afterAll === 'function') {
|
|
72
|
+
await global.testSetup.afterAll();
|
|
73
|
+
}
|
|
74
|
+
await mongoose.disconnect();
|
|
75
|
+
await mongoMemoryServerInstance.stop();
|
|
76
|
+
// }, 2000);
|
|
77
77
|
});
|