@abtnode/core 1.8.41 → 1.8.43

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.
@@ -3471,6 +3471,10 @@ class BlockletManager extends BaseBlockletManager {
3471
3471
  tasks.push(this._downloadBundle(meta, did, url, context));
3472
3472
  }
3473
3473
  const results = await Promise.all(tasks);
3474
+
3475
+ // since preferences only exist in blocklet bundle, we need to populate then after downloaded
3476
+ await this._setConfigsFromMeta(did);
3477
+
3474
3478
  if (results.find((x) => x.isCancelled)) {
3475
3479
  return { isCancelled: true };
3476
3480
  }
package/lib/index.js CHANGED
@@ -244,6 +244,8 @@ function ABTNode(options) {
244
244
  isInitialized,
245
245
  resetNode: (params, context) =>
246
246
  resetNode({ params, context, blockletManager, routerManager, takeRoutingSnapshot, teamManager, certManager }),
247
+ updateNodeStatus: states.node.updateStatus.bind(states.node),
248
+ resetNodeStatus: states.node.resetStatus.bind(states.node),
247
249
 
248
250
  // Gateway
249
251
  updateGateway: nodeAPI.updateGateway.bind(nodeAPI),
@@ -5,7 +5,7 @@ const isEmpty = require('lodash/isEmpty');
5
5
  const security = require('@abtnode/util/lib/security');
6
6
  const { isFromPublicKey } = require('@arcblock/did');
7
7
  const logger = require('@abtnode/logger')('@abtnode/core:node');
8
- const { NODE_MODES, DISK_ALERT_THRESHOLD_PERCENT, EVENTS } = require('@abtnode/constant');
8
+ const { NODE_MODES, DISK_ALERT_THRESHOLD_PERCENT, EVENTS, SERVER_STATUS } = require('@abtnode/constant');
9
9
 
10
10
  const BaseState = require('./base');
11
11
  const { validateOwner } = require('../util');
@@ -316,6 +316,22 @@ class NodeState extends BaseState {
316
316
 
317
317
  return nodeInfo.routing;
318
318
  }
319
+
320
+ async updateStatus(status) {
321
+ if (!Object.values(SERVER_STATUS).includes(status)) {
322
+ throw new Error('status is invalid');
323
+ }
324
+
325
+ const record = await this.read();
326
+ await this.update(record._id, { $set: { status } });
327
+
328
+ record.status = status;
329
+ return record;
330
+ }
331
+
332
+ async resetStatus() {
333
+ return this.updateStatus(SERVER_STATUS.RUNNING);
334
+ }
319
335
  }
320
336
 
321
337
  module.exports = NodeState;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.8.41",
6
+ "version": "1.8.43",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,32 +19,32 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@abtnode/auth": "1.8.41",
23
- "@abtnode/certificate-manager": "1.8.41",
24
- "@abtnode/constant": "1.8.41",
25
- "@abtnode/cron": "1.8.41",
26
- "@abtnode/db": "1.8.41",
27
- "@abtnode/logger": "1.8.41",
28
- "@abtnode/queue": "1.8.41",
29
- "@abtnode/rbac": "1.8.41",
30
- "@abtnode/router-provider": "1.8.41",
31
- "@abtnode/static-server": "1.8.41",
32
- "@abtnode/timemachine": "1.8.41",
33
- "@abtnode/util": "1.8.41",
34
- "@arcblock/did": "1.18.26",
22
+ "@abtnode/auth": "1.8.43",
23
+ "@abtnode/certificate-manager": "1.8.43",
24
+ "@abtnode/constant": "1.8.43",
25
+ "@abtnode/cron": "1.8.43",
26
+ "@abtnode/db": "1.8.43",
27
+ "@abtnode/logger": "1.8.43",
28
+ "@abtnode/queue": "1.8.43",
29
+ "@abtnode/rbac": "1.8.43",
30
+ "@abtnode/router-provider": "1.8.43",
31
+ "@abtnode/static-server": "1.8.43",
32
+ "@abtnode/timemachine": "1.8.43",
33
+ "@abtnode/util": "1.8.43",
34
+ "@arcblock/did": "1.18.30",
35
35
  "@arcblock/did-motif": "^1.1.10",
36
- "@arcblock/did-util": "1.18.26",
37
- "@arcblock/event-hub": "1.18.26",
38
- "@arcblock/jwt": "^1.18.26",
36
+ "@arcblock/did-util": "1.18.30",
37
+ "@arcblock/event-hub": "1.18.30",
38
+ "@arcblock/jwt": "^1.18.30",
39
39
  "@arcblock/pm2-events": "^0.0.5",
40
- "@arcblock/vc": "1.18.26",
41
- "@blocklet/constant": "1.8.41",
42
- "@blocklet/meta": "1.8.41",
43
- "@blocklet/sdk": "1.8.41",
40
+ "@arcblock/vc": "1.18.30",
41
+ "@blocklet/constant": "1.8.43",
42
+ "@blocklet/meta": "1.8.43",
43
+ "@blocklet/sdk": "1.8.43",
44
44
  "@fidm/x509": "^1.2.1",
45
- "@ocap/mcrypto": "1.18.26",
46
- "@ocap/util": "1.18.26",
47
- "@ocap/wallet": "1.18.26",
45
+ "@ocap/mcrypto": "1.18.30",
46
+ "@ocap/util": "1.18.30",
47
+ "@ocap/wallet": "1.18.30",
48
48
  "@slack/webhook": "^5.0.4",
49
49
  "axios": "^0.27.2",
50
50
  "axon": "^2.0.3",
@@ -57,7 +57,7 @@
57
57
  "is-base64": "^1.1.0",
58
58
  "is-ip": "^3.1.0",
59
59
  "is-url": "^1.2.4",
60
- "joi": "17.6.3",
60
+ "joi": "17.7.0",
61
61
  "js-yaml": "^4.1.0",
62
62
  "lodash": "^4.17.21",
63
63
  "lru-cache": "^6.0.0",
@@ -82,5 +82,5 @@
82
82
  "express": "^4.18.2",
83
83
  "jest": "^27.5.1"
84
84
  },
85
- "gitHead": "bdc6b7c45ec5c59b83b2ef4ac088dc2eae9f4dea"
85
+ "gitHead": "5c6b7b09f6252a83523594aead6c722bf4ba0d0c"
86
86
  }