@tachybase/module-data-source 0.23.47 → 0.23.58

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,19 +1,19 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "0.23.47",
4
- "@tachybase/server": "0.23.47",
3
+ "@tachybase/client": "0.23.58",
4
+ "@tachybase/server": "0.23.58",
5
5
  "lodash": "4.17.21",
6
6
  "@ant-design/icons": "5.5.2",
7
7
  "antd": "5.22.5",
8
8
  "react-router-dom": "6.28.1",
9
- "@tachybase/schema": "0.23.47",
9
+ "@tachybase/schema": "0.23.58",
10
10
  "react-i18next": "15.2.0",
11
- "@tachybase/database": "0.23.47",
12
- "@tachybase/utils": "0.23.47",
13
- "@tachybase/module-acl": "0.23.47",
14
- "@tachybase/acl": "0.23.47",
11
+ "@tachybase/database": "0.23.58",
12
+ "@tachybase/utils": "0.23.58",
13
+ "@tachybase/module-acl": "0.23.58",
14
+ "@tachybase/acl": "0.23.58",
15
15
  "sequelize": "6.37.5",
16
- "@tachybase/components": "0.23.47",
16
+ "@tachybase/components": "0.23.58",
17
17
  "@dnd-kit/core": "6.3.1",
18
18
  "ahooks": "3.8.4"
19
19
  };
@@ -7,6 +7,7 @@ export declare class PluginDataSourceManagerServer extends Plugin {
7
7
  dataSourceStatus: {
8
8
  [dataSourceKey: string]: DataSourceState;
9
9
  };
10
+ renderJsonTemplate(template: any): any;
10
11
  beforeLoad(): Promise<void>;
11
12
  load(): Promise<void>;
12
13
  }
@@ -52,6 +52,9 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
52
52
  this.dataSourceErrors = {};
53
53
  this.dataSourceStatus = {};
54
54
  }
55
+ renderJsonTemplate(template) {
56
+ return this.app.environment.renderJsonTemplate(template);
57
+ }
55
58
  async beforeLoad() {
56
59
  this.app.db.registerModels({
57
60
  DataSourcesCollectionModel: import_data_sources_collection_model.DataSourcesCollectionModel,
@@ -93,7 +96,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
93
96
  const type = model.get("type");
94
97
  const klass = this.app.dataSourceManager.factory.getClass(type);
95
98
  try {
96
- await klass.testConnection(dataSourceOptions);
99
+ await klass.testConnection(this.renderJsonTemplate(dataSourceOptions || {}));
97
100
  } catch (error) {
98
101
  throw new Error(`Test connection failed: ${error.message}`);
99
102
  }
@@ -247,7 +250,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
247
250
  const { options, type } = values;
248
251
  const klass = ctx.app.dataSourceManager.factory.getClass(type);
249
252
  try {
250
- await klass.testConnection(options);
253
+ await klass.testConnection(this.renderJsonTemplate(options || {}));
251
254
  } catch (error) {
252
255
  throw new Error(`Test connection failed: ${error.message}`);
253
256
  }
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": "0.23.47",
4
+ "version": "0.23.58",
5
5
  "description": "Manage data sources, including the built-in Master database, external databases, APIs, etc.",
6
6
  "keywords": [
7
7
  "Data model tools"
@@ -18,16 +18,16 @@
18
18
  "react-i18next": "^15.2.0",
19
19
  "react-router-dom": "6.28.1",
20
20
  "sequelize": "^6.37.5",
21
- "@tachybase/components": "0.23.47",
22
- "@tachybase/schema": "0.23.47"
21
+ "@tachybase/components": "0.23.58",
22
+ "@tachybase/schema": "0.23.58"
23
23
  },
24
24
  "peerDependencies": {
25
- "@tachybase/acl": "0.23.47",
26
- "@tachybase/client": "0.23.47",
27
- "@tachybase/database": "0.23.47",
28
- "@tachybase/server": "0.23.47",
29
- "@tachybase/test": "0.23.47",
30
- "@tachybase/utils": "0.23.47"
25
+ "@tachybase/acl": "0.23.58",
26
+ "@tachybase/client": "0.23.58",
27
+ "@tachybase/database": "0.23.58",
28
+ "@tachybase/test": "0.23.58",
29
+ "@tachybase/utils": "0.23.58",
30
+ "@tachybase/server": "0.23.58"
31
31
  },
32
32
  "description.zh-CN": "管理数据源,包括内置的 Master 数据库,外部的数据库、API。",
33
33
  "displayName.zh-CN": "数据源管理",