@blocklet/sdk 1.16.42-beta-20250412-084444-20b0cf19 → 1.16.42-beta-20250415-222652-04c5d2fe
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/service/auth.js +10 -0
- package/package.json +15 -15
package/lib/service/auth.js
CHANGED
|
@@ -65,6 +65,9 @@ class AuthService {
|
|
|
65
65
|
'getUsersCountPerRole',
|
|
66
66
|
'getUser',
|
|
67
67
|
'getOwner',
|
|
68
|
+
// user session
|
|
69
|
+
'getUserSessions',
|
|
70
|
+
'getUserSessionsCount',
|
|
68
71
|
// 'removeUser',
|
|
69
72
|
'updateUserApproval',
|
|
70
73
|
'updateUserTags',
|
|
@@ -114,6 +117,10 @@ class AuthService {
|
|
|
114
117
|
'getTrustedDomains',
|
|
115
118
|
'clearCache',
|
|
116
119
|
'getVault',
|
|
120
|
+
// access key
|
|
121
|
+
'createAccessKey',
|
|
122
|
+
'verifyAccessKey',
|
|
123
|
+
'getAccessKeys',
|
|
117
124
|
];
|
|
118
125
|
const teamDid = process.env.BLOCKLET_DID;
|
|
119
126
|
const apiFallback = (fn) => (params = {}, ...args) => fn({ input: { ...params, teamDid }, ...args });
|
|
@@ -145,6 +152,9 @@ class AuthService {
|
|
|
145
152
|
deletePermission: (fn) => (name) => fn({ input: { name, teamDid } }),
|
|
146
153
|
hasPermission: (fn) => (role, permission) => fn({ input: { teamDid, role, permission } }),
|
|
147
154
|
getBlocklet: (fn) => (attachRuntimeInfo = false) => fn({ input: { did: teamDid, attachRuntimeInfo } }, { ignoreFields: ['blocklet.settings.navigations', 'blocklet.settings.theme'] }),
|
|
155
|
+
createAccessKey: (fn) => (params) => fn({ input: { teamDid, authType: 'simple', createdVia: 'sdk', passport: 'guest', ...params } }),
|
|
156
|
+
verifyAccessKey: (fn) => (params) => fn({ input: { teamDid, ...params } }),
|
|
157
|
+
getAccessKeys: (fn) => (params) => fn({ input: { teamDid, ...params } }),
|
|
148
158
|
};
|
|
149
159
|
apiList.forEach((api) => {
|
|
150
160
|
const fn = client[api];
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.42-beta-
|
|
6
|
+
"version": "1.16.42-beta-20250415-222652-04c5d2fe",
|
|
7
7
|
"description": "graphql client to read/write data on abt node",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"typings": "lib/index.d.ts",
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
"author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/client": "1.16.42-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.42-beta-
|
|
32
|
-
"@abtnode/util": "1.16.42-beta-
|
|
33
|
-
"@arcblock/did": "1.19.
|
|
34
|
-
"@arcblock/did-auth": "1.19.
|
|
35
|
-
"@arcblock/jwt": "1.19.
|
|
36
|
-
"@arcblock/ws": "1.19.
|
|
37
|
-
"@blocklet/constant": "1.16.42-beta-
|
|
38
|
-
"@blocklet/env": "1.16.42-beta-
|
|
39
|
-
"@blocklet/meta": "1.16.42-beta-
|
|
30
|
+
"@abtnode/client": "1.16.42-beta-20250415-222652-04c5d2fe",
|
|
31
|
+
"@abtnode/constant": "1.16.42-beta-20250415-222652-04c5d2fe",
|
|
32
|
+
"@abtnode/util": "1.16.42-beta-20250415-222652-04c5d2fe",
|
|
33
|
+
"@arcblock/did": "1.19.20",
|
|
34
|
+
"@arcblock/did-auth": "1.19.20",
|
|
35
|
+
"@arcblock/jwt": "1.19.20",
|
|
36
|
+
"@arcblock/ws": "1.19.20",
|
|
37
|
+
"@blocklet/constant": "1.16.42-beta-20250415-222652-04c5d2fe",
|
|
38
|
+
"@blocklet/env": "1.16.42-beta-20250415-222652-04c5d2fe",
|
|
39
|
+
"@blocklet/meta": "1.16.42-beta-20250415-222652-04c5d2fe",
|
|
40
40
|
"@did-connect/authenticator": "^2.2.7",
|
|
41
41
|
"@did-connect/handler": "^2.2.7",
|
|
42
42
|
"@nedb/core": "^2.1.5",
|
|
43
|
-
"@ocap/mcrypto": "1.19.
|
|
44
|
-
"@ocap/util": "1.19.
|
|
45
|
-
"@ocap/wallet": "1.19.
|
|
43
|
+
"@ocap/mcrypto": "1.19.20",
|
|
44
|
+
"@ocap/util": "1.19.20",
|
|
45
|
+
"@ocap/wallet": "1.19.20",
|
|
46
46
|
"axios": "^1.7.9",
|
|
47
47
|
"cheerio": "1.0.0-rc.12",
|
|
48
48
|
"debug": "^4.3.7",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"ts-node": "^10.9.1",
|
|
83
83
|
"typescript": "^5.6.3"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "4458b1e7e92d62d93c70de7f636a0f6ae9a59f26"
|
|
86
86
|
}
|