@abtnode/core 1.16.45-beta-20250630-233332-04c2bd6f → 1.16.45-beta-20250702-072658-6f6c82be
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/lib/blocklet/manager/disk.js +46 -15
- package/package.json +24 -24
|
@@ -5022,8 +5022,17 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
5022
5022
|
await updateBlockletDocument({
|
|
5023
5023
|
blocklet,
|
|
5024
5024
|
nodeInfo,
|
|
5025
|
-
})
|
|
5026
|
-
|
|
5025
|
+
})
|
|
5026
|
+
.then(() => {
|
|
5027
|
+
logger.info('updated blocklet dns document', { appPid: blocklet.appPid, appDid: blocklet.appDid });
|
|
5028
|
+
})
|
|
5029
|
+
.catch((err) => {
|
|
5030
|
+
logger.error('update blocklet dns document failed', {
|
|
5031
|
+
appPid: blocklet.appPid,
|
|
5032
|
+
appDid: blocklet.appDid,
|
|
5033
|
+
error: err,
|
|
5034
|
+
});
|
|
5035
|
+
});
|
|
5027
5036
|
}
|
|
5028
5037
|
|
|
5029
5038
|
async _updateDependents(did) {
|
|
@@ -5577,22 +5586,15 @@ class FederatedBlockletManager extends DiskBlockletManager {
|
|
|
5577
5586
|
}
|
|
5578
5587
|
|
|
5579
5588
|
/**
|
|
5580
|
-
*
|
|
5581
|
-
*
|
|
5582
|
-
*
|
|
5583
|
-
* @param {
|
|
5584
|
-
* @returns
|
|
5589
|
+
* 更新站点群其他站点的用户信息
|
|
5590
|
+
* @param {object} param
|
|
5591
|
+
* @param {string} param.teamDid master blocklet pid
|
|
5592
|
+
* @param {object} param.updated 更新后的用户信息
|
|
5593
|
+
* @returns {Promise<void>}
|
|
5585
5594
|
*/
|
|
5586
|
-
async
|
|
5595
|
+
async updateUserInfoAndSyncFederated({ teamDid, updated }) {
|
|
5587
5596
|
try {
|
|
5588
|
-
const existingUser = await this.teamAPI.getUser({ teamDid, user: { did: user.did } });
|
|
5589
|
-
if (!existingUser) {
|
|
5590
|
-
throw new Error('User not found');
|
|
5591
|
-
}
|
|
5592
|
-
const updateData = generateUserUpdateData(user, existingUser);
|
|
5593
|
-
const updated = await this.teamAPI.updateUser({ teamDid, user: updateData });
|
|
5594
5597
|
const { sourceAppPid } = updated;
|
|
5595
|
-
|
|
5596
5598
|
const blocklet = await this.getBlocklet(teamDid);
|
|
5597
5599
|
|
|
5598
5600
|
const masterSite = getFederatedMaster(blocklet);
|
|
@@ -5630,6 +5632,35 @@ class FederatedBlockletManager extends DiskBlockletManager {
|
|
|
5630
5632
|
},
|
|
5631
5633
|
});
|
|
5632
5634
|
}
|
|
5635
|
+
} catch (error) {
|
|
5636
|
+
logger.error('Failed to update user info and sync federated', {
|
|
5637
|
+
teamDid,
|
|
5638
|
+
sourceAppPid: updated.sourceAppPid,
|
|
5639
|
+
userDid: updated.did,
|
|
5640
|
+
error,
|
|
5641
|
+
});
|
|
5642
|
+
}
|
|
5643
|
+
}
|
|
5644
|
+
|
|
5645
|
+
/**
|
|
5646
|
+
* 调用来源有两种
|
|
5647
|
+
* 1. js-sdk: 调用时,会处理好 user.phone 与 user.metadata.phone 的同步,已经 user.metadata.location 与 user.address.city 的同步
|
|
5648
|
+
* 2. node-sdk: 需要处理 node-sdk 的调用时的数据同步
|
|
5649
|
+
* @param {*} param0
|
|
5650
|
+
* @returns
|
|
5651
|
+
*/
|
|
5652
|
+
async updateUserInfoAndSync({ teamDid, user }) {
|
|
5653
|
+
try {
|
|
5654
|
+
const existingUser = await this.teamAPI.getUser({ teamDid, user: { did: user.did } });
|
|
5655
|
+
if (!existingUser) {
|
|
5656
|
+
throw new Error('User not found');
|
|
5657
|
+
}
|
|
5658
|
+
const updateData = generateUserUpdateData(user, existingUser);
|
|
5659
|
+
const updated = await this.teamAPI.updateUser({ teamDid, user: updateData });
|
|
5660
|
+
|
|
5661
|
+
// 异步更新站点群其他站点的用户信息
|
|
5662
|
+
this.updateUserInfoAndSyncFederated({ teamDid, updated });
|
|
5663
|
+
|
|
5633
5664
|
return updated;
|
|
5634
5665
|
} catch (err) {
|
|
5635
5666
|
logger.error('user profile sync failed', { err });
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.45-beta-
|
|
6
|
+
"version": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,22 +19,22 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@abtnode/analytics": "1.16.45-beta-
|
|
23
|
-
"@abtnode/auth": "1.16.45-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.45-beta-
|
|
25
|
-
"@abtnode/client": "1.16.45-beta-
|
|
26
|
-
"@abtnode/constant": "1.16.45-beta-
|
|
27
|
-
"@abtnode/cron": "1.16.45-beta-
|
|
28
|
-
"@abtnode/db-cache": "1.16.45-beta-
|
|
29
|
-
"@abtnode/docker-utils": "1.16.45-beta-
|
|
30
|
-
"@abtnode/logger": "1.16.45-beta-
|
|
31
|
-
"@abtnode/models": "1.16.45-beta-
|
|
32
|
-
"@abtnode/queue": "1.16.45-beta-
|
|
33
|
-
"@abtnode/rbac": "1.16.45-beta-
|
|
34
|
-
"@abtnode/router-provider": "1.16.45-beta-
|
|
35
|
-
"@abtnode/static-server": "1.16.45-beta-
|
|
36
|
-
"@abtnode/timemachine": "1.16.45-beta-
|
|
37
|
-
"@abtnode/util": "1.16.45-beta-
|
|
22
|
+
"@abtnode/analytics": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
23
|
+
"@abtnode/auth": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
25
|
+
"@abtnode/client": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
26
|
+
"@abtnode/constant": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
27
|
+
"@abtnode/cron": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
28
|
+
"@abtnode/db-cache": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
29
|
+
"@abtnode/docker-utils": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
30
|
+
"@abtnode/logger": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
31
|
+
"@abtnode/models": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
32
|
+
"@abtnode/queue": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
33
|
+
"@abtnode/rbac": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
34
|
+
"@abtnode/router-provider": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
35
|
+
"@abtnode/static-server": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
36
|
+
"@abtnode/timemachine": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
37
|
+
"@abtnode/util": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
38
38
|
"@arcblock/did": "1.20.14",
|
|
39
39
|
"@arcblock/did-auth": "1.20.14",
|
|
40
40
|
"@arcblock/did-ext": "1.20.14",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"@arcblock/pm2-events": "^0.0.5",
|
|
46
46
|
"@arcblock/validator": "1.20.14",
|
|
47
47
|
"@arcblock/vc": "1.20.14",
|
|
48
|
-
"@blocklet/constant": "1.16.45-beta-
|
|
48
|
+
"@blocklet/constant": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
49
49
|
"@blocklet/did-space-js": "^1.0.62",
|
|
50
|
-
"@blocklet/env": "1.16.45-beta-
|
|
50
|
+
"@blocklet/env": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
51
51
|
"@blocklet/error": "^0.2.5",
|
|
52
|
-
"@blocklet/meta": "1.16.45-beta-
|
|
53
|
-
"@blocklet/resolver": "1.16.45-beta-
|
|
54
|
-
"@blocklet/sdk": "1.16.45-beta-
|
|
55
|
-
"@blocklet/store": "1.16.45-beta-
|
|
52
|
+
"@blocklet/meta": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
53
|
+
"@blocklet/resolver": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
54
|
+
"@blocklet/sdk": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
55
|
+
"@blocklet/store": "1.16.45-beta-20250702-072658-6f6c82be",
|
|
56
56
|
"@blocklet/theme": "^2.13.70",
|
|
57
57
|
"@fidm/x509": "^1.2.1",
|
|
58
58
|
"@ocap/mcrypto": "1.20.14",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"jest": "^29.7.0",
|
|
117
117
|
"unzipper": "^0.10.11"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "e2b7203766cce76f547833530ac0eb463752162c"
|
|
120
120
|
}
|