axe-api 0.20.0-rc15 → 0.20.0-rc17

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.
@@ -41,7 +41,11 @@ class FileResolver {
41
41
  resolve(directory) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
43
  const results = {};
44
- const files = yield fs_1.default.readdirSync(directory);
44
+ const files = (yield fs_1.default.readdirSync(directory, { withFileTypes: true }))
45
+ .filter((item) => !item.isDirectory())
46
+ .filter((filename) => filename.name.includes(".ts"))
47
+ .filter((filename) => filename.name.includes(".ts"))
48
+ .map((item) => item.name);
45
49
  for (const file of files) {
46
50
  const configFile = path_1.default.join(directory, file);
47
51
  const { default: content } = yield Promise.resolve().then(() => __importStar(require(configFile)));
@@ -39,7 +39,7 @@ class ModelResolver {
39
39
  if (typeof relationFunction !== "function") {
40
40
  throw new Error(`Model relation definition should be a function: ${model.name}.${relationMethod}`);
41
41
  }
42
- model.relations.push(relationFunction());
42
+ model.relations.push(relationFunction.call(model.instance));
43
43
  }
44
44
  }
45
45
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "0.20.0-rc15",
3
+ "version": "0.20.0-rc17",
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",