@abtnode/core 1.16.17-beta-952ef53d → 1.16.17-beta-d81014f4
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/api/team.js +46 -19
- package/lib/blocklet/manager/helper/install-component-from-dev.js +1 -1
- package/lib/blocklet/manager/helper/install-component-from-url.js +1 -1
- package/lib/blocklet/manager/helper/upgrade-components.js +1 -0
- package/lib/router/helper.js +10 -1
- package/package.json +32 -32
package/lib/api/team.js
CHANGED
|
@@ -1376,7 +1376,7 @@ class TeamAPI extends EventEmitter {
|
|
|
1376
1376
|
|
|
1377
1377
|
const userSessions = await state.model.findAll({
|
|
1378
1378
|
where,
|
|
1379
|
-
attributes: ['id', 'appPid', 'userDid', 'visitorId', 'passportId'],
|
|
1379
|
+
attributes: ['id', 'appPid', 'userDid', 'visitorId', 'passportId', 'updatedAt'],
|
|
1380
1380
|
include: {
|
|
1381
1381
|
model: userState.model,
|
|
1382
1382
|
as: 'user',
|
|
@@ -1424,10 +1424,12 @@ class TeamAPI extends EventEmitter {
|
|
|
1424
1424
|
appPid,
|
|
1425
1425
|
passportId,
|
|
1426
1426
|
});
|
|
1427
|
+
logger.info('insert userSession successfully', { userDid, ua, lastLoginIp, appPid, passportId });
|
|
1427
1428
|
} else {
|
|
1428
1429
|
const exist = await state.findOne({ userDid, visitorId, appPid });
|
|
1429
1430
|
if (exist) {
|
|
1430
1431
|
[, [data]] = await state.update(exist.id, { ua, lastLoginIp, passportId, status });
|
|
1432
|
+
logger.info('update userSession successfully', { id: exist.id, ua, lastLoginIp, passportId, status });
|
|
1431
1433
|
} else {
|
|
1432
1434
|
data = await state.insert({
|
|
1433
1435
|
visitorId,
|
|
@@ -1437,6 +1439,7 @@ class TeamAPI extends EventEmitter {
|
|
|
1437
1439
|
appPid,
|
|
1438
1440
|
passportId,
|
|
1439
1441
|
});
|
|
1442
|
+
logger.info('insert userSession successfully', { visitorId, userDid, ua, lastLoginIp, appPid, passportId });
|
|
1440
1443
|
}
|
|
1441
1444
|
}
|
|
1442
1445
|
|
|
@@ -1450,24 +1453,48 @@ class TeamAPI extends EventEmitter {
|
|
|
1450
1453
|
});
|
|
1451
1454
|
const masterSite = federated.sites[0];
|
|
1452
1455
|
if (masterSite && masterSite.isMaster !== false && masterSite.appPid === sourceAppPid) {
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1456
|
+
try {
|
|
1457
|
+
await callFederated({
|
|
1458
|
+
action: 'sync',
|
|
1459
|
+
permanentWallet,
|
|
1460
|
+
site: masterSite,
|
|
1461
|
+
data: {
|
|
1462
|
+
userSessions: [
|
|
1463
|
+
{
|
|
1464
|
+
action: 'login',
|
|
1465
|
+
userDid,
|
|
1466
|
+
visitorId: data.visitorId,
|
|
1467
|
+
ua,
|
|
1468
|
+
lastLoginIp,
|
|
1469
|
+
appPid: teamDid,
|
|
1470
|
+
passportId,
|
|
1471
|
+
},
|
|
1472
|
+
],
|
|
1473
|
+
},
|
|
1474
|
+
});
|
|
1475
|
+
logger.info('sync userSession to federated site successfully', {
|
|
1476
|
+
userDid,
|
|
1477
|
+
visitorId: data.visitorId,
|
|
1478
|
+
ua,
|
|
1479
|
+
lastLoginIp,
|
|
1480
|
+
appPid: teamDid,
|
|
1481
|
+
passportId,
|
|
1482
|
+
});
|
|
1483
|
+
} catch (err) {
|
|
1484
|
+
logger.info(
|
|
1485
|
+
'sync userSession to federated site failed',
|
|
1486
|
+
{
|
|
1487
|
+
userDid,
|
|
1488
|
+
visitorId: data.visitorId,
|
|
1489
|
+
ua,
|
|
1490
|
+
lastLoginIp,
|
|
1491
|
+
appPid: teamDid,
|
|
1492
|
+
passportId,
|
|
1493
|
+
},
|
|
1494
|
+
err
|
|
1495
|
+
);
|
|
1496
|
+
throw err;
|
|
1497
|
+
}
|
|
1471
1498
|
}
|
|
1472
1499
|
}
|
|
1473
1500
|
|
|
@@ -36,7 +36,7 @@ const installComponentFromDev = async ({ folder, meta, rootDid, mountPoint, mana
|
|
|
36
36
|
await manager.deleteComponent({ did, rootDid });
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
let defaultPath = formatName(meta.name);
|
|
39
|
+
let defaultPath = formatName(meta.title) || formatName(meta.name);
|
|
40
40
|
if (!existRoot.children.map((x) => x.mountPoint).includes('/')) {
|
|
41
41
|
defaultPath = '';
|
|
42
42
|
}
|
|
@@ -86,7 +86,7 @@ const installComponentFromUrl = async ({
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
if (hasStartEngine(newChildMeta)) {
|
|
89
|
-
newChild.mountPoint = mountPoint || formatName(newChildMeta.name);
|
|
89
|
+
newChild.mountPoint = mountPoint || formatName(newChildMeta.title) || formatName(newChildMeta.name);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const { dynamicComponents } = await parseComponents(newChild);
|
|
@@ -111,6 +111,7 @@ const upgrade = async ({ updateId, componentDids, context, states, manager }) =>
|
|
|
111
111
|
|
|
112
112
|
logger.info('blocklet components to upgrade', {
|
|
113
113
|
did,
|
|
114
|
+
componentDids,
|
|
114
115
|
children: children.map((x) => ({ name: x.meta.name, version: x.meta.version })),
|
|
115
116
|
});
|
|
116
117
|
|
package/lib/router/helper.js
CHANGED
|
@@ -11,7 +11,13 @@ const cloneDeep = require('lodash/cloneDeep');
|
|
|
11
11
|
const groupBy = require('lodash/groupBy');
|
|
12
12
|
const isEqual = require('lodash/isEqual');
|
|
13
13
|
const joinUrl = require('url-join');
|
|
14
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
replaceSlotToIp,
|
|
16
|
+
findComponentById,
|
|
17
|
+
findWebInterface,
|
|
18
|
+
getComponentId,
|
|
19
|
+
hasStartEngine,
|
|
20
|
+
} = require('@blocklet/meta/lib/util');
|
|
15
21
|
const { getProvider } = require('@abtnode/router-provider');
|
|
16
22
|
const normalizePathPrefix = require('@abtnode/util/lib/normalize-path-prefix');
|
|
17
23
|
const getTmpDir = require('@abtnode/util/lib/get-tmp-directory');
|
|
@@ -551,6 +557,9 @@ const expandComponentRules = (sites = [], blocklets) => {
|
|
|
551
557
|
|
|
552
558
|
site.rules.filter(isComponentRule).forEach((baseRule) => {
|
|
553
559
|
components.forEach((x) => {
|
|
560
|
+
if (!hasStartEngine(x.meta)) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
554
563
|
const newRule = {
|
|
555
564
|
id: UUID.v4(),
|
|
556
565
|
groupId: baseRule.groupId,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.17-beta-
|
|
6
|
+
"version": "1.16.17-beta-d81014f4",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,39 +19,39 @@
|
|
|
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.17-beta-
|
|
23
|
-
"@abtnode/auth": "1.16.17-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.17-beta-
|
|
25
|
-
"@abtnode/constant": "1.16.17-beta-
|
|
26
|
-
"@abtnode/cron": "1.16.17-beta-
|
|
27
|
-
"@abtnode/logger": "1.16.17-beta-
|
|
28
|
-
"@abtnode/models": "1.16.17-beta-
|
|
29
|
-
"@abtnode/queue": "1.16.17-beta-
|
|
30
|
-
"@abtnode/rbac": "1.16.17-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.16.17-beta-
|
|
32
|
-
"@abtnode/static-server": "1.16.17-beta-
|
|
33
|
-
"@abtnode/timemachine": "1.16.17-beta-
|
|
34
|
-
"@abtnode/util": "1.16.17-beta-
|
|
35
|
-
"@arcblock/did": "1.18.
|
|
36
|
-
"@arcblock/did-auth": "1.18.
|
|
37
|
-
"@arcblock/did-ext": "^1.18.
|
|
22
|
+
"@abtnode/analytics": "1.16.17-beta-d81014f4",
|
|
23
|
+
"@abtnode/auth": "1.16.17-beta-d81014f4",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.17-beta-d81014f4",
|
|
25
|
+
"@abtnode/constant": "1.16.17-beta-d81014f4",
|
|
26
|
+
"@abtnode/cron": "1.16.17-beta-d81014f4",
|
|
27
|
+
"@abtnode/logger": "1.16.17-beta-d81014f4",
|
|
28
|
+
"@abtnode/models": "1.16.17-beta-d81014f4",
|
|
29
|
+
"@abtnode/queue": "1.16.17-beta-d81014f4",
|
|
30
|
+
"@abtnode/rbac": "1.16.17-beta-d81014f4",
|
|
31
|
+
"@abtnode/router-provider": "1.16.17-beta-d81014f4",
|
|
32
|
+
"@abtnode/static-server": "1.16.17-beta-d81014f4",
|
|
33
|
+
"@abtnode/timemachine": "1.16.17-beta-d81014f4",
|
|
34
|
+
"@abtnode/util": "1.16.17-beta-d81014f4",
|
|
35
|
+
"@arcblock/did": "1.18.93",
|
|
36
|
+
"@arcblock/did-auth": "1.18.93",
|
|
37
|
+
"@arcblock/did-ext": "^1.18.93",
|
|
38
38
|
"@arcblock/did-motif": "^1.1.13",
|
|
39
|
-
"@arcblock/did-util": "1.18.
|
|
40
|
-
"@arcblock/event-hub": "1.18.
|
|
41
|
-
"@arcblock/jwt": "^1.18.
|
|
39
|
+
"@arcblock/did-util": "1.18.93",
|
|
40
|
+
"@arcblock/event-hub": "1.18.93",
|
|
41
|
+
"@arcblock/jwt": "^1.18.93",
|
|
42
42
|
"@arcblock/pm2-events": "^0.0.5",
|
|
43
|
-
"@arcblock/validator": "^1.18.
|
|
44
|
-
"@arcblock/vc": "1.18.
|
|
45
|
-
"@blocklet/constant": "1.16.17-beta-
|
|
46
|
-
"@blocklet/env": "1.16.17-beta-
|
|
47
|
-
"@blocklet/meta": "1.16.17-beta-
|
|
48
|
-
"@blocklet/resolver": "1.16.17-beta-
|
|
49
|
-
"@blocklet/sdk": "1.16.17-beta-
|
|
50
|
-
"@did-space/client": "^0.3.
|
|
43
|
+
"@arcblock/validator": "^1.18.93",
|
|
44
|
+
"@arcblock/vc": "1.18.93",
|
|
45
|
+
"@blocklet/constant": "1.16.17-beta-d81014f4",
|
|
46
|
+
"@blocklet/env": "1.16.17-beta-d81014f4",
|
|
47
|
+
"@blocklet/meta": "1.16.17-beta-d81014f4",
|
|
48
|
+
"@blocklet/resolver": "1.16.17-beta-d81014f4",
|
|
49
|
+
"@blocklet/sdk": "1.16.17-beta-d81014f4",
|
|
50
|
+
"@did-space/client": "^0.3.12",
|
|
51
51
|
"@fidm/x509": "^1.2.1",
|
|
52
|
-
"@ocap/mcrypto": "1.18.
|
|
53
|
-
"@ocap/util": "1.18.
|
|
54
|
-
"@ocap/wallet": "1.18.
|
|
52
|
+
"@ocap/mcrypto": "1.18.93",
|
|
53
|
+
"@ocap/util": "1.18.93",
|
|
54
|
+
"@ocap/wallet": "1.18.93",
|
|
55
55
|
"@slack/webhook": "^5.0.4",
|
|
56
56
|
"archiver": "^5.3.1",
|
|
57
57
|
"axios": "^0.27.2",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"jest": "^27.5.1",
|
|
102
102
|
"unzipper": "^0.10.11"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "0317f39a400a7ee4475e09e9154de5d8f8227b50"
|
|
105
105
|
}
|