@tachybase/module-error-handler 0.23.41 → 0.23.48

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.
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
- "@tachybase/client": "0.23.41",
3
- "@tachybase/database": "0.23.41",
4
- "@tachybase/server": "0.23.41",
5
- "@formily/json-schema": "2.3.2",
2
+ "@tachybase/client": "0.23.48",
3
+ "@tachybase/database": "0.23.48",
4
+ "@tachybase/schema": "0.23.48",
5
+ "@tachybase/server": "0.23.48",
6
6
  "lodash": "4.17.21"
7
7
  };
@@ -21,7 +21,9 @@ __export(error_handler_exports, {
21
21
  });
22
22
  module.exports = __toCommonJS(error_handler_exports);
23
23
  class ErrorHandler {
24
- handlers = [];
24
+ constructor() {
25
+ this.handlers = [];
26
+ }
25
27
  register(guard, render) {
26
28
  this.handlers.push({
27
29
  guard,
@@ -31,15 +31,18 @@ __export(server_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(server_exports);
33
33
  var import_database = require("@tachybase/database");
34
+ var import_schema = require("@tachybase/schema");
34
35
  var import_server = require("@tachybase/server");
35
- var import_json_schema = require("@formily/json-schema");
36
36
  var import_lodash = __toESM(require("lodash"));
37
37
  var import_error_handler = require("./error-handler");
38
38
  var import_en_US = __toESM(require("./locale/en_US"));
39
39
  var import_zh_CN = __toESM(require("./locale/zh_CN"));
40
40
  class PluginErrorHandler extends import_server.Plugin {
41
- errorHandler = new import_error_handler.ErrorHandler();
42
- i18nNs = "error-handler";
41
+ constructor() {
42
+ super(...arguments);
43
+ this.errorHandler = new import_error_handler.ErrorHandler();
44
+ this.i18nNs = "error-handler";
45
+ }
43
46
  beforeLoad() {
44
47
  this.registerSequelizeValidationErrorHandler();
45
48
  }
@@ -54,7 +57,7 @@ class PluginErrorHandler extends import_server.Plugin {
54
57
  const database = dataSource ? dataSource.collectionManager.db : ctx.db;
55
58
  const collection = database.modelCollection.get(model);
56
59
  const field = collection.getField(path);
57
- const fieldOptions = import_json_schema.Schema.compile(field == null ? void 0 : field.options, { t: tFunc });
60
+ const fieldOptions = import_schema.Schema.compile(field == null ? void 0 : field.options, { t: tFunc });
58
61
  const title = import_lodash.default.get(fieldOptions, "uiSchema.title", path);
59
62
  return title;
60
63
  };
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@tachybase/module-error-handler",
3
3
  "displayName": "Error handler",
4
- "version": "0.23.41",
4
+ "version": "0.23.48",
5
5
  "description": "Handling application errors and exceptions.",
6
6
  "license": "Apache-2.0",
7
7
  "main": "./dist/server/index.js",
8
8
  "dependencies": {},
9
9
  "devDependencies": {
10
- "@formily/json-schema": "2.3.2",
11
10
  "lodash": "4.17.21",
12
- "supertest": "^6.3.4"
11
+ "supertest": "^6.3.4",
12
+ "@tachybase/schema": "0.23.48"
13
13
  },
14
14
  "peerDependencies": {
15
- "@tachybase/database": "0.23.41",
16
- "@tachybase/server": "0.23.41",
17
- "@tachybase/client": "0.23.41",
18
- "@tachybase/utils": "0.23.41",
19
- "@tachybase/test": "0.23.41"
15
+ "@tachybase/client": "0.23.48",
16
+ "@tachybase/database": "0.23.48",
17
+ "@tachybase/server": "0.23.48",
18
+ "@tachybase/utils": "0.23.48",
19
+ "@tachybase/test": "0.23.48"
20
20
  },
21
21
  "description.zh-CN": "处理应用程序中的错误和异常。",
22
22
  "displayName.zh-CN": "错误处理器",