@heybox/hb-sdk 0.4.6 → 0.5.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/README.md +39 -5
- package/dist/cli-chunks/{create-BahMMgJH.cjs → create-BiCyOEAv.cjs} +1 -1
- package/dist/cli-chunks/{dev-CTuXVPpU.cjs → dev-D4XRqzz1.cjs} +1 -1
- package/dist/cli-chunks/{doctor-9gg3ZIvt.cjs → doctor-CmHZYQ2I.cjs} +1 -1
- package/dist/cli-chunks/{index-CLne_LW7.cjs → index-DXS0s9d7.cjs} +2 -2
- package/dist/cli-chunks/{index-DuwxUSkq.cjs → index-kv8oOmFw.cjs} +13 -13
- package/dist/cli-chunks/{login-OqaEx-Wd.cjs → login-F9AEL3cF.cjs} +2 -2
- package/dist/cli-chunks/{remote-zX17hOT4.cjs → remote-BRktlraB.cjs} +210 -91
- package/dist/cli-chunks/{session-D7lF9mpd.cjs → session-DItg0094.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/mock-host/main.js +987 -7
- package/dist/index.cjs.js +51 -0
- package/dist/index.esm.js +51 -0
- package/dist/miniapp-publish.cjs.js +16 -0
- package/dist/miniapp-publish.esm.js +14 -1
- package/dist/protocol.cjs.js +50 -0
- package/dist/protocol.esm.js +46 -1
- package/dist/templates/vue3-vite-ts/README.md.ejs +2 -1
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/api-protocol.md +22 -2
- package/skill/references/api-root.md +70 -2
- package/skill/references/cli.md +6 -3
- package/skill/references/safety-boundaries.md +2 -1
- package/skill/skill.json +4 -4
- package/types/index.d.ts +1 -1
- package/types/miniapp-publish/index.d.ts +10 -0
- package/types/modules/share/types.d.ts +2 -2
- package/types/modules/user/get-current-user-detail.d.ts +9 -0
- package/types/modules/user/get-current-user-profile.d.ts +9 -0
- package/types/modules/user/get-platform-account-info.d.ts +12 -0
- package/types/modules/user/get-platform-account-overview.d.ts +9 -0
- package/types/modules/user/get-steam-game-list.d.ts +12 -0
- package/types/modules/user/index.d.ts +33 -1
- package/types/modules/user/types.d.ts +285 -0
- package/types/protocol/capabilities.d.ts +52 -2
- package/types/protocol.d.ts +2 -2
|
@@ -16,8 +16,8 @@ export interface MiniProgramShowShareMenuOptions {
|
|
|
16
16
|
title: string;
|
|
17
17
|
/** 分享描述。 */
|
|
18
18
|
desc: string;
|
|
19
|
-
/** 分享落地页 URL
|
|
20
|
-
url
|
|
19
|
+
/** 分享落地页 URL;不传时由宿主 runtime 生成当前小程序的通用分享页。 */
|
|
20
|
+
url?: string;
|
|
21
21
|
/** 分享缩略图 URL。 */
|
|
22
22
|
imageUrl?: string;
|
|
23
23
|
/** 指定分享渠道;不传则由客户端展示默认分享面板。 */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MiniProgramRequester } from '../../core/client';
|
|
2
|
+
import type { CurrentUserDetail, UserScopedResult } from './types';
|
|
3
|
+
export { USER_GET_CURRENT_USER_DETAIL_METHOD } from '../../protocol/capabilities';
|
|
4
|
+
/** `user.getCurrentUserDetail` 不需要入参。 */
|
|
5
|
+
export type GetCurrentUserDetailPayload = void;
|
|
6
|
+
/** `user.getCurrentUserDetail` 返回当前用户展示详情。 */
|
|
7
|
+
export type GetCurrentUserDetailResult = UserScopedResult<CurrentUserDetail>;
|
|
8
|
+
/** 获取当前访问小程序用户的展示详情。 */
|
|
9
|
+
export declare function getCurrentUserDetail(requester: MiniProgramRequester): Promise<GetCurrentUserDetailResult>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MiniProgramRequester } from '../../core/client';
|
|
2
|
+
import type { CurrentUserProfile, UserScopedResult } from './types';
|
|
3
|
+
export { USER_GET_CURRENT_USER_PROFILE_METHOD } from '../../protocol/capabilities';
|
|
4
|
+
/** `user.getCurrentUserProfile` 不需要入参。 */
|
|
5
|
+
export type GetCurrentUserProfilePayload = void;
|
|
6
|
+
/** `user.getCurrentUserProfile` 返回当前用户敏感资料详情。 */
|
|
7
|
+
export type GetCurrentUserProfileResult = UserScopedResult<CurrentUserProfile>;
|
|
8
|
+
/** 获取当前访问小程序用户的敏感资料详情。 */
|
|
9
|
+
export declare function getCurrentUserProfile(requester: MiniProgramRequester): Promise<GetCurrentUserProfileResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MiniProgramRequester } from '../../core/client';
|
|
2
|
+
import type { PlatformAccountResult, PlatformAccountType } from './types';
|
|
3
|
+
export { USER_GET_PLATFORM_ACCOUNT_INFO_METHOD } from '../../protocol/capabilities';
|
|
4
|
+
/** `user.getPlatformAccountInfo` 请求参数。 */
|
|
5
|
+
export interface GetPlatformAccountInfoPayload<T extends PlatformAccountType = PlatformAccountType> {
|
|
6
|
+
/** 要读取的平台账号类型。 */
|
|
7
|
+
platform: T;
|
|
8
|
+
}
|
|
9
|
+
/** `user.getPlatformAccountInfo` 返回指定平台的当前用户账号详情。 */
|
|
10
|
+
export type GetPlatformAccountInfoResult<T extends PlatformAccountType = PlatformAccountType> = PlatformAccountResult<T>;
|
|
11
|
+
/** 获取当前访问小程序用户的指定平台账号详情。 */
|
|
12
|
+
export declare function getPlatformAccountInfo<T extends PlatformAccountType>(requester: MiniProgramRequester, platform: T): Promise<GetPlatformAccountInfoResult<T>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MiniProgramRequester } from '../../core/client';
|
|
2
|
+
import type { PlatformAccountOverview, UserScopedResult } from './types';
|
|
3
|
+
export { USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD } from '../../protocol/capabilities';
|
|
4
|
+
/** `user.getPlatformAccountOverview` 不需要入参。 */
|
|
5
|
+
export type GetPlatformAccountOverviewPayload = void;
|
|
6
|
+
/** `user.getPlatformAccountOverview` 返回当前用户平台账号概览。 */
|
|
7
|
+
export type GetPlatformAccountOverviewResult = UserScopedResult<PlatformAccountOverview>;
|
|
8
|
+
/** 获取当前访问小程序用户的平台账号绑定/隐藏状态概览。 */
|
|
9
|
+
export declare function getPlatformAccountOverview(requester: MiniProgramRequester): Promise<GetPlatformAccountOverviewResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MiniProgramRequester } from '../../core/client';
|
|
2
|
+
import type { GetSteamGameListOptions, GetSteamGameListResult } from './types';
|
|
3
|
+
export { USER_GET_STEAM_GAME_LIST_METHOD } from '../../protocol/capabilities';
|
|
4
|
+
export type { GetSteamGameListOptions, GetSteamGameListPayload, GetSteamGameListResult } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* 获取当前用户 Steam 游戏库。
|
|
7
|
+
*
|
|
8
|
+
* @param requester 底层 bridge 请求能力。
|
|
9
|
+
* @param options 查询与分页参数。
|
|
10
|
+
* @returns 当前用户 Steam 游戏库;未登录或未绑定 Steam 时返回状态对象。
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSteamGameList(requester: MiniProgramRequester, options?: GetSteamGameListOptions): Promise<GetSteamGameListResult>;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { MiniProgramRequester } from '../../core/client';
|
|
2
|
-
import { type GetUserInfoResult } from './get-info';
|
|
2
|
+
import { USER_GET_INFO_METHOD, type GetUserInfoResult } from './get-info';
|
|
3
|
+
import { USER_GET_CURRENT_USER_DETAIL_METHOD, type GetCurrentUserDetailResult } from './get-current-user-detail';
|
|
4
|
+
import { USER_GET_CURRENT_USER_PROFILE_METHOD, type GetCurrentUserProfileResult } from './get-current-user-profile';
|
|
5
|
+
import { USER_GET_PLATFORM_ACCOUNT_INFO_METHOD, type GetPlatformAccountInfoResult } from './get-platform-account-info';
|
|
6
|
+
import { USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD, type GetPlatformAccountOverviewResult } from './get-platform-account-overview';
|
|
7
|
+
import { USER_GET_STEAM_GAME_LIST_METHOD, type GetSteamGameListOptions, type GetSteamGameListResult } from './get-steam-game-list';
|
|
8
|
+
import type { PlatformAccountType } from './types';
|
|
3
9
|
export * from './get-info';
|
|
10
|
+
export * from './get-current-user-detail';
|
|
11
|
+
export * from './get-current-user-profile';
|
|
12
|
+
export * from './get-platform-account-info';
|
|
13
|
+
export * from './get-platform-account-overview';
|
|
14
|
+
export * from './get-steam-game-list';
|
|
4
15
|
export * from './types';
|
|
5
16
|
export type { MiniProgramUserMethod } from '../../protocol/capabilities';
|
|
6
17
|
/** 外部小程序可调用的用户模块。 */
|
|
@@ -9,6 +20,26 @@ export interface MiniProgramUserModule {
|
|
|
9
20
|
* 获取当前用户登录态与公开基础资料。
|
|
10
21
|
*/
|
|
11
22
|
getInfo(): Promise<GetUserInfoResult>;
|
|
23
|
+
/**
|
|
24
|
+
* 获取当前用户展示详情。
|
|
25
|
+
*/
|
|
26
|
+
getCurrentUserDetail(): Promise<GetCurrentUserDetailResult>;
|
|
27
|
+
/**
|
|
28
|
+
* 获取当前用户敏感资料详情。
|
|
29
|
+
*/
|
|
30
|
+
getCurrentUserProfile(): Promise<GetCurrentUserProfileResult>;
|
|
31
|
+
/**
|
|
32
|
+
* 获取当前用户平台账号绑定/隐藏状态概览。
|
|
33
|
+
*/
|
|
34
|
+
getPlatformAccountOverview(): Promise<GetPlatformAccountOverviewResult>;
|
|
35
|
+
/**
|
|
36
|
+
* 获取当前用户指定平台账号详情。
|
|
37
|
+
*/
|
|
38
|
+
getPlatformAccountInfo<T extends PlatformAccountType>(platform: T): Promise<GetPlatformAccountInfoResult<T>>;
|
|
39
|
+
/**
|
|
40
|
+
* 获取当前用户 Steam 游戏库。
|
|
41
|
+
*/
|
|
42
|
+
getSteamGameList(options?: GetSteamGameListOptions): Promise<GetSteamGameListResult>;
|
|
12
43
|
}
|
|
13
44
|
/**
|
|
14
45
|
* 创建用户模块。
|
|
@@ -17,3 +48,4 @@ export interface MiniProgramUserModule {
|
|
|
17
48
|
* @returns 面向业务层的用户模块对象。
|
|
18
49
|
*/
|
|
19
50
|
export declare function createUserModule(requester: MiniProgramRequester): MiniProgramUserModule;
|
|
51
|
+
export { USER_GET_INFO_METHOD, USER_GET_CURRENT_USER_DETAIL_METHOD, USER_GET_CURRENT_USER_PROFILE_METHOD, USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD, USER_GET_PLATFORM_ACCOUNT_INFO_METHOD, USER_GET_STEAM_GAME_LIST_METHOD, };
|
|
@@ -25,3 +25,288 @@ export interface MiniProgramUserInfoResult {
|
|
|
25
25
|
/** 当前用户公开基础资料;未登录时为 `null`。 */
|
|
26
26
|
userInfo: MiniProgramUserInfo | null;
|
|
27
27
|
}
|
|
28
|
+
/** 当前用户作用域的登录态包装。 */
|
|
29
|
+
export type UserScopedResult<T> = {
|
|
30
|
+
/** 当前访问小程序的用户已登录黑盒账号。 */
|
|
31
|
+
isLogin: true;
|
|
32
|
+
/** 当前用户作用域数据。 */
|
|
33
|
+
data: T;
|
|
34
|
+
} | {
|
|
35
|
+
/** 当前访问小程序的用户未登录黑盒账号。 */
|
|
36
|
+
isLogin: false;
|
|
37
|
+
/** 未登录时固定为 `null`。 */
|
|
38
|
+
data: null;
|
|
39
|
+
};
|
|
40
|
+
/** 当前用户等级展示信息。 */
|
|
41
|
+
export interface CurrentUserLevelInfo {
|
|
42
|
+
level?: string;
|
|
43
|
+
level_name?: string;
|
|
44
|
+
exp?: string;
|
|
45
|
+
next_exp?: string;
|
|
46
|
+
icon?: string;
|
|
47
|
+
}
|
|
48
|
+
/** 当前用户徽章展示信息。 */
|
|
49
|
+
export interface CurrentUserMedal {
|
|
50
|
+
id?: string;
|
|
51
|
+
name?: string;
|
|
52
|
+
desc?: string;
|
|
53
|
+
icon?: string;
|
|
54
|
+
image?: string;
|
|
55
|
+
is_wearing?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/** 当前用户头像装扮信息。 */
|
|
58
|
+
export interface CurrentUserAvatarDecoration {
|
|
59
|
+
id?: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
image?: string;
|
|
62
|
+
frame_url?: string;
|
|
63
|
+
is_using?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** 当前用户头像配置。 */
|
|
66
|
+
export interface CurrentUserAvatarConfig {
|
|
67
|
+
avatar?: string;
|
|
68
|
+
frame_url?: string;
|
|
69
|
+
pendant_url?: string;
|
|
70
|
+
}
|
|
71
|
+
/** 当前用户社区资料摘要。 */
|
|
72
|
+
export interface CurrentUserBbsInfo {
|
|
73
|
+
uid?: string;
|
|
74
|
+
nickname?: string;
|
|
75
|
+
avatar?: string;
|
|
76
|
+
level?: string;
|
|
77
|
+
}
|
|
78
|
+
/** 当前用户公开/展示详情。 */
|
|
79
|
+
export interface CurrentUserDetail {
|
|
80
|
+
heybox_id: string;
|
|
81
|
+
nickname: string;
|
|
82
|
+
avatar: string;
|
|
83
|
+
sex?: string;
|
|
84
|
+
signature?: string;
|
|
85
|
+
ip_location?: string;
|
|
86
|
+
friends_count?: string;
|
|
87
|
+
level_info?: CurrentUserLevelInfo;
|
|
88
|
+
medals?: CurrentUserMedal[];
|
|
89
|
+
avatar_decoration?: CurrentUserAvatarDecoration;
|
|
90
|
+
avatar_config?: CurrentUserAvatarConfig;
|
|
91
|
+
bbs_info?: CurrentUserBbsInfo;
|
|
92
|
+
}
|
|
93
|
+
/** 当前用户敏感资料/编辑详情。 */
|
|
94
|
+
export interface CurrentUserProfile {
|
|
95
|
+
heybox_id: string;
|
|
96
|
+
nickname?: string;
|
|
97
|
+
avatar?: string;
|
|
98
|
+
gender?: string;
|
|
99
|
+
birthday?: string;
|
|
100
|
+
email?: string;
|
|
101
|
+
education?: string;
|
|
102
|
+
career?: string;
|
|
103
|
+
signature?: string;
|
|
104
|
+
}
|
|
105
|
+
/** 第一版支持的平台账号类型。 */
|
|
106
|
+
export type PlatformAccountType = 'steam' | 'epic' | 'xbox' | 'psn' | 'switch' | 'pc_hardware' | 'mobile';
|
|
107
|
+
/** 平台账号轻量展示统计项。 */
|
|
108
|
+
export interface PlatformStatItem {
|
|
109
|
+
key?: string;
|
|
110
|
+
name?: string;
|
|
111
|
+
desc?: string;
|
|
112
|
+
value?: string;
|
|
113
|
+
num?: string;
|
|
114
|
+
icon?: string;
|
|
115
|
+
img?: string;
|
|
116
|
+
color?: string;
|
|
117
|
+
}
|
|
118
|
+
/** 平台账号通用基础资料。 */
|
|
119
|
+
export interface BasePlatformAccountInfo {
|
|
120
|
+
nickname?: string;
|
|
121
|
+
avatar?: string;
|
|
122
|
+
background_url?: string;
|
|
123
|
+
stats?: PlatformStatItem[];
|
|
124
|
+
}
|
|
125
|
+
/** Steam 平台账号详情。 */
|
|
126
|
+
export interface SteamPlatformAccountInfo extends BasePlatformAccountInfo {
|
|
127
|
+
steamid: string;
|
|
128
|
+
short_id?: string;
|
|
129
|
+
level?: string;
|
|
130
|
+
city?: string;
|
|
131
|
+
province?: string;
|
|
132
|
+
country?: string;
|
|
133
|
+
country_code?: string;
|
|
134
|
+
country_flag?: string;
|
|
135
|
+
avatar_frame?: string;
|
|
136
|
+
head_image?: string;
|
|
137
|
+
head_video?: string;
|
|
138
|
+
update_time?: string;
|
|
139
|
+
account_year?: string;
|
|
140
|
+
individuality_signature?: string;
|
|
141
|
+
level_icon?: string;
|
|
142
|
+
total_badge_count?: string;
|
|
143
|
+
total_dlcs_count?: string;
|
|
144
|
+
total_game_count?: string;
|
|
145
|
+
total_game_price?: string;
|
|
146
|
+
total_player_time?: string;
|
|
147
|
+
friend_code?: string;
|
|
148
|
+
friend_code_show?: boolean;
|
|
149
|
+
inventory_open?: boolean;
|
|
150
|
+
personal_information_open?: boolean;
|
|
151
|
+
has_history?: boolean;
|
|
152
|
+
}
|
|
153
|
+
/** Steam 游戏库排序方式。 */
|
|
154
|
+
export type SteamGameListSort = 'weeks' | 'all' | 'achieved';
|
|
155
|
+
/** Steam 游戏库请求参数。 */
|
|
156
|
+
export interface GetSteamGameListOptions {
|
|
157
|
+
/** 指定当前用户绑定的 Steam ID;不传时由宿主使用默认主账号。 */
|
|
158
|
+
steamId?: string;
|
|
159
|
+
/** 分页数量,默认 20,最大 100。 */
|
|
160
|
+
limit?: number;
|
|
161
|
+
/** 分页偏移量,默认 0。 */
|
|
162
|
+
offset?: number;
|
|
163
|
+
/** 排序方式,默认 `weeks`。 */
|
|
164
|
+
sort?: SteamGameListSort;
|
|
165
|
+
/** 搜索关键词。 */
|
|
166
|
+
q?: string;
|
|
167
|
+
/** 是否包含当前用户隐藏的游戏,默认 `false`。 */
|
|
168
|
+
includeHidden?: boolean;
|
|
169
|
+
}
|
|
170
|
+
/** `user.getSteamGameList` 请求参数。 */
|
|
171
|
+
export type GetSteamGameListPayload = GetSteamGameListOptions | undefined;
|
|
172
|
+
/** Steam 游戏价格信息。 */
|
|
173
|
+
export interface SteamGamePrice {
|
|
174
|
+
current?: string;
|
|
175
|
+
initial?: string;
|
|
176
|
+
discount?: number;
|
|
177
|
+
lowestPrice?: number;
|
|
178
|
+
deadlineDate?: string;
|
|
179
|
+
deadlineTimestamp?: number;
|
|
180
|
+
}
|
|
181
|
+
/** 当前用户 Steam 游戏库条目。 */
|
|
182
|
+
export interface SteamGameListItem {
|
|
183
|
+
appid: number;
|
|
184
|
+
steamAppid: number;
|
|
185
|
+
name: string;
|
|
186
|
+
image?: string;
|
|
187
|
+
icon?: string;
|
|
188
|
+
background?: string;
|
|
189
|
+
verticalImage?: string;
|
|
190
|
+
playtimeForever?: number;
|
|
191
|
+
playtime2Weeks?: number;
|
|
192
|
+
playtimePercent?: number;
|
|
193
|
+
achievedCount?: number;
|
|
194
|
+
achievementCount?: number;
|
|
195
|
+
isCleared?: boolean;
|
|
196
|
+
score?: string;
|
|
197
|
+
isFree?: boolean;
|
|
198
|
+
notOwned?: boolean;
|
|
199
|
+
hidden?: boolean;
|
|
200
|
+
onlinePlayer?: string;
|
|
201
|
+
tags?: string[];
|
|
202
|
+
genres?: string[];
|
|
203
|
+
price?: SteamGamePrice;
|
|
204
|
+
}
|
|
205
|
+
/** 当前用户 Steam 游戏库分页数据。 */
|
|
206
|
+
export interface SteamGameListData {
|
|
207
|
+
gameList: SteamGameListItem[];
|
|
208
|
+
total?: number;
|
|
209
|
+
hasMore: boolean;
|
|
210
|
+
nextOffset: number;
|
|
211
|
+
isMe?: boolean;
|
|
212
|
+
}
|
|
213
|
+
/** `user.getSteamGameList` 返回当前用户 Steam 游戏库。 */
|
|
214
|
+
export type GetSteamGameListResult = {
|
|
215
|
+
isLogin: false;
|
|
216
|
+
isBound: false;
|
|
217
|
+
data: null;
|
|
218
|
+
} | {
|
|
219
|
+
isLogin: true;
|
|
220
|
+
isBound: false;
|
|
221
|
+
data: null;
|
|
222
|
+
} | {
|
|
223
|
+
isLogin: true;
|
|
224
|
+
isBound: true;
|
|
225
|
+
data: SteamGameListData;
|
|
226
|
+
};
|
|
227
|
+
/** Epic 平台账号详情。 */
|
|
228
|
+
export interface EpicPlatformAccountInfo extends BasePlatformAccountInfo {
|
|
229
|
+
xuid?: string;
|
|
230
|
+
head_color?: string;
|
|
231
|
+
desc?: string;
|
|
232
|
+
}
|
|
233
|
+
/** Xbox 平台账号详情。 */
|
|
234
|
+
export interface XboxPlatformAccountInfo extends BasePlatformAccountInfo {
|
|
235
|
+
xuid?: string;
|
|
236
|
+
desc?: string;
|
|
237
|
+
}
|
|
238
|
+
/** PSN 平台账号详情。 */
|
|
239
|
+
export interface PsnPlatformAccountInfo extends BasePlatformAccountInfo {
|
|
240
|
+
name?: string;
|
|
241
|
+
level?: string;
|
|
242
|
+
description?: string;
|
|
243
|
+
is_open?: boolean;
|
|
244
|
+
}
|
|
245
|
+
/** Switch 平台账号详情。 */
|
|
246
|
+
export interface SwitchPlatformAccountInfo extends BasePlatformAccountInfo {
|
|
247
|
+
heybox_id?: string;
|
|
248
|
+
friend_code?: string;
|
|
249
|
+
friends_total?: string;
|
|
250
|
+
games_total?: string;
|
|
251
|
+
server_name?: string;
|
|
252
|
+
type?: string;
|
|
253
|
+
desc?: string;
|
|
254
|
+
}
|
|
255
|
+
/** PC 硬件账号详情。 */
|
|
256
|
+
export interface PcHardwareAccountInfo {
|
|
257
|
+
cpu?: string;
|
|
258
|
+
gpu?: string;
|
|
259
|
+
board?: string;
|
|
260
|
+
perf_level?: string;
|
|
261
|
+
}
|
|
262
|
+
/** 移动设备平台账号详情。 */
|
|
263
|
+
export interface MobilePlatformAccountInfo {
|
|
264
|
+
current_device?: {
|
|
265
|
+
id?: string;
|
|
266
|
+
name?: string;
|
|
267
|
+
desc?: string;
|
|
268
|
+
model?: string;
|
|
269
|
+
img_url?: string;
|
|
270
|
+
update_time?: string;
|
|
271
|
+
stats?: PlatformStatItem[];
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
/** 平台类型到平台账号详情的映射。 */
|
|
275
|
+
export interface PlatformAccountInfoMap {
|
|
276
|
+
steam: SteamPlatformAccountInfo;
|
|
277
|
+
epic: EpicPlatformAccountInfo;
|
|
278
|
+
xbox: XboxPlatformAccountInfo;
|
|
279
|
+
psn: PsnPlatformAccountInfo;
|
|
280
|
+
switch: SwitchPlatformAccountInfo;
|
|
281
|
+
pc_hardware: PcHardwareAccountInfo;
|
|
282
|
+
mobile: MobilePlatformAccountInfo;
|
|
283
|
+
}
|
|
284
|
+
/** 单个平台账号详情返回结构。 */
|
|
285
|
+
export type PlatformAccountResult<T extends PlatformAccountType> = {
|
|
286
|
+
isLogin: true;
|
|
287
|
+
platform: T;
|
|
288
|
+
is_bound: true;
|
|
289
|
+
is_hidden: boolean;
|
|
290
|
+
account_info: PlatformAccountInfoMap[T];
|
|
291
|
+
} | {
|
|
292
|
+
isLogin: true;
|
|
293
|
+
platform: T;
|
|
294
|
+
is_bound: false;
|
|
295
|
+
is_hidden: boolean;
|
|
296
|
+
account_info: null;
|
|
297
|
+
} | {
|
|
298
|
+
isLogin: false;
|
|
299
|
+
platform: T;
|
|
300
|
+
is_bound: false;
|
|
301
|
+
is_hidden: false;
|
|
302
|
+
account_info: null;
|
|
303
|
+
};
|
|
304
|
+
/** 平台账号绑定/隐藏状态概览。 */
|
|
305
|
+
export interface PlatformAccountOverview {
|
|
306
|
+
platforms: Array<{
|
|
307
|
+
platform: PlatformAccountType;
|
|
308
|
+
is_bound: boolean;
|
|
309
|
+
is_hidden: boolean;
|
|
310
|
+
}>;
|
|
311
|
+
display_order: PlatformAccountType[];
|
|
312
|
+
}
|
|
@@ -5,7 +5,7 @@ import type { NetworkRequestPayload, NetworkResponsePayload } from '../modules/n
|
|
|
5
5
|
import type { ScreenshotPayload, ScreenshotResult, ShowShareMenuPayload, ShowShareMenuResult } from '../modules/share';
|
|
6
6
|
import type { GetStoragePayload, GetStorageResult, SetStoragePayload } from '../modules/storage';
|
|
7
7
|
import type { HideLoadingPayload, HideLoadingResult, ShowLoadingPayload, ShowLoadingResult, ShowToastPayload, ShowToastResult } from '../modules/ui';
|
|
8
|
-
import type { GetUserInfoPayload, GetUserInfoResult } from '../modules/user';
|
|
8
|
+
import type { GetCurrentUserDetailPayload, GetCurrentUserDetailResult, GetCurrentUserProfilePayload, GetCurrentUserProfileResult, GetPlatformAccountInfoPayload, GetPlatformAccountInfoResult, GetPlatformAccountOverviewPayload, GetPlatformAccountOverviewResult, GetSteamGameListPayload, GetSteamGameListResult, GetUserInfoPayload, GetUserInfoResult } from '../modules/user';
|
|
9
9
|
import type { GetWindowInfoPayload, GetWindowInfoResult, SetNavigationBarStylePayload, SetNavigationBarStyleResult } from '../modules/viewport';
|
|
10
10
|
/**
|
|
11
11
|
* 登录授权能力方法名。
|
|
@@ -21,6 +21,16 @@ export declare const AUTH_LOGIN_METHOD: "auth.login";
|
|
|
21
21
|
* 供 SDK 与父容器 runtime 共享同一 bridge method 标识。
|
|
22
22
|
*/
|
|
23
23
|
export declare const USER_GET_INFO_METHOD: "user.getInfo";
|
|
24
|
+
/** 当前用户展示详情能力方法名。 */
|
|
25
|
+
export declare const USER_GET_CURRENT_USER_DETAIL_METHOD: "user.getCurrentUserDetail";
|
|
26
|
+
/** 当前用户敏感资料详情能力方法名。 */
|
|
27
|
+
export declare const USER_GET_CURRENT_USER_PROFILE_METHOD: "user.getCurrentUserProfile";
|
|
28
|
+
/** 当前用户平台账号概览能力方法名。 */
|
|
29
|
+
export declare const USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD: "user.getPlatformAccountOverview";
|
|
30
|
+
/** 当前用户指定平台账号详情能力方法名。 */
|
|
31
|
+
export declare const USER_GET_PLATFORM_ACCOUNT_INFO_METHOD: "user.getPlatformAccountInfo";
|
|
32
|
+
/** 当前用户 Steam 游戏库能力方法名。 */
|
|
33
|
+
export declare const USER_GET_STEAM_GAME_LIST_METHOD: "user.getSteamGameList";
|
|
24
34
|
/**
|
|
25
35
|
* 展示分享面板能力方法名。
|
|
26
36
|
*
|
|
@@ -87,7 +97,7 @@ export declare const NAVIGATION_RELOAD_METHOD: "navigation.reload";
|
|
|
87
97
|
/** 授权模块开放的方法名。 */
|
|
88
98
|
export type MiniProgramAuthMethod = typeof AUTH_LOGIN_METHOD;
|
|
89
99
|
/** 用户模块开放的方法名。 */
|
|
90
|
-
export type MiniProgramUserMethod = typeof USER_GET_INFO_METHOD;
|
|
100
|
+
export type MiniProgramUserMethod = typeof USER_GET_INFO_METHOD | typeof USER_GET_CURRENT_USER_DETAIL_METHOD | typeof USER_GET_CURRENT_USER_PROFILE_METHOD | typeof USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD | typeof USER_GET_PLATFORM_ACCOUNT_INFO_METHOD | typeof USER_GET_STEAM_GAME_LIST_METHOD;
|
|
91
101
|
/** 分享模块开放的方法名。 */
|
|
92
102
|
export type MiniProgramShareMethod = typeof SHARE_SHOW_SHARE_MENU_METHOD | typeof SHARE_SCREENSHOT_METHOD;
|
|
93
103
|
/** Viewport 模块开放的方法名。 */
|
|
@@ -145,6 +155,36 @@ export declare const MINI_PROGRAM_PROTOCOL_CAPABILITIES: readonly [{
|
|
|
145
155
|
readonly capability: "user.getInfo";
|
|
146
156
|
readonly permission: "user.getInfo";
|
|
147
157
|
readonly risk: "medium";
|
|
158
|
+
}, {
|
|
159
|
+
readonly method: "user.getCurrentUserDetail";
|
|
160
|
+
readonly module: "user";
|
|
161
|
+
readonly capability: "user.getCurrentUserDetail";
|
|
162
|
+
readonly permission: "user.currentUserDetail";
|
|
163
|
+
readonly risk: "high";
|
|
164
|
+
}, {
|
|
165
|
+
readonly method: "user.getCurrentUserProfile";
|
|
166
|
+
readonly module: "user";
|
|
167
|
+
readonly capability: "user.getCurrentUserProfile";
|
|
168
|
+
readonly permission: "user.currentUserProfile";
|
|
169
|
+
readonly risk: "high";
|
|
170
|
+
}, {
|
|
171
|
+
readonly method: "user.getPlatformAccountOverview";
|
|
172
|
+
readonly module: "user";
|
|
173
|
+
readonly capability: "user.getPlatformAccountOverview";
|
|
174
|
+
readonly permission: "user.platformAccount.overview";
|
|
175
|
+
readonly risk: "medium";
|
|
176
|
+
}, {
|
|
177
|
+
readonly method: "user.getPlatformAccountInfo";
|
|
178
|
+
readonly module: "user";
|
|
179
|
+
readonly capability: "user.getPlatformAccountInfo";
|
|
180
|
+
readonly permission: "user.platformAccount.info";
|
|
181
|
+
readonly risk: "high";
|
|
182
|
+
}, {
|
|
183
|
+
readonly method: "user.getSteamGameList";
|
|
184
|
+
readonly module: "user";
|
|
185
|
+
readonly capability: "user.getSteamGameList";
|
|
186
|
+
readonly permission: "user.steamGameList";
|
|
187
|
+
readonly risk: "high";
|
|
148
188
|
}, {
|
|
149
189
|
readonly method: "share.showShareMenu";
|
|
150
190
|
readonly module: "share";
|
|
@@ -234,6 +274,11 @@ export declare const MINI_PROGRAM_PROTOCOL_CAPABILITIES: readonly [{
|
|
|
234
274
|
export interface MiniProgramCapabilityPayloadMap {
|
|
235
275
|
[AUTH_LOGIN_METHOD]: LoginPayload;
|
|
236
276
|
[USER_GET_INFO_METHOD]: GetUserInfoPayload;
|
|
277
|
+
[USER_GET_CURRENT_USER_DETAIL_METHOD]: GetCurrentUserDetailPayload;
|
|
278
|
+
[USER_GET_CURRENT_USER_PROFILE_METHOD]: GetCurrentUserProfilePayload;
|
|
279
|
+
[USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD]: GetPlatformAccountOverviewPayload;
|
|
280
|
+
[USER_GET_PLATFORM_ACCOUNT_INFO_METHOD]: GetPlatformAccountInfoPayload;
|
|
281
|
+
[USER_GET_STEAM_GAME_LIST_METHOD]: GetSteamGameListPayload;
|
|
237
282
|
[SHARE_SHOW_SHARE_MENU_METHOD]: ShowShareMenuPayload;
|
|
238
283
|
[SHARE_SCREENSHOT_METHOD]: ScreenshotPayload;
|
|
239
284
|
[VIEWPORT_GET_WINDOW_INFO_METHOD]: GetWindowInfoPayload;
|
|
@@ -253,6 +298,11 @@ export interface MiniProgramCapabilityPayloadMap {
|
|
|
253
298
|
export interface MiniProgramCapabilityResultMap {
|
|
254
299
|
[AUTH_LOGIN_METHOD]: LoginResult;
|
|
255
300
|
[USER_GET_INFO_METHOD]: GetUserInfoResult;
|
|
301
|
+
[USER_GET_CURRENT_USER_DETAIL_METHOD]: GetCurrentUserDetailResult;
|
|
302
|
+
[USER_GET_CURRENT_USER_PROFILE_METHOD]: GetCurrentUserProfileResult;
|
|
303
|
+
[USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD]: GetPlatformAccountOverviewResult;
|
|
304
|
+
[USER_GET_PLATFORM_ACCOUNT_INFO_METHOD]: GetPlatformAccountInfoResult;
|
|
305
|
+
[USER_GET_STEAM_GAME_LIST_METHOD]: GetSteamGameListResult;
|
|
256
306
|
[SHARE_SHOW_SHARE_MENU_METHOD]: ShowShareMenuResult;
|
|
257
307
|
[SHARE_SCREENSHOT_METHOD]: ScreenshotResult;
|
|
258
308
|
[VIEWPORT_GET_WINDOW_INFO_METHOD]: GetWindowInfoResult;
|
package/types/protocol.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { MINI_PROGRAM_BRIDGE_NONCE_PARAM, MINI_PROGRAM_MESSAGE_NAMESPACE, MINI_PROGRAM_MESSAGE_VERSION, SDK_HANDSHAKE_METHOD, } from './protocol/constants';
|
|
2
2
|
export { isMiniProgramBridgeMessage } from './protocol/guards';
|
|
3
3
|
export type { MiniProgramBridgeError, MiniProgramBridgeMessage, MiniProgramBridgeMessageType, MiniProgramEventHandler, MiniProgramEventName, MiniProgramEventPayloadMap, } from './protocol/types';
|
|
4
|
-
export { AUTH_LOGIN_METHOD, DEVICE_SET_CLIPBOARD_METHOD, DEVICE_VIBRATE_METHOD, MINI_PROGRAM_PROTOCOL_CAPABILITIES, NAVIGATION_CLOSE_METHOD, NAVIGATION_RELOAD_METHOD, NETWORK_REQUEST_METHOD, SHARE_SCREENSHOT_METHOD, SHARE_SHOW_SHARE_MENU_METHOD, STORAGE_GET_STORAGE_METHOD, STORAGE_SET_STORAGE_METHOD, UI_HIDE_LOADING_METHOD, UI_SHOW_LOADING_METHOD, UI_SHOW_TOAST_METHOD, USER_GET_INFO_METHOD, VIEWPORT_GET_WINDOW_INFO_METHOD, VIEWPORT_SET_NAVIGATION_BAR_STYLE_METHOD, } from './protocol/capabilities';
|
|
4
|
+
export { AUTH_LOGIN_METHOD, DEVICE_SET_CLIPBOARD_METHOD, DEVICE_VIBRATE_METHOD, MINI_PROGRAM_PROTOCOL_CAPABILITIES, NAVIGATION_CLOSE_METHOD, NAVIGATION_RELOAD_METHOD, NETWORK_REQUEST_METHOD, SHARE_SCREENSHOT_METHOD, SHARE_SHOW_SHARE_MENU_METHOD, STORAGE_GET_STORAGE_METHOD, STORAGE_SET_STORAGE_METHOD, UI_HIDE_LOADING_METHOD, UI_SHOW_LOADING_METHOD, UI_SHOW_TOAST_METHOD, USER_GET_CURRENT_USER_DETAIL_METHOD, USER_GET_CURRENT_USER_PROFILE_METHOD, USER_GET_INFO_METHOD, USER_GET_PLATFORM_ACCOUNT_INFO_METHOD, USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD, USER_GET_STEAM_GAME_LIST_METHOD, VIEWPORT_GET_WINDOW_INFO_METHOD, VIEWPORT_SET_NAVIGATION_BAR_STYLE_METHOD, } from './protocol/capabilities';
|
|
5
5
|
export type { MiniProgramDeviceMethod, MiniProgramAuthMethod, MiniProgramBridgeMethod, MiniProgramCapabilityDefinition, MiniProgramCapabilityModule, MiniProgramCapabilityPayload, MiniProgramCapabilityPayloadMap, MiniProgramCapabilityResult, MiniProgramCapabilityResultMap, MiniProgramCapabilityRisk, MiniProgramNavigationMethod, MiniProgramNetworkMethod, MiniProgramShareMethod, MiniProgramStorageMethod, MiniProgramUiMethod, MiniProgramUserMethod, MiniProgramViewportMethod, } from './protocol/capabilities';
|
|
6
6
|
export type { LoginPayload, LoginResult } from './modules/auth';
|
|
7
|
-
export type { GetUserInfoPayload, GetUserInfoResult, MiniProgramUserInfo, MiniProgramUserInfoResult, } from './modules/user';
|
|
7
|
+
export type { GetCurrentUserDetailPayload, GetCurrentUserDetailResult, GetCurrentUserProfilePayload, GetCurrentUserProfileResult, GetPlatformAccountInfoPayload, GetPlatformAccountInfoResult, GetPlatformAccountOverviewPayload, GetPlatformAccountOverviewResult, GetSteamGameListOptions, GetSteamGameListPayload, GetSteamGameListResult, GetUserInfoPayload, GetUserInfoResult, MiniProgramUserInfo, MiniProgramUserInfoResult, SteamGameListData, SteamGameListItem, SteamGameListSort, SteamGamePrice, } from './modules/user';
|
|
8
8
|
export type { ScreenshotPayload, ScreenshotResult } from './modules/share/screenshot';
|
|
9
9
|
export type { ShowShareMenuPayload, ShowShareMenuResult } from './modules/share/show-share-menu';
|
|
10
10
|
export type { MiniProgramScreenshotOptions, MiniProgramScreenshotRect, MiniProgramShareChannel, MiniProgramShowShareMenuOptions, } from './modules/share';
|