@abtnode/core 1.6.28 → 1.6.29

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.
Files changed (2) hide show
  1. package/lib/util/service.js +16 -2
  2. package/package.json +20 -20
@@ -2,6 +2,8 @@ const fs = require('fs-extra');
2
2
  const cloneDeep = require('lodash/cloneDeep');
3
3
  const Ajv = require('ajv').default;
4
4
 
5
+ const { NODE_SERVICES } = require('@abtnode/constant');
6
+
5
7
  const ajv = new Ajv({
6
8
  useDefaults: true,
7
9
  removeAdditional: 'all',
@@ -21,8 +23,8 @@ const getServices = ({ stringifySchema = false } = {}) => {
21
23
  });
22
24
 
23
25
  // backward compatible
24
- const authService = cloneDeep(list.find((x) => x.name === 'auth'));
25
- authService.name = '@abtnode/auth-service';
26
+ const authService = cloneDeep(list.find((x) => x.name === NODE_SERVICES.AUTH));
27
+ authService.name = NODE_SERVICES.AUTH_SERVICE;
26
28
  list.push(authService);
27
29
 
28
30
  return list;
@@ -60,8 +62,20 @@ const getDefaultServiceConfig = (service) => {
60
62
  return getServiceConfig(serviceMeta, {});
61
63
  };
62
64
 
65
+ const findService = (services, name) => {
66
+ const names = [name];
67
+
68
+ // backward compatible
69
+ if (name === NODE_SERVICES.AUTH) {
70
+ names.push(NODE_SERVICES.AUTH_SERVICE);
71
+ }
72
+
73
+ return (services || []).find((x) => names.includes(x.name));
74
+ };
75
+
63
76
  module.exports = {
64
77
  getServices,
65
78
  getServiceConfig,
66
79
  getDefaultServiceConfig,
80
+ findService,
67
81
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.28",
6
+ "version": "1.6.29",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,28 +19,28 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@abtnode/certificate-manager": "1.6.28",
23
- "@abtnode/constant": "1.6.28",
24
- "@abtnode/cron": "1.6.28",
25
- "@abtnode/db": "1.6.28",
26
- "@abtnode/logger": "1.6.28",
27
- "@abtnode/queue": "1.6.28",
28
- "@abtnode/rbac": "1.6.28",
29
- "@abtnode/router-provider": "1.6.28",
30
- "@abtnode/static-server": "1.6.28",
31
- "@abtnode/timemachine": "1.6.28",
32
- "@abtnode/util": "1.6.28",
33
- "@arcblock/did": "^1.14.19",
34
- "@arcblock/event-hub": "1.14.19",
22
+ "@abtnode/certificate-manager": "1.6.29",
23
+ "@abtnode/constant": "1.6.29",
24
+ "@abtnode/cron": "1.6.29",
25
+ "@abtnode/db": "1.6.29",
26
+ "@abtnode/logger": "1.6.29",
27
+ "@abtnode/queue": "1.6.29",
28
+ "@abtnode/rbac": "1.6.29",
29
+ "@abtnode/router-provider": "1.6.29",
30
+ "@abtnode/static-server": "1.6.29",
31
+ "@abtnode/timemachine": "1.6.29",
32
+ "@abtnode/util": "1.6.29",
33
+ "@arcblock/did": "^1.14.20",
34
+ "@arcblock/event-hub": "1.14.20",
35
35
  "@arcblock/pm2-events": "^0.0.5",
36
- "@arcblock/vc": "^1.14.19",
37
- "@blocklet/meta": "1.6.28",
36
+ "@arcblock/vc": "^1.14.20",
37
+ "@blocklet/meta": "1.6.29",
38
38
  "@fidm/x509": "^1.2.1",
39
39
  "@nedb/core": "^1.2.2",
40
40
  "@nedb/multi": "^1.2.2",
41
- "@ocap/mcrypto": "^1.14.19",
42
- "@ocap/util": "^1.14.19",
43
- "@ocap/wallet": "^1.14.19",
41
+ "@ocap/mcrypto": "^1.14.20",
42
+ "@ocap/util": "^1.14.20",
43
+ "@ocap/wallet": "^1.14.20",
44
44
  "@slack/webhook": "^5.0.3",
45
45
  "ajv": "^7.0.3",
46
46
  "axios": "^0.25.0",
@@ -77,5 +77,5 @@
77
77
  "express": "^4.17.1",
78
78
  "jest": "^27.4.5"
79
79
  },
80
- "gitHead": "acef8ea339bd8fc9c785312eb5a1a113ecbf0d4d"
80
+ "gitHead": "0d02246307d364e952990b3e64b608dfefc80efe"
81
81
  }