axe-api 0.20.0-rc13 → 0.20.0-rc15

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/build/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import Server from "./src/Server";
2
2
  import Model from "./src/Model";
3
3
  import ApiError from "./src/Exceptions/ApiError";
4
4
  import { DEFAULT_HANDLERS } from "./src/constants";
5
- import { IoCService, DocumentationService } from "./src/Services";
5
+ import { IoCService } from "./src/Services";
6
6
  export * from "./src/Enums";
7
7
  export * from "./src/Interfaces";
8
- export { Server, Model, ApiError, DEFAULT_HANDLERS, IoCService, DocumentationService, };
8
+ export { Server, Model, ApiError, DEFAULT_HANDLERS, IoCService };
package/build/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.DocumentationService = exports.IoCService = exports.DEFAULT_HANDLERS = exports.ApiError = exports.Model = exports.Server = void 0;
20
+ exports.IoCService = exports.DEFAULT_HANDLERS = exports.ApiError = exports.Model = exports.Server = void 0;
21
21
  const Server_1 = __importDefault(require("./src/Server"));
22
22
  exports.Server = Server_1.default;
23
23
  const Model_1 = __importDefault(require("./src/Model"));
@@ -28,6 +28,5 @@ const constants_1 = require("./src/constants");
28
28
  Object.defineProperty(exports, "DEFAULT_HANDLERS", { enumerable: true, get: function () { return constants_1.DEFAULT_HANDLERS; } });
29
29
  const Services_1 = require("./src/Services");
30
30
  Object.defineProperty(exports, "IoCService", { enumerable: true, get: function () { return Services_1.IoCService; } });
31
- Object.defineProperty(exports, "DocumentationService", { enumerable: true, get: function () { return Services_1.DocumentationService; } });
32
31
  __exportStar(require("./src/Enums"), exports);
33
32
  __exportStar(require("./src/Interfaces"), exports);
@@ -35,7 +35,11 @@ class ModelResolver {
35
35
  for (const model of modelList.get()) {
36
36
  const relationMethods = this.getInstanceMethods(model);
37
37
  for (const relationMethod of relationMethods) {
38
- model.relations.push(model.instance[relationMethod]());
38
+ const relationFunction = model.instance[relationMethod];
39
+ if (typeof relationFunction !== "function") {
40
+ throw new Error(`Model relation definition should be a function: ${model.name}.${relationMethod}`);
41
+ }
42
+ model.relations.push(relationFunction());
39
43
  }
40
44
  }
41
45
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "0.20.0-rc13",
3
+ "version": "0.20.0-rc15",
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",