@blocklet/sdk 1.16.6-beta-4ea1eb90 → 1.16.6-beta-7c9b42cc

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/did.js CHANGED
@@ -18,21 +18,9 @@ async function getUserInfo(userDid, { authClient = undefined } = {}) {
18
18
  // eslint-disable-next-line no-param-reassign
19
19
  authClient = new auth_1.default();
20
20
  }
21
- let { user } = await authClient.getUser(userDid);
22
- if (!user) {
23
- const { users } = await authClient.getUsers({
24
- query: {
25
- connectedDid: userDid,
26
- },
27
- });
28
- if (users.length > 1) {
29
- throw new Error('User is invalid');
30
- }
31
- [user] = users;
32
- }
33
- else if (user.extraConfigs?.bindDid) {
34
- ({ user } = await authClient.getUser(user.extraConfigs.bindDid));
35
- }
21
+ const { user } = await authClient.getUser(userDid, {
22
+ enableConnectedAccout: true,
23
+ });
36
24
  return user;
37
25
  }
38
26
  exports.getUserInfo = getUserInfo;
@@ -7,7 +7,11 @@ declare class AuthService {
7
7
  constructor(httpEndpoint?: string);
8
8
  }
9
9
  interface AuthService {
10
- getUser(did: string): Promise<Client.ResponseUser>;
10
+ getUser(did: string, options: {
11
+ enableConnectedAccout?: boolean;
12
+ enableNormalize?: boolean;
13
+ blockletSk?: string;
14
+ }): Promise<Client.ResponseUser>;
11
15
  getUsers(args?: OmitTeamDid<Client.RequestUsersInput>): Promise<Client.ResponseUsers>;
12
16
  getOwner(): Promise<Client.ResponseUser>;
13
17
  updateUserApproval(did: string, approved: boolean): Promise<Client.ResponseUser>;
@@ -95,8 +95,8 @@ class AuthService {
95
95
  const apiFallback = (fn) => (params = {}, ...args) => fn({ input: { ...params, teamDid }, ...args });
96
96
  // const apiConvertDid = (fn: Function) => (did: string) => fn({ input: { user: { did }, teamDid } });
97
97
  const apiFnMap = {
98
- getUser: (fn) => async (did) => {
99
- const res = await fn({ input: { user: { did }, teamDid } });
98
+ getUser: (fn) => async (did, options) => {
99
+ const res = await fn({ input: { user: { did }, options, teamDid } });
100
100
  fixAvatar(res.user);
101
101
  return res;
102
102
  },
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.6-beta-4ea1eb90",
6
+ "version": "1.16.6-beta-7c9b42cc",
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",
@@ -26,20 +26,20 @@
26
26
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@abtnode/client": "1.16.6-beta-4ea1eb90",
30
- "@abtnode/constant": "1.16.6-beta-4ea1eb90",
31
- "@arcblock/did": "1.18.72",
32
- "@arcblock/did-auth": "1.18.72",
33
- "@arcblock/jwt": "1.18.72",
34
- "@arcblock/ws": "1.18.72",
35
- "@blocklet/constant": "1.16.6-beta-4ea1eb90",
36
- "@blocklet/env": "1.16.6-beta-4ea1eb90",
37
- "@blocklet/meta": "1.16.6-beta-4ea1eb90",
38
- "@did-connect/authenticator": "^2.1.51",
39
- "@did-connect/handler": "^2.1.51",
29
+ "@abtnode/client": "1.16.6-beta-7c9b42cc",
30
+ "@abtnode/constant": "1.16.6-beta-7c9b42cc",
31
+ "@arcblock/did": "1.18.75",
32
+ "@arcblock/did-auth": "1.18.75",
33
+ "@arcblock/jwt": "1.18.75",
34
+ "@arcblock/ws": "1.18.75",
35
+ "@blocklet/constant": "1.16.6-beta-7c9b42cc",
36
+ "@blocklet/env": "1.16.6-beta-7c9b42cc",
37
+ "@blocklet/meta": "1.16.6-beta-7c9b42cc",
38
+ "@did-connect/authenticator": "^2.1.52",
39
+ "@did-connect/handler": "^2.1.52",
40
40
  "@nedb/core": "^2.1.5",
41
- "@ocap/mcrypto": "1.18.72",
42
- "@ocap/wallet": "1.18.72",
41
+ "@ocap/mcrypto": "1.18.75",
42
+ "@ocap/wallet": "1.18.75",
43
43
  "axios": "^0.27.2",
44
44
  "cheerio": "^1.0.0-rc.12",
45
45
  "fs-extra": "^10.1.0",
@@ -72,5 +72,5 @@
72
72
  "ts-node": "^10.9.1",
73
73
  "typescript": "^4.8.4"
74
74
  },
75
- "gitHead": "0f0f63b552a88343a3f8e0d434b47c3bca6a75b9"
75
+ "gitHead": "113a82e948a779a050f1b06f5667c43c96315054"
76
76
  }