@heybox/hb-sdk 0.9.8 → 0.9.9-alpha.1
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/CHANGELOG.md +13 -0
- package/README.md +2 -0
- package/dist/cli-chunks/bindings-B9HSKhmy.cjs +84 -0
- package/dist/cli-chunks/{build-BuYvQeZO.cjs → build-vZ5iT2JO.cjs} +6 -5
- package/dist/cli-chunks/{create-4XrYdjC0.cjs → create-DJseFABS.cjs} +2 -2
- package/dist/cli-chunks/{dev-BIxJPUFK.cjs → dev-CsuAVpLX.cjs} +61 -14
- package/dist/cli-chunks/{doctor-XhNbYYVj.cjs → doctor-BYzYg-oP.cjs} +1 -1
- package/dist/cli-chunks/game-binding-guide-BfKQ4e83.cjs +273 -0
- package/dist/cli-chunks/game-bindings-DWOIBCax.cjs +51 -0
- package/dist/cli-chunks/{games-Cd9fgl6N.cjs → games-DmPaqaDd.cjs} +2 -2
- package/dist/cli-chunks/{index-Cr8tP0XZ.cjs → index-D5rcGk_z.cjs} +55 -24
- package/dist/cli-chunks/{index-aGcX-ULf.cjs → index-DPEhBPfc.cjs} +1 -1
- package/dist/cli-chunks/{index.esm-CvMA_ppV.cjs → index.esm-CenYK5Bl.cjs} +73 -3
- package/dist/cli-chunks/{index.esm-UetP1FSl.cjs → index.esm-DYWovNyE.cjs} +13 -10
- package/dist/cli-chunks/{login-Dd55F6qr.cjs → login-o1LQxi8P.cjs} +1 -1
- package/dist/cli-chunks/{project-vite-quIPuubf.cjs → project-vite-CGIy1XaL.cjs} +1 -1
- package/dist/cli-chunks/{remote-BfI4Ag6B.cjs → remote-BQ3O-aiB.cjs} +131 -133
- package/dist/cli-chunks/{runtime-permission-env-C1e5q2m5.cjs → runtime-permission-env-soFtqTxP.cjs} +27 -87
- package/dist/cli-chunks/{skill-DY7-DQPL.cjs → skill-BHighcnl.cjs} +2 -2
- package/dist/cli-chunks/{version-D4jIw125.cjs → version-CAh_EBAH.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-D9CVFRHE.js +224 -0
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-FZ3iQQs-.js +13 -0
- package/dist/devtools/browser-dev-host/assets/index-CVzVitcL.js +567 -0
- package/dist/devtools/browser-dev-host/assets/index-D0XGMYIr.css +1 -0
- package/dist/devtools/browser-dev-host/index.html +3 -3
- package/dist/index.cjs.js +149 -4
- package/dist/index.esm.js +149 -5
- package/dist/miniapp-publish.cjs.js +65 -2
- package/dist/miniapp-publish.esm.js +64 -3
- package/dist/protocol.cjs.js +51 -5
- package/dist/protocol.esm.js +51 -5
- package/dist/templates/vanilla-vite-js/README.md.ejs +1 -1
- package/dist/vite.cjs.js +60 -3
- package/dist/vite.esm.js +60 -3
- package/package.json +6 -6
- package/skill/SKILL.md +3 -2
- package/skill/skill.json +5 -5
- package/types/index.d.ts +140 -4
- package/types/miniapp-publish/index.d.ts +14 -3
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-x4xuSDs_.js +0 -221
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-C1gCwbuV.js +0 -13
- package/dist/devtools/browser-dev-host/assets/index-Bk5RxHO3.css +0 -1
- package/dist/devtools/browser-dev-host/assets/index-C6l2jsZT.js +0 -567
package/dist/protocol.esm.js
CHANGED
|
@@ -29,6 +29,19 @@ const SDK_LOCATION_REPORT_METHOD = 'sdk.location.report';
|
|
|
29
29
|
const SDK_CSP_VIOLATION_METHOD = 'sdk.csp.violation';
|
|
30
30
|
const MINI_PROGRAM_OPERATION_PROGRESS_METHOD = 'operation.progress';
|
|
31
31
|
|
|
32
|
+
const POST_READ_METHODS = [
|
|
33
|
+
'post.get',
|
|
34
|
+
'post.comments.list',
|
|
35
|
+
'post.watch',
|
|
36
|
+
];
|
|
37
|
+
const POST_WRITE_METHODS = [
|
|
38
|
+
'post.setLiked',
|
|
39
|
+
'post.setFavorited',
|
|
40
|
+
'post.comments.openEditor',
|
|
41
|
+
'post.comments.delete',
|
|
42
|
+
'post.comments.setLiked',
|
|
43
|
+
];
|
|
44
|
+
|
|
32
45
|
/** 游戏资料内部 wire:业务方法由 SDK 映射为精确资源请求。 */
|
|
33
46
|
const USER_GAMES_GET_OVERVIEW_METHOD = 'user.games.getOverview';
|
|
34
47
|
const USER_DATA_QUERY_METHOD = 'user.data.query';
|
|
@@ -139,6 +152,20 @@ const COMPANION_SHOW_NOTIFICATION_METHOD = 'companion.showNotification';
|
|
|
139
152
|
* 仅表示无需 Manifest 权限声明,不表示绕过参数校验、Host 能力、可信手势或业务策略。
|
|
140
153
|
*/
|
|
141
154
|
const MINI_PROGRAM_PROTOCOL_CAPABILITIES = [
|
|
155
|
+
...POST_READ_METHODS.map((method) => ({
|
|
156
|
+
method,
|
|
157
|
+
module: 'post',
|
|
158
|
+
capability: method,
|
|
159
|
+
requirement: { kind: 'all', permissions: ['post'] },
|
|
160
|
+
risk: 'medium',
|
|
161
|
+
})),
|
|
162
|
+
...POST_WRITE_METHODS.map((method) => ({
|
|
163
|
+
method,
|
|
164
|
+
module: 'post',
|
|
165
|
+
capability: method,
|
|
166
|
+
requirement: { kind: 'all', permissions: ['post'] },
|
|
167
|
+
risk: 'high',
|
|
168
|
+
})),
|
|
142
169
|
...[GAME_SAVES_LIST_METHOD, GAME_SAVES_SYNC_METHOD, GAME_SAVES_GET_FILE_METHOD, GAME_SAVES_READ_PARSED_DATA_METHOD].map((method) => ({
|
|
143
170
|
method,
|
|
144
171
|
module: 'gameSaves',
|
|
@@ -231,7 +258,13 @@ const MINI_PROGRAM_PROTOCOL_CAPABILITIES = [
|
|
|
231
258
|
requirement: { kind: 'all', permissions: ['share'] },
|
|
232
259
|
risk: 'medium',
|
|
233
260
|
},
|
|
234
|
-
{
|
|
261
|
+
{
|
|
262
|
+
method: SHARE_SCREENSHOT_LONG_METHOD,
|
|
263
|
+
module: 'share',
|
|
264
|
+
capability: SHARE_SCREENSHOT_LONG_METHOD,
|
|
265
|
+
requirement: { kind: 'all', permissions: ['share'] },
|
|
266
|
+
risk: 'medium',
|
|
267
|
+
},
|
|
235
268
|
{
|
|
236
269
|
method: VIEWPORT_GET_WINDOW_INFO_METHOD,
|
|
237
270
|
module: 'viewport',
|
|
@@ -524,8 +557,8 @@ const MINI_PROGRAM_PROTOCOL_CAPABILITIES = [
|
|
|
524
557
|
* `code` 与字符串 `message`。该最低结构允许 `payload` 与合法 `error` 同时存在,终态语义由消费端决定。
|
|
525
558
|
* - 普通 `event`(v1/v2):`method` 非空、`error` 必须为 `undefined`,`id` 可省略或为非空字符串;事件名和
|
|
526
559
|
* `payload` 不在此处校验。
|
|
527
|
-
* - `operation.progress` 与 `cancel` 只接受 v2。progress 还要求非空 `id`
|
|
528
|
-
* prepare
|
|
560
|
+
* - `operation.progress` 与 `cancel` 只接受 v2。progress 还要求非空 `id` 和受支持的下载、companion
|
|
561
|
+
* prepare 或关联帖订阅就绪 payload;cancel 要求非空 `id`,且 `method`、`payload`、`error` 都必须为 `undefined`。
|
|
529
562
|
*
|
|
530
563
|
* 返回 `true` 只表示 wire envelope 可识别,不建立信任或授权边界。该函数不会校验
|
|
531
564
|
* `MessageEvent.source` / `origin`,只检查 nonce 非空而不会与当前 iframe 的预期 nonce 比较,也不会确认
|
|
@@ -1435,7 +1468,9 @@ function isMiniProgramCompanionPrepareProgress(value) {
|
|
|
1435
1468
|
hasOnlyKeys(value, ['phase', 'processed', 'total']));
|
|
1436
1469
|
}
|
|
1437
1470
|
function isMiniProgramOperationProgressPayload(value) {
|
|
1438
|
-
return isMiniProgramDownloadProgressPayload(value) ||
|
|
1471
|
+
return (isMiniProgramDownloadProgressPayload(value) ||
|
|
1472
|
+
isMiniProgramCompanionPrepareProgress(value) ||
|
|
1473
|
+
(isRecord$5(value) && hasOnlyKeys(value, ['watching']) && value.watching === true));
|
|
1439
1474
|
}
|
|
1440
1475
|
function isSDKHandshakePayload(value) {
|
|
1441
1476
|
return isRecord$5(value) && isNonEmptyString$1(value.href) && typeof value.userAgent === 'string' && isNonEmptyString$1(value.sdkVersion);
|
|
@@ -1671,6 +1706,7 @@ const MINI_PROGRAM_PERMISSION_KEYS = [
|
|
|
1671
1706
|
'appProtocol',
|
|
1672
1707
|
'workspaceCards',
|
|
1673
1708
|
'user_game_data',
|
|
1709
|
+
'post',
|
|
1674
1710
|
];
|
|
1675
1711
|
new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
1676
1712
|
|
|
@@ -1753,6 +1789,7 @@ const MANAGED_RUNTIME_PERMISSION_KEYS = new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
|
1753
1789
|
* - `appProtocol`
|
|
1754
1790
|
* - `workspaceCards`
|
|
1755
1791
|
* - `user_game_data`
|
|
1792
|
+
* - `post`
|
|
1756
1793
|
*
|
|
1757
1794
|
* 匹配大小写敏感且按原字符串执行。该 guard 不 trim,因此 `' network '` 返回 `false`;历史权限 key
|
|
1758
1795
|
* `network.request` 也返回 `false`,即使同名 capability method 仍是公开 method。消费完整 schema v1 权限快照时
|
|
@@ -1821,6 +1858,7 @@ function isManagedMiniProgramRuntimePermissionKey(key) {
|
|
|
1821
1858
|
* 必须是已发布的精确资源 key(见 `USER_GAME_DATA_RESOURCE_KEYS`),重复或未知项会让整份
|
|
1822
1859
|
* snapshot 失败;返回值只复制校验后的 `resources` 数组,不接受 `*`、前缀或未开放 key。
|
|
1823
1860
|
* 空数组是合法的「未声明任何资源」,它不会授予任何资源级访问。
|
|
1861
|
+
* `post` 必须显式包含 `read`、`write` 两个 boolean,分别控制读取和互动;解析后丢弃其他字段。
|
|
1824
1862
|
* 其余当前权限是无配置项权限,输入 config 可以缺失、为 `null` 或 `{}`,并统一输出 `{}`;
|
|
1825
1863
|
* 非空对象、数组或其他值会使整个 snapshot 无效。Runtime snapshot 必须显式包含
|
|
1826
1864
|
* network 的有效 boolean,即使 Manifest 目录把省略 `useOfficialDomain` 的开发者默认值定义为
|
|
@@ -1833,7 +1871,7 @@ function isManagedMiniProgramRuntimePermissionKey(key) {
|
|
|
1833
1871
|
* `valid: true` 只表示 snapshot 可安全消费,不代表 entry 已启用,更不代表某个 capability 已获
|
|
1834
1872
|
* 授权。Runtime consumer 应先查 {@link MINI_PROGRAM_PROTOCOL_CAPABILITIES} 中目标 method 的
|
|
1835
1873
|
* `requirement`:`kind: 'none'` 不读取权限;`kind: 'all'` 要求列出的每个 canonical entry 都存在
|
|
1836
|
-
* 且 `status === 'enabled'
|
|
1874
|
+
* 且 `status === 'enabled'`;`post` 还要求方法对应的 `config.read` 或 `config.write` 为 true。之后仍需通过 Host capability、可信手势、用户授权、参数和业务
|
|
1837
1875
|
* policy。当前 Runtime 对 `valid: false` 按空权限表 fail closed,受保护 method 会得到
|
|
1838
1876
|
* `PERMISSION_NOT_IN_SNAPSHOT`,而不是沿用输入中的部分 enabled entry。
|
|
1839
1877
|
*
|
|
@@ -1904,6 +1942,14 @@ function parseMiniProgramRuntimePermissions(snapshot) {
|
|
|
1904
1942
|
};
|
|
1905
1943
|
continue;
|
|
1906
1944
|
}
|
|
1945
|
+
if (key === 'post') {
|
|
1946
|
+
const config = rawEntry.config;
|
|
1947
|
+
if (!isRecord$3(config) || typeof config.read !== 'boolean' || typeof config.write !== 'boolean') {
|
|
1948
|
+
return { valid: false, permissions: {} };
|
|
1949
|
+
}
|
|
1950
|
+
permissions[key] = { key, status: rawEntry.status, config: { read: config.read, write: config.write } };
|
|
1951
|
+
continue;
|
|
1952
|
+
}
|
|
1907
1953
|
if (key === 'user_game_data') {
|
|
1908
1954
|
const config = rawEntry.config;
|
|
1909
1955
|
if (!isRecord$3(config))
|
|
@@ -16,7 +16,7 @@ npm run deploy -- --release-note "更新说明"
|
|
|
16
16
|
|
|
17
17
|
发布前请补充 `package.json#heybox.desc`,描述已实现的主要功能和适用场景。模板不预填简介,以免占位文案被当作真实介绍发布。
|
|
18
18
|
|
|
19
|
-
如果小程序服务于特定 PC 游戏,可运行 `npm run hb-sdk -- remote games search "游戏名" --json` 查询平台游戏 appid
|
|
19
|
+
如果小程序服务于特定 PC 游戏,可运行 `npm run hb-sdk -- remote games search "游戏名" --json` 查询平台游戏 appid,核对结果后运行 `npm run hb-sdk -- remote games configure --app-id <appid>` 写回本地配置,或在调试台左侧“关联游戏”Tab中搜索并多选。关联后,已发布的小程序可在对应 PC 游戏工作区被发现,仍受适配平台等条件限制。工具类应主动检查,无需关联游戏时可保持为空,也可稍后设置。关联游戏随版本审核,修改后需重新构建;能否绑定以部署预检为准。
|
|
20
20
|
|
|
21
21
|
`package.json#heybox.platforms` 默认声明全平台 `android`、`ios`、`ohos`、`windows`、`macos`,请按项目实际完成适配并验收的平台保留,未适配的平台务必删除。`linux` 目前没有客户端基线与 API 兼容声明,暂不建议声明。
|
|
22
22
|
|
package/dist/vite.cjs.js
CHANGED
|
@@ -30,7 +30,7 @@ function getMiniappMetadataWarnings(metadata) {
|
|
|
30
30
|
warnings.push({
|
|
31
31
|
code: 'MINIAPP_TOOL_GAME_BINDING_MISSING',
|
|
32
32
|
field: 'bindAppIds',
|
|
33
|
-
message: '
|
|
33
|
+
message: '当前小程序为工具类,尚未关联游戏。关联后可在对应 PC 游戏工作区被发现(仍受适配平台等条件限制)。可在调试台“关联游戏”中选择,或运行 hb-sdk remote games configure;无需关联时可保持为空,修改后重新构建。',
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
return warnings;
|
|
@@ -57,6 +57,19 @@ const MINI_PROGRAM_MESSAGE_VERSION = 2;
|
|
|
57
57
|
*/
|
|
58
58
|
const MINI_PROGRAM_BRIDGE_NONCE_PARAM = 'hb_mini_bridge_nonce';
|
|
59
59
|
|
|
60
|
+
const POST_READ_METHODS = [
|
|
61
|
+
'post.get',
|
|
62
|
+
'post.comments.list',
|
|
63
|
+
'post.watch',
|
|
64
|
+
];
|
|
65
|
+
const POST_WRITE_METHODS = [
|
|
66
|
+
'post.setLiked',
|
|
67
|
+
'post.setFavorited',
|
|
68
|
+
'post.comments.openEditor',
|
|
69
|
+
'post.comments.delete',
|
|
70
|
+
'post.comments.setLiked',
|
|
71
|
+
];
|
|
72
|
+
|
|
60
73
|
/** 游戏资料内部 wire:业务方法由 SDK 映射为精确资源请求。 */
|
|
61
74
|
const USER_GAMES_GET_OVERVIEW_METHOD = 'user.games.getOverview';
|
|
62
75
|
const USER_DATA_QUERY_METHOD = 'user.data.query';
|
|
@@ -167,6 +180,20 @@ const COMPANION_SHOW_NOTIFICATION_METHOD = 'companion.showNotification';
|
|
|
167
180
|
* 仅表示无需 Manifest 权限声明,不表示绕过参数校验、Host 能力、可信手势或业务策略。
|
|
168
181
|
*/
|
|
169
182
|
[
|
|
183
|
+
...POST_READ_METHODS.map((method) => ({
|
|
184
|
+
method,
|
|
185
|
+
module: 'post',
|
|
186
|
+
capability: method,
|
|
187
|
+
requirement: { kind: 'all', permissions: ['post'] },
|
|
188
|
+
risk: 'medium',
|
|
189
|
+
})),
|
|
190
|
+
...POST_WRITE_METHODS.map((method) => ({
|
|
191
|
+
method,
|
|
192
|
+
module: 'post',
|
|
193
|
+
capability: method,
|
|
194
|
+
requirement: { kind: 'all', permissions: ['post'] },
|
|
195
|
+
risk: 'high',
|
|
196
|
+
})),
|
|
170
197
|
...[GAME_SAVES_LIST_METHOD, GAME_SAVES_SYNC_METHOD, GAME_SAVES_GET_FILE_METHOD, GAME_SAVES_READ_PARSED_DATA_METHOD].map((method) => ({
|
|
171
198
|
method,
|
|
172
199
|
module: 'gameSaves',
|
|
@@ -259,7 +286,13 @@ const COMPANION_SHOW_NOTIFICATION_METHOD = 'companion.showNotification';
|
|
|
259
286
|
requirement: { kind: 'all', permissions: ['share'] },
|
|
260
287
|
risk: 'medium',
|
|
261
288
|
},
|
|
262
|
-
{
|
|
289
|
+
{
|
|
290
|
+
method: SHARE_SCREENSHOT_LONG_METHOD,
|
|
291
|
+
module: 'share',
|
|
292
|
+
capability: SHARE_SCREENSHOT_LONG_METHOD,
|
|
293
|
+
requirement: { kind: 'all', permissions: ['share'] },
|
|
294
|
+
risk: 'medium',
|
|
295
|
+
},
|
|
263
296
|
{
|
|
264
297
|
method: VIEWPORT_GET_WINDOW_INFO_METHOD,
|
|
265
298
|
module: 'viewport',
|
|
@@ -728,6 +761,7 @@ const MINI_PROGRAM_PERMISSION_KEYS = [
|
|
|
728
761
|
'appProtocol',
|
|
729
762
|
'workspaceCards',
|
|
730
763
|
'user_game_data',
|
|
764
|
+
'post',
|
|
731
765
|
];
|
|
732
766
|
const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
733
767
|
{
|
|
@@ -936,6 +970,19 @@ const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
|
936
970
|
'平台取数不授予小程序 `network` 权限;已交付的数据副本无法撤回。',
|
|
937
971
|
],
|
|
938
972
|
},
|
|
973
|
+
{
|
|
974
|
+
key: 'post',
|
|
975
|
+
name: '关联帖子',
|
|
976
|
+
description: '读取关联帖子与评论,或以当前用户身份互动并打开社区原生编辑器。',
|
|
977
|
+
access: 'declaration',
|
|
978
|
+
risk: 'high',
|
|
979
|
+
config: {
|
|
980
|
+
read: { type: 'boolean', required: false, default: false, description: '读取帖子、评论和订阅变化。' },
|
|
981
|
+
write: { type: 'boolean', required: false, default: false, description: '点赞、收藏、删除评论及打开社区原生编辑器。' },
|
|
982
|
+
},
|
|
983
|
+
methods: [...POST_READ_METHODS, ...POST_WRITE_METHODS],
|
|
984
|
+
conditions: ['显式声明 read / write,省略时为 false;写操作须由用户明确触发,继续执行社区审核和权限校验。'],
|
|
985
|
+
},
|
|
939
986
|
];
|
|
940
987
|
new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
941
988
|
|
|
@@ -11246,7 +11293,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
|
11246
11293
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
11247
11294
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
11248
11295
|
? undefined
|
|
11249
|
-
: '0.9.
|
|
11296
|
+
: '0.9.9-alpha.1';
|
|
11250
11297
|
|
|
11251
11298
|
/**
|
|
11252
11299
|
* network.request 诊断日志的纯脱敏工具。
|
|
@@ -12497,6 +12544,16 @@ function parseMiniappPermissions(value, options) {
|
|
|
12497
12544
|
}
|
|
12498
12545
|
useOfficialDomain = declaration.useOfficialDomain === true;
|
|
12499
12546
|
}
|
|
12547
|
+
if (key === 'post') {
|
|
12548
|
+
for (const field of ['read', 'write']) {
|
|
12549
|
+
if (declaration[field] !== undefined && typeof declaration[field] !== 'boolean') {
|
|
12550
|
+
throw new Error(`${itemLabel}.${field} 必须是 boolean`);
|
|
12551
|
+
}
|
|
12552
|
+
}
|
|
12553
|
+
if (declaration.enabled)
|
|
12554
|
+
permissions.post = { enabled: true, read: declaration.read === true, write: declaration.write === true };
|
|
12555
|
+
continue;
|
|
12556
|
+
}
|
|
12500
12557
|
if (key === 'user_game_data') {
|
|
12501
12558
|
// 即使声明关闭也校验资源清单:enabled:false 不能隐藏非法字段。
|
|
12502
12559
|
const resources = parseUserGameDataResources(declaration.resources, itemLabel);
|
package/dist/vite.esm.js
CHANGED
|
@@ -27,7 +27,7 @@ function getMiniappMetadataWarnings(metadata) {
|
|
|
27
27
|
warnings.push({
|
|
28
28
|
code: 'MINIAPP_TOOL_GAME_BINDING_MISSING',
|
|
29
29
|
field: 'bindAppIds',
|
|
30
|
-
message: '
|
|
30
|
+
message: '当前小程序为工具类,尚未关联游戏。关联后可在对应 PC 游戏工作区被发现(仍受适配平台等条件限制)。可在调试台“关联游戏”中选择,或运行 hb-sdk remote games configure;无需关联时可保持为空,修改后重新构建。',
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
return warnings;
|
|
@@ -54,6 +54,19 @@ const MINI_PROGRAM_MESSAGE_VERSION = 2;
|
|
|
54
54
|
*/
|
|
55
55
|
const MINI_PROGRAM_BRIDGE_NONCE_PARAM = 'hb_mini_bridge_nonce';
|
|
56
56
|
|
|
57
|
+
const POST_READ_METHODS = [
|
|
58
|
+
'post.get',
|
|
59
|
+
'post.comments.list',
|
|
60
|
+
'post.watch',
|
|
61
|
+
];
|
|
62
|
+
const POST_WRITE_METHODS = [
|
|
63
|
+
'post.setLiked',
|
|
64
|
+
'post.setFavorited',
|
|
65
|
+
'post.comments.openEditor',
|
|
66
|
+
'post.comments.delete',
|
|
67
|
+
'post.comments.setLiked',
|
|
68
|
+
];
|
|
69
|
+
|
|
57
70
|
/** 游戏资料内部 wire:业务方法由 SDK 映射为精确资源请求。 */
|
|
58
71
|
const USER_GAMES_GET_OVERVIEW_METHOD = 'user.games.getOverview';
|
|
59
72
|
const USER_DATA_QUERY_METHOD = 'user.data.query';
|
|
@@ -164,6 +177,20 @@ const COMPANION_SHOW_NOTIFICATION_METHOD = 'companion.showNotification';
|
|
|
164
177
|
* 仅表示无需 Manifest 权限声明,不表示绕过参数校验、Host 能力、可信手势或业务策略。
|
|
165
178
|
*/
|
|
166
179
|
[
|
|
180
|
+
...POST_READ_METHODS.map((method) => ({
|
|
181
|
+
method,
|
|
182
|
+
module: 'post',
|
|
183
|
+
capability: method,
|
|
184
|
+
requirement: { kind: 'all', permissions: ['post'] },
|
|
185
|
+
risk: 'medium',
|
|
186
|
+
})),
|
|
187
|
+
...POST_WRITE_METHODS.map((method) => ({
|
|
188
|
+
method,
|
|
189
|
+
module: 'post',
|
|
190
|
+
capability: method,
|
|
191
|
+
requirement: { kind: 'all', permissions: ['post'] },
|
|
192
|
+
risk: 'high',
|
|
193
|
+
})),
|
|
167
194
|
...[GAME_SAVES_LIST_METHOD, GAME_SAVES_SYNC_METHOD, GAME_SAVES_GET_FILE_METHOD, GAME_SAVES_READ_PARSED_DATA_METHOD].map((method) => ({
|
|
168
195
|
method,
|
|
169
196
|
module: 'gameSaves',
|
|
@@ -256,7 +283,13 @@ const COMPANION_SHOW_NOTIFICATION_METHOD = 'companion.showNotification';
|
|
|
256
283
|
requirement: { kind: 'all', permissions: ['share'] },
|
|
257
284
|
risk: 'medium',
|
|
258
285
|
},
|
|
259
|
-
{
|
|
286
|
+
{
|
|
287
|
+
method: SHARE_SCREENSHOT_LONG_METHOD,
|
|
288
|
+
module: 'share',
|
|
289
|
+
capability: SHARE_SCREENSHOT_LONG_METHOD,
|
|
290
|
+
requirement: { kind: 'all', permissions: ['share'] },
|
|
291
|
+
risk: 'medium',
|
|
292
|
+
},
|
|
260
293
|
{
|
|
261
294
|
method: VIEWPORT_GET_WINDOW_INFO_METHOD,
|
|
262
295
|
module: 'viewport',
|
|
@@ -725,6 +758,7 @@ const MINI_PROGRAM_PERMISSION_KEYS = [
|
|
|
725
758
|
'appProtocol',
|
|
726
759
|
'workspaceCards',
|
|
727
760
|
'user_game_data',
|
|
761
|
+
'post',
|
|
728
762
|
];
|
|
729
763
|
const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
730
764
|
{
|
|
@@ -933,6 +967,19 @@ const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
|
933
967
|
'平台取数不授予小程序 `network` 权限;已交付的数据副本无法撤回。',
|
|
934
968
|
],
|
|
935
969
|
},
|
|
970
|
+
{
|
|
971
|
+
key: 'post',
|
|
972
|
+
name: '关联帖子',
|
|
973
|
+
description: '读取关联帖子与评论,或以当前用户身份互动并打开社区原生编辑器。',
|
|
974
|
+
access: 'declaration',
|
|
975
|
+
risk: 'high',
|
|
976
|
+
config: {
|
|
977
|
+
read: { type: 'boolean', required: false, default: false, description: '读取帖子、评论和订阅变化。' },
|
|
978
|
+
write: { type: 'boolean', required: false, default: false, description: '点赞、收藏、删除评论及打开社区原生编辑器。' },
|
|
979
|
+
},
|
|
980
|
+
methods: [...POST_READ_METHODS, ...POST_WRITE_METHODS],
|
|
981
|
+
conditions: ['显式声明 read / write,省略时为 false;写操作须由用户明确触发,继续执行社区审核和权限校验。'],
|
|
982
|
+
},
|
|
936
983
|
];
|
|
937
984
|
new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
938
985
|
|
|
@@ -11243,7 +11290,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
|
11243
11290
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
11244
11291
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
11245
11292
|
? undefined
|
|
11246
|
-
: '0.9.
|
|
11293
|
+
: '0.9.9-alpha.1';
|
|
11247
11294
|
|
|
11248
11295
|
/**
|
|
11249
11296
|
* network.request 诊断日志的纯脱敏工具。
|
|
@@ -12494,6 +12541,16 @@ function parseMiniappPermissions(value, options) {
|
|
|
12494
12541
|
}
|
|
12495
12542
|
useOfficialDomain = declaration.useOfficialDomain === true;
|
|
12496
12543
|
}
|
|
12544
|
+
if (key === 'post') {
|
|
12545
|
+
for (const field of ['read', 'write']) {
|
|
12546
|
+
if (declaration[field] !== undefined && typeof declaration[field] !== 'boolean') {
|
|
12547
|
+
throw new Error(`${itemLabel}.${field} 必须是 boolean`);
|
|
12548
|
+
}
|
|
12549
|
+
}
|
|
12550
|
+
if (declaration.enabled)
|
|
12551
|
+
permissions.post = { enabled: true, read: declaration.read === true, write: declaration.write === true };
|
|
12552
|
+
continue;
|
|
12553
|
+
}
|
|
12497
12554
|
if (key === 'user_game_data') {
|
|
12498
12555
|
// 即使声明关闭也校验资源清单:enabled:false 不能隐藏非法字段。
|
|
12499
12556
|
const resources = parseUserGameDataResources(declaration.resources, itemLabel);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heybox/hb-sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9-alpha.1",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"./src/index.ts",
|
|
6
6
|
"./src/core/singleton.ts",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"undici": "^7.28.0",
|
|
89
89
|
"ws": "^8.18.0",
|
|
90
90
|
"sharp": "^0.34.5",
|
|
91
|
-
"@heybox/hb-sdk-protocol": "0.9.
|
|
91
|
+
"@heybox/hb-sdk-protocol": "0.9.9-alpha.1"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"vite": ">=5"
|
|
@@ -141,12 +141,12 @@
|
|
|
141
141
|
"rollup-plugin-dts": "6.4.0",
|
|
142
142
|
"playwright-core": "1.64.1",
|
|
143
143
|
"@heybox-domain/heybox-theme": "~0.1.0",
|
|
144
|
-
"@heybox/hb-sdk-runtime": "~0.9.8",
|
|
145
144
|
"@heybox-domain/heybox-vue3-ui": "~0.1.0",
|
|
146
|
-
"@heybox/hb-api": "~1.28.
|
|
145
|
+
"@heybox/hb-api": "~1.28.27",
|
|
146
|
+
"@heybox/hb-sdk-runtime": "~0.9.9-alpha.1",
|
|
147
|
+
"@heybox/runtime": "~0.2.2",
|
|
147
148
|
"@heybox/runtime-policy": "~0.2.2",
|
|
148
|
-
"@heybox/runtime-transport-fetch": "~0.2.2"
|
|
149
|
-
"@heybox/runtime": "~0.2.2"
|
|
149
|
+
"@heybox/runtime-transport-fetch": "~0.2.2"
|
|
150
150
|
},
|
|
151
151
|
"publishConfig": {
|
|
152
152
|
"registry": "https://registry.npmjs.org/",
|
package/skill/SKILL.md
CHANGED
|
@@ -65,8 +65,9 @@ Choose workflow guidance from indexed Guides or Recipes and exact contracts from
|
|
|
65
65
|
After the mini-program purpose is clear, after completing its main functionality, and before build, deploy or audit submission, check its category, description and game bindings using the canonical project-configuration and CLI guides.
|
|
66
66
|
|
|
67
67
|
- Proactively fill a missing description in the local project from implemented functionality and intended users when local editing is authorized. Keep existing user-written text; update it only when the requested work changes its meaning. Do not invent features or add placeholder descriptions merely to silence warnings.
|
|
68
|
-
- Check whether the category reflects the actual purpose; do not assume the scaffold's initial category is correct.
|
|
69
|
-
-
|
|
68
|
+
- Check whether the category reflects the actual purpose; do not assume the scaffold's initial category is correct. Assess game relevance independently of category, including projects still using the default `other`. Explain that confirmed game bindings can make published Mini-programs discoverable in the matching PC game workspace, subject to declared platforms and platform eligibility.
|
|
69
|
+
- For a tool serving specific PC games, use its implemented purpose, name, description and declared game-data resources to propose search terms. Resource GameIds and Steam IDs are not substitutes for platform game-search results. Search through the documented CLI, verify the exact game/edition/platform and preserve all existing bindings unless changing them is intended. When local edits are authorized and identity is clear, prefer the documented local `remote games configure --app-id ... --json` workflow after checking installed CLI support; it replaces the full local list, so include the existing bindings to keep. On older versions, follow that version's documented project-editing workflow. Never silently take the first candidate, bind all search results, or infer permission to publish from a local configuration change.
|
|
70
|
+
- Search results are candidates, not proof that binding is valid. Never guess appids, assume every id is a Steam App ID, or choose the first result merely by ranking. Ask a short question when names, editions or platforms remain ambiguous. Tools without a specific game may remain unbound. Do not invent a separate project category or persist a reminder preference. Do not clear existing bindings without intended removal. Explain an unresolved binding decision without changing category to bypass warnings. A deferred or ambiguous decision must remain unresolved so the next publishing guide can ask again.
|
|
70
71
|
- Treat metadata warnings as actionable suggestions and fix confirmed omissions within the authorized scope. Missing optional metadata must not block development or publication, and a warning does not authorize remote publication. Leave invalid-value errors to the documented validation rules.
|
|
71
72
|
|
|
72
73
|
## Troubleshooting and Proactive Feedback
|
package/skill/skill.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.9.
|
|
3
|
+
"skillVersion": "0.9.9-alpha.1+skill.85a3bbd19a58",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.9.
|
|
7
|
-
"compatibility": "0.9.
|
|
6
|
+
"version": "0.9.9-alpha.1",
|
|
7
|
+
"compatibility": "0.9.9-alpha.1"
|
|
8
8
|
},
|
|
9
9
|
"distribution": {
|
|
10
10
|
"type": "npm",
|
|
11
11
|
"package": "@heybox/hb-sdk",
|
|
12
|
-
"version": "0.9.
|
|
12
|
+
"version": "0.9.9-alpha.1",
|
|
13
13
|
"path": "skill"
|
|
14
14
|
},
|
|
15
|
-
"integrity": "sha256-
|
|
15
|
+
"integrity": "sha256-85a3bbd19a58256cb109d799b37c39bd53c40dc59627e61da6ee77b3d2eb02b6"
|
|
16
16
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _heybox_hb_sdk_protocol from '@heybox/hb-sdk-protocol';
|
|
2
|
-
import { MiniProgramEventName, MiniProgramEventPayloadMap, MiniProgramBridgeError, MiniProgramRuntimeMode, MiniProgramOperatingSystemName, LoginScope as LoginScope$1, AccountState, MiniProgramUserInfoResult, ReadResult, ArkProfile, ArkGachaAnalysis, Page, GachaRecord, UserGameDataGameId, GameOverview, UserGameDataSavesOptions, UserGameDataSaveInfo, UserGameDataSaveFileInfo, SyncResult, BlackMythWukongSave, TaskBarHeroSave, PhantomBladeZeroSave, UserGameDataResourceKey, UserGameDataCancellationSignal, UserDataPermissionRequestResult, DataPermissionSnapshot, RequestFollowAuthorResult, GetFollowStatusResult, SetDisplayPayload, SetDisplayResult, WorkspaceCardsRefreshOptions, WorkspaceCardLaunchContext, GameSaveFileInfo as GameSaveFileInfo$1, GameSaveInfo as GameSaveInfo$1, GameSaveStructuredData, CompanionExit, CompanionNotificationCategory, CompanionPrepareProgress, CompanionTarget, CompanionCapability, CompanionInfo, CompanionPreparationStatus, ExecuteProtocolInput } from '@heybox/hb-sdk-protocol';
|
|
3
|
-
export { AccountState, ArkGachaAnalysis, ArkProfile, AuthorFollowStatus, AuthorizedUserInfo, BlackMythWukongSave, CompanionCapability, CompanionExit, CompanionInfo, CompanionNotificationCategory, CompanionPreparationStatus, CompanionPrepareProgress, CompanionTarget, ExecuteProtocolInput, ExecuteProtocolObject, ExecuteProtocolResult, GachaRecord, GameOverview, GameSaveStructuredData, GetFollowStatusResult, MiniProgramDisplayState, MiniProgramEventName, MiniProgramEventPayloadMap, MiniProgramOperatingSystemName, MiniProgramOrientationMode, MiniProgramRuntimeMode, MiniProgramUserInfoResult, Page, PhantomBladeZeroSave, ReadMeta, ReadResult, RequestFollowAuthorResult, RequiredAction, RequiredActionDescriptor, ResourceOverview, SetDisplayPayload, SetDisplayResult, SyncResult, TaskBarHeroSave, USER_INFO_AUTHORIZATION_SCOPES, UserGameDataGameId, UserGameDataResourceKey, UserGameDataSaveFileInfo, UserGameDataSaveInfo, UserGameDataSavesOptions, UserInfoAuthorization, UserInfoAuthorizationScope, UserInfoAuthorizationStatus, WorkspaceCardLaunchContext, WorkspaceCardsRefreshOptions } from '@heybox/hb-sdk-protocol';
|
|
2
|
+
import { MiniProgramEventName, MiniProgramEventPayloadMap, MiniProgramBridgeError, MiniProgramRuntimeMode, MiniProgramOperatingSystemName, LoginScope as LoginScope$1, AccountState, MiniProgramUserInfoResult, ReadResult, ArkProfile, ArkGachaAnalysis, Page, GachaRecord, UserGameDataGameId, GameOverview, UserGameDataSavesOptions, UserGameDataSaveInfo, UserGameDataSaveFileInfo, SyncResult, BlackMythWukongSave, TaskBarHeroSave, PhantomBladeZeroSave, UserGameDataResourceKey, UserGameDataCancellationSignal, UserDataPermissionRequestResult, DataPermissionSnapshot, RequestFollowAuthorResult, GetFollowStatusResult, SetDisplayPayload, SetDisplayResult, WorkspaceCardsRefreshOptions, WorkspaceCardLaunchContext, GameSaveFileInfo as GameSaveFileInfo$1, GameSaveInfo as GameSaveInfo$1, GameSaveStructuredData, PostCommentListOptions, PostCommentPage, PostCommentEditorOptions, LinkedPost, PostChangeEvent, CompanionExit, CompanionNotificationCategory, CompanionPrepareProgress, CompanionTarget, CompanionCapability, CompanionInfo, CompanionPreparationStatus, ExecuteProtocolInput } from '@heybox/hb-sdk-protocol';
|
|
3
|
+
export { AccountState, ArkGachaAnalysis, ArkProfile, AuthorFollowStatus, AuthorizedUserInfo, BlackMythWukongSave, CompanionCapability, CompanionExit, CompanionInfo, CompanionNotificationCategory, CompanionPreparationStatus, CompanionPrepareProgress, CompanionTarget, ExecuteProtocolInput, ExecuteProtocolObject, ExecuteProtocolResult, GachaRecord, GameOverview, GameSaveStructuredData, GetFollowStatusResult, LinkedPost, MiniProgramDisplayState, MiniProgramEventName, MiniProgramEventPayloadMap, MiniProgramOperatingSystemName, MiniProgramOrientationMode, MiniProgramRuntimeMode, MiniProgramUserInfoResult, Page, PhantomBladeZeroSave, PostAuthor, PostChangeEvent, PostComment, PostCommentEditorOptions, PostCommentListOptions, PostCommentPage, PostContentBlock, PostImage, ReadMeta, ReadResult, RequestFollowAuthorResult, RequiredAction, RequiredActionDescriptor, ResourceOverview, SetDisplayPayload, SetDisplayResult, SyncResult, TaskBarHeroSave, USER_INFO_AUTHORIZATION_SCOPES, UserGameDataGameId, UserGameDataResourceKey, UserGameDataSaveFileInfo, UserGameDataSaveInfo, UserGameDataSavesOptions, UserInfoAuthorization, UserInfoAuthorizationScope, UserInfoAuthorizationStatus, WorkspaceCardLaunchContext, WorkspaceCardsRefreshOptions } from '@heybox/hb-sdk-protocol';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 小程序生命周期或业务事件监听函数。
|
|
@@ -4565,6 +4565,139 @@ interface GameSavesModule {
|
|
|
4565
4565
|
sync(gameId: string, options?: GameSavesSyncOptions): Promise<void>;
|
|
4566
4566
|
}
|
|
4567
4567
|
|
|
4568
|
+
/** 关联帖评论能力;读取受当前用户可见范围限制。 */
|
|
4569
|
+
interface PostCommentsModule {
|
|
4570
|
+
/** 分页读取评论;指定 rootCommentId 时读取回复,排序沿用社区默认规则。
|
|
4571
|
+
* 需要声明 `post.read: true`。
|
|
4572
|
+
* @since 0.9.9
|
|
4573
|
+
* @hbPlatform android
|
|
4574
|
+
* @hbPlatform ios
|
|
4575
|
+
* @hbPlatform ohos
|
|
4576
|
+
* @hbPlatform windows
|
|
4577
|
+
* @hbPlatform macos
|
|
4578
|
+
* @hbClient android none
|
|
4579
|
+
* @hbClient ios none
|
|
4580
|
+
* @hbClient ohos none
|
|
4581
|
+
* @hbClient windows none
|
|
4582
|
+
* @hbClient macos none
|
|
4583
|
+
* @experimental
|
|
4584
|
+
*/
|
|
4585
|
+
list(options?: PostCommentListOptions): Promise<PostCommentPage>;
|
|
4586
|
+
/** 打开社区原生评论编辑器,指定 replyToCommentId 时回复该评论;回复子评论还需提供 rootCommentId,不单独校验归属。协议投递后完成调用,发布成功通过 onChange 通知。
|
|
4587
|
+
* 需要声明 `post.write: true`。
|
|
4588
|
+
* @since 0.9.9
|
|
4589
|
+
* @hbPlatform android
|
|
4590
|
+
* @hbPlatform ios
|
|
4591
|
+
* @hbClient android numeric-dot \>= 1.3.402
|
|
4592
|
+
* @hbClient ios none
|
|
4593
|
+
* @experimental
|
|
4594
|
+
*/
|
|
4595
|
+
openEditor(options?: PostCommentEditorOptions): Promise<void>;
|
|
4596
|
+
/** 按社区权限删除指定评论;应使用关联帖列表返回的 ID,Runtime 不额外校验评论归属。
|
|
4597
|
+
* 需要声明 `post.write: true`。
|
|
4598
|
+
* @since 0.9.9
|
|
4599
|
+
* @hbPlatform android
|
|
4600
|
+
* @hbPlatform ios
|
|
4601
|
+
* @hbPlatform ohos
|
|
4602
|
+
* @hbPlatform windows
|
|
4603
|
+
* @hbPlatform macos
|
|
4604
|
+
* @hbClient android none
|
|
4605
|
+
* @hbClient ios none
|
|
4606
|
+
* @hbClient ohos none
|
|
4607
|
+
* @hbClient windows none
|
|
4608
|
+
* @hbClient macos none
|
|
4609
|
+
* @experimental
|
|
4610
|
+
*/
|
|
4611
|
+
delete(commentId: string): Promise<void>;
|
|
4612
|
+
/** 向社区提交评论点赞或取消互动操作;应使用关联帖列表返回的 ID,归属不额外校验,重复操作由社区返回结果。
|
|
4613
|
+
* 需要声明 `post.write: true`。
|
|
4614
|
+
* @since 0.9.9
|
|
4615
|
+
* @hbPlatform android
|
|
4616
|
+
* @hbPlatform ios
|
|
4617
|
+
* @hbPlatform ohos
|
|
4618
|
+
* @hbPlatform windows
|
|
4619
|
+
* @hbPlatform macos
|
|
4620
|
+
* @hbClient android none
|
|
4621
|
+
* @hbClient ios none
|
|
4622
|
+
* @hbClient ohos none
|
|
4623
|
+
* @hbClient windows none
|
|
4624
|
+
* @hbClient macos none
|
|
4625
|
+
* @experimental
|
|
4626
|
+
*/
|
|
4627
|
+
setLiked(options: {
|
|
4628
|
+
commentId: string;
|
|
4629
|
+
liked: boolean;
|
|
4630
|
+
}): Promise<void>;
|
|
4631
|
+
}
|
|
4632
|
+
/** 关联帖子的数据和操作能力;本次运行固定首次读取的绑定,换绑后需重新打开小程序。 */
|
|
4633
|
+
interface PostModule {
|
|
4634
|
+
/** 读取关联图文帖的正文、图片、作者、统计和当前用户状态;不支持视频帖。
|
|
4635
|
+
* 需要声明 `post.read: true`。
|
|
4636
|
+
* @since 0.9.9
|
|
4637
|
+
* @hbPlatform android
|
|
4638
|
+
* @hbPlatform ios
|
|
4639
|
+
* @hbPlatform ohos
|
|
4640
|
+
* @hbPlatform windows
|
|
4641
|
+
* @hbPlatform macos
|
|
4642
|
+
* @hbClient android none
|
|
4643
|
+
* @hbClient ios none
|
|
4644
|
+
* @hbClient ohos none
|
|
4645
|
+
* @hbClient windows none
|
|
4646
|
+
* @hbClient macos none
|
|
4647
|
+
* @experimental
|
|
4648
|
+
*/
|
|
4649
|
+
get(): Promise<LinkedPost>;
|
|
4650
|
+
/** 向社区提交帖子点赞或取消操作,重复操作由社区返回结果。
|
|
4651
|
+
* 需要声明 `post.write: true`。
|
|
4652
|
+
* @since 0.9.9
|
|
4653
|
+
* @hbPlatform android
|
|
4654
|
+
* @hbPlatform ios
|
|
4655
|
+
* @hbPlatform ohos
|
|
4656
|
+
* @hbPlatform windows
|
|
4657
|
+
* @hbPlatform macos
|
|
4658
|
+
* @hbClient android none
|
|
4659
|
+
* @hbClient ios none
|
|
4660
|
+
* @hbClient ohos none
|
|
4661
|
+
* @hbClient windows none
|
|
4662
|
+
* @hbClient macos none
|
|
4663
|
+
* @experimental
|
|
4664
|
+
*/
|
|
4665
|
+
setLiked(liked: boolean): Promise<void>;
|
|
4666
|
+
/** 向社区提交帖子收藏或取消操作,重复操作由社区返回结果。
|
|
4667
|
+
* 需要声明 `post.write: true`。
|
|
4668
|
+
* @since 0.9.9
|
|
4669
|
+
* @hbPlatform android
|
|
4670
|
+
* @hbPlatform ios
|
|
4671
|
+
* @hbPlatform ohos
|
|
4672
|
+
* @hbPlatform windows
|
|
4673
|
+
* @hbPlatform macos
|
|
4674
|
+
* @hbClient android none
|
|
4675
|
+
* @hbClient ios none
|
|
4676
|
+
* @hbClient ohos none
|
|
4677
|
+
* @hbClient windows none
|
|
4678
|
+
* @hbClient macos none
|
|
4679
|
+
* @experimental
|
|
4680
|
+
*/
|
|
4681
|
+
setFavorited(favorited: boolean): Promise<void>;
|
|
4682
|
+
comments: PostCommentsModule;
|
|
4683
|
+
/** 注册刷新通知,Runtime 共享轮询并在帖子或小程序内评论写版本变化时通知。
|
|
4684
|
+
* 需要声明 `post.read: true`。
|
|
4685
|
+
* @since 0.9.9
|
|
4686
|
+
* @hbPlatform android
|
|
4687
|
+
* @hbPlatform ios
|
|
4688
|
+
* @hbPlatform ohos
|
|
4689
|
+
* @hbPlatform windows
|
|
4690
|
+
* @hbPlatform macos
|
|
4691
|
+
* @hbClient android none
|
|
4692
|
+
* @hbClient ios none
|
|
4693
|
+
* @hbClient ohos none
|
|
4694
|
+
* @hbClient windows none
|
|
4695
|
+
* @hbClient macos none
|
|
4696
|
+
* @experimental
|
|
4697
|
+
*/
|
|
4698
|
+
onChange(listener: (event: PostChangeEvent) => void): Promise<() => void>;
|
|
4699
|
+
}
|
|
4700
|
+
|
|
4568
4701
|
/**
|
|
4569
4702
|
* 排行榜排序方向。
|
|
4570
4703
|
*
|
|
@@ -8418,6 +8551,8 @@ declare const companion: MiniProgramCompanionModule;
|
|
|
8418
8551
|
declare const environment: MiniProgramEnvironmentModule;
|
|
8419
8552
|
/** 默认 SDK 的工作区卡片模块。 */
|
|
8420
8553
|
declare const workspaceCards: WorkspaceCardsModule;
|
|
8554
|
+
/** 默认 SDK 实例的关联帖子能力。 */
|
|
8555
|
+
declare const post: PostModule;
|
|
8421
8556
|
|
|
8422
8557
|
declare const hbSDK: {
|
|
8423
8558
|
getHandshakeState: typeof getHandshakeState;
|
|
@@ -8437,10 +8572,11 @@ declare const hbSDK: {
|
|
|
8437
8572
|
environment: MiniProgramEnvironmentModule;
|
|
8438
8573
|
navigation: MiniProgramNavigationModule;
|
|
8439
8574
|
cloud: MiniProgramCloudModule;
|
|
8575
|
+
post: PostModule;
|
|
8440
8576
|
gameSaves: GameSavesModule;
|
|
8441
8577
|
companion: MiniProgramCompanionModule;
|
|
8442
8578
|
workspaceCards: WorkspaceCardsModule;
|
|
8443
8579
|
};
|
|
8444
8580
|
|
|
8445
|
-
export { HbMiniProgramNetworkError, HbMiniProgramSDKError, auth, cloud, companion, hbSDK as default, device, environment, files, gameSaves, getHandshakeState, media, navigation, network, off, on, onHandshakeStateChange, share, storage, ui, user, viewport, workspaceCards };
|
|
8446
|
-
export type { ArkGameModule, ClosePayload, CloseResult, CompanionAttachments, CompanionExitHandler, CompanionNotification, CompanionNotifications, CompanionOutputHandler, CompanionOwnershipLostHandler, CompanionPrepareOptions, CompanionSession, CompanionState, CompanionStateChangeHandler, CompanionStdio, CopyLinkPayload, CopyLinkResult, CreateOptions, DeleteCurrentUserLeaderboardEntryPayload, DeleteCurrentUserLeaderboardEntryResult, DirectoryHandle, DownloadBaseOptions, DownloadOptions, DownloadProgress, FileHandle, FileMode, FileStat, FileSystem, FileSystemEntity, FilesModule, GameSaveFileInfo, GameSaveInfo, GameSavesFileOptions, GameSavesModule, GameSavesSyncOptions, GetCurrentUserLeaderboardEntryPayload, GetCurrentUserLeaderboardEntryResult, GetLeaderboardInfoPayload, GetLeaderboardInfoResult, GetLeaderboardListPayload, GetLeaderboardListResult, GetSteamGameListOptions, GetSteamGameListPayload, GetSteamGameListResult, GetStoragePayload, GetStorageResult, GetUserInfoPayload, GetUserInfoResult, GetWindowInfoPayload, GetWindowInfoResult, HideLoadingPayload, HideLoadingResult, LeaderboardEntry, LeaderboardOrder, ListOptions, LoginOptions, LoginPayload, LoginResult, LoginScope, MediaImageItem, MediaItem, MediaModule, MediaSelectionType, MediaType, MediaVideoItem, MiniProgramAppPageTarget, MiniProgramAuthModule, MiniProgramCloudLeaderboardModule, MiniProgramCloudModule, MiniProgramCloudStorageModule, MiniProgramCompanionModule, MiniProgramCopyLinkOptions, MiniProgramDeviceModule, MiniProgramEnvironmentInfo, MiniProgramEnvironmentModule, MiniProgramEventHandler, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, MiniProgramNavigationBarForegroundStyle, MiniProgramNavigationModule, MiniProgramNetworkHeaders, MiniProgramNetworkModule, MiniProgramNetworkParams, MiniProgramNetworkRequestConfig, MiniProgramNetworkRequestMethod, MiniProgramNetworkResponse, MiniProgramNetworkValidateStatus, MiniProgramSDKHandshakeState, MiniProgramSDKHandshakeStateHandler, MiniProgramSafeArea, MiniProgramScreenshotElementOptions, MiniProgramScreenshotOptions, MiniProgramScreenshotRect, MiniProgramSetNavigationBarStyleOptions, MiniProgramShareChannel, MiniProgramShareExtraValue, MiniProgramShareModule, MiniProgramSharePostOptions, MiniProgramShowShareMenuOptions, MiniProgramStorageModule, MiniProgramToastStatus, MiniProgramUiModule, MiniProgramUserModule, MiniProgramVibrateIntensity, MiniProgramViewportModule, MiniProgramWindowInfoResult, NetworkRequestPayload, NetworkResponsePayload, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPageOptions, OpenGameDetailAppPagePayload, OpenMiniProgramAppPageOptions, OpenMiniProgramAppPagePayload, OpenPostDetailAppPageOptions, OpenPostDetailAppPagePayload, OpenUserDetailAppPageOptions, OpenUserDetailAppPagePayload, PathRoot, PickDirectoryOptions, PickFilesOptions, PickMediaOptions, ReloadPayload, ReloadResult, RemoveOptions, RevokeAuthorizationPayload, RevokeAuthorizationResult, SaveFileOptions, ScreenshotPayload, ScreenshotResult, SetClipboardPayload, SetClipboardResult, SetNavigationBarStylePayload, SetNavigationBarStyleResult, SetStoragePayload, ShowLoadingPayload, ShowLoadingResult, ShowShareMenuPayload, ShowShareMenuResult, ShowToastPayload, ShowToastResult, SteamGameListData, SteamGameListItem, SteamGameListSort, SubmitLeaderboardEntryPayload, SubmitLeaderboardEntryResult, UploadBaseOptions, UploadOptions, UploadProgress, UploadResponse, UserDataPermissionModule, UserGameSaveFileInfo, UserGameSaveFileOptions, UserGameSaveInfo, UserGameSavesModule, UserGamesGachaRecordsOptions, UserGamesModule, UserGamesOverviewOptions, UserGamesProfileOptions, UserSaveGameModule, VibratePayload, VibrateResult, WorkspaceCardsModule };
|
|
8581
|
+
export { HbMiniProgramNetworkError, HbMiniProgramSDKError, auth, cloud, companion, hbSDK as default, device, environment, files, gameSaves, getHandshakeState, media, navigation, network, off, on, onHandshakeStateChange, post, share, storage, ui, user, viewport, workspaceCards };
|
|
8582
|
+
export type { ArkGameModule, ClosePayload, CloseResult, CompanionAttachments, CompanionExitHandler, CompanionNotification, CompanionNotifications, CompanionOutputHandler, CompanionOwnershipLostHandler, CompanionPrepareOptions, CompanionSession, CompanionState, CompanionStateChangeHandler, CompanionStdio, CopyLinkPayload, CopyLinkResult, CreateOptions, DeleteCurrentUserLeaderboardEntryPayload, DeleteCurrentUserLeaderboardEntryResult, DirectoryHandle, DownloadBaseOptions, DownloadOptions, DownloadProgress, FileHandle, FileMode, FileStat, FileSystem, FileSystemEntity, FilesModule, GameSaveFileInfo, GameSaveInfo, GameSavesFileOptions, GameSavesModule, GameSavesSyncOptions, GetCurrentUserLeaderboardEntryPayload, GetCurrentUserLeaderboardEntryResult, GetLeaderboardInfoPayload, GetLeaderboardInfoResult, GetLeaderboardListPayload, GetLeaderboardListResult, GetSteamGameListOptions, GetSteamGameListPayload, GetSteamGameListResult, GetStoragePayload, GetStorageResult, GetUserInfoPayload, GetUserInfoResult, GetWindowInfoPayload, GetWindowInfoResult, HideLoadingPayload, HideLoadingResult, LeaderboardEntry, LeaderboardOrder, ListOptions, LoginOptions, LoginPayload, LoginResult, LoginScope, MediaImageItem, MediaItem, MediaModule, MediaSelectionType, MediaType, MediaVideoItem, MiniProgramAppPageTarget, MiniProgramAuthModule, MiniProgramCloudLeaderboardModule, MiniProgramCloudModule, MiniProgramCloudStorageModule, MiniProgramCompanionModule, MiniProgramCopyLinkOptions, MiniProgramDeviceModule, MiniProgramEnvironmentInfo, MiniProgramEnvironmentModule, MiniProgramEventHandler, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, MiniProgramNavigationBarForegroundStyle, MiniProgramNavigationModule, MiniProgramNetworkHeaders, MiniProgramNetworkModule, MiniProgramNetworkParams, MiniProgramNetworkRequestConfig, MiniProgramNetworkRequestMethod, MiniProgramNetworkResponse, MiniProgramNetworkValidateStatus, MiniProgramSDKHandshakeState, MiniProgramSDKHandshakeStateHandler, MiniProgramSafeArea, MiniProgramScreenshotElementOptions, MiniProgramScreenshotOptions, MiniProgramScreenshotRect, MiniProgramSetNavigationBarStyleOptions, MiniProgramShareChannel, MiniProgramShareExtraValue, MiniProgramShareModule, MiniProgramSharePostOptions, MiniProgramShowShareMenuOptions, MiniProgramStorageModule, MiniProgramToastStatus, MiniProgramUiModule, MiniProgramUserModule, MiniProgramVibrateIntensity, MiniProgramViewportModule, MiniProgramWindowInfoResult, NetworkRequestPayload, NetworkResponsePayload, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPageOptions, OpenGameDetailAppPagePayload, OpenMiniProgramAppPageOptions, OpenMiniProgramAppPagePayload, OpenPostDetailAppPageOptions, OpenPostDetailAppPagePayload, OpenUserDetailAppPageOptions, OpenUserDetailAppPagePayload, PathRoot, PickDirectoryOptions, PickFilesOptions, PickMediaOptions, PostCommentsModule, PostModule, ReloadPayload, ReloadResult, RemoveOptions, RevokeAuthorizationPayload, RevokeAuthorizationResult, SaveFileOptions, ScreenshotPayload, ScreenshotResult, SetClipboardPayload, SetClipboardResult, SetNavigationBarStylePayload, SetNavigationBarStyleResult, SetStoragePayload, ShowLoadingPayload, ShowLoadingResult, ShowShareMenuPayload, ShowShareMenuResult, ShowToastPayload, ShowToastResult, SteamGameListData, SteamGameListItem, SteamGameListSort, SubmitLeaderboardEntryPayload, SubmitLeaderboardEntryResult, UploadBaseOptions, UploadOptions, UploadProgress, UploadResponse, UserDataPermissionModule, UserGameSaveFileInfo, UserGameSaveFileOptions, UserGameSaveInfo, UserGameSavesModule, UserGamesGachaRecordsOptions, UserGamesModule, UserGamesOverviewOptions, UserGamesProfileOptions, UserSaveGameModule, VibratePayload, VibrateResult, WorkspaceCardsModule };
|