@blocklet/sdk 1.16.49-beta-20250826-112154-8ca981fa → 1.16.49-beta-20250828-094758-93e69d1f

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.
@@ -80,5 +80,8 @@ interface BlockletService {
80
80
  getUserFollowers(args?: OmitTeamDid<Client.RequestUserFollowsInput>): Promise<Client.ResponseUserFollows>;
81
81
  getUserFollowing(args?: OmitTeamDid<Client.RequestUserFollowsInput>): Promise<Client.ResponseUserFollows>;
82
82
  getUserFollowStats(args?: OmitTeamDid<Client.RequestUserFollowsStatsInput>): Promise<Client.ResponseFollowStats>;
83
+ checkFollowing(args: OmitTeamDid<Client.RequestCheckFollowingInput>): Promise<Client.ResponseCheckFollowing>;
84
+ followUser(args: OmitTeamDid<Client.RequestFollowUserActionInput>): Promise<Client.GeneralResponse>;
85
+ unfollowUser(args: OmitTeamDid<Client.RequestFollowUserActionInput>): Promise<Client.GeneralResponse>;
83
86
  }
84
87
  export = BlockletService;
@@ -109,6 +109,9 @@ class BlockletService {
109
109
  'getUserFollowers',
110
110
  'getUserFollowing',
111
111
  'getUserFollowStats',
112
+ 'checkFollowing',
113
+ 'followUser',
114
+ 'unfollowUser',
112
115
  // updateUserInfo
113
116
  'updateUserAddress',
114
117
  'updateUserInfo',
@@ -299,39 +302,23 @@ class BlockletService {
299
302
  throw new Error((0, error_1.formatError)(err));
300
303
  }
301
304
  };
302
- this.getUserFollowers = async (args) => {
305
+ // 通用的客户端调用方法,用于减少代码重复
306
+ const callClientMethod = async (methodName, args) => {
303
307
  try {
304
- const res = await client.getUserFollowers({
305
- input: { teamDid, ...args },
306
- });
308
+ const clientMethod = client[methodName];
309
+ const res = await clientMethod({ input: { teamDid, ...args } });
307
310
  return res;
308
311
  }
309
312
  catch (err) {
310
- throw new Error((0, error_1.formatError)(err));
311
- }
312
- };
313
- this.getUserFollowing = async (args) => {
314
- try {
315
- const res = await client.getUserFollowing({
316
- input: { teamDid, ...args },
317
- });
318
- return res;
319
- }
320
- catch (err) {
321
- throw new Error((0, error_1.formatError)(err));
322
- }
323
- };
324
- this.getUserFollowStats = async (args) => {
325
- try {
326
- const res = await client.getUserFollowStats({
327
- input: { teamDid, ...args },
328
- });
329
- return res;
330
- }
331
- catch (err) {
332
- throw new Error((0, error_1.formatError)(err));
313
+ throw new Error((0, error_1.formatError)(err)); // 这几个错误消息需要 format
333
314
  }
334
315
  };
316
+ this.getUserFollowers = (args) => callClientMethod('getUserFollowers', args);
317
+ this.getUserFollowing = (args) => callClientMethod('getUserFollowing', args);
318
+ this.getUserFollowStats = (args) => callClientMethod('getUserFollowStats', args);
319
+ this.checkFollowing = (args) => callClientMethod('checkFollowing', args);
320
+ this.followUser = (args) => callClientMethod('followUser', args);
321
+ this.unfollowUser = (args) => callClientMethod('unfollowUser', args);
335
322
  // eslint-disable-next-line no-constructor-return
336
323
  return new Proxy(this, {
337
324
  get(target, propKey) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.49-beta-20250826-112154-8ca981fa",
6
+ "version": "1.16.49-beta-20250828-094758-93e69d1f",
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,19 +27,19 @@
27
27
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@abtnode/constant": "1.16.49-beta-20250826-112154-8ca981fa",
31
- "@abtnode/db-cache": "1.16.49-beta-20250826-112154-8ca981fa",
32
- "@abtnode/util": "1.16.49-beta-20250826-112154-8ca981fa",
30
+ "@abtnode/constant": "1.16.49-beta-20250828-094758-93e69d1f",
31
+ "@abtnode/db-cache": "1.16.49-beta-20250828-094758-93e69d1f",
32
+ "@abtnode/util": "1.16.49-beta-20250828-094758-93e69d1f",
33
33
  "@arcblock/did": "1.22.2",
34
34
  "@arcblock/did-connect-js": "1.22.2",
35
35
  "@arcblock/jwt": "1.22.2",
36
36
  "@arcblock/ws": "1.22.2",
37
- "@blocklet/constant": "1.16.49-beta-20250826-112154-8ca981fa",
38
- "@blocklet/env": "1.16.49-beta-20250826-112154-8ca981fa",
37
+ "@blocklet/constant": "1.16.49-beta-20250828-094758-93e69d1f",
38
+ "@blocklet/env": "1.16.49-beta-20250828-094758-93e69d1f",
39
39
  "@blocklet/error": "^0.2.5",
40
- "@blocklet/meta": "1.16.49-beta-20250826-112154-8ca981fa",
41
- "@blocklet/server-js": "1.16.49-beta-20250826-112154-8ca981fa",
42
- "@blocklet/theme": "^3.1.25",
40
+ "@blocklet/meta": "1.16.49-beta-20250828-094758-93e69d1f",
41
+ "@blocklet/server-js": "1.16.49-beta-20250828-094758-93e69d1f",
42
+ "@blocklet/theme": "^3.1.32",
43
43
  "@did-connect/authenticator": "^2.2.8",
44
44
  "@did-connect/handler": "^2.2.8",
45
45
  "@nedb/core": "^2.1.5",
@@ -85,5 +85,5 @@
85
85
  "ts-node": "^10.9.1",
86
86
  "typescript": "^5.6.3"
87
87
  },
88
- "gitHead": "f31434546e024c4ce20a1d3c0d34b64f12980536"
88
+ "gitHead": "587711a6df767cafaadbb503daeac586e22c3988"
89
89
  }