@blocklet/sdk 1.16.43-beta-20250507-124320-c405ab23 → 1.16.43-beta-20250508-132430-79f0da2d

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.
@@ -1,4 +1,5 @@
1
1
  import Client from '@abtnode/client';
2
+ import { LOGIN_PROVIDER } from '@blocklet/constant';
2
3
  type PartialDeep<T> = {
3
4
  [K in keyof T]?: T[K] extends object ? PartialDeep<T[K]> : T[K];
4
5
  };
@@ -16,13 +17,16 @@ interface AuthService {
16
17
  user: Object;
17
18
  token: string;
18
19
  refreshToken: string;
20
+ visitorId?: string;
19
21
  }>;
20
22
  refreshSession: (params: {
21
23
  refreshToken: string;
24
+ visitorId?: string;
22
25
  }) => Promise<{
23
26
  user: Object;
24
27
  token: string;
25
28
  refreshToken: string;
29
+ provider: keyof typeof LOGIN_PROVIDER;
26
30
  }>;
27
31
  getUser(did: string, options?: {
28
32
  enableConnectedAccount?: boolean;
@@ -221,7 +221,13 @@ class AuthService {
221
221
  };
222
222
  this.refreshSession = async (data) => {
223
223
  try {
224
- const { data: resData } = await service_api_1.default.post('/api/did/refreshSession', {}, { headers: { Authorization: `Bearer ${data.refreshToken}` } });
224
+ const headers = {
225
+ Authorization: `Bearer ${data.refreshToken}`,
226
+ };
227
+ if (data.visitorId) {
228
+ headers['x-blocklet-visitor-id'] = data.visitorId;
229
+ }
230
+ const { data: resData } = await service_api_1.default.post('/api/did/refreshSession', {}, { headers });
225
231
  if (resData?.user) {
226
232
  fixAvatar(resData.user);
227
233
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.43-beta-20250507-124320-c405ab23",
6
+ "version": "1.16.43-beta-20250508-132430-79f0da2d",
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,23 +27,23 @@
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.43-beta-20250507-124320-c405ab23",
31
- "@abtnode/constant": "1.16.43-beta-20250507-124320-c405ab23",
32
- "@abtnode/util": "1.16.43-beta-20250507-124320-c405ab23",
33
- "@arcblock/did": "1.20.4",
34
- "@arcblock/did-auth": "1.20.4",
35
- "@arcblock/jwt": "1.20.4",
36
- "@arcblock/ws": "1.20.4",
37
- "@blocklet/constant": "1.16.43-beta-20250507-124320-c405ab23",
38
- "@blocklet/env": "1.16.43-beta-20250507-124320-c405ab23",
30
+ "@abtnode/client": "1.16.43-beta-20250508-132430-79f0da2d",
31
+ "@abtnode/constant": "1.16.43-beta-20250508-132430-79f0da2d",
32
+ "@abtnode/util": "1.16.43-beta-20250508-132430-79f0da2d",
33
+ "@arcblock/did": "1.20.6",
34
+ "@arcblock/did-auth": "1.20.6",
35
+ "@arcblock/jwt": "1.20.6",
36
+ "@arcblock/ws": "1.20.6",
37
+ "@blocklet/constant": "1.16.43-beta-20250508-132430-79f0da2d",
38
+ "@blocklet/env": "1.16.43-beta-20250508-132430-79f0da2d",
39
39
  "@blocklet/error": "^0.2.4",
40
- "@blocklet/meta": "1.16.43-beta-20250507-124320-c405ab23",
40
+ "@blocklet/meta": "1.16.43-beta-20250508-132430-79f0da2d",
41
41
  "@did-connect/authenticator": "^2.2.7",
42
42
  "@did-connect/handler": "^2.2.7",
43
43
  "@nedb/core": "^2.1.5",
44
- "@ocap/mcrypto": "1.20.4",
45
- "@ocap/util": "1.20.4",
46
- "@ocap/wallet": "1.20.4",
44
+ "@ocap/mcrypto": "1.20.6",
45
+ "@ocap/util": "1.20.6",
46
+ "@ocap/wallet": "1.20.6",
47
47
  "axios": "^1.7.9",
48
48
  "cheerio": "1.0.0-rc.12",
49
49
  "debug": "^4.3.7",
@@ -83,5 +83,5 @@
83
83
  "ts-node": "^10.9.1",
84
84
  "typescript": "^5.6.3"
85
85
  },
86
- "gitHead": "4e5087dfaa52788676f313d23bfdd3ac68d63503"
86
+ "gitHead": "d9fc34b79948644ab30abc83e8e58ffb174332d6"
87
87
  }