@abtnode/core 1.8.34 → 1.8.35

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/team.js CHANGED
@@ -713,7 +713,7 @@ class TeamAPI extends EventEmitter {
713
713
  async updateRole({ teamDid, role: { name, title, description } = {} }) {
714
714
  logger.info('update role', { teamDid, name, title, description });
715
715
 
716
- validateUpdateRole({ name, title, description });
716
+ await validateUpdateRole({ name, title, description });
717
717
 
718
718
  const rbac = await this.getRBAC(teamDid);
719
719
 
@@ -162,7 +162,7 @@ class RouterManager extends EventEmitter {
162
162
  const updateSet = {};
163
163
 
164
164
  if (params.corsAllowedOrigins) {
165
- updateSet.corsAllowedOrigins = params.corsAllowedOrigins;
165
+ updateSet.corsAllowedOrigins = params.corsAllowedOrigins.filter((x) => x !== '__none__');
166
166
  }
167
167
 
168
168
  if (params.domain) {
@@ -19,13 +19,18 @@ const rbacCreationLock = new Lock('rbac-creation-lock');
19
19
 
20
20
  const closeDatabase = async (db) =>
21
21
  new Promise((resolve, reject) => {
22
+ if (!db) {
23
+ resolve(true);
24
+ return;
25
+ }
26
+
22
27
  db.closeDatabase((err) => {
23
28
  if (err) {
24
29
  reject(err);
25
30
  return;
26
31
  }
27
32
 
28
- resolve();
33
+ resolve(true);
29
34
  });
30
35
  });
31
36
 
@@ -2,18 +2,28 @@
2
2
  const JOI = require('joi');
3
3
  const { getMultipleLangParams } = require('./util');
4
4
 
5
- const nameSchema = JOI.string().trim().max(64);
5
+ const roleNameSchema = JOI.string()
6
+ .trim()
7
+ .max(64)
8
+ .custom((value) => {
9
+ if (value.startsWith('blocklet')) {
10
+ throw new Error('role name cannot start with "blocklet"');
11
+ }
12
+
13
+ return value;
14
+ });
15
+
6
16
  const titleSchema = JOI.string().trim().max(25);
7
17
  const descriptionSchema = JOI.string().trim().max(600);
8
18
 
9
19
  const createRoleSchema = JOI.object({
10
- name: nameSchema.required(),
20
+ name: roleNameSchema.required(),
11
21
  title: titleSchema.required(),
12
22
  description: descriptionSchema.required(),
13
23
  });
14
24
 
15
25
  const updateRoleSchema = JOI.object({
16
- name: nameSchema.required(),
26
+ name: roleNameSchema.required(),
17
27
  title: titleSchema,
18
28
  description: descriptionSchema,
19
29
  });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.8.34",
6
+ "version": "1.8.35",
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.34",
23
- "@abtnode/certificate-manager": "1.8.34",
24
- "@abtnode/constant": "1.8.34",
25
- "@abtnode/cron": "1.8.34",
26
- "@abtnode/db": "1.8.34",
27
- "@abtnode/logger": "1.8.34",
28
- "@abtnode/queue": "1.8.34",
29
- "@abtnode/rbac": "1.8.34",
30
- "@abtnode/router-provider": "1.8.34",
31
- "@abtnode/static-server": "1.8.34",
32
- "@abtnode/timemachine": "1.8.34",
33
- "@abtnode/util": "1.8.34",
34
- "@arcblock/did": "1.18.13",
22
+ "@abtnode/auth": "1.8.35",
23
+ "@abtnode/certificate-manager": "1.8.35",
24
+ "@abtnode/constant": "1.8.35",
25
+ "@abtnode/cron": "1.8.35",
26
+ "@abtnode/db": "1.8.35",
27
+ "@abtnode/logger": "1.8.35",
28
+ "@abtnode/queue": "1.8.35",
29
+ "@abtnode/rbac": "1.8.35",
30
+ "@abtnode/router-provider": "1.8.35",
31
+ "@abtnode/static-server": "1.8.35",
32
+ "@abtnode/timemachine": "1.8.35",
33
+ "@abtnode/util": "1.8.35",
34
+ "@arcblock/did": "1.18.15",
35
35
  "@arcblock/did-motif": "^1.1.10",
36
- "@arcblock/did-util": "1.18.13",
37
- "@arcblock/event-hub": "1.18.13",
38
- "@arcblock/jwt": "^1.18.13",
36
+ "@arcblock/did-util": "1.18.15",
37
+ "@arcblock/event-hub": "1.18.15",
38
+ "@arcblock/jwt": "^1.18.15",
39
39
  "@arcblock/pm2-events": "^0.0.5",
40
- "@arcblock/vc": "1.18.13",
41
- "@blocklet/constant": "1.8.34",
42
- "@blocklet/meta": "1.8.34",
43
- "@blocklet/sdk": "1.8.34",
40
+ "@arcblock/vc": "1.18.15",
41
+ "@blocklet/constant": "1.8.35",
42
+ "@blocklet/meta": "1.8.35",
43
+ "@blocklet/sdk": "1.8.35",
44
44
  "@fidm/x509": "^1.2.1",
45
- "@ocap/mcrypto": "1.18.13",
46
- "@ocap/util": "1.18.13",
47
- "@ocap/wallet": "1.18.13",
45
+ "@ocap/mcrypto": "1.18.15",
46
+ "@ocap/util": "1.18.15",
47
+ "@ocap/wallet": "1.18.15",
48
48
  "@slack/webhook": "^5.0.4",
49
49
  "axios": "^0.27.2",
50
50
  "axon": "^2.0.3",
@@ -82,5 +82,5 @@
82
82
  "express": "^4.18.2",
83
83
  "jest": "^27.5.1"
84
84
  },
85
- "gitHead": "c5fbb8e57493db62f212217cfde1980c82f00297"
85
+ "gitHead": "dd89e7a61dc8cff64302608ad5ab6545dd903daa"
86
86
  }