@abtnode/core 1.16.24-beta-a02d4e5e → 1.16.24-beta-64150e24

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
@@ -1380,7 +1380,7 @@ class TeamAPI extends EventEmitter {
1380
1380
  }
1381
1381
 
1382
1382
  // user-session management
1383
- async getUserSession({ teamDid, userDid, visitorId }) {
1383
+ async getUserSession({ teamDid, userDid, visitorId, appPid }) {
1384
1384
  const state = await this.getUserSessionState(teamDid);
1385
1385
  const userState = await this.getUserState(teamDid);
1386
1386
 
@@ -1389,6 +1389,7 @@ class TeamAPI extends EventEmitter {
1389
1389
  };
1390
1390
  if (userDid) where.userDid = userDid;
1391
1391
  if (visitorId) where.visitorId = visitorId;
1392
+ if (appPid) where.appPid = appPid;
1392
1393
 
1393
1394
  const userSessions = await state.model.findAll({
1394
1395
  where,
@@ -43,7 +43,7 @@ const installComponentFromDev = async ({ folder, meta, rootDid, mountPoint, mana
43
43
 
44
44
  const component = {
45
45
  meta: ensureMeta(meta),
46
- mountPoint: mountPoint || `/${defaultPath}`,
46
+ mountPoint: (mountPoint || `/${defaultPath}`).toLowerCase(),
47
47
  source: BlockletSource.local,
48
48
  deployedFrom: folder,
49
49
  status: BlockletStatus.installed,
@@ -188,7 +188,7 @@ class User extends ExtendBase {
188
188
  // eslint-disable-next-line require-await
189
189
  async getUsers({ query, sort, paging } = {}) {
190
190
  const where = {};
191
- const { approved, role, search, tags, includeTags } = query || {};
191
+ const { approved, role, search, tags, includeTags, includePassports } = query || {};
192
192
  const shouldIncludeTag = (tags && tags.length) || includeTags;
193
193
 
194
194
  if (isNullOrUndefined(approved) === false) {
@@ -224,18 +224,39 @@ class User extends ExtendBase {
224
224
  if (!Object.keys(sorting).length) {
225
225
  sorting.createdAt = -1;
226
226
  }
227
+ const include = [];
228
+ if (shouldIncludeTag) {
229
+ include.push(this.getTagInclude(tags));
230
+ }
231
+ if (includePassports) {
232
+ include.push({
233
+ model: this.models.Passport,
234
+ as: 'passports',
235
+ });
236
+ }
227
237
 
228
- return this.paginate({ where, include: shouldIncludeTag ? [this.getTagInclude(tags)] : [] }, sorting, paging);
238
+ return this.paginate({ where, include }, sorting, paging);
229
239
  }
230
240
 
231
241
  // eslint-disable-next-line require-await
232
242
  async getUsersByDids({ dids, query }) {
233
- const { approved, includeTags } = query || {};
243
+ const { approved, includeTags, includePassports } = query || {};
234
244
  const condition = { did: dids };
235
245
  if (isNullOrUndefined(approved) === false) {
236
246
  condition.approved = !!approved;
237
247
  }
238
- return this.find({ where: condition, include: includeTags ? [this.getTagInclude()] : [] });
248
+ const include = [];
249
+ if (includeTags) {
250
+ include.push(this.getTagInclude());
251
+ }
252
+ if (includePassports) {
253
+ include.push({
254
+ model: this.models.Passport,
255
+ as: 'passports',
256
+ });
257
+ }
258
+
259
+ return this.find({ where: condition, include });
239
260
  }
240
261
 
241
262
  // eslint-disable-next-line require-await
@@ -58,12 +58,14 @@ const revokeAndDeleteNFTDomainRecord = async ({ name, blocklet, nodeInfo }) => {
58
58
  const { wallet } = getBlockletInfo(blocklet, nodeInfo.sk);
59
59
 
60
60
  const payload = {
61
- delegatee: wallet.address,
61
+ delegatee: blocklet.appPid,
62
62
  domain: name,
63
63
  };
64
64
 
65
65
  const nftDomainServiceUrl = await getDidDomainServiceURL(nodeInfo.nftDomainUrl);
66
66
 
67
+ logger.info('will revoke and delete nft domain record', { name, appPid: blocklet.appPid, payload });
68
+
67
69
  try {
68
70
  const { data } = await axios({
69
71
  method: 'DELETE',
@@ -11,6 +11,7 @@ class WalletSender extends BaseSender {
11
11
  const sender = {
12
12
  appDid: nodeInfo.did,
13
13
  appSk: nodeInfo.sk,
14
+ type: 'server',
14
15
  };
15
16
 
16
17
  const message = {
@@ -18,7 +19,11 @@ class WalletSender extends BaseSender {
18
19
  body: description,
19
20
  };
20
21
 
21
- const { users } = await node.getUsers({ teamDid: nodeInfo.did, paging: { pageSize: 100 } });
22
+ const { users } = await node.getUsers({
23
+ teamDid: nodeInfo.did,
24
+ paging: { pageSize: 100 },
25
+ query: { includePassports: true },
26
+ });
22
27
  const adminUsers = users
23
28
  .filter(
24
29
  (x) =>
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.24-beta-a02d4e5e",
6
+ "version": "1.16.24-beta-64150e24",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,19 +19,19 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@abtnode/analytics": "1.16.24-beta-a02d4e5e",
23
- "@abtnode/auth": "1.16.24-beta-a02d4e5e",
24
- "@abtnode/certificate-manager": "1.16.24-beta-a02d4e5e",
25
- "@abtnode/constant": "1.16.24-beta-a02d4e5e",
26
- "@abtnode/cron": "1.16.24-beta-a02d4e5e",
27
- "@abtnode/logger": "1.16.24-beta-a02d4e5e",
28
- "@abtnode/models": "1.16.24-beta-a02d4e5e",
29
- "@abtnode/queue": "1.16.24-beta-a02d4e5e",
30
- "@abtnode/rbac": "1.16.24-beta-a02d4e5e",
31
- "@abtnode/router-provider": "1.16.24-beta-a02d4e5e",
32
- "@abtnode/static-server": "1.16.24-beta-a02d4e5e",
33
- "@abtnode/timemachine": "1.16.24-beta-a02d4e5e",
34
- "@abtnode/util": "1.16.24-beta-a02d4e5e",
22
+ "@abtnode/analytics": "1.16.24-beta-64150e24",
23
+ "@abtnode/auth": "1.16.24-beta-64150e24",
24
+ "@abtnode/certificate-manager": "1.16.24-beta-64150e24",
25
+ "@abtnode/constant": "1.16.24-beta-64150e24",
26
+ "@abtnode/cron": "1.16.24-beta-64150e24",
27
+ "@abtnode/logger": "1.16.24-beta-64150e24",
28
+ "@abtnode/models": "1.16.24-beta-64150e24",
29
+ "@abtnode/queue": "1.16.24-beta-64150e24",
30
+ "@abtnode/rbac": "1.16.24-beta-64150e24",
31
+ "@abtnode/router-provider": "1.16.24-beta-64150e24",
32
+ "@abtnode/static-server": "1.16.24-beta-64150e24",
33
+ "@abtnode/timemachine": "1.16.24-beta-64150e24",
34
+ "@abtnode/util": "1.16.24-beta-64150e24",
35
35
  "@arcblock/did": "1.18.110",
36
36
  "@arcblock/did-auth": "1.18.110",
37
37
  "@arcblock/did-ext": "^1.18.110",
@@ -42,12 +42,12 @@
42
42
  "@arcblock/pm2-events": "^0.0.5",
43
43
  "@arcblock/validator": "^1.18.110",
44
44
  "@arcblock/vc": "1.18.110",
45
- "@blocklet/constant": "1.16.24-beta-a02d4e5e",
46
- "@blocklet/env": "1.16.24-beta-a02d4e5e",
47
- "@blocklet/meta": "1.16.24-beta-a02d4e5e",
48
- "@blocklet/resolver": "1.16.24-beta-a02d4e5e",
49
- "@blocklet/sdk": "1.16.24-beta-a02d4e5e",
50
- "@did-space/client": "^0.3.60",
45
+ "@blocklet/constant": "1.16.24-beta-64150e24",
46
+ "@blocklet/env": "1.16.24-beta-64150e24",
47
+ "@blocklet/meta": "1.16.24-beta-64150e24",
48
+ "@blocklet/resolver": "1.16.24-beta-64150e24",
49
+ "@blocklet/sdk": "1.16.24-beta-64150e24",
50
+ "@did-space/client": "^0.3.64",
51
51
  "@fidm/x509": "^1.2.1",
52
52
  "@ocap/mcrypto": "1.18.110",
53
53
  "@ocap/util": "1.18.110",
@@ -102,5 +102,5 @@
102
102
  "jest": "^29.7.0",
103
103
  "unzipper": "^0.10.11"
104
104
  },
105
- "gitHead": "bfe534f98c5a21bec765cb441a648e9f4edfe607"
105
+ "gitHead": "30c91a8e2790a0527ba336497f5032ba54ed4225"
106
106
  }