@tachybase/module-data-source 1.6.20 → 1.6.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/externalVersion.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.6.
|
|
4
|
-
"@tego/server": "1.6.
|
|
3
|
+
"@tachybase/client": "1.6.22",
|
|
4
|
+
"@tego/server": "1.6.13",
|
|
5
5
|
"lodash": "4.17.21",
|
|
6
6
|
"@ant-design/icons": "6.1.0",
|
|
7
7
|
"antd": "5.22.5",
|
|
8
8
|
"react-router-dom": "6.28.1",
|
|
9
|
-
"@tachybase/schema": "1.6.
|
|
9
|
+
"@tachybase/schema": "1.6.13",
|
|
10
10
|
"react-i18next": "16.2.1",
|
|
11
|
-
"@tachybase/module-acl": "1.6.
|
|
11
|
+
"@tachybase/module-acl": "1.6.22",
|
|
12
12
|
"sequelize": "6.37.5",
|
|
13
|
-
"@tego/client": "1.6.
|
|
13
|
+
"@tego/client": "1.6.13",
|
|
14
14
|
"@dnd-kit/core": "6.3.1",
|
|
15
15
|
"ahooks": "3.9.0"
|
|
16
16
|
};
|
|
@@ -56,6 +56,14 @@ const availableActions = {
|
|
|
56
56
|
type: "old-data"
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
+
function getDataSourceManagerPlugin(app) {
|
|
60
|
+
for (const pluginName of ["data-source-manager", "data-source", "@tachybase/module-data-source"]) {
|
|
61
|
+
const plugin = app.pm.get(pluginName);
|
|
62
|
+
if (plugin) {
|
|
63
|
+
return plugin;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
59
67
|
class DataSourceModel extends import_server.Model {
|
|
60
68
|
isMainRecord() {
|
|
61
69
|
return this.get("type") === "main";
|
|
@@ -87,7 +95,10 @@ class DataSourceModel extends import_server.Model {
|
|
|
87
95
|
async loadIntoApplication(options) {
|
|
88
96
|
const { app, loadAtAfterStart } = options;
|
|
89
97
|
const dataSourceKey = this.get("key");
|
|
90
|
-
const pluginDataSourceManagerServer = app
|
|
98
|
+
const pluginDataSourceManagerServer = getDataSourceManagerPlugin(app);
|
|
99
|
+
if (!pluginDataSourceManagerServer) {
|
|
100
|
+
throw new Error("Data source manager plugin is required to load data sources");
|
|
101
|
+
}
|
|
91
102
|
if (pluginDataSourceManagerServer.dataSourceStatus[dataSourceKey] === "loaded") {
|
|
92
103
|
pluginDataSourceManagerServer.dataSourceStatus[dataSourceKey] = "reloading";
|
|
93
104
|
} else {
|
package/dist/server/plugin.js
CHANGED
|
@@ -252,7 +252,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
252
252
|
const { options, type } = values;
|
|
253
253
|
const klass = ctx.tego.dataSourceManager.factory.getClass(type);
|
|
254
254
|
try {
|
|
255
|
-
await klass.testConnection(
|
|
255
|
+
await klass.testConnection(plugin.renderJsonTemplate(options || {}));
|
|
256
256
|
} catch (error) {
|
|
257
257
|
throw new Error(`Test connection failed: ${error.message}`);
|
|
258
258
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/module-data-source",
|
|
3
3
|
"displayName": "Data source manager",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.22",
|
|
5
5
|
"description": "Manage data sources, including the built-in Master database, external databases, APIs, etc.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Data model tools"
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@ant-design/icons": "^6.1.0",
|
|
21
21
|
"@dnd-kit/core": "^6.3.1",
|
|
22
|
-
"@tachybase/schema": "1.6.
|
|
23
|
-
"@tachybase/test": "1.6.
|
|
24
|
-
"@tego/client": "1.6.
|
|
25
|
-
"@tego/server": "1.6.
|
|
22
|
+
"@tachybase/schema": "1.6.13",
|
|
23
|
+
"@tachybase/test": "1.6.13",
|
|
24
|
+
"@tego/client": "1.6.13",
|
|
25
|
+
"@tego/server": "1.6.13",
|
|
26
26
|
"@types/lodash": "^4.17.20",
|
|
27
27
|
"ahooks": "^3.9.0",
|
|
28
28
|
"antd": "5.22.5",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"react-i18next": "16.2.1",
|
|
32
32
|
"react-router-dom": "6.28.1",
|
|
33
33
|
"sequelize": "6.37.5",
|
|
34
|
-
"@tachybase/
|
|
35
|
-
"@tachybase/
|
|
34
|
+
"@tachybase/client": "1.6.22",
|
|
35
|
+
"@tachybase/module-acl": "1.6.22"
|
|
36
36
|
},
|
|
37
37
|
"description.zh-CN": "管理数据源,包括内置的 Master 数据库,外部的数据库、API。",
|
|
38
38
|
"displayName.zh-CN": "数据源管理",
|