@abtnode/core 1.5.21 → 1.6.3

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/node.js CHANGED
@@ -114,7 +114,7 @@ class NodeAPI {
114
114
  const info = await this.state.read();
115
115
  const env = await this.state.getEnvironments();
116
116
  info.environments = Object.keys(env).map((x) => ({ key: x, value: env[x] }));
117
- info.uptime = +new Date() - process.uptime() * 1000;
117
+ info.uptime = process.uptime() * 1000;
118
118
 
119
119
  return info;
120
120
  }
@@ -3,7 +3,7 @@ const { BlockletGroup } = require('@blocklet/meta/lib/constants');
3
3
  const joinURL = require('url-join');
4
4
  const get = require('lodash/get');
5
5
  const pick = require('lodash/pick');
6
- const { BLOCKLET_STORE_API_PREFIX } = require('@abtnode/constant');
6
+ const { BLOCKLET_STORE_API_PREFIX, BLOCKLET_STORE_META_PATH } = require('@abtnode/constant');
7
7
 
8
8
  const { name } = require('../../package.json');
9
9
 
@@ -170,7 +170,7 @@ BlockletRegistry.validateRegistryURL = async (registry) => {
170
170
 
171
171
  BlockletRegistry.getRegistryMeta = async (registry) => {
172
172
  try {
173
- const url = joinURL(registry, BLOCKLET_STORE_API_PREFIX, `/registry.json?__t__=${Date.now()}`);
173
+ const url = joinURL(registry, BLOCKLET_STORE_META_PATH, `?__t__=${Date.now()}`);
174
174
  const { data } = await request.get(url);
175
175
 
176
176
  if (!data) {
@@ -798,7 +798,7 @@ const getRuntimeInfo = async (appId) => {
798
798
  const proc = await getProcessInfo(appId);
799
799
  return {
800
800
  pid: proc.pid,
801
- uptime: proc.pm2_env ? Number(proc.pm2_env.pm_uptime) : 0,
801
+ uptime: proc.pm2_env ? +new Date() - Number(proc.pm2_env.pm_uptime) : 0,
802
802
  memoryUsage: proc.monit.memory,
803
803
  cpuUsage: proc.monit.cpu,
804
804
  status: proc.pm2_env ? proc.pm2_env.status : null,
@@ -3,7 +3,7 @@ const { DEFAULT_IP_DNS_DOMAIN_SUFFIX } = require('@abtnode/constant');
3
3
 
4
4
  const SLOT_FOR_IP_DNS_SITE = '888-888-888-888';
5
5
 
6
- const formatName = (name) => slugify(name.replace(/^[@./-]/, '').replace(/[@./]/g, '-'));
6
+ const formatName = (name) => slugify(name.replace(/^[@./-]/, '').replace(/[@./_]/g, '-'));
7
7
 
8
8
  const hiddenInterfaceNames = ['public', 'publicUrl'];
9
9
 
@@ -10,7 +10,8 @@ const isSatisfied = (requirements, throwOnUnsatisfied = true) => {
10
10
  }
11
11
 
12
12
  const { platform: actualOs, arch: actualCpu } = process;
13
- const { os: expectedOs, cpu: expectedCpu, abtnode: expectedVersion } = Object.assign(defaults, requirements);
13
+ const { os: expectedOs, cpu: expectedCpu, abtnode, server } = Object.assign(defaults, requirements);
14
+ const expectedVersion = server || abtnode;
14
15
 
15
16
  const isOsSatisfied =
16
17
  expectedOs === '*' || expectedOs === actualOs || (Array.isArray(expectedOs) && expectedOs.includes(actualOs));
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.5.21",
6
+ "version": "1.6.3",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,26 +19,26 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@abtnode/constant": "1.5.21",
23
- "@abtnode/cron": "1.5.21",
24
- "@abtnode/logger": "1.5.21",
25
- "@abtnode/queue": "1.5.21",
26
- "@abtnode/rbac": "1.5.21",
27
- "@abtnode/router-provider": "1.5.21",
28
- "@abtnode/static-server": "1.5.21",
29
- "@abtnode/timemachine": "1.5.21",
30
- "@abtnode/util": "1.5.21",
31
- "@arcblock/did": "^1.13.65",
32
- "@arcblock/event-hub": "1.13.65",
22
+ "@abtnode/constant": "1.6.3",
23
+ "@abtnode/cron": "1.6.3",
24
+ "@abtnode/logger": "1.6.3",
25
+ "@abtnode/queue": "1.6.3",
26
+ "@abtnode/rbac": "1.6.3",
27
+ "@abtnode/router-provider": "1.6.3",
28
+ "@abtnode/static-server": "1.6.3",
29
+ "@abtnode/timemachine": "1.6.3",
30
+ "@abtnode/util": "1.6.3",
31
+ "@arcblock/did": "^1.13.71",
32
+ "@arcblock/event-hub": "1.13.71",
33
33
  "@arcblock/pm2-events": "^0.0.5",
34
- "@arcblock/vc": "^1.13.65",
35
- "@blocklet/meta": "1.5.21",
34
+ "@arcblock/vc": "^1.13.71",
35
+ "@blocklet/meta": "1.6.3",
36
36
  "@fidm/x509": "^1.2.1",
37
37
  "@nedb/core": "^1.2.2",
38
38
  "@nedb/multi": "^1.2.2",
39
- "@ocap/mcrypto": "^1.13.65",
40
- "@ocap/util": "^1.13.65",
41
- "@ocap/wallet": "^1.13.65",
39
+ "@ocap/mcrypto": "^1.13.71",
40
+ "@ocap/util": "^1.13.71",
41
+ "@ocap/wallet": "^1.13.71",
42
42
  "@slack/webhook": "^5.0.3",
43
43
  "axios": "^0.21.4",
44
44
  "axon": "^2.0.3",
@@ -73,5 +73,5 @@
73
73
  "express": "^4.17.1",
74
74
  "jest": "^27.3.1"
75
75
  },
76
- "gitHead": "db219f519704e8c7ebe60f8448ec6c447ac4e059"
76
+ "gitHead": "3642ccce1e0ab0e1937e32a7dc119a9763bc21c2"
77
77
  }