@tachybase/plugin-api-logs 1.5.1 → 1.6.1

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,11 +1,11 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.5.1",
4
- "@tachybase/schema": "1.3.52",
5
- "@ant-design/icons": "5.6.1",
3
+ "@tachybase/client": "1.6.1",
4
+ "@tachybase/schema": "1.6.0-alpha.9",
5
+ "@ant-design/icons": "6.1.0",
6
6
  "react-i18next": "16.2.1",
7
- "@tego/server": "1.3.52",
8
- "@tego/client": "1.3.52",
7
+ "@tego/server": "1.6.0-alpha.9",
8
+ "@tego/client": "1.6.0-alpha.9",
9
9
  "antd": "5.22.5",
10
10
  "lodash": "4.17.21"
11
11
  };
@@ -99,8 +99,8 @@ class ApiLogsController {
99
99
  }
100
100
  try {
101
101
  await apiLogsRepo.createMany({ records: collectionsToInsert, hooks: false });
102
- const plugin = ctx.app.pm.get("api-logs");
103
- await ((_b = plugin.apiFilter) == null ? void 0 : _b.load());
102
+ const plugin = ctx.tego.pm.get("api-logs");
103
+ await ((_b = plugin == null ? void 0 : plugin.apiFilter) == null ? void 0 : _b.load());
104
104
  } catch (error) {
105
105
  ctx.throw(((_e = (_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.error) == null ? void 0 : _e.message) || "request error");
106
106
  }
@@ -27,7 +27,7 @@ async function handleCreate(ctx, next) {
27
27
  const currentTime = (/* @__PURE__ */ new Date()).toISOString();
28
28
  const apilogsRepo = ctx.db.getRepository("apiLogs");
29
29
  const currentUserId = (_a = ctx.auth) == null ? void 0 : _a.user.id;
30
- const app = ctx.app;
30
+ const app = ctx.tego;
31
31
  const collection = app.mainDataSource.collectionManager.getCollection(ctx.action.resourceName);
32
32
  const currentRecordId = (_b = ctx.body) == null ? void 0 : _b[collection.filterTargetKey];
33
33
  const changes = [];
@@ -40,7 +40,7 @@ async function handleGetInsertValues(ctx, tk, insertValues) {
40
40
  const values = await getInsertValues(ctx, tk);
41
41
  insertValues.push(values);
42
42
  } catch (error) {
43
- ctx.app.logger.error("handleDestroy error, getInsertValues: ", {
43
+ ctx.tego.logger.error("handleDestroy error, getInsertValues: ", {
44
44
  param: ctx.action.params,
45
45
  error
46
46
  });
@@ -51,7 +51,7 @@ async function getInsertValues(ctx, tk) {
51
51
  const { actionName, resourceName, params } = ctx.action;
52
52
  const apilogsRepo = ctx.db.getRepository("apiLogs");
53
53
  const currentUserId = (_a = ctx.auth) == null ? void 0 : _a.user.id;
54
- const app = ctx.app;
54
+ const app = ctx.tego;
55
55
  const collection = app.mainDataSource.collectionManager.getCollection(ctx.action.resourceName);
56
56
  const changes = [];
57
57
  const { changed, data: dataBefore } = await (0, import_getFieldChange.getChanged)(ctx, tk);
@@ -27,7 +27,7 @@ async function handleUpdate(ctx, next) {
27
27
  const currentTime = (/* @__PURE__ */ new Date()).toISOString();
28
28
  const apilogsRepo = ctx.db.getRepository("apiLogs");
29
29
  const currentUserId = (_a = ctx.auth) == null ? void 0 : _a.user.id;
30
- const app = ctx.app;
30
+ const app = ctx.tego;
31
31
  const collection = app.mainDataSource.collectionManager.getCollection(ctx.action.resourceName);
32
32
  const changes = [];
33
33
  const { changed, data: dataBefore } = await (0, import_getFieldChange.getChanged)(ctx, params.filterByTk);
@@ -106,7 +106,7 @@ async function getChanged(ctx, filterByTk) {
106
106
  filterByTk = params.filterByTk;
107
107
  }
108
108
  const fieldsObj = {};
109
- const app = ctx.app;
109
+ const app = ctx.tego;
110
110
  const collection = app.mainDataSource.collectionManager.getCollection(ctx.action.resourceName);
111
111
  const repo = ctx.db.getRepository(collection.name);
112
112
  const fields = collection.getFields();
@@ -148,7 +148,7 @@ async function getChanged(ctx, filterByTk) {
148
148
  changed
149
149
  };
150
150
  } catch (err) {
151
- ctx.log.error(err);
151
+ ctx.logger.error(err);
152
152
  return {
153
153
  error: err.stack
154
154
  };
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-api-logs",
3
3
  "displayName": "Api Logs",
4
- "version": "1.5.1",
4
+ "version": "1.6.1",
5
5
  "description": "Provides seamless tracking of API actions through enhanced user interface components, configuration panels, and dashboards",
6
6
  "keywords": [
7
7
  "Logging and monitoring"
8
8
  ],
9
9
  "main": "dist/server/index.js",
10
10
  "devDependencies": {
11
- "@ant-design/icons": "^5.6.1",
12
- "@tachybase/schema": "1.3.52",
13
- "@tachybase/test": "1.3.52",
14
- "@tego/client": "1.3.52",
15
- "@tego/server": "1.3.52",
11
+ "@ant-design/icons": "^6.1.0",
12
+ "@tachybase/schema": "1.6.0-alpha.9",
13
+ "@tachybase/test": "1.6.0-alpha.9",
14
+ "@tego/client": "1.6.0-alpha.9",
15
+ "@tego/server": "1.6.0-alpha.9",
16
16
  "antd": "5.22.5",
17
17
  "lodash": "4.17.21",
18
18
  "react-i18next": "16.2.1",
19
19
  "react-router-dom": "6.28.1",
20
- "@tachybase/client": "1.5.1"
20
+ "@tachybase/client": "1.6.1"
21
21
  },
22
22
  "description.zh-CN": "Api Logs通过增强的用户界面组件、配置面板和仪表板提供对 API 操作的无缝跟踪",
23
23
  "displayName.zh-CN": "Api 日志"