@abtnode/util 1.17.8-beta-20260116-080047-9fdd00d3 → 1.17.8-beta-20260119-102944-6ba93a16

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/passport.js +11 -2
  2. package/package.json +6 -6
package/lib/passport.js CHANGED
@@ -1,8 +1,17 @@
1
1
  const uniqBy = require('lodash/uniqBy');
2
2
  const { ROLES, PASSPORT_STATUS } = require('@abtnode/constant');
3
3
 
4
- const hasActiveOwnerPassport = (user) =>
5
- (user?.passports || []).some((x) => x.role === ROLES.OWNER && x.status === PASSPORT_STATUS.VALID);
4
+ const hasActiveOwnerPassport = (user, { blocklet, nodeInfo } = {}) => {
5
+ return (user?.passports || []).some((x) => {
6
+ let result = x.role === ROLES.OWNER && x.status === PASSPORT_STATUS.VALID;
7
+ if (blocklet) {
8
+ result = result && user.did === blocklet?.settings?.owner?.did;
9
+ } else if (nodeInfo) {
10
+ result = result && user.did === nodeInfo?.nodeOwner?.did;
11
+ }
12
+ return result;
13
+ });
14
+ };
6
15
 
7
16
  const getActivePassports = (user, issuerDidList = []) => {
8
17
  const isRecoverable = (x) => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.17.8-beta-20260116-080047-9fdd00d3",
6
+ "version": "1.17.8-beta-20260119-102944-6ba93a16",
7
7
  "description": "ArcBlock's JavaScript utility",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,14 +18,14 @@
18
18
  "author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.17.8-beta-20260116-080047-9fdd00d3",
22
- "@abtnode/db-cache": "1.17.8-beta-20260116-080047-9fdd00d3",
21
+ "@abtnode/constant": "1.17.8-beta-20260119-102944-6ba93a16",
22
+ "@abtnode/db-cache": "1.17.8-beta-20260119-102944-6ba93a16",
23
23
  "@arcblock/did": "^1.28.5",
24
24
  "@arcblock/event-hub": "^1.28.5",
25
25
  "@arcblock/pm2": "^6.0.12",
26
- "@blocklet/constant": "1.17.8-beta-20260116-080047-9fdd00d3",
26
+ "@blocklet/constant": "1.17.8-beta-20260119-102944-6ba93a16",
27
27
  "@blocklet/error": "^0.3.5",
28
- "@blocklet/meta": "1.17.8-beta-20260116-080047-9fdd00d3",
28
+ "@blocklet/meta": "1.17.8-beta-20260119-102944-6ba93a16",
29
29
  "@blocklet/xss": "^0.3.16",
30
30
  "@ocap/client": "^1.28.5",
31
31
  "@ocap/mcrypto": "^1.28.5",
@@ -90,5 +90,5 @@
90
90
  "express": "^4.18.2",
91
91
  "fs-extra": "^11.2.0"
92
92
  },
93
- "gitHead": "aa9d4c5e44b56fb55acbb312be752103efe4f61e"
93
+ "gitHead": "52d0430ade8bad2dbc91251b6183d152116fee0f"
94
94
  }