@adaptivestone/framework 3.0.15 → 3.0.18

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.18
2
+
3
+ [UPDATE] update deps
4
+ [UPDATE] change default branch to 'main'
5
+
6
+ ### 3.0.17
7
+
8
+ [UPDATE] update deps
9
+
10
+ ### 3.0.16
11
+
12
+ [UPDATE] update deps
13
+ [FIX] fix bug with route level middleware
14
+
1
15
  ### 3.0.15
2
16
 
3
17
  [UPDATE] update deps
@@ -6,8 +6,7 @@ class Documentation extends AbstractCommand {
6
6
  const CM = new ControllerManager(this.app);
7
7
  this.app.documentation = [];
8
8
  await CM.initControllers({ folders: this.app.foldersConfig });
9
- console.log(JSON.stringify(this.app.documentation));
10
- return JSON.stringify(this.app.documentation);
9
+ return this.app.documentation;
11
10
  }
12
11
  }
13
12
 
@@ -136,7 +136,8 @@ class AbstractController extends Base {
136
136
  }
137
137
  for (const path in routes[verb]) {
138
138
  const routeAdditionalMiddlewares = routeMiddlewaresReg.filter(
139
- (middleware) => middleware.path === path,
139
+ (middleware) =>
140
+ middleware.path === path && middleware.method === verb,
140
141
  );
141
142
  let routeObject = routes[verb][path];
142
143
  routeObjectClone = merge({}, routeObject);
@@ -171,6 +172,7 @@ class AbstractController extends Base {
171
172
 
172
173
  routesInfo.push({
173
174
  name: fnName,
175
+ description: routeObject?.description,
174
176
  method: verb.toUpperCase(),
175
177
  path,
176
178
  fullPath,
@@ -333,6 +335,7 @@ class AbstractController extends Base {
333
335
  [route.fullPath]: {
334
336
  method: route.method,
335
337
  name: route.name,
338
+ description: route?.description,
336
339
  fields,
337
340
  routeMiddlewares: routeMiddlewaresReg
338
341
  // eslint-disable-next-line consistent-return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptivestone/framework",
3
- "version": "3.0.15",
3
+ "version": "3.0.18",
4
4
  "description": "Adaptive stone node js framework",
5
5
  "main": "src/index.js",
6
6
  "engines": {
@@ -32,7 +32,7 @@
32
32
  "cors": "^2.8.5",
33
33
  "deepmerge": "^4.2.2",
34
34
  "dotenv": "^16.0.0",
35
- "email-templates": "^9.0.0",
35
+ "email-templates": "^10.0.0",
36
36
  "express": "^4.17.1",
37
37
  "i18next": "^21.2.4",
38
38
  "i18next-chained-backend": "^3.0.2",
@@ -57,9 +57,9 @@
57
57
  "eslint-config-prettier": "^8.3.0",
58
58
  "eslint-plugin-import": "^2.23.4",
59
59
  "eslint-plugin-jest": "^26.0.0",
60
- "husky": "^7.0.0",
60
+ "husky": "^8.0.0",
61
61
  "jest": "^28.0.0",
62
- "lint-staged": "^12.0.0",
62
+ "lint-staged": "^13.0.0",
63
63
  "mongodb-memory-server": "^8.0.2",
64
64
  "nodemon": "^2.0.12",
65
65
  "supertest": "^6.1.4"
package/tests/setup.js CHANGED
@@ -15,6 +15,7 @@ beforeAll(async () => {
15
15
  await mongoMemoryServerInstance.waitUntilRunning();
16
16
  process.env.LOGGER_CONSOLE_LEVEL = 'error';
17
17
  const connectionStringMongo = await mongoMemoryServerInstance.getUri();
18
+ console.info('MONGO_URI: ', connectionStringMongo);
18
19
  global.server = new Server({
19
20
  folders: {
20
21
  config: process.env.TEST_FOLDER_CONFIG || path.resolve('./config'),