@abtnode/core 1.7.13 → 1.7.14
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/index.js +1 -1
- package/lib/states/audit-log.js +7 -6
- package/lib/util/upgrade.js +1 -1
- package/package.json +14 -14
package/lib/index.js
CHANGED
|
@@ -426,7 +426,7 @@ function ABTNode(options) {
|
|
|
426
426
|
action,
|
|
427
427
|
args: {},
|
|
428
428
|
context: formatContext({
|
|
429
|
-
user: { fullName: 'CLI', role: '
|
|
429
|
+
user: { fullName: 'CLI', role: 'admin', did: options.nodeDid },
|
|
430
430
|
headers: { 'user-agent': 'CLI' },
|
|
431
431
|
}),
|
|
432
432
|
result: null,
|
package/lib/states/audit-log.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-async-promise-executor */
|
|
2
2
|
const pick = require('lodash/pick');
|
|
3
3
|
const get = require('lodash/get');
|
|
4
|
+
const joinUrl = require('url-join');
|
|
4
5
|
const { getDisplayName } = require('@blocklet/meta/lib/util');
|
|
5
6
|
const { BLOCKLET_SITE_GROUP_SUFFIX } = require('@abtnode/constant');
|
|
6
7
|
const logger = require('@abtnode/logger')('@abtnode/core:states:audit-log');
|
|
@@ -10,8 +11,8 @@ const BaseState = require('./base');
|
|
|
10
11
|
const { parse } = require('../util/ua');
|
|
11
12
|
const { lookup } = require('../util/ip');
|
|
12
13
|
|
|
13
|
-
const getServerInfo = (info) => `[${info.name}](${info.routing.adminPath
|
|
14
|
-
const getBlockletInfo = (blocklet, info) => `[${getDisplayName(blocklet)} v${blocklet.meta.version}](${info.routing.adminPath
|
|
14
|
+
const getServerInfo = (info) => `[${info.name}](${joinUrl(info.routing.adminPath, '/settings/about')})`;
|
|
15
|
+
const getBlockletInfo = (blocklet, info) => `[${getDisplayName(blocklet)} v${blocklet.meta.version}](${joinUrl(info.routing.adminPath, '/blocklets/', blocklet.meta.did, '/overview')})`; // prettier-ignore
|
|
15
16
|
const expandTeam = async (teamDid, info, node) => {
|
|
16
17
|
if (!teamDid) {
|
|
17
18
|
return '';
|
|
@@ -64,10 +65,10 @@ const expandUser = async (teamDid, userDid, passportId, info, node) => {
|
|
|
64
65
|
const passport = user.passports.find((x) => x.id === passportId);
|
|
65
66
|
|
|
66
67
|
if (teamDid === info.did) {
|
|
67
|
-
return [`[${user.fullName}](${info.routing.adminPath
|
|
68
|
+
return [`[${user.fullName}](${joinUrl(info.routing.adminPath, '/team/members')})`, passport ? passport.name : ''];
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
return [`[${user.fullName}](${info.routing.adminPath
|
|
71
|
+
return [`[${user.fullName}](${joinUrl(info.routing.adminPath, '/blocklets/', teamDid, '/members')})`, passport ? passport.name : '']; // prettier-ignore
|
|
71
72
|
};
|
|
72
73
|
|
|
73
74
|
/**
|
|
@@ -181,7 +182,7 @@ const getLogContent = async (action, args, context, result, info, node) => {
|
|
|
181
182
|
case 'updateNodeInfo':
|
|
182
183
|
return `updated basic server settings: \n${Object.keys(args).map(x => `- ${x}: ${args[x]}`).join('\n')}`; // prettier-ignore
|
|
183
184
|
case 'upgradeNodeVersion':
|
|
184
|
-
return `
|
|
185
|
+
return `upgrade server to ${info.nextVersion}`;
|
|
185
186
|
case 'startServer':
|
|
186
187
|
return 'server was started';
|
|
187
188
|
case 'stopServer':
|
|
@@ -329,7 +330,7 @@ class AuditLogState extends BaseState {
|
|
|
329
330
|
}
|
|
330
331
|
* @return {object} new doc
|
|
331
332
|
*/
|
|
332
|
-
create({ action, args, context, result }, node) {
|
|
333
|
+
create({ action, args = {}, context = {}, result = {} }, node) {
|
|
333
334
|
return new Promise(async (resolve) => {
|
|
334
335
|
// Do not store secure configs in audit log
|
|
335
336
|
if (Array.isArray(args.configs)) {
|
package/lib/util/upgrade.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.7.
|
|
6
|
+
"version": "1.7.14",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@abtnode/certificate-manager": "1.7.
|
|
23
|
-
"@abtnode/constant": "1.7.
|
|
24
|
-
"@abtnode/cron": "1.7.
|
|
25
|
-
"@abtnode/db": "1.7.
|
|
26
|
-
"@abtnode/logger": "1.7.
|
|
27
|
-
"@abtnode/queue": "1.7.
|
|
28
|
-
"@abtnode/rbac": "1.7.
|
|
29
|
-
"@abtnode/router-provider": "1.7.
|
|
30
|
-
"@abtnode/static-server": "1.7.
|
|
31
|
-
"@abtnode/timemachine": "1.7.
|
|
32
|
-
"@abtnode/util": "1.7.
|
|
22
|
+
"@abtnode/certificate-manager": "1.7.14",
|
|
23
|
+
"@abtnode/constant": "1.7.14",
|
|
24
|
+
"@abtnode/cron": "1.7.14",
|
|
25
|
+
"@abtnode/db": "1.7.14",
|
|
26
|
+
"@abtnode/logger": "1.7.14",
|
|
27
|
+
"@abtnode/queue": "1.7.14",
|
|
28
|
+
"@abtnode/rbac": "1.7.14",
|
|
29
|
+
"@abtnode/router-provider": "1.7.14",
|
|
30
|
+
"@abtnode/static-server": "1.7.14",
|
|
31
|
+
"@abtnode/timemachine": "1.7.14",
|
|
32
|
+
"@abtnode/util": "1.7.14",
|
|
33
33
|
"@arcblock/did": "^1.16.6",
|
|
34
34
|
"@arcblock/did-motif": "^1.1.5",
|
|
35
35
|
"@arcblock/event-hub": "1.16.6",
|
|
36
36
|
"@arcblock/pm2-events": "^0.0.5",
|
|
37
37
|
"@arcblock/vc": "^1.16.6",
|
|
38
|
-
"@blocklet/meta": "1.7.
|
|
38
|
+
"@blocklet/meta": "1.7.14",
|
|
39
39
|
"@fidm/x509": "^1.2.1",
|
|
40
40
|
"@nedb/core": "^1.2.2",
|
|
41
41
|
"@nedb/multi": "^1.2.2",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"express": "^4.17.1",
|
|
79
79
|
"jest": "^27.4.5"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "1f3855e6dc8b6d6c91526264e2f63215df6b962c"
|
|
82
82
|
}
|