@seayoo-web/gamer-api 2.2.2 → 2.3.0
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/dist/index.js +735 -664
- package/package.json +6 -6
- package/types/src/club.d.ts +21 -21
- package/types/src/community.d.ts +20 -20
- package/types/src/event.config/feature.lottery.d.ts +1 -1
- package/types/src/event.config/reward.d.ts +1 -1
- package/types/src/event.d.ts +18 -18
- package/types/src/event.engage/index.d.ts +2 -2
- package/types/src/weixin.d.ts +4 -4
- package/types/index.d.ts +0 -5
- package/types/src/club.define.d.ts +0 -371
- package/types/src/club.enums.d.ts +0 -104
- package/types/src/club.guards.d.ts +0 -33
- package/types/src/community.define.d.ts +0 -331
- package/types/src/community.enums.d.ts +0 -99
- package/types/src/community.guards.d.ts +0 -52
- package/types/src/event.config/feature.base.d.ts +0 -23
- package/types/src/event.config/feature.cashback.d.ts +0 -18
- package/types/src/event.config/feature.checkIn.d.ts +0 -7
- package/types/src/event.config/feature.claimActivationKey.d.ts +0 -7
- package/types/src/event.config/feature.claimRewards.d.ts +0 -7
- package/types/src/event.config/feature.comment.d.ts +0 -14
- package/types/src/event.config/feature.d.ts +0 -40
- package/types/src/event.config/feature.follow.d.ts +0 -24
- package/types/src/event.config/feature.giftcode.d.ts +0 -24
- package/types/src/event.config/feature.invite.d.ts +0 -12
- package/types/src/event.config/feature.invitedRegister.d.ts +0 -7
- package/types/src/event.config/feature.lotteryDraw.d.ts +0 -14
- package/types/src/event.config/feature.preregister.d.ts +0 -7
- package/types/src/event.config/feature.quest.d.ts +0 -31
- package/types/src/event.config/feature.register.d.ts +0 -7
- package/types/src/event.config/feature.share.d.ts +0 -16
- package/types/src/event.config/feature.subscribe.d.ts +0 -12
- package/types/src/event.config/feature.survey.d.ts +0 -14
- package/types/src/event.config/feature.team.d.ts +0 -14
- package/types/src/event.config/feature.vote.d.ts +0 -44
- package/types/src/event.config/index.d.ts +0 -23
- package/types/src/event.config.d.ts +0 -228
- package/types/src/event.define.d.ts +0 -48
- package/types/src/event.engage/engage.cashback.d.ts +0 -9
- package/types/src/event.engage/engage.claimActivationKey.d.ts +0 -5
- package/types/src/event.engage/engage.comment.d.ts +0 -22
- package/types/src/event.engage/engage.d.ts +0 -49
- package/types/src/event.engage/engage.giftcode.d.ts +0 -5
- package/types/src/event.engage/engage.invite.d.ts +0 -9
- package/types/src/event.engage/engage.lottery.d.ts +0 -9
- package/types/src/event.engage/engage.lotteryDraw.d.ts +0 -40
- package/types/src/event.engage/engage.lotteryDraw.reward.d.ts +0 -38
- package/types/src/event.engage/engage.preregister.d.ts +0 -11
- package/types/src/event.engage/engage.quest.d.ts +0 -28
- package/types/src/event.engage/engage.share.d.ts +0 -9
- package/types/src/event.engage/engage.subscribe.d.ts +0 -14
- package/types/src/event.engage/engage.survey.d.ts +0 -7
- package/types/src/event.engage/engage.team.d.ts +0 -53
- package/types/src/event.engage/engage.vote.d.ts +0 -9
- package/types/src/event.engage/reward.d.ts +0 -52
- package/types/src/event.enums.d.ts +0 -392
- package/types/src/event.guards.d.ts +0 -38
- package/types/src/token.d.ts +0 -93
- package/types/src/token.define.d.ts +0 -31
- package/types/src/token.guards.d.ts +0 -5
- package/types/src/utils.d.ts +0 -12
- package/types/src/weixin.define.d.ts +0 -46
- package/types/src/weixin.guards.d.ts +0 -2
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
|
+
"version": "2.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^22.13.1",
|
|
26
26
|
"@seayoo-web/combo-webview": "^2.5.4",
|
|
27
|
-
"@seayoo-web/
|
|
28
|
-
"@seayoo-web/
|
|
29
|
-
"@seayoo-web/
|
|
30
|
-
"@seayoo-web/
|
|
27
|
+
"@seayoo-web/tsconfig": "^1.0.4",
|
|
28
|
+
"@seayoo-web/scripts": "^2.5.7",
|
|
29
|
+
"@seayoo-web/utils": "^3.5.2",
|
|
30
|
+
"@seayoo-web/request": "^3.2.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@seayoo-web/combo-webview": "^2.5.4",
|
|
34
|
-
"@seayoo-web/utils": "^3.5.
|
|
34
|
+
"@seayoo-web/utils": "^3.5.2"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"prebuild": "pnpm -F request build && pnpm -F combo-webview build",
|
package/types/src/club.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type SomePartial } from "@seayoo-web/utils";
|
|
|
2
2
|
import type { ClubAddress, ClubUserProfile, RedeemParams } from "./club.define";
|
|
3
3
|
import type { ClubCreditChangeType, ClubItemType } from "./club.enums";
|
|
4
4
|
import type { AuthToken } from "./token";
|
|
5
|
-
import type { RequestInternalError } from "@seayoo-web/request";
|
|
5
|
+
import type { RequestInternalError, IRequestOptions } from "@seayoo-web/request";
|
|
6
6
|
export * from "./club.enums";
|
|
7
7
|
export * from "./club.define";
|
|
8
8
|
export declare class ClubApi {
|
|
@@ -14,13 +14,13 @@ export declare class ClubApi {
|
|
|
14
14
|
*
|
|
15
15
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=tuhsPt3ihp
|
|
16
16
|
*/
|
|
17
|
-
getConfig(): Promise<import("./club.define").ClubGlobalConfig | null>;
|
|
17
|
+
getConfig(requestOptions?: IRequestOptions): Promise<import("./club.define").ClubGlobalConfig | null>;
|
|
18
18
|
/**
|
|
19
19
|
* 用于游戏内嵌 Web 页面和微信小程序获取当前登录的游戏账号在俱乐部中的信息。
|
|
20
20
|
*
|
|
21
21
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=hIDfaMlT7m
|
|
22
22
|
*/
|
|
23
|
-
getCurrentPlayer(): Promise<import("./club.define").ClubPlayer | {
|
|
23
|
+
getCurrentPlayer(requestOptions?: IRequestOptions): Promise<import("./club.define").ClubPlayer | {
|
|
24
24
|
error: RequestInternalError | "seayoo_account_already_deleted" | "player_not_found";
|
|
25
25
|
}>;
|
|
26
26
|
/**
|
|
@@ -28,7 +28,7 @@ export declare class ClubApi {
|
|
|
28
28
|
*
|
|
29
29
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Dpb9JAKqzG
|
|
30
30
|
*/
|
|
31
|
-
linkPlayer(): Promise<import("./club.define").ClubPlayer | {
|
|
31
|
+
linkPlayer(requestOptions?: IRequestOptions): Promise<import("./club.define").ClubPlayer | {
|
|
32
32
|
error: RequestInternalError | "seayoo_user_id_has_combo_id" | "combo_id_has_seayoo_user_id";
|
|
33
33
|
}>;
|
|
34
34
|
/**
|
|
@@ -36,13 +36,13 @@ export declare class ClubApi {
|
|
|
36
36
|
*
|
|
37
37
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=nwu4FiGM9V
|
|
38
38
|
*/
|
|
39
|
-
getRoles(playerId: string, forceReload?: boolean): Promise<import("./club.define").PlayerRole[]>;
|
|
39
|
+
getRoles(playerId: string, forceReload?: boolean, requestOptions?: IRequestOptions): Promise<import("./club.define").PlayerRole[]>;
|
|
40
40
|
/**
|
|
41
41
|
* 获取俱乐部会员的角色卡片数据
|
|
42
42
|
*
|
|
43
43
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=A1Wr7kUXnS
|
|
44
44
|
*/
|
|
45
|
-
getRoleCard(memberId: string): Promise<import("./club.define").PlayerRoleCard | null>;
|
|
45
|
+
getRoleCard(memberId: string, requestOptions?: IRequestOptions): Promise<import("./club.define").PlayerRoleCard | null>;
|
|
46
46
|
/**
|
|
47
47
|
* 设置自己的角色卡片
|
|
48
48
|
*
|
|
@@ -52,25 +52,25 @@ export declare class ClubApi {
|
|
|
52
52
|
player_id: string;
|
|
53
53
|
server_id: string;
|
|
54
54
|
role_id: string;
|
|
55
|
-
}): Promise<import("./club.define").PlayerRoleCard | null>;
|
|
55
|
+
}, requestOptions?: IRequestOptions): Promise<import("./club.define").PlayerRoleCard | null>;
|
|
56
56
|
/**
|
|
57
57
|
* 强制刷新自己的角色卡片,从游戏内获取最新数据
|
|
58
58
|
*
|
|
59
59
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=RPdJquwmgv
|
|
60
60
|
*/
|
|
61
|
-
refreshRoleCard(): Promise<import("./club.define").PlayerRoleCard | null>;
|
|
61
|
+
refreshRoleCard(requestOptions?: IRequestOptions): Promise<import("./club.define").PlayerRoleCard | null>;
|
|
62
62
|
/**
|
|
63
63
|
* 获取俱乐部用户的信息
|
|
64
64
|
*
|
|
65
65
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TMWBCFcOr2
|
|
66
66
|
*/
|
|
67
|
-
getUserProfile(memberId: string): Promise<ClubUserProfile | null>;
|
|
67
|
+
getUserProfile(memberId: string, requestOptions?: IRequestOptions): Promise<ClubUserProfile | null>;
|
|
68
68
|
/**
|
|
69
69
|
* 修改自己的俱乐部用户信息
|
|
70
70
|
*
|
|
71
71
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Qt822A57jd
|
|
72
72
|
*/
|
|
73
|
-
updateUserProfile(option: ClubUserProfile): Promise<ClubUserProfile | {
|
|
73
|
+
updateUserProfile(option: ClubUserProfile, requestOptions?: IRequestOptions): Promise<ClubUserProfile | {
|
|
74
74
|
error: RequestInternalError | "player_not_found" | "sensitive_nickname" | "sensitive_bio" | "sensitive_avatar";
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
@@ -78,19 +78,19 @@ export declare class ClubApi {
|
|
|
78
78
|
*
|
|
79
79
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=NowUIynMVn
|
|
80
80
|
*/
|
|
81
|
-
getAddresses(): Promise<ClubAddress[]>;
|
|
81
|
+
getAddresses(requestOptions?: IRequestOptions): Promise<ClubAddress[]>;
|
|
82
82
|
/**
|
|
83
83
|
* 增加俱乐部收货地址
|
|
84
84
|
*
|
|
85
85
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TaGIIYDRYA
|
|
86
86
|
*/
|
|
87
|
-
addAddress(option: Omit<SomePartial<ClubAddress, "is_default">, "address_id"
|
|
87
|
+
addAddress(option: Omit<SomePartial<ClubAddress, "is_default">, "address_id">, requestOptions?: IRequestOptions): Promise<ClubAddress | null>;
|
|
88
88
|
/**
|
|
89
89
|
* 修改自己的俱乐部收货地址
|
|
90
90
|
*
|
|
91
91
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=p9FlJhHnWN
|
|
92
92
|
*/
|
|
93
|
-
updateAddress(option: SomePartial<ClubAddress, "is_default"
|
|
93
|
+
updateAddress(option: SomePartial<ClubAddress, "is_default">, requestOptions?: IRequestOptions): Promise<ClubAddress | {
|
|
94
94
|
error: RequestInternalError | "address_not_found";
|
|
95
95
|
}>;
|
|
96
96
|
/**
|
|
@@ -98,7 +98,7 @@ export declare class ClubApi {
|
|
|
98
98
|
*
|
|
99
99
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=MEEOBdf8rm
|
|
100
100
|
*/
|
|
101
|
-
deleteAddress(addressId: number): Promise<boolean | null>;
|
|
101
|
+
deleteAddress(addressId: number, requestOptions?: IRequestOptions): Promise<boolean | null>;
|
|
102
102
|
/**
|
|
103
103
|
* 获取俱乐部积分统计信息
|
|
104
104
|
*
|
|
@@ -111,7 +111,7 @@ export declare class ClubApi {
|
|
|
111
111
|
end_time: number;
|
|
112
112
|
/** 游戏账号 ID,游戏外必传 */
|
|
113
113
|
player_id?: string;
|
|
114
|
-
}): Promise<import("./club.define").ClubUserCredit | {
|
|
114
|
+
}, requestOptions?: IRequestOptions): Promise<import("./club.define").ClubUserCredit | {
|
|
115
115
|
error: RequestInternalError | "player_not_found";
|
|
116
116
|
}>;
|
|
117
117
|
/**
|
|
@@ -132,7 +132,7 @@ export declare class ClubApi {
|
|
|
132
132
|
end_time: number;
|
|
133
133
|
/** 游戏账号 ID,游戏外必传 */
|
|
134
134
|
player_id?: string;
|
|
135
|
-
}): Promise<{
|
|
135
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
136
136
|
credit_logs: import("./club.define").ClubCreditLog[];
|
|
137
137
|
next_token: string | undefined;
|
|
138
138
|
}>;
|
|
@@ -141,13 +141,13 @@ export declare class ClubApi {
|
|
|
141
141
|
*
|
|
142
142
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=UFSDGvqkdV
|
|
143
143
|
*/
|
|
144
|
-
getBenefits(): Promise<import("./club.define").ClubBenefitSummary[]>;
|
|
144
|
+
getBenefits(requestOptions?: IRequestOptions): Promise<import("./club.define").ClubBenefitSummary[]>;
|
|
145
145
|
/**
|
|
146
146
|
* 获取某个权益详细信息
|
|
147
147
|
*
|
|
148
148
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=XKto0MeaHF
|
|
149
149
|
*/
|
|
150
|
-
getBenefit(benefitId: number): Promise<import("./club.define").ClubBenefit | null>;
|
|
150
|
+
getBenefit(benefitId: number, requestOptions?: IRequestOptions): Promise<import("./club.define").ClubBenefit | null>;
|
|
151
151
|
/**
|
|
152
152
|
* 获取商城商品列表
|
|
153
153
|
*
|
|
@@ -156,7 +156,7 @@ export declare class ClubApi {
|
|
|
156
156
|
getProducts(option?: {
|
|
157
157
|
/** 游戏账号 ID,游戏外必传 */
|
|
158
158
|
player_id?: string;
|
|
159
|
-
}): Promise<import("./club.define").ClubProduct[]>;
|
|
159
|
+
}, requestOptions?: IRequestOptions): Promise<import("./club.define").ClubProduct[]>;
|
|
160
160
|
/**
|
|
161
161
|
* 兑换商城商品
|
|
162
162
|
*
|
|
@@ -171,7 +171,7 @@ export declare class ClubApi {
|
|
|
171
171
|
params?: RedeemParams;
|
|
172
172
|
/** 游戏账号 ID,游戏外必传 */
|
|
173
173
|
player_id?: string;
|
|
174
|
-
}): Promise<true | {
|
|
174
|
+
}, requestOptions?: IRequestOptions): Promise<true | {
|
|
175
175
|
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
176
|
}>;
|
|
177
177
|
/**
|
|
@@ -188,7 +188,7 @@ export declare class ClubApi {
|
|
|
188
188
|
item_type?: ClubItemType;
|
|
189
189
|
/** 游戏账号 ID,游戏外必传 */
|
|
190
190
|
player_id?: string;
|
|
191
|
-
}): Promise<{
|
|
191
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
192
192
|
redemptions: import("./club.define").Redemption[];
|
|
193
193
|
next_token: string | undefined;
|
|
194
194
|
}>;
|
package/types/src/community.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NotificationCategory } from "./community.enums";
|
|
2
2
|
import type { AuthToken } from "./token";
|
|
3
|
-
import type { RequestInternalError } from "@seayoo-web/request";
|
|
3
|
+
import type { IRequestOptions, RequestInternalError } from "@seayoo-web/request";
|
|
4
4
|
export * from "./community.enums";
|
|
5
5
|
export * from "./community.define";
|
|
6
6
|
export declare class CommunityApi {
|
|
@@ -12,19 +12,19 @@ export declare class CommunityApi {
|
|
|
12
12
|
*
|
|
13
13
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
14
14
|
*/
|
|
15
|
-
getForums(): Promise<import("./community.define").Forum[]>;
|
|
15
|
+
getForums(requestOptions?: IRequestOptions): Promise<import("./community.define").Forum[]>;
|
|
16
16
|
/**
|
|
17
17
|
* 获取社区话题列表,仅返回启用状态的话题
|
|
18
18
|
*
|
|
19
19
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
20
20
|
*/
|
|
21
|
-
getTopics(): Promise<import("./community.define").Topic[]>;
|
|
21
|
+
getTopics(requestOptions?: IRequestOptions): Promise<import("./community.define").Topic[]>;
|
|
22
22
|
/**
|
|
23
23
|
* 根据话题 ID 获取社区话题信息
|
|
24
24
|
*
|
|
25
25
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
26
26
|
*/
|
|
27
|
-
getTopic(topicId: number): Promise<import("./community.define").Topic | {
|
|
27
|
+
getTopic(topicId: number, requestOptions?: IRequestOptions): Promise<import("./community.define").Topic | {
|
|
28
28
|
error: RequestInternalError | "topic_not_enabled" | "topic_not_found";
|
|
29
29
|
}>;
|
|
30
30
|
/**
|
|
@@ -56,7 +56,7 @@ export declare class CommunityApi {
|
|
|
56
56
|
* - post_like 帖子点赞数排序
|
|
57
57
|
*/
|
|
58
58
|
sort_key?: "post_time_desc" | "post_like";
|
|
59
|
-
}): Promise<{
|
|
59
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
60
60
|
posts: import("./community.define").Post[];
|
|
61
61
|
next_token: string | undefined;
|
|
62
62
|
} | {
|
|
@@ -67,7 +67,7 @@ export declare class CommunityApi {
|
|
|
67
67
|
*
|
|
68
68
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
69
69
|
*/
|
|
70
|
-
getPinnedPosts(forumId: number, maxResults: number, nextToken?: string): Promise<{
|
|
70
|
+
getPinnedPosts(forumId: number, maxResults: number, nextToken?: string, requestOptions?: IRequestOptions): Promise<{
|
|
71
71
|
posts: import("./community.define").Post[];
|
|
72
72
|
next_token: string | undefined;
|
|
73
73
|
} | {
|
|
@@ -78,7 +78,7 @@ export declare class CommunityApi {
|
|
|
78
78
|
*
|
|
79
79
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
80
80
|
*/
|
|
81
|
-
getPost(postId: number): Promise<import("./community.define").Post | {
|
|
81
|
+
getPost(postId: number, requestOptions?: IRequestOptions): Promise<import("./community.define").Post | {
|
|
82
82
|
error: RequestInternalError | "post_deleted";
|
|
83
83
|
}>;
|
|
84
84
|
/**
|
|
@@ -92,7 +92,7 @@ export declare class CommunityApi {
|
|
|
92
92
|
title?: string;
|
|
93
93
|
image_urls?: string[];
|
|
94
94
|
topic_ids?: number[];
|
|
95
|
-
}): Promise<{
|
|
95
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
96
96
|
post: import("./community.define").Post;
|
|
97
97
|
antispam: import("./community.define").Antispam;
|
|
98
98
|
} | {
|
|
@@ -112,7 +112,7 @@ export declare class CommunityApi {
|
|
|
112
112
|
max_results: number;
|
|
113
113
|
/** 分页token */
|
|
114
114
|
next_token?: string;
|
|
115
|
-
}): Promise<{
|
|
115
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
116
116
|
comments: import("./community.define").Comment[];
|
|
117
117
|
next_token: string | undefined;
|
|
118
118
|
} | {
|
|
@@ -123,7 +123,7 @@ export declare class CommunityApi {
|
|
|
123
123
|
*
|
|
124
124
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
125
125
|
*/
|
|
126
|
-
getComment(commentId: number): Promise<import("./community.define").Comment | {
|
|
126
|
+
getComment(commentId: number, requestOptions?: IRequestOptions): Promise<import("./community.define").Comment | {
|
|
127
127
|
error: RequestInternalError | "comment_not_found" | "comment_deleted";
|
|
128
128
|
}>;
|
|
129
129
|
/**
|
|
@@ -138,7 +138,7 @@ export declare class CommunityApi {
|
|
|
138
138
|
content: string;
|
|
139
139
|
/** 评论内容图片地址 */
|
|
140
140
|
image_url?: string;
|
|
141
|
-
}): Promise<{
|
|
141
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
142
142
|
comment: import("./community.define").Comment | undefined;
|
|
143
143
|
antispam: import("./community.define").Comment | undefined;
|
|
144
144
|
} | {
|
|
@@ -158,7 +158,7 @@ export declare class CommunityApi {
|
|
|
158
158
|
query_value: string;
|
|
159
159
|
/** 分页标识,不传默认首次查询 */
|
|
160
160
|
next_token?: string;
|
|
161
|
-
}): Promise<{
|
|
161
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
162
162
|
replies: import("./community.define").Reply[];
|
|
163
163
|
next_token: string | undefined;
|
|
164
164
|
} | {
|
|
@@ -169,7 +169,7 @@ export declare class CommunityApi {
|
|
|
169
169
|
*
|
|
170
170
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
171
171
|
*/
|
|
172
|
-
getReply(replyId: number): Promise<import("./community.define").Reply | {
|
|
172
|
+
getReply(replyId: number, requestOptions?: IRequestOptions): Promise<import("./community.define").Reply | {
|
|
173
173
|
error: RequestInternalError | "reply_not_found" | "reply_deleted";
|
|
174
174
|
}>;
|
|
175
175
|
/**
|
|
@@ -184,7 +184,7 @@ export declare class CommunityApi {
|
|
|
184
184
|
content: string;
|
|
185
185
|
/** 回复的回复 ID (仅当回复回复的时候需要) */
|
|
186
186
|
reply_id?: number;
|
|
187
|
-
}): Promise<{
|
|
187
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
188
188
|
reply: import("./community.define").Reply | undefined;
|
|
189
189
|
antispam: import("./community.define").Antispam | undefined;
|
|
190
190
|
} | {
|
|
@@ -200,7 +200,7 @@ export declare class CommunityApi {
|
|
|
200
200
|
target_type: "post" | "comment" | "reply";
|
|
201
201
|
/** 目标 ID */
|
|
202
202
|
target_id: number;
|
|
203
|
-
}): Promise<true | {
|
|
203
|
+
}, requestOptions?: IRequestOptions): Promise<true | {
|
|
204
204
|
error: RequestInternalError | "post_not_found" | "post_deleted" | "comment_not_found" | "comment_deleted" | "reply_not_found" | "reply_deleted";
|
|
205
205
|
}>;
|
|
206
206
|
/**
|
|
@@ -213,7 +213,7 @@ export declare class CommunityApi {
|
|
|
213
213
|
target_type: "post" | "comment" | "reply";
|
|
214
214
|
/** 目标 ID */
|
|
215
215
|
target_id: number;
|
|
216
|
-
}): Promise<true | {
|
|
216
|
+
}, requestOptions?: IRequestOptions): Promise<true | {
|
|
217
217
|
error: RequestInternalError | "post_not_found" | "post_deleted" | "comment_not_found" | "comment_deleted" | "reply_not_found" | "reply_deleted";
|
|
218
218
|
}>;
|
|
219
219
|
/**
|
|
@@ -230,7 +230,7 @@ export declare class CommunityApi {
|
|
|
230
230
|
filename: string;
|
|
231
231
|
/** 资源文件内容的 SHA-256 哈希值,用于校验上传对象的完整性 */
|
|
232
232
|
content_sha256: string;
|
|
233
|
-
}): Promise<import("./community.define").PresignedUrlResponse | null>;
|
|
233
|
+
}, requestOptions?: IRequestOptions): Promise<import("./community.define").PresignedUrlResponse | null>;
|
|
234
234
|
/**
|
|
235
235
|
* 获取用户社区通知
|
|
236
236
|
*
|
|
@@ -245,7 +245,7 @@ export declare class CommunityApi {
|
|
|
245
245
|
max_results?: number;
|
|
246
246
|
/** 分页标识,不传默认首次查询 */
|
|
247
247
|
next_token?: string;
|
|
248
|
-
}): Promise<{
|
|
248
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
249
249
|
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
250
|
next_token: string | undefined;
|
|
251
251
|
} | {
|
|
@@ -256,7 +256,7 @@ export declare class CommunityApi {
|
|
|
256
256
|
*
|
|
257
257
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CwIOMjAfMU
|
|
258
258
|
*/
|
|
259
|
-
getUnreadNotificationsCount(): Promise<{
|
|
259
|
+
getUnreadNotificationsCount(requestOptions?: IRequestOptions): Promise<{
|
|
260
260
|
system: number;
|
|
261
261
|
comment: number;
|
|
262
262
|
like: number;
|
|
@@ -266,5 +266,5 @@ export declare class CommunityApi {
|
|
|
266
266
|
*
|
|
267
267
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=TCJQxnOjJe
|
|
268
268
|
*/
|
|
269
|
-
clearUnreadNotifications(category: NotificationCategory): Promise<boolean>;
|
|
269
|
+
clearUnreadNotifications(category: NotificationCategory, requestOptions?: IRequestOptions): Promise<boolean>;
|
|
270
270
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InferType } from "@seayoo-web/utils";
|
|
2
2
|
import { type EventFeatureBaseConfig } from "./feature.base";
|
|
3
|
-
declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"
|
|
3
|
+
declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"credit" | "event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "external_gift_code" | "void_item", false, false>;
|
|
4
4
|
declare const featureType: "lottery";
|
|
5
5
|
export interface FeatureLotteryItemConfig {
|
|
6
6
|
/** 抽奖奖励道具 id */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InferType } from "@seayoo-web/utils";
|
|
2
|
-
declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"
|
|
2
|
+
declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"credit" | "event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "external_gift_code" | "void_item", false, false>;
|
|
3
3
|
export interface EventRewardItemConfig {
|
|
4
4
|
/** 玩法奖励道具 id */
|
|
5
5
|
reward_item_id: number;
|
package/types/src/event.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClaimRewardStatus, type GamerItemType, type RewardSource } from "./event.enums";
|
|
2
2
|
import type { EngagementFeatureType, InferEngagementParam } from "./event.define";
|
|
3
3
|
import type { AuthToken } from "./token";
|
|
4
|
-
import type { RequestInternalError } from "@seayoo-web/request";
|
|
4
|
+
import type { IRequestOptions, RequestInternalError } from "@seayoo-web/request";
|
|
5
5
|
export * from "./event.define";
|
|
6
6
|
export * from "./event.enums";
|
|
7
7
|
/** EventApi */
|
|
@@ -15,25 +15,25 @@ export declare class EventApi {
|
|
|
15
15
|
*
|
|
16
16
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl
|
|
17
17
|
*/
|
|
18
|
-
verifyMobileAllowed(gameId: string, mobile: string): Promise<import("./event.define").VerifyMobileResult | null>;
|
|
18
|
+
verifyMobileAllowed(gameId: string, mobile: string, requestOptions?: IRequestOptions): Promise<import("./event.define").VerifyMobileResult | null>;
|
|
19
19
|
/**
|
|
20
20
|
* 获取运营活动的基础配置信息
|
|
21
21
|
*
|
|
22
22
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=wFXxtdNKPm
|
|
23
23
|
*/
|
|
24
|
-
getConfig(): Promise<import("./event.config").EventConfig | null>;
|
|
24
|
+
getConfig(requestOptions?: IRequestOptions): Promise<import("./event.config").EventConfig | null>;
|
|
25
25
|
/**
|
|
26
26
|
* 获取某个玩法参与用户数量
|
|
27
27
|
*
|
|
28
28
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=ejPOcWMvT1
|
|
29
29
|
*/
|
|
30
|
-
getEngagementsUserCount(featureId: number): Promise<number | null>;
|
|
30
|
+
getEngagementsUserCount(featureId: number, requestOptions?: IRequestOptions): Promise<number | null>;
|
|
31
31
|
/**
|
|
32
32
|
* 获取某个玩法参与次数
|
|
33
33
|
*
|
|
34
34
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=ejPOcWMvT1
|
|
35
35
|
*/
|
|
36
|
-
getEngagementsCount(featureId: number): Promise<number | null>;
|
|
36
|
+
getEngagementsCount(featureId: number, requestOptions?: IRequestOptions): Promise<number | null>;
|
|
37
37
|
/**
|
|
38
38
|
* 获取某个玩法的参与记录(和特定用户无关)
|
|
39
39
|
*
|
|
@@ -41,7 +41,7 @@ export declare class EventApi {
|
|
|
41
41
|
*
|
|
42
42
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=THtZ4ewIQW
|
|
43
43
|
*/
|
|
44
|
-
getEngagements(featureId: number): Promise<import("./event.engage").CommentEngagement[] | import("./event.engage").TeamEngagement[]>;
|
|
44
|
+
getEngagements(featureId: number, requestOptions?: IRequestOptions): Promise<import("./event.engage").CommentEngagement[] | import("./event.engage").TeamEngagement[]>;
|
|
45
45
|
/**
|
|
46
46
|
* 用户访问某个活动或玩法
|
|
47
47
|
*
|
|
@@ -54,7 +54,7 @@ export declare class EventApi {
|
|
|
54
54
|
utm_source?: string;
|
|
55
55
|
/** 邀请人的世游通行证 ID */
|
|
56
56
|
invited_by?: string;
|
|
57
|
-
}): Promise<{
|
|
57
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
58
58
|
first_visit: boolean;
|
|
59
59
|
} | {
|
|
60
60
|
error: RequestInternalError | "event_not_found" | "feature_not_found" | "invalid_server_id" | "invalid_role_id";
|
|
@@ -71,7 +71,7 @@ export declare class EventApi {
|
|
|
71
71
|
getUserFeatureStatus(option?: {
|
|
72
72
|
server_id: string;
|
|
73
73
|
role_id: string;
|
|
74
|
-
}): Promise<import("./event.define").UserFeatureStatus[]>;
|
|
74
|
+
}, requestOptions?: IRequestOptions): Promise<import("./event.define").UserFeatureStatus[]>;
|
|
75
75
|
/**
|
|
76
76
|
* 获取当前登录用户参与某个玩法的记录
|
|
77
77
|
*
|
|
@@ -95,7 +95,7 @@ export declare class EventApi {
|
|
|
95
95
|
* 当玩法的 engage_account_type 为 role_id 时,可提供 server_id 和 role_id 获取具体角色的参与记录
|
|
96
96
|
*/
|
|
97
97
|
role_id?: string;
|
|
98
|
-
}): Promise<never[] | {
|
|
98
|
+
}, requestOptions?: IRequestOptions): Promise<never[] | {
|
|
99
99
|
engagements: import("./event.engage").UserEngagement[];
|
|
100
100
|
next_token: string;
|
|
101
101
|
}>;
|
|
@@ -119,7 +119,7 @@ export declare class EventApi {
|
|
|
119
119
|
server_name?: string;
|
|
120
120
|
role_id?: string;
|
|
121
121
|
role_name?: string;
|
|
122
|
-
}): Promise<import("./event.define").EngageResponse | {
|
|
122
|
+
}, requestOptions?: IRequestOptions): Promise<import("./event.define").EngageResponse | {
|
|
123
123
|
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";
|
|
124
124
|
}>;
|
|
125
125
|
/**
|
|
@@ -138,7 +138,7 @@ export declare class EventApi {
|
|
|
138
138
|
role_id?: string;
|
|
139
139
|
/** 游戏角色名 */
|
|
140
140
|
role_name?: string;
|
|
141
|
-
}): Promise<import("./event.define").ClaimedItem[] | {
|
|
141
|
+
}, requestOptions?: IRequestOptions): Promise<import("./event.define").ClaimedItem[] | {
|
|
142
142
|
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
143
|
}>;
|
|
144
144
|
/**
|
|
@@ -146,7 +146,7 @@ export declare class EventApi {
|
|
|
146
146
|
*
|
|
147
147
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=aQLhlOAB4Q
|
|
148
148
|
*/
|
|
149
|
-
claimWeixinHongbao(rewardId: number): Promise<{
|
|
149
|
+
claimWeixinHongbao(rewardId: number, requestOptions?: IRequestOptions): Promise<{
|
|
150
150
|
reward_status: ClaimRewardStatus;
|
|
151
151
|
} | {
|
|
152
152
|
error: RequestInternalError | "invalid_weixin_openid" | "event_not_started" | "event_already_ended" | "no_rewards_to_claim" | "reward_received" | "invalid_merchant_parameter" | "budget_not_enough";
|
|
@@ -164,7 +164,7 @@ export declare class EventApi {
|
|
|
164
164
|
/** 单次查询的数量,默认 20 */
|
|
165
165
|
max_results?: number;
|
|
166
166
|
next_token?: string;
|
|
167
|
-
}): Promise<{
|
|
167
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
168
168
|
user_rewards: import("./event.engage").UserReward[];
|
|
169
169
|
next_token: string;
|
|
170
170
|
}>;
|
|
@@ -173,7 +173,7 @@ export declare class EventApi {
|
|
|
173
173
|
*
|
|
174
174
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=mnGCTeTgMb
|
|
175
175
|
*/
|
|
176
|
-
getUserItemCount(itemId: number): Promise<number | null>;
|
|
176
|
+
getUserItemCount(itemId: number, requestOptions?: IRequestOptions): Promise<number | null>;
|
|
177
177
|
/**
|
|
178
178
|
* 填写实物奖励收货地址
|
|
179
179
|
*
|
|
@@ -196,7 +196,7 @@ export declare class EventApi {
|
|
|
196
196
|
district: string;
|
|
197
197
|
/** 详细收货地址 */
|
|
198
198
|
address: string;
|
|
199
|
-
}): Promise<boolean | null>;
|
|
199
|
+
}, requestOptions?: IRequestOptions): Promise<boolean | null>;
|
|
200
200
|
/**
|
|
201
201
|
* 小程序码携带参数最多 32 个可见字符,若前端携带参数过长,则将参数保存在 api 中,并返回符合小程序码要求的 scene
|
|
202
202
|
*
|
|
@@ -204,7 +204,7 @@ export declare class EventApi {
|
|
|
204
204
|
*
|
|
205
205
|
* @param params - 前端扫描二维码打开小程序所需参数
|
|
206
206
|
*/
|
|
207
|
-
getUnlimitQrcodeScene(params: string): Promise<string | null>;
|
|
207
|
+
getUnlimitQrcodeScene(params: string, requestOptions?: IRequestOptions): Promise<string | null>;
|
|
208
208
|
/**
|
|
209
209
|
* 根据小程序码携带 scene 值,获取对应的前端所需参数
|
|
210
210
|
*
|
|
@@ -212,7 +212,7 @@ export declare class EventApi {
|
|
|
212
212
|
*
|
|
213
213
|
* @param scene - 小程序码 scene 值
|
|
214
214
|
*/
|
|
215
|
-
getParamsByQrcodeScene(scene: string): Promise<string | null>;
|
|
215
|
+
getParamsByQrcodeScene(scene: string, requestOptions?: IRequestOptions): Promise<string | null>;
|
|
216
216
|
/**
|
|
217
217
|
* 生成不限制的带参数的小程序码(dataURI 格式的小程序码图片)
|
|
218
218
|
*
|
|
@@ -254,5 +254,5 @@ export declare class EventApi {
|
|
|
254
254
|
};
|
|
255
255
|
/** 生成的小程序码是否需要透明底色 */
|
|
256
256
|
is_hyaline?: boolean;
|
|
257
|
-
}): Promise<string | null>;
|
|
257
|
+
}, requestOptions?: IRequestOptions): Promise<string | null>;
|
|
258
258
|
}
|
|
@@ -29,11 +29,11 @@ export declare const UserEngagementValidator: import("@seayoo-web/utils").Object
|
|
|
29
29
|
lock: never;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* 部分玩法参与时需要提供的参数
|
|
33
33
|
*/
|
|
34
34
|
export type EngagementParam = PreregisterEngagementParam | LotteryEngagementParam | CommentEngagementParam | ShareEngagementParam | VoteEngagementParam | SubscribeEngagementParam | TeamEngagementParam | LotteryDrawEngagementParam;
|
|
35
35
|
export type EngagementFeatureType = FeatureType | unknown;
|
|
36
36
|
/**
|
|
37
37
|
* 根据玩法类型推导需要提交的参数数据类型
|
|
38
38
|
*/
|
|
39
|
-
export type InferEngagementParam<T extends EngagementFeatureType> = [unknown] extends [T] ? EngagementParam : [T] extends ["preregister"] ? PreregisterEngagementParam : [T] extends ["lottery"] ? LotteryEngagementParam : [T] extends ["comment"] ? CommentEngagementParam : [T] extends ["share"] ? ShareEngagementParam : [T] extends ["vote"] ? VoteEngagementParam : [T] extends ["weixin_subscribe"] ? SubscribeEngagementParam : null;
|
|
39
|
+
export type InferEngagementParam<T extends EngagementFeatureType> = [unknown] extends [T] ? EngagementParam : [T] extends ["preregister"] ? PreregisterEngagementParam : [T] extends ["lottery"] ? LotteryEngagementParam : [T] extends ["comment"] ? CommentEngagementParam : [T] extends ["share"] ? ShareEngagementParam : [T] extends ["vote"] ? VoteEngagementParam : [T] extends ["weixin_subscribe"] ? SubscribeEngagementParam : [T] extends ["team"] ? TeamEngagementParam : [T] extends ["lottery_draw"] ? LotteryDrawEngagementParam : null;
|
package/types/src/weixin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type WeixinWebLoginErrorCode } from "./weixin.define";
|
|
2
2
|
import type { AuthToken } from "./token";
|
|
3
|
-
import type { RequestInternalError } from "@seayoo-web/request";
|
|
3
|
+
import type { IRequestOptions, RequestInternalError } from "@seayoo-web/request";
|
|
4
4
|
export * from "./weixin.define";
|
|
5
5
|
export declare class WeixinApi {
|
|
6
6
|
private token;
|
|
@@ -65,7 +65,7 @@ export declare class WeixinApi {
|
|
|
65
65
|
* - snsapi_base 不弹出授权页面,用户无感知,只能获取用户 openid,如果需要获取 union_id 则需要 snsapi_userinfo
|
|
66
66
|
* - snsapi_userinfo 【默认】弹出授权页面,可拿到 openid、union_id、昵称、头像等信息,但用户也可能会拒绝授权
|
|
67
67
|
*/
|
|
68
|
-
webLogin(scope?: "snsapi_base" | "snsapi_userinfo"): Promise<import("./weixin.define").WeixinLoginResponse | {
|
|
68
|
+
webLogin(scope?: "snsapi_base" | "snsapi_userinfo", requestOptions?: IRequestOptions): Promise<import("./weixin.define").WeixinLoginResponse | {
|
|
69
69
|
error: WeixinWebLoginErrorCode;
|
|
70
70
|
} | {
|
|
71
71
|
error: RequestInternalError | "invalid_weixin_appid" | "invalid_weixin_code";
|
|
@@ -82,13 +82,13 @@ export declare class WeixinApi {
|
|
|
82
82
|
* @param weixinToken 调用 login 后,得到的 weixinToken,如果 weixinToken 为空则跳过不处理
|
|
83
83
|
* @param gameCode 从游戏内跳转至小程序时,通过请求参数 query 携带的 game_code,如果值为空则跳过不处理
|
|
84
84
|
*/
|
|
85
|
-
linkPlayer(weixinToken: string, gameCode: string): Promise<void>;
|
|
85
|
+
linkPlayer(weixinToken: string, gameCode: string, requestOptions?: IRequestOptions): Promise<void>;
|
|
86
86
|
/**
|
|
87
87
|
* 获取集成 JSSDK 所需的签名信息
|
|
88
88
|
*
|
|
89
89
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=CuWOqxr9Ue
|
|
90
90
|
*/
|
|
91
|
-
getJSSDKConfig(): Promise<{
|
|
91
|
+
getJSSDKConfig(requestOptions?: IRequestOptions): Promise<{
|
|
92
92
|
appid: string;
|
|
93
93
|
nonceStr: string;
|
|
94
94
|
timestamp: number;
|