@adaptivestone/framework 3.0.7 → 3.0.10

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ### 3.0.10
2
+
3
+ [UPDATE] update deps
4
+ [CHANGE] tests afterAll not using timeout anymore (conflict with jest 28-alpha)
5
+ [NEW] config for mail now supports "EMAIL_TRANSPORT" env variable. SMTP by default (as was)
6
+
7
+ ### 3.0.9
8
+
9
+ [UPDATE] update deps
10
+
11
+ ### 3.0.8
12
+
13
+ [UPDATE] update deps
14
+
1
15
  ### 3.0.7
2
16
 
3
17
  [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',
@@ -11,6 +11,14 @@ class AbstractCommand extends Base {
11
11
  return 'Command description';
12
12
  }
13
13
 
14
+ /**
15
+ * Entry point to every command. This method should be overridden
16
+ * @override
17
+ */
18
+ async run() {
19
+ this.logger.error('You should implement run method');
20
+ }
21
+
14
22
  static get loggerGroup() {
15
23
  return 'command';
16
24
  }
@@ -350,6 +350,25 @@ class AbstractController extends Base {
350
350
  }
351
351
  }
352
352
 
353
+ /**
354
+ * Object with routes. Routes relative to controller
355
+ * @example
356
+ * return {
357
+ * post: {
358
+ * "/someUrl": {
359
+ * handler: this.postSomeUrl,
360
+ * request: yup.object().shape({
361
+ * count: yup.number().max(100)required(),
362
+ * })
363
+ * }
364
+ * },
365
+ * };
366
+ */
367
+ get routes() {
368
+ this.logger.warn('Please implement "routes" method on controller.');
369
+ return {};
370
+ }
371
+
353
372
  /**
354
373
  * Array of middlewares to append for route
355
374
  * You should provide path relative to controller and then array of middlewares to apply.
@@ -40,6 +40,14 @@ class AbstractModel extends Base {
40
40
  }
41
41
  }
42
42
 
43
+ /**
44
+ * Mongoose schema
45
+ */
46
+ get modelSchema() {
47
+ this.logger.warn('You should provide modelSchema');
48
+ return {};
49
+ }
50
+
43
51
  static get loggerGroup() {
44
52
  return 'model';
45
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptivestone/framework",
3
- "version": "3.0.7",
3
+ "version": "3.0.10",
4
4
  "description": "Adaptive stone node js framework",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "cors": "^2.8.5",
30
30
  "deepmerge": "^4.2.2",
31
31
  "dotenv": "^16.0.0",
32
- "email-templates": "^8.0.7",
32
+ "email-templates": "^9.0.0",
33
33
  "express": "^4.17.1",
34
34
  "i18next": "^21.2.4",
35
35
  "i18next-chained-backend": "^3.0.2",
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
- if (typeof global.testSetup.afterAll === 'function') {
72
- await global.testSetup.afterAll();
73
- }
74
- await mongoose.disconnect();
75
- await mongoMemoryServerInstance.stop();
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
  });