@itrocks/framework 0.3.0 → 0.3.2

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.
Files changed (2) hide show
  1. package/cjs/main.js +6 -2
  2. package/package.json +1 -1
package/cjs/main.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.run = run;
4
4
  const action_1 = require("@itrocks/action");
5
+ const action_2 = require("@itrocks/action");
5
6
  const action_request_1 = require("@itrocks/action-request");
6
7
  const action_request_2 = require("@itrocks/action-request");
7
8
  const app_dir_1 = require("@itrocks/app-dir");
@@ -35,7 +36,7 @@ async function execute(request) {
35
36
  if ((0, class_type_1.isAnyType)(module)) {
36
37
  const action = (new module);
37
38
  if (request.format in action) {
38
- const need = (0, action_1.needOf)(action);
39
+ const need = (0, action_2.needOf)(action);
39
40
  if (need.alternative
40
41
  && (need.alternative !== request.action)
41
42
  && (((need.need === 'object') && !request.ids.length)
@@ -55,7 +56,10 @@ async function execute(request) {
55
56
  }
56
57
  async function run() {
57
58
  await (0, route_1.loadRoutes)(route_1.routes, config_1.config.routes ?? {});
58
- (0, action_request_1.actionRequestDependsOn)({ getModule: route_1.routes.resolve.bind(route_1.routes) });
59
+ (0, action_request_1.actionRequestDependsOn)({
60
+ getModule: route_1.routes.resolve.bind(route_1.routes),
61
+ isDomainObject: object => (0, class_type_1.isAnyType)(object) && !(object.prototype instanceof action_1.Action)
62
+ });
59
63
  return new fastify_1.FastifyServer({
60
64
  assetPath: app_dir_1.appDir,
61
65
  execute: request => execute(new action_request_2.Request(request)),
package/package.json CHANGED
@@ -96,5 +96,5 @@
96
96
  "build:front": "tsc -p src/front/tsconfig.json && sed -i 's#../../##g' *.js *.d.ts"
97
97
  },
98
98
  "types": "./cjs/framework.d.ts",
99
- "version": "0.3.0"
99
+ "version": "0.3.2"
100
100
  }