axe-api 0.30.1 → 0.30.3

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,10 +1,22 @@
1
1
  # Release Notes
2
2
 
3
+ ## [0.30.3 (2023-05-05)](https://github.com/axe-api/axe-api/compare/0.30.3...0.30.2)
4
+
5
+ ### Fixed
6
+
7
+ - Fixed security issues on dependencies.
8
+
9
+ ## [0.30.2 (2023-04-18)](https://github.com/axe-api/axe-api/compare/0.30.2...0.30.1)
10
+
11
+ ### Features
12
+
13
+ - Event/Hook type warning added [#163](https://github.com/axe-api/axe-api/issues/163)
14
+
3
15
  ## [0.30.1 (2023-04-15)](https://github.com/axe-api/axe-api/compare/0.30.1...0.30.0)
4
16
 
5
17
  ### Fixed
6
18
 
7
- - Fixed URL slash character difference between windows and *nix [#164](https://github.com/axe-api/axe-api/issues/164)
19
+ - Fixed URL slash character difference between windows and \*nix [#164](https://github.com/axe-api/axe-api/issues/164)
8
20
 
9
21
  ## [0.30.0 (2023-04-05)](https://github.com/axe-api/axe-api/compare/0.30.0...0.22.0)
10
22
 
@@ -88,6 +88,7 @@ class ModelResolver {
88
88
  }
89
89
  setModelHooks(modelList, hookType) {
90
90
  return __awaiter(this, void 0, void 0, function* () {
91
+ const logger = Services_1.LogService.getInstance();
91
92
  // What kind of hooks that we can have
92
93
  const hookList = Object.keys(Enums_1.HookFunctionTypes);
93
94
  const fileResolver = new FileResolver_1.default();
@@ -111,12 +112,15 @@ class ModelResolver {
111
112
  }
112
113
  // Loading all hooks files in the subfolder
113
114
  const hooks = yield fileResolver.resolveContent(subfolderPath);
114
- for (const hookName of hookList) {
115
+ for (const hookName in hooks) {
115
116
  // If we have an acceptable hook
116
- if (hooks[hookName]) {
117
+ if (hookList.includes(hookName)) {
117
118
  // We bind the hook with the model
118
119
  currentModel.setExtensions(hookType, hookName, hooks[hookName].default);
119
120
  }
121
+ else {
122
+ logger.warn(`Invalid ${hookType} type: "${hookName}" in this folder: "${subfolderPath}"`);
123
+ }
120
124
  }
121
125
  }
122
126
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "0.30.1",
3
+ "version": "0.30.3",
4
4
  "description": "AXE API is a simple tool which has been created based on Express and Knex.js to create Rest APIs quickly.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",