@nocobase/plugin-data-source-manager 2.2.0-beta.17 → 2.2.0-beta.18
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
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.2.0-beta.
|
|
11
|
+
"@nocobase/client": "2.2.0-beta.18",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/plugin-acl": "2.2.0-beta.
|
|
14
|
-
"@nocobase/utils": "2.2.0-beta.
|
|
15
|
-
"@nocobase/flow-engine": "2.2.0-beta.
|
|
16
|
-
"@nocobase/client-v2": "2.2.0-beta.
|
|
17
|
-
"@nocobase/ai": "2.2.0-beta.
|
|
18
|
-
"@nocobase/server": "2.2.0-beta.
|
|
19
|
-
"@nocobase/data-source-manager": "2.2.0-beta.
|
|
13
|
+
"@nocobase/plugin-acl": "2.2.0-beta.18",
|
|
14
|
+
"@nocobase/utils": "2.2.0-beta.18",
|
|
15
|
+
"@nocobase/flow-engine": "2.2.0-beta.18",
|
|
16
|
+
"@nocobase/client-v2": "2.2.0-beta.18",
|
|
17
|
+
"@nocobase/ai": "2.2.0-beta.18",
|
|
18
|
+
"@nocobase/server": "2.2.0-beta.18",
|
|
19
|
+
"@nocobase/data-source-manager": "2.2.0-beta.18",
|
|
20
20
|
"lodash": "4.18.1",
|
|
21
|
-
"@nocobase/acl": "2.2.0-beta.
|
|
22
|
-
"@nocobase/database": "2.2.0-beta.
|
|
21
|
+
"@nocobase/acl": "2.2.0-beta.18",
|
|
22
|
+
"@nocobase/database": "2.2.0-beta.18",
|
|
23
23
|
"@ant-design/icons": "5.6.1",
|
|
24
24
|
"antd": "5.24.2",
|
|
25
25
|
"react-router-dom": "6.30.1",
|
|
@@ -28,9 +28,9 @@ module.exports = {
|
|
|
28
28
|
"react-i18next": "11.18.6",
|
|
29
29
|
"@emotion/css": "11.13.0",
|
|
30
30
|
"ahooks": "3.7.8",
|
|
31
|
-
"@nocobase/actions": "2.2.0-beta.
|
|
31
|
+
"@nocobase/actions": "2.2.0-beta.18",
|
|
32
32
|
"sequelize": "6.35.2",
|
|
33
|
-
"@nocobase/test": "2.2.0-beta.
|
|
33
|
+
"@nocobase/test": "2.2.0-beta.18",
|
|
34
34
|
"@formily/antd-v5": "1.2.3",
|
|
35
35
|
"@formily/core": "2.3.7",
|
|
36
36
|
"@formily/reactive": "2.3.7",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-08-
|
|
1
|
+
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-08-20T12:47:03.401Z"}
|
|
@@ -47,10 +47,11 @@ async function loadDataSourceTablesIntoCollections(ctx, next) {
|
|
|
47
47
|
if (resourceName === "dataSources" && (actionName === "create" || actionName === "update")) {
|
|
48
48
|
const dataSourcesRepo = ctx.app.db.getRepository("dataSources");
|
|
49
49
|
const { options, type, collections, key } = params.values || {};
|
|
50
|
+
let model;
|
|
50
51
|
const dataSourceProvider = actionName === "update" ? {
|
|
51
52
|
get: async () => {
|
|
52
53
|
const { filterByTk } = params;
|
|
53
|
-
|
|
54
|
+
model = await dataSourcesRepo.findByTargetKey(filterByTk);
|
|
54
55
|
if (import_lodash.default.isEqual(model.get("options"), options)) {
|
|
55
56
|
return ctx.app.dataSourceManager.get(filterByTk);
|
|
56
57
|
} else {
|
|
@@ -78,6 +79,10 @@ async function loadDataSourceTablesIntoCollections(ctx, next) {
|
|
|
78
79
|
`The number of collections exceeds the limit of ${import_constants.ALLOW_MAX_COLLECTIONS_COUNT}. Please remove some collections before adding new ones.`
|
|
79
80
|
);
|
|
80
81
|
}
|
|
82
|
+
} else if (model && (collections == null ? void 0 : collections.length)) {
|
|
83
|
+
await dataSource.loadTables(ctx, collections, {
|
|
84
|
+
localData: await model.loadLocalData()
|
|
85
|
+
});
|
|
81
86
|
} else {
|
|
82
87
|
await dataSource.loadTables(ctx, collections);
|
|
83
88
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { ACL } from '@nocobase/acl';
|
|
10
10
|
import { Model, Transaction } from '@nocobase/database';
|
|
11
|
+
import { LoadedCollections } from '@nocobase/data-source-manager';
|
|
11
12
|
import { Application } from '@nocobase/server';
|
|
12
13
|
export declare class DataSourceModel extends Model {
|
|
13
14
|
isMainRecord(): boolean;
|
|
@@ -23,5 +24,5 @@ export declare class DataSourceModel extends Model {
|
|
|
23
24
|
refresh?: boolean;
|
|
24
25
|
reuseDB?: boolean;
|
|
25
26
|
}): Promise<void>;
|
|
26
|
-
|
|
27
|
+
loadLocalData(): Promise<LoadedCollections>;
|
|
27
28
|
}
|
|
@@ -166,16 +166,17 @@ class DataSourceModel extends import_database.Model {
|
|
|
166
166
|
for (const remoteField of remoteFields) {
|
|
167
167
|
const remoteFieldOptions = remoteField.toJSON();
|
|
168
168
|
const collectionName = remoteFieldOptions.collectionName;
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
let localCollection = localData[collectionName];
|
|
170
|
+
if (!localCollection) {
|
|
171
|
+
localCollection = {
|
|
171
172
|
name: collectionName,
|
|
172
173
|
fields: []
|
|
173
174
|
};
|
|
175
|
+
localData[collectionName] = localCollection;
|
|
174
176
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
localData[collectionName].fields.push(remoteFieldOptions);
|
|
177
|
+
const fields = localCollection.fields || [];
|
|
178
|
+
fields.push(remoteFieldOptions);
|
|
179
|
+
localCollection.fields = fields;
|
|
179
180
|
}
|
|
180
181
|
return localData;
|
|
181
182
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-source-manager",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.18",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "Data source manager",
|
|
6
6
|
"displayName.ru-RU": "Менеджер управления источниками данных",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"keywords": [
|
|
23
23
|
"Data model tools"
|
|
24
24
|
],
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "b74c962f7d35aa12012d908d16bd74fe6ac20a3d",
|
|
26
26
|
"license": "Apache-2.0"
|
|
27
27
|
}
|