@nocobase/plugin-user-data-sync 2.2.0-beta.9 → 2.3.0-alpha.1
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
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"@formily/react": "2.3.7",
|
|
13
|
-
"@nocobase/client": "2.
|
|
13
|
+
"@nocobase/client": "2.3.0-alpha.1",
|
|
14
14
|
"@ant-design/icons": "5.6.1",
|
|
15
15
|
"@formily/core": "2.3.7",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
|
-
"@nocobase/utils": "2.
|
|
18
|
-
"@nocobase/flow-engine": "2.
|
|
17
|
+
"@nocobase/utils": "2.3.0-alpha.1",
|
|
18
|
+
"@nocobase/flow-engine": "2.3.0-alpha.1",
|
|
19
19
|
"react-i18next": "11.18.6",
|
|
20
|
-
"@nocobase/client-v2": "2.
|
|
21
|
-
"@nocobase/server": "2.
|
|
22
|
-
"@nocobase/logger": "2.
|
|
23
|
-
"@nocobase/actions": "2.
|
|
20
|
+
"@nocobase/client-v2": "2.3.0-alpha.1",
|
|
21
|
+
"@nocobase/server": "2.3.0-alpha.1",
|
|
22
|
+
"@nocobase/logger": "2.3.0-alpha.1",
|
|
23
|
+
"@nocobase/actions": "2.3.0-alpha.1",
|
|
24
24
|
"dayjs": "1.11.13",
|
|
25
|
-
"@nocobase/database": "2.
|
|
25
|
+
"@nocobase/database": "2.3.0-alpha.1",
|
|
26
26
|
"ahooks": "3.7.8"
|
|
27
27
|
};
|
|
@@ -89,10 +89,10 @@ export declare class UserDataResourceManager {
|
|
|
89
89
|
registerResource(resource: UserDataResource, options?: ToposortOptions): void;
|
|
90
90
|
set db(value: Database);
|
|
91
91
|
saveOriginRecords(data: UserData): Promise<void>;
|
|
92
|
-
findOriginRecords({ sourceName, dataType, sourceUks }: {
|
|
93
|
-
sourceName:
|
|
94
|
-
dataType:
|
|
95
|
-
sourceUks:
|
|
92
|
+
findOriginRecords({ sourceName, dataType, sourceUks, }: {
|
|
93
|
+
sourceName: string;
|
|
94
|
+
dataType: SyncDataType;
|
|
95
|
+
sourceUks: string[];
|
|
96
96
|
}): Promise<OriginRecord[]>;
|
|
97
97
|
addResourceToOriginRecord({ recordId, resource, resourcePk }: {
|
|
98
98
|
recordId: any;
|
|
@@ -93,11 +93,24 @@ class UserDataResourceManager {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
async findOriginRecords({
|
|
97
|
-
|
|
96
|
+
async findOriginRecords({
|
|
97
|
+
sourceName,
|
|
98
|
+
dataType,
|
|
99
|
+
sourceUks
|
|
100
|
+
}) {
|
|
101
|
+
const originRecords = await this.syncRecordRepo.find({
|
|
98
102
|
appends: ["resources"],
|
|
99
103
|
filter: { sourceName, dataType, sourceUk: { $in: sourceUks } }
|
|
100
104
|
});
|
|
105
|
+
const sourceUkOrder = /* @__PURE__ */ new Map();
|
|
106
|
+
sourceUks.forEach((sourceUk, index) => {
|
|
107
|
+
if (!sourceUkOrder.has(sourceUk)) {
|
|
108
|
+
sourceUkOrder.set(sourceUk, index);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return originRecords.sort((a, b) => {
|
|
112
|
+
return (sourceUkOrder.get(a.sourceUk) ?? Number.MAX_SAFE_INTEGER) - (sourceUkOrder.get(b.sourceUk) ?? Number.MAX_SAFE_INTEGER);
|
|
113
|
+
});
|
|
101
114
|
}
|
|
102
115
|
async addResourceToOriginRecord({ recordId, resource, resourcePk }) {
|
|
103
116
|
const syncRecord = await this.syncRecordRepo.findOne({
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Reigster and manage extensible user data synchronization sources, with HTTP API provided by default. Support for synchronizing data to resources such as users and departments.",
|
|
7
7
|
"description.ru-RU": "Регистрация и управление расширяемыми источниками синхронизации данных пользователей, по умолчанию предоставляется HTTP API. Поддержка синхронизации данных для таких ресурсов, как пользователи и департаменты.",
|
|
8
8
|
"description.zh-CN": "注册和管理可扩展的用户数据同步来源,默认提供 HTTP API。支持向用户和部门等资源同步数据。",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.3.0-alpha.1",
|
|
10
10
|
"main": "dist/server/index.js",
|
|
11
11
|
"peerDependencies": {
|
|
12
12
|
"@nocobase/client": "2.x",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"Users & permissions"
|
|
19
19
|
],
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "2377df8ceb12549149017f7f14a61207bf6e49a2"
|
|
22
22
|
}
|