@seayoo-web/gamer-api 2.4.2 → 2.4.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seayoo-web/gamer-api",
3
3
  "description": "agent for gamer api",
4
- "version": "2.4.2",
4
+ "version": "2.4.4",
5
5
  "type": "module",
6
6
  "source": "index.ts",
7
7
  "main": "./dist/index.js",
@@ -30,15 +30,15 @@
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.13.1",
33
- "@seayoo-web/request": "^3.2.0",
34
- "@seayoo-web/combo-webview": "^2.5.4",
35
33
  "@seayoo-web/tsconfig": "^1.0.4",
36
- "@seayoo-web/utils": "^3.5.2",
37
- "@seayoo-web/scripts": "^2.5.7"
34
+ "@seayoo-web/combo-webview": "^2.5.4",
35
+ "@seayoo-web/request": "^3.2.0",
36
+ "@seayoo-web/scripts": "^2.5.7",
37
+ "@seayoo-web/utils": "^3.6.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@seayoo-web/combo-webview": "^2.5.4",
41
- "@seayoo-web/utils": "^3.5.2"
41
+ "@seayoo-web/utils": "^3.6.0"
42
42
  },
43
43
  "scripts": {
44
44
  "prebuild": "pnpm -F request build && pnpm -F combo-webview build",
@@ -21,6 +21,7 @@ export declare class ClubApi {
21
21
  * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=hIDfaMlT7m
22
22
  */
23
23
  getCurrentPlayer(requestOptions?: IRequestOptions): Promise<import("./club.define").ClubPlayer | {
24
+ message: string;
24
25
  error: RequestInternalError | "seayoo_account_already_deleted" | "player_not_found";
25
26
  }>;
26
27
  /**
@@ -29,6 +30,7 @@ export declare class ClubApi {
29
30
  * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Dpb9JAKqzG
30
31
  */
31
32
  linkPlayer(requestOptions?: IRequestOptions): Promise<import("./club.define").ClubPlayer | {
33
+ message: string;
32
34
  error: RequestInternalError | "seayoo_user_id_has_combo_id" | "combo_id_has_seayoo_user_id";
33
35
  }>;
34
36
  /**
@@ -71,6 +73,7 @@ export declare class ClubApi {
71
73
  * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Qt822A57jd
72
74
  */
73
75
  updateUserProfile(option: ClubUserProfile, requestOptions?: IRequestOptions): Promise<ClubUserProfile | {
76
+ message: string;
74
77
  error: RequestInternalError | "player_not_found" | "sensitive_nickname" | "sensitive_bio" | "sensitive_avatar";
75
78
  }>;
76
79
  /**
@@ -91,6 +94,7 @@ export declare class ClubApi {
91
94
  * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=p9FlJhHnWN
92
95
  */
93
96
  updateAddress(option: SomePartial<ClubAddress, "is_default">, requestOptions?: IRequestOptions): Promise<ClubAddress | {
97
+ message: string;
94
98
  error: RequestInternalError | "address_not_found";
95
99
  }>;
96
100
  /**
@@ -112,6 +116,7 @@ export declare class ClubApi {
112
116
  /** 游戏账号 ID,游戏外必传 */
113
117
  player_id?: string;
114
118
  }, requestOptions?: IRequestOptions): Promise<import("./club.define").ClubUserCredit | {
119
+ message: string;
115
120
  error: RequestInternalError | "player_not_found";
116
121
  }>;
117
122
  /**
@@ -172,6 +177,7 @@ export declare class ClubApi {
172
177
  /** 游戏账号 ID,游戏外必传 */
173
178
  player_id?: string;
174
179
  }, requestOptions?: IRequestOptions): Promise<true | {
180
+ message: string;
175
181
  error: RequestInternalError | "mall_product_not_found" | "credit_not_found" | "role_not_found" | "player_level_not_enough" | "credit_balance_not_enough" | "redeem_product_quantity_exceeds_limit" | "redeem_quantity_over_stock" | "redeem_quantity_over_daily_limit" | "redeem_quantity_over_month_limit" | "redeem_quantity_over_year_limit" | "redeem_quantity_over_total_limit" | "club_redeem_condition_dissatisfied";
176
182
  }>;
177
183
  /**
@@ -60,6 +60,7 @@ export declare class CommunityApi {
60
60
  posts: import("./community.define").Post[];
61
61
  next_token: string | undefined;
62
62
  } | {
63
+ message: string;
63
64
  error: RequestInternalError | "forum_not_found" | "topic_not_found";
64
65
  }>;
65
66
  /**
@@ -71,6 +72,7 @@ export declare class CommunityApi {
71
72
  posts: import("./community.define").Post[];
72
73
  next_token: string | undefined;
73
74
  } | {
75
+ message: string;
74
76
  error: RequestInternalError | "forum_not_found";
75
77
  }>;
76
78
  /**
@@ -79,6 +81,7 @@ export declare class CommunityApi {
79
81
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
80
82
  */
81
83
  getPost(postId: number, requestOptions?: IRequestOptions): Promise<import("./community.define").Post | {
84
+ message: string;
82
85
  error: RequestInternalError | "post_deleted";
83
86
  }>;
84
87
  /**
@@ -96,6 +99,7 @@ export declare class CommunityApi {
96
99
  post: import("./community.define").Post;
97
100
  antispam: import("./community.define").Antispam;
98
101
  } | {
102
+ message: string;
99
103
  error: RequestInternalError | "post_body_too_long" | "post_subject_too_long" | "post_tag_already_exists" | "moderation_check_text_error" | "moderation_check_image_error" | "unknown_moderation_suggestion" | "invalid_content_length" | "forum_disabled" | "not_allowed_to_post" | "please_real_name" | "post_tag_not_exists";
100
104
  }>;
101
105
  /**
@@ -116,6 +120,7 @@ export declare class CommunityApi {
116
120
  comments: import("./community.define").Comment[];
117
121
  next_token: string | undefined;
118
122
  } | {
123
+ message: string;
119
124
  error: RequestInternalError | "post_not_found" | "post_deleted";
120
125
  }>;
121
126
  /**
@@ -124,6 +129,7 @@ export declare class CommunityApi {
124
129
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
125
130
  */
126
131
  getComment(commentId: number, requestOptions?: IRequestOptions): Promise<import("./community.define").Comment | {
132
+ message: string;
127
133
  error: RequestInternalError | "comment_not_found" | "comment_deleted";
128
134
  }>;
129
135
  /**
@@ -142,6 +148,7 @@ export declare class CommunityApi {
142
148
  comment: import("./community.define").Comment | undefined;
143
149
  antispam: import("./community.define").Comment | undefined;
144
150
  } | {
151
+ message: string;
145
152
  error: RequestInternalError | "moderation_check_text_error" | "moderation_check_image_error" | "unknown_moderation_suggestion" | "invalid_content_length" | "forum_disabled" | "post_not_found" | "post_already_deleted";
146
153
  }>;
147
154
  /**
@@ -160,9 +167,7 @@ export declare class CommunityApi {
160
167
  next_token?: string;
161
168
  }, requestOptions?: IRequestOptions): Promise<{
162
169
  replies: import("./community.define").Reply[];
163
- next_token: string | undefined;
164
- } | {
165
- replies: never[];
170
+ next_token: string;
166
171
  }>;
167
172
  /**
168
173
  * 根据回复 id 获取回复详情
@@ -170,6 +175,7 @@ export declare class CommunityApi {
170
175
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
171
176
  */
172
177
  getReply(replyId: number, requestOptions?: IRequestOptions): Promise<import("./community.define").Reply | {
178
+ message: string;
173
179
  error: RequestInternalError | "reply_not_found" | "reply_deleted";
174
180
  }>;
175
181
  /**
@@ -188,6 +194,7 @@ export declare class CommunityApi {
188
194
  reply: import("./community.define").Reply | undefined;
189
195
  antispam: import("./community.define").Antispam | undefined;
190
196
  } | {
197
+ message: string;
191
198
  error: RequestInternalError | "moderation_check_text_error" | "moderation_check_image_error" | "comment_not_found" | "comment_deleted" | "reply_not_found" | "reply_deleted";
192
199
  }>;
193
200
  /**
@@ -201,6 +208,7 @@ export declare class CommunityApi {
201
208
  /** 目标 ID */
202
209
  target_id: number;
203
210
  }, requestOptions?: IRequestOptions): Promise<true | {
211
+ message: string;
204
212
  error: RequestInternalError | "post_not_found" | "post_deleted" | "comment_not_found" | "comment_deleted" | "reply_not_found" | "reply_deleted";
205
213
  }>;
206
214
  /**
@@ -214,6 +222,7 @@ export declare class CommunityApi {
214
222
  /** 目标 ID */
215
223
  target_id: number;
216
224
  }, requestOptions?: IRequestOptions): Promise<true | {
225
+ message: string;
217
226
  error: RequestInternalError | "post_not_found" | "post_deleted" | "comment_not_found" | "comment_deleted" | "reply_not_found" | "reply_deleted";
218
227
  }>;
219
228
  /**
@@ -247,9 +256,7 @@ export declare class CommunityApi {
247
256
  next_token?: string;
248
257
  }, requestOptions?: IRequestOptions): Promise<{
249
258
  notifications: (import("./community.define").NotificationSystem | import("./community.define").NotificationPost | import("./community.define").NotificationPostComment | import("./community.define").NotificationCommentReply | import("./community.define").NotificationComment | import("./community.define").NotificationReplyReplied | import("./community.define").NotificationReply)[];
250
- next_token: string | undefined;
251
- } | {
252
- notifications: never[];
259
+ next_token: string;
253
260
  }>;
254
261
  /**
255
262
  * 获取用户未读通知数量
@@ -57,6 +57,7 @@ export declare class EventApi {
57
57
  }, requestOptions?: IRequestOptions): Promise<{
58
58
  first_visit: boolean;
59
59
  } | {
60
+ message: string;
60
61
  error: RequestInternalError | "event_not_found" | "feature_not_found" | "invalid_server_id" | "invalid_role_id";
61
62
  }>;
62
63
  /**
@@ -95,7 +96,7 @@ export declare class EventApi {
95
96
  * 当玩法的 engage_account_type 为 role_id 时,可提供 server_id 和 role_id 获取具体角色的参与记录
96
97
  */
97
98
  role_id?: string;
98
- }, requestOptions?: IRequestOptions): Promise<never[] | {
99
+ }, requestOptions?: IRequestOptions): Promise<{
99
100
  engagements: import("./event.engage").UserEngagement[];
100
101
  next_token: string;
101
102
  }>;
@@ -120,6 +121,7 @@ export declare class EventApi {
120
121
  role_id?: string;
121
122
  role_name?: string;
122
123
  }, requestOptions?: IRequestOptions): Promise<import("./event.define").EngageResponse | {
124
+ message: string;
123
125
  error: RequestInternalError | "event_not_found" | "feature_not_found" | "invalid_weixin_appid" | "invalid_weixin_openid" | "event_not_started" | "event_already_ended" | "engage_feature_reached_limit" | "comment_too_frequently" | "lottery_reward_is_empty" | "invalid_merchant_parameter" | "budget_not_enough" | "combo_id_not_found" | "query_user_order_total_amount_err" | "unique_gift_code_is_empty" | "player_created_at_out_of_range" | "user_had_joined_a_team" | "team_is_full" | "disband_team_not_allowed" | "change_team_visibility_not_allowed" | "team_not_found" | "join_team_conflict" | "team_has_been_disbanded" | "exceeded_assembled_team_limit" | "invalid_engage_lottery_draw_ticket" | "lottery_ticket_not_found" | "draw_lottery_ticket_not_start" | "draw_lottery_ticket_is_ended" | "activation_group_not_found" | "activation_group_expired" | "no_claim_activation_key_eligibility" | "no_activation_key_available";
124
126
  }>;
125
127
  /**
@@ -133,12 +135,13 @@ export declare class EventApi {
133
135
  /** 产生奖励的来源 */
134
136
  reward_source: RewardSource;
135
137
  /** 游戏服务器 ID,领取游戏道具时为必填 */
136
- server_id?: number;
138
+ server_id?: string | number;
137
139
  /** 游戏角色 ID,领取游戏道具时为必填 */
138
140
  role_id?: string;
139
141
  /** 游戏角色名 */
140
142
  role_name?: string;
141
143
  }, requestOptions?: IRequestOptions): Promise<import("./event.define").ClaimedItem[] | {
144
+ message: string;
142
145
  error: RequestInternalError | "invalid_server_id" | "invalid_role_id" | "event_not_found" | "engagement_not_found" | "event_not_started" | "event_already_ended" | "claim_rewards_not_started" | "claim_rewards_already_ended" | "no_rewards_to_claim" | "reward_received" | "claim_reward_error";
143
146
  }>;
144
147
  /**
@@ -149,6 +152,7 @@ export declare class EventApi {
149
152
  claimWeixinHongbao(rewardId: number, requestOptions?: IRequestOptions): Promise<{
150
153
  reward_status: ClaimRewardStatus;
151
154
  } | {
155
+ message: string;
152
156
  error: RequestInternalError | "invalid_weixin_openid" | "event_not_started" | "event_already_ended" | "no_rewards_to_claim" | "reward_received" | "invalid_merchant_parameter" | "budget_not_enough";
153
157
  }>;
154
158
  /**
@@ -158,7 +162,9 @@ export declare class EventApi {
158
162
  */
159
163
  verifyActivationKey(activationKey: string, requestOptions?: IRequestOptions): Promise<true | {
160
164
  readonly error: "not_logged_in";
165
+ message?: undefined;
161
166
  } | {
167
+ message: string;
162
168
  error: RequestInternalError | "invalid_activation_key" | "activation_key_expired";
163
169
  }>;
164
170
  /**
@@ -185,7 +191,7 @@ export declare class EventApi {
185
191
  */
186
192
  getUserItemCount(itemId: number, requestOptions?: IRequestOptions): Promise<number | null>;
187
193
  /**
188
- * 填写实物奖励收货地址
194
+ * 填写实物奖励收货地址,返回 null 表示未登录
189
195
  *
190
196
  * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=QIwGhnaexb
191
197
  */
@@ -46,7 +46,8 @@ export declare class WeixinApi {
46
46
  *
47
47
  * https://kdocs.cn/l/cf2mO2uRLqh9?linkname=GwIZ0givCb
48
48
  */
49
- login(): Promise<import("./weixin.define").WeixinLoginResponse | {
49
+ login(requestOptions?: IRequestOptions): Promise<import("./weixin.define").WeixinLoginResponse | {
50
+ message: string;
50
51
  error: RequestInternalError | "invalid_weixin_appid" | "invalid_weixin_code";
51
52
  }>;
52
53
  /**
@@ -66,8 +67,10 @@ export declare class WeixinApi {
66
67
  * - snsapi_userinfo 【默认】弹出授权页面,可拿到 openid、union_id、昵称、头像等信息,但用户也可能会拒绝授权
67
68
  */
68
69
  webLogin(scope?: "snsapi_base" | "snsapi_userinfo", requestOptions?: IRequestOptions): Promise<import("./weixin.define").WeixinLoginResponse | {
70
+ message: string;
69
71
  error: WeixinWebLoginErrorCode;
70
72
  } | {
73
+ message: string;
71
74
  error: RequestInternalError | "invalid_weixin_appid" | "invalid_weixin_code";
72
75
  } | undefined>;
73
76
  /**
@@ -82,7 +85,7 @@ export declare class WeixinApi {
82
85
  * @param weixinToken 调用 login 后,得到的 weixinToken,如果 weixinToken 为空则跳过不处理
83
86
  * @param gameCode 从游戏内跳转至小程序时,通过请求参数 query 携带的 game_code,如果值为空则跳过不处理
84
87
  */
85
- linkPlayer(weixinToken: string, gameCode: string, requestOptions?: IRequestOptions): Promise<void>;
88
+ linkPlayer(weixinToken: string, gameCode: string, requestOptions?: IRequestOptions): Promise<boolean>;
86
89
  /**
87
90
  * 获取集成 JSSDK 所需的签名信息
88
91
  *