@abtnode/core 1.16.27-beta-e0e33468 → 1.16.27-beta-91ff0d1b
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 +12 -6
- package/lib/event/index.js +8 -2
- package/lib/states/audit-log.js +6 -1
- package/package.json +21 -21
|
@@ -832,7 +832,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
-
async stop({ did, updateStatus = true, silent = false, componentDids }, context) {
|
|
835
|
+
async stop({ did, updateStatus = true, silent = false, componentDids, reason }, context) {
|
|
836
836
|
logger.info('stop blocklet', { did, componentDids, updateStatus, silent });
|
|
837
837
|
|
|
838
838
|
const blocklet = await this.getBlocklet(did);
|
|
@@ -895,11 +895,17 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
895
895
|
});
|
|
896
896
|
this.configSynchronizer.throttledSyncAppConfig(blocklet.meta.did);
|
|
897
897
|
|
|
898
|
+
let description = `${
|
|
899
|
+
componentDids?.length ? getComponentNamesWithVersion(blocklet, componentDids) : 'All components'
|
|
900
|
+
} is successfully stopped for ${blocklet.meta.title}.`;
|
|
901
|
+
|
|
902
|
+
if (reason === SUSPENDED_REASON.expired) {
|
|
903
|
+
description = `${description} Reason: The subscription has expired.`;
|
|
904
|
+
}
|
|
905
|
+
|
|
898
906
|
this._createNotification(did, {
|
|
899
907
|
title: 'Component stop succeed',
|
|
900
|
-
description
|
|
901
|
-
componentDids?.length ? getComponentNamesWithVersion(blocklet, componentDids) : 'All components'
|
|
902
|
-
} is successfully stopped for ${blocklet.meta.title}.`,
|
|
908
|
+
description,
|
|
903
909
|
entityType: 'blocklet',
|
|
904
910
|
entityId: did,
|
|
905
911
|
severity: 'success',
|
|
@@ -3609,7 +3615,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3609
3615
|
: BlockletEvents.componentUpgraded;
|
|
3610
3616
|
const actionName = action === INSTALL_ACTIONS.INSTALL_COMPONENT ? 'installed' : 'upgraded';
|
|
3611
3617
|
|
|
3612
|
-
this.emit(notificationEvent, { ...blocklet, componentDids, context });
|
|
3618
|
+
this.emit(notificationEvent, { ...blocklet, componentDids, oldBlocklet, context });
|
|
3613
3619
|
|
|
3614
3620
|
this._createNotification(did, {
|
|
3615
3621
|
title: `Component ${actionName} succeed`,
|
|
@@ -4055,7 +4061,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
4055
4061
|
// 如果 Blocklet 没停止, 先停止
|
|
4056
4062
|
const blocklet = await states.blocklet.getBlocklet(did);
|
|
4057
4063
|
if (blocklet.status !== BlockletStatus.stopped) {
|
|
4058
|
-
await this.stop({ did });
|
|
4064
|
+
await this.stop({ did, reason: SUSPENDED_REASON.expired });
|
|
4059
4065
|
logger.info('the expired blocklet is stopped', { did, blockletDid: did });
|
|
4060
4066
|
}
|
|
4061
4067
|
|
package/lib/event/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
TeamEvents,
|
|
13
13
|
BLOCKLET_CONFIGURABLE_KEY,
|
|
14
14
|
} = require('@blocklet/constant');
|
|
15
|
-
const { EVENTS, BACKUPS } = require('@abtnode/constant');
|
|
15
|
+
const { EVENTS, BACKUPS, NODE_MODES } = require('@abtnode/constant');
|
|
16
16
|
|
|
17
17
|
const { NodeMonitSender } = require('../monitor/node-monit-sender');
|
|
18
18
|
const handleInstanceInStore = require('../util/public-to-store');
|
|
@@ -123,13 +123,19 @@ module.exports = ({
|
|
|
123
123
|
// Emit events to node listener
|
|
124
124
|
// Call eventHandler
|
|
125
125
|
// NOT emit events to event hub
|
|
126
|
-
const onInternalEvent = (name, data) => {
|
|
126
|
+
const onInternalEvent = async (name, data) => {
|
|
127
127
|
events.emit(name, data);
|
|
128
128
|
if (typeof eventHandler === 'function') {
|
|
129
129
|
eventHandler({ name, data });
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
if (name === EVENTS.NODE_RUNTIME_INFO) {
|
|
133
|
+
const info = await node.getNodeInfo();
|
|
134
|
+
|
|
135
|
+
if (info.mode === NODE_MODES.SERVERLESS) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
133
139
|
nodeMonitSender.sendToWallet(data);
|
|
134
140
|
}
|
|
135
141
|
};
|
package/lib/states/audit-log.js
CHANGED
|
@@ -132,7 +132,12 @@ const getLogContent = async (action, args, context, result, info, node) => {
|
|
|
132
132
|
result.componentDids
|
|
133
133
|
)}**${errMsg}`;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
const newVersions = getComponentNamesWithVersion(result, result.componentDids);
|
|
136
|
+
if (result.oldBlocklet) {
|
|
137
|
+
const oldVersions = getComponentNamesWithVersion(result.oldBlocklet, result.componentDids);
|
|
138
|
+
return `${actionName} component: **${newVersions}** from **${oldVersions}**`;
|
|
139
|
+
}
|
|
140
|
+
return `${actionName} component: **${newVersions}**`;
|
|
136
141
|
case 'deleteComponent':
|
|
137
142
|
return `removed ${result.deletedComponent.meta.title}@${result.deletedComponent.meta.version} ${args.keepData !== false ? 'but kept its data and config' : 'and its data and config'}`; // prettier-ignore
|
|
138
143
|
case 'configBlocklet':
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.27-beta-
|
|
6
|
+
"version": "1.16.27-beta-91ff0d1b",
|
|
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.27-beta-
|
|
23
|
-
"@abtnode/auth": "1.16.27-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.27-beta-
|
|
25
|
-
"@abtnode/constant": "1.16.27-beta-
|
|
26
|
-
"@abtnode/cron": "1.16.27-beta-
|
|
27
|
-
"@abtnode/logger": "1.16.27-beta-
|
|
28
|
-
"@abtnode/models": "1.16.27-beta-
|
|
29
|
-
"@abtnode/queue": "1.16.27-beta-
|
|
30
|
-
"@abtnode/rbac": "1.16.27-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.16.27-beta-
|
|
32
|
-
"@abtnode/static-server": "1.16.27-beta-
|
|
33
|
-
"@abtnode/timemachine": "1.16.27-beta-
|
|
34
|
-
"@abtnode/util": "1.16.27-beta-
|
|
22
|
+
"@abtnode/analytics": "1.16.27-beta-91ff0d1b",
|
|
23
|
+
"@abtnode/auth": "1.16.27-beta-91ff0d1b",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.27-beta-91ff0d1b",
|
|
25
|
+
"@abtnode/constant": "1.16.27-beta-91ff0d1b",
|
|
26
|
+
"@abtnode/cron": "1.16.27-beta-91ff0d1b",
|
|
27
|
+
"@abtnode/logger": "1.16.27-beta-91ff0d1b",
|
|
28
|
+
"@abtnode/models": "1.16.27-beta-91ff0d1b",
|
|
29
|
+
"@abtnode/queue": "1.16.27-beta-91ff0d1b",
|
|
30
|
+
"@abtnode/rbac": "1.16.27-beta-91ff0d1b",
|
|
31
|
+
"@abtnode/router-provider": "1.16.27-beta-91ff0d1b",
|
|
32
|
+
"@abtnode/static-server": "1.16.27-beta-91ff0d1b",
|
|
33
|
+
"@abtnode/timemachine": "1.16.27-beta-91ff0d1b",
|
|
34
|
+
"@abtnode/util": "1.16.27-beta-91ff0d1b",
|
|
35
35
|
"@arcblock/did": "1.18.115",
|
|
36
36
|
"@arcblock/did-auth": "1.18.115",
|
|
37
37
|
"@arcblock/did-ext": "^1.18.115",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"@arcblock/pm2-events": "^0.0.5",
|
|
43
43
|
"@arcblock/validator": "^1.18.115",
|
|
44
44
|
"@arcblock/vc": "1.18.115",
|
|
45
|
-
"@blocklet/constant": "1.16.27-beta-
|
|
46
|
-
"@blocklet/env": "1.16.27-beta-
|
|
47
|
-
"@blocklet/meta": "1.16.27-beta-
|
|
48
|
-
"@blocklet/resolver": "1.16.27-beta-
|
|
49
|
-
"@blocklet/sdk": "1.16.27-beta-
|
|
50
|
-
"@blocklet/store": "1.16.27-beta-
|
|
45
|
+
"@blocklet/constant": "1.16.27-beta-91ff0d1b",
|
|
46
|
+
"@blocklet/env": "1.16.27-beta-91ff0d1b",
|
|
47
|
+
"@blocklet/meta": "1.16.27-beta-91ff0d1b",
|
|
48
|
+
"@blocklet/resolver": "1.16.27-beta-91ff0d1b",
|
|
49
|
+
"@blocklet/sdk": "1.16.27-beta-91ff0d1b",
|
|
50
|
+
"@blocklet/store": "1.16.27-beta-91ff0d1b",
|
|
51
51
|
"@did-space/client": "^0.4.3",
|
|
52
52
|
"@fidm/x509": "^1.2.1",
|
|
53
53
|
"@ocap/mcrypto": "1.18.115",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"jest": "^29.7.0",
|
|
104
104
|
"unzipper": "^0.10.11"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "5c8d1719acb88ae62298293030860c79b0124692"
|
|
107
107
|
}
|