@abtnode/core 1.16.29-beta-112566d5 → 1.16.29-beta-1fedbcdd
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 +25 -33
- package/lib/event/index.js +1 -5
- package/lib/states/user.js +1 -0
- package/package.json +22 -22
|
@@ -898,11 +898,6 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
898
898
|
? componentDids.map((x) => ({ did: x }))
|
|
899
899
|
: blocklet.children.map((x) => ({ did: x.meta.did })),
|
|
900
900
|
});
|
|
901
|
-
// for backward compatibility
|
|
902
|
-
this.emit(BlockletInternalEvents.componentsUpdated, {
|
|
903
|
-
appDid: blocklet.appDid,
|
|
904
|
-
components: getComponentsInternalInfo(res),
|
|
905
|
-
});
|
|
906
901
|
this.configSynchronizer.throttledSyncAppConfig(blocklet.meta.did);
|
|
907
902
|
|
|
908
903
|
let description = `${
|
|
@@ -1265,11 +1260,6 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
1265
1260
|
appDid: app.appDid,
|
|
1266
1261
|
components: [{ did: child.meta.did }],
|
|
1267
1262
|
});
|
|
1268
|
-
// for backward compatibility
|
|
1269
|
-
this.emit(BlockletInternalEvents.componentsUpdated, {
|
|
1270
|
-
appDid: app.appDid,
|
|
1271
|
-
components: getComponentsInternalInfo(newBlocklet),
|
|
1272
|
-
});
|
|
1273
1263
|
this.configSynchronizer.throttledSyncAppConfig(app.meta.did);
|
|
1274
1264
|
|
|
1275
1265
|
return { ...newBlocklet, deletedComponent: child };
|
|
@@ -1349,17 +1339,31 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
1349
1339
|
}
|
|
1350
1340
|
}
|
|
1351
1341
|
|
|
1352
|
-
|
|
1353
|
-
|
|
1342
|
+
/**
|
|
1343
|
+
*
|
|
1344
|
+
* @param {object} param - params
|
|
1345
|
+
* @param {string} param.did - blocklet did
|
|
1346
|
+
* @param {string[]} param.componentDids - component dids
|
|
1347
|
+
* @param {boolean} param.shouldUpdateBlockletStatus - should update blocklet status
|
|
1348
|
+
* @param {*} context
|
|
1349
|
+
* @returns
|
|
1350
|
+
*/
|
|
1351
|
+
async deleteProcess({ did, componentDids, shouldUpdateBlockletStatus = true }, context) {
|
|
1354
1352
|
const blocklet = await this.getBlocklet(did);
|
|
1355
1353
|
|
|
1356
1354
|
logger.info('delete blocklet process', { did, componentDids });
|
|
1357
1355
|
|
|
1358
1356
|
await deleteBlockletProcess(blocklet, { ...context, componentDids });
|
|
1359
|
-
|
|
1360
|
-
const result = await states.blocklet.setBlockletStatus(did, BlockletStatus.stopped, { componentDids });
|
|
1361
1357
|
logger.info('blocklet process deleted successfully', { did, componentDids });
|
|
1362
|
-
|
|
1358
|
+
|
|
1359
|
+
// 有些情况不需要更新 blocklet 状态, 比如下载完成,安装之前清理 process 时, 不需要更新 blocklet 状态
|
|
1360
|
+
if (shouldUpdateBlockletStatus) {
|
|
1361
|
+
const result = await states.blocklet.setBlockletStatus(did, BlockletStatus.stopped, { componentDids });
|
|
1362
|
+
logger.info('blocklet status updated to stopped after deleted processes', { did, componentDids });
|
|
1363
|
+
return result;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
return blocklet;
|
|
1363
1367
|
}
|
|
1364
1368
|
|
|
1365
1369
|
// Get blocklet by blockletDid or appDid
|
|
@@ -1566,7 +1570,6 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
1566
1570
|
this.configSynchronizer.throttledSyncAppConfig(blocklet.meta.did);
|
|
1567
1571
|
}
|
|
1568
1572
|
|
|
1569
|
-
this.emit(BlockletEvents.updated, { ...newState, context });
|
|
1570
1573
|
const serverSk = (await states.node.read()).sk;
|
|
1571
1574
|
if (childDid) {
|
|
1572
1575
|
const configs = JSON.stringify(finalConfigs.map((x) => ({ key: x.key, value: x.value })));
|
|
@@ -1579,6 +1582,8 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
1579
1582
|
this.configSynchronizer.syncComponentConfig(childDid, rootDid, { serverSk });
|
|
1580
1583
|
}
|
|
1581
1584
|
|
|
1585
|
+
this.emit(BlockletEvents.updated, { ...newState, context });
|
|
1586
|
+
|
|
1582
1587
|
try {
|
|
1583
1588
|
const observableConfigs = [
|
|
1584
1589
|
BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,
|
|
@@ -1853,11 +1858,6 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
1853
1858
|
appDid: blocklet.appDid,
|
|
1854
1859
|
components: getComponentsInternalInfo(blocklet).filter((x) => x.did === component.meta.did),
|
|
1855
1860
|
});
|
|
1856
|
-
// for backward compatibility
|
|
1857
|
-
this.emit(BlockletInternalEvents.componentsUpdated, {
|
|
1858
|
-
appDid: blocklet.appDid,
|
|
1859
|
-
components: getComponentsInternalInfo(blocklet),
|
|
1860
|
-
});
|
|
1861
1861
|
this.configSynchronizer.throttledSyncAppConfig(blocklet.meta.did);
|
|
1862
1862
|
|
|
1863
1863
|
return this.getBlocklet(rootDid);
|
|
@@ -2709,11 +2709,6 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
2709
2709
|
appDid: blocklet.appDid,
|
|
2710
2710
|
components: (componentDids || []).map((x) => ({ did: x })),
|
|
2711
2711
|
});
|
|
2712
|
-
// for backward compatibility
|
|
2713
|
-
this.emit(BlockletInternalEvents.componentsUpdated, {
|
|
2714
|
-
appDid: blocklet.appDid,
|
|
2715
|
-
components: getComponentsInternalInfo(res),
|
|
2716
|
-
});
|
|
2717
2712
|
this.configSynchronizer.throttledSyncAppConfig(res);
|
|
2718
2713
|
|
|
2719
2714
|
this.emit(BlockletEvents.statusChange, res);
|
|
@@ -3259,7 +3254,9 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3259
3254
|
return null;
|
|
3260
3255
|
}
|
|
3261
3256
|
|
|
3262
|
-
blocklet.site
|
|
3257
|
+
if (blocklet.site) {
|
|
3258
|
+
blocklet.site.domainAliases = await this.getDomainAliases(blocklet, context);
|
|
3259
|
+
}
|
|
3263
3260
|
|
|
3264
3261
|
// app runtime info, app status
|
|
3265
3262
|
blocklet.appRuntimeInfo = this.runtimeMonitor.getRuntimeInfo(blocklet.meta.did);
|
|
@@ -3449,7 +3446,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3449
3446
|
|
|
3450
3447
|
// ensure delete process
|
|
3451
3448
|
try {
|
|
3452
|
-
await this.deleteProcess({ did }, context);
|
|
3449
|
+
await this.deleteProcess({ did, shouldUpdateBlockletStatus: false }, context);
|
|
3453
3450
|
logger.info('ensure delete blocklet process for installing', { did, name: meta.name });
|
|
3454
3451
|
} catch (err) {
|
|
3455
3452
|
logger.error('ensure delete blocklet process failed for installing', { did, name: meta.name, error: err });
|
|
@@ -3747,11 +3744,6 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3747
3744
|
}
|
|
3748
3745
|
);
|
|
3749
3746
|
}
|
|
3750
|
-
// for backward compatibility
|
|
3751
|
-
this.emit(BlockletInternalEvents.componentsUpdated, {
|
|
3752
|
-
appDid: blocklet.appDid,
|
|
3753
|
-
components: getComponentsInternalInfo(blocklet),
|
|
3754
|
-
});
|
|
3755
3747
|
this.configSynchronizer.throttledSyncAppConfig(blocklet);
|
|
3756
3748
|
|
|
3757
3749
|
return blocklet;
|
package/lib/event/index.js
CHANGED
|
@@ -357,11 +357,7 @@ module.exports = ({
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
if (
|
|
361
|
-
[BlockletEvents.started, BlockletEvents.startFailed, BlockletEvents.stopped, BlockletEvents.reloaded].includes(
|
|
362
|
-
eventName
|
|
363
|
-
)
|
|
364
|
-
) {
|
|
360
|
+
if ([BlockletEvents.started, BlockletEvents.startFailed, BlockletEvents.stopped].includes(eventName)) {
|
|
365
361
|
try {
|
|
366
362
|
await blockletManager.runtimeMonitor.monit(blocklet.meta.did);
|
|
367
363
|
} catch (error) {
|
package/lib/states/user.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.29-beta-
|
|
6
|
+
"version": "1.16.29-beta-1fedbcdd",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,19 +19,19 @@
|
|
|
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.29-beta-
|
|
23
|
-
"@abtnode/auth": "1.16.29-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.29-beta-
|
|
25
|
-
"@abtnode/constant": "1.16.29-beta-
|
|
26
|
-
"@abtnode/cron": "1.16.29-beta-
|
|
27
|
-
"@abtnode/logger": "1.16.29-beta-
|
|
28
|
-
"@abtnode/models": "1.16.29-beta-
|
|
29
|
-
"@abtnode/queue": "1.16.29-beta-
|
|
30
|
-
"@abtnode/rbac": "1.16.29-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.16.29-beta-
|
|
32
|
-
"@abtnode/static-server": "1.16.29-beta-
|
|
33
|
-
"@abtnode/timemachine": "1.16.29-beta-
|
|
34
|
-
"@abtnode/util": "1.16.29-beta-
|
|
22
|
+
"@abtnode/analytics": "1.16.29-beta-1fedbcdd",
|
|
23
|
+
"@abtnode/auth": "1.16.29-beta-1fedbcdd",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.29-beta-1fedbcdd",
|
|
25
|
+
"@abtnode/constant": "1.16.29-beta-1fedbcdd",
|
|
26
|
+
"@abtnode/cron": "1.16.29-beta-1fedbcdd",
|
|
27
|
+
"@abtnode/logger": "1.16.29-beta-1fedbcdd",
|
|
28
|
+
"@abtnode/models": "1.16.29-beta-1fedbcdd",
|
|
29
|
+
"@abtnode/queue": "1.16.29-beta-1fedbcdd",
|
|
30
|
+
"@abtnode/rbac": "1.16.29-beta-1fedbcdd",
|
|
31
|
+
"@abtnode/router-provider": "1.16.29-beta-1fedbcdd",
|
|
32
|
+
"@abtnode/static-server": "1.16.29-beta-1fedbcdd",
|
|
33
|
+
"@abtnode/timemachine": "1.16.29-beta-1fedbcdd",
|
|
34
|
+
"@abtnode/util": "1.16.29-beta-1fedbcdd",
|
|
35
35
|
"@arcblock/did": "1.18.126",
|
|
36
36
|
"@arcblock/did-auth": "1.18.126",
|
|
37
37
|
"@arcblock/did-ext": "^1.18.126",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@arcblock/pm2-events": "^0.0.5",
|
|
43
43
|
"@arcblock/validator": "^1.18.126",
|
|
44
44
|
"@arcblock/vc": "1.18.126",
|
|
45
|
-
"@blocklet/constant": "1.16.29-beta-
|
|
46
|
-
"@blocklet/env": "1.16.29-beta-
|
|
47
|
-
"@blocklet/meta": "1.16.29-beta-
|
|
48
|
-
"@blocklet/resolver": "1.16.29-beta-
|
|
49
|
-
"@blocklet/sdk": "1.16.29-beta-
|
|
50
|
-
"@blocklet/store": "1.16.29-beta-
|
|
51
|
-
"@did-space/client": "^0.5.
|
|
45
|
+
"@blocklet/constant": "1.16.29-beta-1fedbcdd",
|
|
46
|
+
"@blocklet/env": "1.16.29-beta-1fedbcdd",
|
|
47
|
+
"@blocklet/meta": "1.16.29-beta-1fedbcdd",
|
|
48
|
+
"@blocklet/resolver": "1.16.29-beta-1fedbcdd",
|
|
49
|
+
"@blocklet/sdk": "1.16.29-beta-1fedbcdd",
|
|
50
|
+
"@blocklet/store": "1.16.29-beta-1fedbcdd",
|
|
51
|
+
"@did-space/client": "^0.5.7",
|
|
52
52
|
"@fidm/x509": "^1.2.1",
|
|
53
53
|
"@ocap/mcrypto": "1.18.126",
|
|
54
54
|
"@ocap/util": "1.18.126",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"jest": "^29.7.0",
|
|
104
104
|
"unzipper": "^0.10.11"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "e66e220d775e821c85b8bd6286342c202ad143f0"
|
|
107
107
|
}
|