@nocobase/plugin-data-visualization 2.0.27 → 2.0.28
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/dist/client/1b4f3d899fb8232f.js +47 -0
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +10 -10
- package/dist/node_modules/koa-compose/package.json +1 -1
- package/dist/node_modules/moment-timezone/package.json +1 -1
- package/dist/server/actions/query.js +37 -9
- package/package.json +2 -2
- package/dist/client/273273dec3066226.js +0 -47
package/dist/externalVersion.js
CHANGED
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.0.
|
|
11
|
+
"@nocobase/client": "2.0.28",
|
|
12
12
|
"@formily/react": "2.3.7",
|
|
13
|
-
"@nocobase/plugin-ai": "2.0.
|
|
14
|
-
"@nocobase/flow-engine": "2.0.
|
|
13
|
+
"@nocobase/plugin-ai": "2.0.28",
|
|
14
|
+
"@nocobase/flow-engine": "2.0.28",
|
|
15
15
|
"react-i18next": "11.18.6",
|
|
16
16
|
"dayjs": "1.11.13",
|
|
17
17
|
"@formily/shared": "2.3.7",
|
|
18
18
|
"lodash": "4.17.21",
|
|
19
|
-
"@nocobase/cache": "2.0.
|
|
20
|
-
"@nocobase/server": "2.0.
|
|
21
|
-
"@nocobase/test": "2.0.
|
|
22
|
-
"@nocobase/utils": "2.0.
|
|
19
|
+
"@nocobase/cache": "2.0.28",
|
|
20
|
+
"@nocobase/server": "2.0.28",
|
|
21
|
+
"@nocobase/test": "2.0.28",
|
|
22
|
+
"@nocobase/utils": "2.0.28",
|
|
23
23
|
"react": "18.2.0",
|
|
24
24
|
"@emotion/css": "11.13.0",
|
|
25
25
|
"@ant-design/icons": "5.6.1",
|
|
@@ -27,9 +27,9 @@ module.exports = {
|
|
|
27
27
|
"antd": "5.24.2",
|
|
28
28
|
"@formily/antd-v5": "1.2.3",
|
|
29
29
|
"@formily/core": "2.3.7",
|
|
30
|
-
"@nocobase/actions": "2.0.
|
|
31
|
-
"@nocobase/database": "2.0.
|
|
32
|
-
"@nocobase/acl": "2.0.
|
|
30
|
+
"@nocobase/actions": "2.0.28",
|
|
31
|
+
"@nocobase/database": "2.0.28",
|
|
32
|
+
"@nocobase/acl": "2.0.28",
|
|
33
33
|
"sequelize": "6.35.2",
|
|
34
34
|
"@formily/reactive": "2.3.7"
|
|
35
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2026-03-
|
|
1
|
+
{"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2026-03-27T15:56:12.848Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2026-03-
|
|
1
|
+
{"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2026-03-27T15:56:13.388Z"}
|
|
@@ -55,6 +55,37 @@ const getDB = (ctx, dataSource) => {
|
|
|
55
55
|
const ds = ctx.app.dataSourceManager.dataSources.get(dataSource);
|
|
56
56
|
return ds == null ? void 0 : ds.collectionManager.db;
|
|
57
57
|
};
|
|
58
|
+
const getChartQueryPermission = async (ctx, collection, acl) => {
|
|
59
|
+
var _a;
|
|
60
|
+
const actionCtx = {
|
|
61
|
+
app: ctx.app,
|
|
62
|
+
db: ctx.db,
|
|
63
|
+
database: ctx.database ?? ctx.db,
|
|
64
|
+
getCurrentRepository: ctx.getCurrentRepository,
|
|
65
|
+
request: ctx.request,
|
|
66
|
+
req: ctx.req,
|
|
67
|
+
action: {
|
|
68
|
+
actionName: "list",
|
|
69
|
+
name: "list",
|
|
70
|
+
params: {},
|
|
71
|
+
resourceName: collection,
|
|
72
|
+
mergeParams() {
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
state: {
|
|
76
|
+
...ctx.state,
|
|
77
|
+
currentRole: ctx.state.currentRole,
|
|
78
|
+
currentRoles: ctx.state.currentRoles,
|
|
79
|
+
currentUser: ((_a = ctx.state.currentUser) == null ? void 0 : _a.toJSON) ? ctx.state.currentUser.toJSON() : ctx.state.currentUser
|
|
80
|
+
},
|
|
81
|
+
permission: {},
|
|
82
|
+
throw(...args) {
|
|
83
|
+
ctx.throw(...args);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
await acl.getActionParams(actionCtx);
|
|
87
|
+
return actionCtx.permission;
|
|
88
|
+
};
|
|
58
89
|
const postProcess = async (ctx, next) => {
|
|
59
90
|
const { data, fieldMap } = ctx.action.params.values;
|
|
60
91
|
ctx.body = data.map((record) => {
|
|
@@ -220,17 +251,14 @@ const cacheMiddleware = async (ctx, next) => {
|
|
|
220
251
|
}
|
|
221
252
|
};
|
|
222
253
|
const checkPermission = async (ctx, next) => {
|
|
223
|
-
var _a, _b
|
|
254
|
+
var _a, _b;
|
|
224
255
|
const { collection, dataSource } = ctx.action.params.values;
|
|
225
|
-
const roleNames = ctx.state.currentRoles || ["anonymous"];
|
|
226
256
|
const acl = ((_a = ctx.app.dataSourceManager.get(dataSource)) == null ? void 0 : _a.acl) || ctx.app.acl;
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
if ((_b = can == null ? void 0 : can.params) == null ? void 0 : _b.filter) {
|
|
257
|
+
const permission = await getChartQueryPermission(ctx, collection, acl);
|
|
258
|
+
const filterParams = (_b = permission == null ? void 0 : permission.parsedParams) == null ? void 0 : _b.filter;
|
|
259
|
+
if (filterParams) {
|
|
232
260
|
try {
|
|
233
|
-
(0, import_acl.checkFilterParams)(ctx.database.getCollection(collection),
|
|
261
|
+
(0, import_acl.checkFilterParams)(ctx.database.getCollection(collection), filterParams);
|
|
234
262
|
} catch (e) {
|
|
235
263
|
if (e instanceof import_acl.NoPermissionError) {
|
|
236
264
|
ctx.throw(403, "No permissions");
|
|
@@ -239,7 +267,7 @@ const checkPermission = async (ctx, next) => {
|
|
|
239
267
|
const filter = ctx.action.params.values.filter || {};
|
|
240
268
|
ctx.action.params.values = {
|
|
241
269
|
...ctx.action.params.values,
|
|
242
|
-
filter: (0, import_utils.assign)(filter,
|
|
270
|
+
filter: (0, import_utils.assign)(filter, filterParams, {
|
|
243
271
|
filter: "andMerge"
|
|
244
272
|
})
|
|
245
273
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-visualization",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.28",
|
|
4
4
|
"displayName": "Data visualization",
|
|
5
5
|
"displayName.ru-RU": "Визуализация данных",
|
|
6
6
|
"displayName.zh-CN": "数据可视化",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@nocobase/test": "2.x",
|
|
47
47
|
"@nocobase/utils": "2.x"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "7a3e96a74b05f2beaa5a87d8ef28ccf269ea90f4",
|
|
50
50
|
"keywords": [
|
|
51
51
|
"Blocks"
|
|
52
52
|
],
|