@tachybase/plugin-block-charts 1.3.20 → 1.3.22
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/index.js +39 -39
- package/dist/externalVersion.js +6 -10
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/koa-compose/package.json +1 -1
- package/dist/server/actions/query.d.ts +1 -1
- package/dist/server/actions/query.js +4 -5
- package/dist/server/migrations/20230926211750-rename-charttype.d.ts +1 -1
- package/dist/server/migrations/20230926211750-rename-charttype.js +1 -1
- package/dist/server/plugin.d.ts +1 -2
- package/dist/server/plugin.js +5 -6
- package/dist/server/services/sql-loader.js +6 -6
- package/package.json +11 -19
package/dist/externalVersion.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@tachybase/client": "1.3.
|
|
3
|
-
"@tachybase/schema": "1.3.
|
|
2
|
+
"@tachybase/client": "1.3.22",
|
|
3
|
+
"@tachybase/schema": "1.3.39",
|
|
4
4
|
"lodash": "4.17.21",
|
|
5
|
-
"@
|
|
6
|
-
"@tachybase/server": "1.3.20",
|
|
7
|
-
"@tachybase/utils": "1.3.20",
|
|
5
|
+
"@tego/server": "1.3.39",
|
|
8
6
|
"react": "18.3.1",
|
|
9
|
-
"@ant-design/icons": "5.
|
|
7
|
+
"@ant-design/icons": "5.6.1",
|
|
10
8
|
"ahooks": "3.9.0",
|
|
11
9
|
"antd": "5.22.5",
|
|
12
10
|
"dayjs": "1.11.13",
|
|
13
|
-
"@
|
|
11
|
+
"@tego/client": "1.3.39",
|
|
14
12
|
"react-i18next": "15.2.0",
|
|
15
|
-
"sequelize": "6.37.5"
|
|
16
|
-
"@tachybase/actions": "1.3.20",
|
|
17
|
-
"@tachybase/database": "1.3.20"
|
|
13
|
+
"sequelize": "6.37.5"
|
|
18
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"fs-extra","version":"11.3.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=14.14"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^10.1.0","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^17.0.0"},"main":"./lib/index.js","exports":{".":"./lib/index.js","./esm":"./lib/esm.mjs"},"files":["lib/","!lib/**/__tests__/"],"scripts":{"lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit && npm run unit-esm","unit":"nyc node test.js","unit-esm":"node test.mjs"},"sideEffects":false,"_lastModified":"2025-07-
|
|
1
|
+
{"name":"fs-extra","version":"11.3.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=14.14"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^10.1.0","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^17.0.0"},"main":"./lib/index.js","exports":{".":"./lib/index.js","./esm":"./lib/esm.mjs"},"files":["lib/","!lib/**/__tests__/"],"scripts":{"lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit && npm run unit-esm","unit":"nyc node test.js","unit-esm":"node test.mjs"},"sideEffects":false,"_lastModified":"2025-07-29T06:18:23.701Z"}
|
|
@@ -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":"2025-07-
|
|
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":"2025-07-29T06:18:23.323Z"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
1
|
+
import { Context, Next } from '@tego/server';
|
|
2
2
|
export declare const postProcess: (ctx: Context, next: Next) => Promise<void>;
|
|
3
3
|
export declare const queryData: (ctx: Context, next: Next) => Promise<void>;
|
|
4
4
|
export declare const parseBuilder: (ctx: Context, next: Next) => Promise<void>;
|
|
@@ -36,8 +36,7 @@ __export(query_exports, {
|
|
|
36
36
|
queryData: () => queryData
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(query_exports);
|
|
39
|
-
var
|
|
40
|
-
var import_utils = require("@tachybase/utils");
|
|
39
|
+
var import_server = require("@tego/server");
|
|
41
40
|
var import_koa_compose = __toESM(require("koa-compose"));
|
|
42
41
|
var import_formatter = require("./formatter");
|
|
43
42
|
const getDB = (ctx, dataSource) => {
|
|
@@ -197,7 +196,7 @@ const parseFieldAndAssociations = async (ctx, next) => {
|
|
|
197
196
|
attributes: [],
|
|
198
197
|
...type === "belongsToMany" ? { through: { attributes: [] } } : {}
|
|
199
198
|
}));
|
|
200
|
-
const filterParser = new
|
|
199
|
+
const filterParser = new import_server.FilterParser(filter, {
|
|
201
200
|
collection
|
|
202
201
|
});
|
|
203
202
|
const { where, include: filterInclude } = filterParser.toSequelizeParams();
|
|
@@ -263,7 +262,7 @@ const parseVariables = async (ctx, next) => {
|
|
|
263
262
|
return user;
|
|
264
263
|
};
|
|
265
264
|
};
|
|
266
|
-
ctx.action.params.values.filter = await (0,
|
|
265
|
+
ctx.action.params.values.filter = await (0, import_server.parseFilter)(filter, {
|
|
267
266
|
timezone: ctx.get("x-timezone"),
|
|
268
267
|
now: (/* @__PURE__ */ new Date()).toISOString(),
|
|
269
268
|
getField: (path) => {
|
|
@@ -272,7 +271,7 @@ const parseVariables = async (ctx, next) => {
|
|
|
272
271
|
return ctx.db.getFieldByPath(`${resourceName}.${fieldPath}`);
|
|
273
272
|
},
|
|
274
273
|
vars: {
|
|
275
|
-
$nDate: (0,
|
|
274
|
+
$nDate: (0, import_server.getDateVars)(),
|
|
276
275
|
$user: getUser()
|
|
277
276
|
}
|
|
278
277
|
});
|
|
@@ -20,7 +20,7 @@ __export(rename_charttype_exports, {
|
|
|
20
20
|
default: () => RenameChartTypeMigration
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(rename_charttype_exports);
|
|
23
|
-
var import_server = require("@
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
24
|
class RenameChartTypeMigration extends import_server.Migration {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
package/dist/server/plugin.d.ts
CHANGED
package/dist/server/plugin.js
CHANGED
|
@@ -31,9 +31,8 @@ __export(plugin_exports, {
|
|
|
31
31
|
default: () => plugin_default
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(plugin_exports);
|
|
34
|
-
var
|
|
35
|
-
var import_server = require("@
|
|
36
|
-
var import_utils = require("@tachybase/utils");
|
|
34
|
+
var import_node_path = __toESM(require("node:path"));
|
|
35
|
+
var import_server = require("@tego/server");
|
|
37
36
|
var import_query = require("./actions/query");
|
|
38
37
|
var import_sql_loader = require("./services/sql-loader");
|
|
39
38
|
class DataVisualizationPlugin extends import_server.Plugin {
|
|
@@ -49,11 +48,11 @@ class DataVisualizationPlugin extends import_server.Plugin {
|
|
|
49
48
|
this.app.acl.allow("charts", "query", "loggedIn");
|
|
50
49
|
}
|
|
51
50
|
async load() {
|
|
52
|
-
const sqlLoader =
|
|
53
|
-
await sqlLoader.loadSqlFiles(
|
|
51
|
+
const sqlLoader = import_server.Container.get(import_sql_loader.SqlLoader);
|
|
52
|
+
await sqlLoader.loadSqlFiles(import_node_path.default.join(__dirname, "./sqls"));
|
|
54
53
|
this.db.addMigrations({
|
|
55
54
|
namespace: "data-visulization",
|
|
56
|
-
directory: (0,
|
|
55
|
+
directory: (0, import_node_path.resolve)(__dirname, "migrations"),
|
|
57
56
|
context: {
|
|
58
57
|
plugin: this
|
|
59
58
|
}
|
|
@@ -74,12 +74,12 @@ __export(sql_loader_exports, {
|
|
|
74
74
|
SqlLoader: () => SqlLoader
|
|
75
75
|
});
|
|
76
76
|
module.exports = __toCommonJS(sql_loader_exports);
|
|
77
|
-
var
|
|
78
|
-
var
|
|
77
|
+
var import_node_path = __toESM(require("node:path"));
|
|
78
|
+
var import_server = require("@tego/server");
|
|
79
79
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
80
80
|
var import_multiprocess = require("../utils/multiprocess");
|
|
81
81
|
var _db_dec, _SqlLoader_decorators, _init;
|
|
82
|
-
_SqlLoader_decorators = [(0,
|
|
82
|
+
_SqlLoader_decorators = [(0, import_server.Service)()], _db_dec = [(0, import_server.Db)()];
|
|
83
83
|
class SqlLoader {
|
|
84
84
|
constructor() {
|
|
85
85
|
this.sqlFiles = {};
|
|
@@ -91,11 +91,11 @@ class SqlLoader {
|
|
|
91
91
|
const dialect = this.db.options.dialect;
|
|
92
92
|
await Promise.all(
|
|
93
93
|
files.map(async (file) => {
|
|
94
|
-
const filePath =
|
|
94
|
+
const filePath = import_node_path.default.join(directory, file);
|
|
95
95
|
const stat = await import_fs_extra.default.stat(filePath);
|
|
96
|
-
if (stat.isFile() &&
|
|
96
|
+
if (stat.isFile() && import_node_path.default.extname(file) === ".sql") {
|
|
97
97
|
const content = await import_fs_extra.default.readFile(filePath, "utf-8");
|
|
98
|
-
const filename =
|
|
98
|
+
const filename = import_node_path.default.basename(file, ".sql");
|
|
99
99
|
const dialects = content.split("\n").filter((line) => line.startsWith("-- dialect:")).map((line) => line.split(":")[1].trim());
|
|
100
100
|
if (!dialects.includes(dialect)) {
|
|
101
101
|
return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-block-charts",
|
|
3
3
|
"displayName": "Block: charts",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.22",
|
|
5
5
|
"description": "Provides data visualization feature, including chart block and chart filter block, support line charts, area charts, bar charts and more than a dozen kinds of charts, you can also extend more chart types.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Blocks"
|
|
@@ -10,34 +10,26 @@
|
|
|
10
10
|
"main": "dist/server/index.js",
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "
|
|
13
|
+
"@ant-design/icons": "^5.6.1",
|
|
14
14
|
"@ant-design/plots": "^2.6.0",
|
|
15
|
+
"@tachybase/schema": "^1.3.39",
|
|
16
|
+
"@tachybase/test": "^1.3.39",
|
|
17
|
+
"@tego/client": "^1.3.39",
|
|
18
|
+
"@tego/server": "^1.3.39",
|
|
15
19
|
"ahooks": "^3.9.0",
|
|
16
20
|
"antd": "5.22.5",
|
|
17
21
|
"dayjs": "1.11.13",
|
|
18
22
|
"deepmerge": "^4.3.1",
|
|
19
23
|
"fs-extra": "^11.3.0",
|
|
20
24
|
"koa-compose": "^4.1.0",
|
|
21
|
-
"lodash": "
|
|
22
|
-
"react": "
|
|
25
|
+
"lodash": "4.17.21",
|
|
26
|
+
"react": "18.3.1",
|
|
23
27
|
"react-error-boundary": "^4.1.2",
|
|
24
|
-
"react-i18next": "
|
|
28
|
+
"react-i18next": "15.2.0",
|
|
25
29
|
"sequelize": "^6.37.5",
|
|
26
|
-
"@tachybase/
|
|
27
|
-
"@tachybase/schema": "1.3.20"
|
|
28
|
-
},
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"@tachybase/actions": "1.3.20",
|
|
31
|
-
"@tachybase/client": "1.3.20",
|
|
32
|
-
"@tachybase/cache": "1.3.20",
|
|
33
|
-
"@tachybase/database": "1.3.20",
|
|
34
|
-
"@tachybase/test": "1.3.20",
|
|
35
|
-
"@tachybase/utils": "1.3.20",
|
|
36
|
-
"@tachybase/server": "1.3.20"
|
|
30
|
+
"@tachybase/client": "1.3.22"
|
|
37
31
|
},
|
|
38
32
|
"description.zh-CN": "提供数据可视化功能,包含图表卡片和图表筛选卡片,支持折线图、面积图、柱状图等十几种图表,你也可以扩展更多图表类型。",
|
|
39
33
|
"displayName.zh-CN": "卡片:图表",
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "tachybase-build --no-dts @tachybase/plugin-block-charts"
|
|
42
|
-
}
|
|
34
|
+
"scripts": {}
|
|
43
35
|
}
|