@heybox/hb-sdk 0.5.2 → 0.5.3
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 +8 -1
- package/dist/cli-chunks/{create-Bh4kJDVt.cjs → create-CIa8XsUa.cjs} +1 -1
- package/dist/cli-chunks/{dev-BYgFjQRn.cjs → dev-DrTprWNa.cjs} +1 -1
- package/dist/cli-chunks/{doctor-BqbJqCW_.cjs → doctor-duvVSZ1O.cjs} +1 -1
- package/dist/cli-chunks/{index-JgAMdKYi.cjs → index-Drc512Vi.cjs} +13 -13
- package/dist/cli-chunks/{index-DflbDKpY.cjs → index-Y-Y6vH26.cjs} +2 -2
- package/dist/cli-chunks/{login-BgPUbxW7.cjs → login-CQwHq3K6.cjs} +2 -2
- package/dist/cli-chunks/{remote-C8Sr29mG.cjs → remote-zxSs0z8Z.cjs} +3 -3
- package/dist/cli-chunks/{session-DNEf3FBW.cjs → session-DJoDsjWF.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/mock-host/main.js +36 -0
- package/dist/index.cjs.js +15 -0
- package/dist/index.esm.js +15 -0
- package/package.json +1 -1
- package/skill/references/api-protocol.md +1 -0
- package/skill/references/api-root.md +11 -2
- package/skill/skill.json +4 -4
- package/types/index.d.ts +1 -1
- package/types/modules/navigation/app-pages/index.d.ts +1 -1
- package/types/modules/navigation/app-pages/types.d.ts +20 -3
- package/types/modules/navigation/index.d.ts +1 -1
- package/types/protocol.d.ts +1 -1
package/README.md
CHANGED
|
@@ -196,11 +196,18 @@ await navigation.openAppPage({
|
|
|
196
196
|
target: 'user_detail',
|
|
197
197
|
userId: '239040',
|
|
198
198
|
});
|
|
199
|
+
|
|
200
|
+
await navigation.openAppPage({
|
|
201
|
+
target: 'post_detail',
|
|
202
|
+
linkId: 57669242,
|
|
203
|
+
rootCommentId: 123,
|
|
204
|
+
commentId: 456,
|
|
205
|
+
});
|
|
199
206
|
```
|
|
200
207
|
|
|
201
208
|
`navigation.close()` 请求宿主关闭当前小程序容器,`navigation.reload()` 请求宿主重载当前小程序页面/容器。调用后 JS 上下文可能被宿主销毁,不保证后续代码继续执行;这两个能力不接受 `reason`、`force`、`confirm` 或 `fallbackUrl` 等扩展参数。
|
|
202
209
|
|
|
203
|
-
`navigation.openAppPage()` 请求宿主打开受 SDK 白名单约束的黑盒 App 页面。当前支持 `target: 'game_detail'`,必填 `appId` 与 `gameType`;`gameType` 支持 `pc`、`console`、`mobile`,可选 `page: 'game' | 'wiki'`、`hSrc`、`skuId`。也支持 `target: 'user_detail'`,必填 `userId
|
|
210
|
+
`navigation.openAppPage()` 请求宿主打开受 SDK 白名单约束的黑盒 App 页面。当前支持 `target: 'game_detail'`,必填 `appId` 与 `gameType`;`gameType` 支持 `pc`、`console`、`mobile`,可选 `page: 'game' | 'wiki'`、`hSrc`、`skuId`。也支持 `target: 'user_detail'`,必填 `userId`;支持 `target: 'post_detail'`,必填 `linkId`,可选 `rootCommentId` 与 `commentId` 定位评论。
|
|
204
211
|
|
|
205
212
|
### 窗口信息
|
|
206
213
|
|
|
@@ -5,7 +5,7 @@ var fs = require('node:fs/promises');
|
|
|
5
5
|
var path = require('node:path');
|
|
6
6
|
var require$$0 = require('fs');
|
|
7
7
|
var require$$1 = require('path');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-Drc512Vi.cjs');
|
|
9
9
|
require('node:module');
|
|
10
10
|
require('os');
|
|
11
11
|
require('readline');
|
|
@@ -9,7 +9,7 @@ var node_url = require('node:url');
|
|
|
9
9
|
var net = require('node:net');
|
|
10
10
|
var node_http = require('node:http');
|
|
11
11
|
var browser = require('./browser-RAy8e8cV.cjs');
|
|
12
|
-
var index = require('./index-
|
|
12
|
+
var index = require('./index-Drc512Vi.cjs');
|
|
13
13
|
require('node:process');
|
|
14
14
|
require('node:buffer');
|
|
15
15
|
require('node:util');
|
|
@@ -4,7 +4,7 @@ var fs$1 = require('node:fs');
|
|
|
4
4
|
var fs = require('node:fs/promises');
|
|
5
5
|
var os = require('node:os');
|
|
6
6
|
var path = require('node:path');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-Drc512Vi.cjs');
|
|
8
8
|
require('node:module');
|
|
9
9
|
require('path');
|
|
10
10
|
require('os');
|
|
@@ -234,19 +234,19 @@ function requireArgument () {
|
|
|
234
234
|
|
|
235
235
|
var command = {};
|
|
236
236
|
|
|
237
|
-
const require$5 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
237
|
+
const require$5 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Drc512Vi.cjs', document.baseURI).href)));
|
|
238
238
|
function __require$4() { return require$5("node:events"); }
|
|
239
239
|
|
|
240
|
-
const require$4 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
240
|
+
const require$4 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Drc512Vi.cjs', document.baseURI).href)));
|
|
241
241
|
function __require$3() { return require$4("node:child_process"); }
|
|
242
242
|
|
|
243
|
-
const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
243
|
+
const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Drc512Vi.cjs', document.baseURI).href)));
|
|
244
244
|
function __require$2() { return require$3("node:path"); }
|
|
245
245
|
|
|
246
|
-
const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
246
|
+
const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Drc512Vi.cjs', document.baseURI).href)));
|
|
247
247
|
function __require$1() { return require$2("node:fs"); }
|
|
248
248
|
|
|
249
|
-
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
249
|
+
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Drc512Vi.cjs', document.baseURI).href)));
|
|
250
250
|
function __require() { return require$1("node:process"); }
|
|
251
251
|
|
|
252
252
|
var help = {};
|
|
@@ -13094,7 +13094,7 @@ function readErrorMessage(error, options = {}) {
|
|
|
13094
13094
|
}
|
|
13095
13095
|
|
|
13096
13096
|
const CLI_VERSION_PLACEHOLDER = ['__HB', 'SDK', 'CLI', 'VERSION__'].join('_');
|
|
13097
|
-
const BUILT_CLI_VERSION = '0.5.
|
|
13097
|
+
const BUILT_CLI_VERSION = '0.5.3';
|
|
13098
13098
|
const PACKAGE_JSON_CANDIDATES = [
|
|
13099
13099
|
path.resolve(__dirname, '..', '..', 'package.json'),
|
|
13100
13100
|
path.resolve(__dirname, '..', 'package.json'),
|
|
@@ -13377,31 +13377,31 @@ function createCommandLoggerResolver(options) {
|
|
|
13377
13377
|
};
|
|
13378
13378
|
}
|
|
13379
13379
|
const defaultClearLoginStatus = async (...args) => {
|
|
13380
|
-
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-
|
|
13380
|
+
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-CQwHq3K6.cjs'); });
|
|
13381
13381
|
return clearLoginStatus(...args);
|
|
13382
13382
|
};
|
|
13383
13383
|
const defaultLoginToHeybox = async (...args) => {
|
|
13384
|
-
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-
|
|
13384
|
+
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-CQwHq3K6.cjs'); });
|
|
13385
13385
|
return loginToHeybox(...args);
|
|
13386
13386
|
};
|
|
13387
13387
|
const defaultPrintLoginStatus = async (...args) => {
|
|
13388
|
-
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-
|
|
13388
|
+
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-CQwHq3K6.cjs'); });
|
|
13389
13389
|
return printLoginStatus(...args);
|
|
13390
13390
|
};
|
|
13391
13391
|
const defaultRunCreateCommand = async (...args) => {
|
|
13392
|
-
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-
|
|
13392
|
+
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-CIa8XsUa.cjs'); });
|
|
13393
13393
|
return runCreateCommand(...args);
|
|
13394
13394
|
};
|
|
13395
13395
|
const defaultRunDevCommand = async (...args) => {
|
|
13396
|
-
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-
|
|
13396
|
+
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-DrTprWNa.cjs'); });
|
|
13397
13397
|
return runDevCommand(...args);
|
|
13398
13398
|
};
|
|
13399
13399
|
const defaultRunDoctorCommand = async (...args) => {
|
|
13400
|
-
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-
|
|
13400
|
+
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-duvVSZ1O.cjs'); });
|
|
13401
13401
|
return runDoctorCommand(...args);
|
|
13402
13402
|
};
|
|
13403
13403
|
const defaultRunRemoteCommand = async (...args) => {
|
|
13404
|
-
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-
|
|
13404
|
+
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-zxSs0z8Z.cjs'); }).then(function (n) { return n.remote; });
|
|
13405
13405
|
return runRemoteCommand(...args);
|
|
13406
13406
|
};
|
|
13407
13407
|
function resolveStandaloneLogger(options, verbose) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$2 = require('./index-
|
|
3
|
+
var index$2 = require('./index-Drc512Vi.cjs');
|
|
4
4
|
var require$$0$2 = require('fs');
|
|
5
5
|
var require$$2$1 = require('crypto');
|
|
6
6
|
var require$$1$2 = require('path');
|
|
7
7
|
var require$$0$3 = require('assert');
|
|
8
8
|
var require$$4$2 = require('events');
|
|
9
9
|
var require$$1$1 = require('util');
|
|
10
|
-
var remote = require('./remote-
|
|
10
|
+
var remote = require('./remote-zxSs0z8Z.cjs');
|
|
11
11
|
var require$$0$5 = require('net');
|
|
12
12
|
var require$$0$4 = require('url');
|
|
13
13
|
var require$$2$2 = require('http');
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var promises = require('node:readline/promises');
|
|
4
4
|
var node_crypto = require('node:crypto');
|
|
5
5
|
var node_http = require('node:http');
|
|
6
|
-
var session = require('./session-
|
|
6
|
+
var session = require('./session-DJoDsjWF.cjs');
|
|
7
7
|
var browser = require('./browser-RAy8e8cV.cjs');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-Drc512Vi.cjs');
|
|
9
9
|
require('node:path');
|
|
10
10
|
require('fs');
|
|
11
11
|
require('constants');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var promises = require('node:readline/promises');
|
|
4
|
-
var session = require('./session-
|
|
4
|
+
var session = require('./session-DJoDsjWF.cjs');
|
|
5
5
|
var childProcess = require('node:child_process');
|
|
6
6
|
var fs = require('node:fs');
|
|
7
7
|
var fs$1 = require('node:fs/promises');
|
|
8
8
|
var path = require('node:path');
|
|
9
|
-
var index = require('./index-
|
|
9
|
+
var index = require('./index-Drc512Vi.cjs');
|
|
10
10
|
|
|
11
11
|
var re = {exports: {}};
|
|
12
12
|
|
|
@@ -3113,7 +3113,7 @@ async function createDefaultCosClient(uploadToken) {
|
|
|
3113
3113
|
};
|
|
3114
3114
|
}
|
|
3115
3115
|
async function loadCosConstructor() {
|
|
3116
|
-
const cosModule = await Promise.resolve().then(function () { return require('./index-
|
|
3116
|
+
const cosModule = await Promise.resolve().then(function () { return require('./index-Y-Y6vH26.cjs'); }).then(function (n) { return n.index; });
|
|
3117
3117
|
return cosModule.default;
|
|
3118
3118
|
}
|
|
3119
3119
|
function formatSize(bytes) {
|
package/dist/cli.cjs
CHANGED
|
@@ -3462,6 +3462,11 @@ function toOpenAppPagePlatformOptions(payload) {
|
|
|
3462
3462
|
target: appPagePayload.target,
|
|
3463
3463
|
protocol: createUserDetailOpenRouterPathProtocol(appPagePayload),
|
|
3464
3464
|
};
|
|
3465
|
+
case 'post_detail':
|
|
3466
|
+
return {
|
|
3467
|
+
target: appPagePayload.target,
|
|
3468
|
+
protocol: createPostDetailOpenRouterPathProtocol(appPagePayload),
|
|
3469
|
+
};
|
|
3465
3470
|
default:
|
|
3466
3471
|
throw createMiniProgramRuntimeBridgeError('INVALID_PARAMS', 'navigation.openAppPage target 不支持');
|
|
3467
3472
|
}
|
|
@@ -3475,6 +3480,8 @@ function readOpenAppPagePayload(payload) {
|
|
|
3475
3480
|
return readOpenGameDetailAppPagePayload(payload);
|
|
3476
3481
|
case 'user_detail':
|
|
3477
3482
|
return readOpenUserDetailAppPagePayload(payload);
|
|
3483
|
+
case 'post_detail':
|
|
3484
|
+
return readOpenPostDetailAppPagePayload(payload);
|
|
3478
3485
|
default:
|
|
3479
3486
|
throw createMiniProgramRuntimeBridgeError('INVALID_PARAMS', 'navigation.openAppPage target 不支持');
|
|
3480
3487
|
}
|
|
@@ -3504,6 +3511,19 @@ function readOpenUserDetailAppPagePayload(payload) {
|
|
|
3504
3511
|
userId: readRequiredString(payload.userId, 'navigation.openAppPage userId 必须是非空字符串'),
|
|
3505
3512
|
};
|
|
3506
3513
|
}
|
|
3514
|
+
function readOpenPostDetailAppPagePayload(payload) {
|
|
3515
|
+
const result = {
|
|
3516
|
+
target: 'post_detail',
|
|
3517
|
+
linkId: readRequiredString(payload.linkId, 'navigation.openAppPage linkId 必须是非空字符串'),
|
|
3518
|
+
};
|
|
3519
|
+
if (payload.rootCommentId !== undefined) {
|
|
3520
|
+
result.rootCommentId = readRequiredString(payload.rootCommentId, 'navigation.openAppPage rootCommentId 必须是非空字符串');
|
|
3521
|
+
}
|
|
3522
|
+
if (payload.commentId !== undefined) {
|
|
3523
|
+
result.commentId = readRequiredString(payload.commentId, 'navigation.openAppPage commentId 必须是非空字符串');
|
|
3524
|
+
}
|
|
3525
|
+
return result;
|
|
3526
|
+
}
|
|
3507
3527
|
function createGameDetailOpenRouterPathProtocol(payload) {
|
|
3508
3528
|
const params = {
|
|
3509
3529
|
app_id: payload.appId,
|
|
@@ -3533,6 +3553,22 @@ function createUserDetailOpenRouterPathProtocol(payload) {
|
|
|
3533
3553
|
},
|
|
3534
3554
|
};
|
|
3535
3555
|
}
|
|
3556
|
+
function createPostDetailOpenRouterPathProtocol(payload) {
|
|
3557
|
+
const params = {
|
|
3558
|
+
link_id: payload.linkId,
|
|
3559
|
+
};
|
|
3560
|
+
if (payload.rootCommentId !== undefined) {
|
|
3561
|
+
params.root_comment_id = payload.rootCommentId;
|
|
3562
|
+
}
|
|
3563
|
+
if (payload.commentId !== undefined) {
|
|
3564
|
+
params.comment_id = payload.commentId;
|
|
3565
|
+
}
|
|
3566
|
+
return {
|
|
3567
|
+
protocol_type: 'openRouterPath',
|
|
3568
|
+
path: '/bbs/link',
|
|
3569
|
+
params,
|
|
3570
|
+
};
|
|
3571
|
+
}
|
|
3536
3572
|
function readRequiredString(value, message) {
|
|
3537
3573
|
if (typeof value !== 'string' || !value.trim()) {
|
|
3538
3574
|
throw createMiniProgramRuntimeBridgeError('INVALID_PARAMS', message);
|
package/dist/index.cjs.js
CHANGED
|
@@ -839,6 +839,8 @@ function normalizeOpenAppPageOptions(options) {
|
|
|
839
839
|
return normalizeGameDetailOptions(options);
|
|
840
840
|
case 'user_detail':
|
|
841
841
|
return normalizeUserDetailOptions(options);
|
|
842
|
+
case 'post_detail':
|
|
843
|
+
return normalizePostDetailOptions(options);
|
|
842
844
|
default:
|
|
843
845
|
throw createSDKError('INVALID_PARAMS', 'navigation.openAppPage target 不支持');
|
|
844
846
|
}
|
|
@@ -873,6 +875,19 @@ function normalizeUserDetailOptions(options) {
|
|
|
873
875
|
userId: readRequiredString(options.userId, 'navigation.openAppPage userId 必须是非空字符串'),
|
|
874
876
|
};
|
|
875
877
|
}
|
|
878
|
+
function normalizePostDetailOptions(options) {
|
|
879
|
+
const payload = {
|
|
880
|
+
target: 'post_detail',
|
|
881
|
+
linkId: readRequiredStringLike(options.linkId, 'navigation.openAppPage linkId 必须是非空字符串或数字'),
|
|
882
|
+
};
|
|
883
|
+
if (options.rootCommentId !== undefined) {
|
|
884
|
+
payload.rootCommentId = readRequiredStringLike(options.rootCommentId, 'navigation.openAppPage rootCommentId 必须是非空字符串或数字');
|
|
885
|
+
}
|
|
886
|
+
if (options.commentId !== undefined) {
|
|
887
|
+
payload.commentId = readRequiredStringLike(options.commentId, 'navigation.openAppPage commentId 必须是非空字符串或数字');
|
|
888
|
+
}
|
|
889
|
+
return payload;
|
|
890
|
+
}
|
|
876
891
|
function readRequiredString(value, message) {
|
|
877
892
|
if (typeof value !== 'string') {
|
|
878
893
|
throw createSDKError('INVALID_PARAMS', message);
|
package/dist/index.esm.js
CHANGED
|
@@ -835,6 +835,8 @@ function normalizeOpenAppPageOptions(options) {
|
|
|
835
835
|
return normalizeGameDetailOptions(options);
|
|
836
836
|
case 'user_detail':
|
|
837
837
|
return normalizeUserDetailOptions(options);
|
|
838
|
+
case 'post_detail':
|
|
839
|
+
return normalizePostDetailOptions(options);
|
|
838
840
|
default:
|
|
839
841
|
throw createSDKError('INVALID_PARAMS', 'navigation.openAppPage target 不支持');
|
|
840
842
|
}
|
|
@@ -869,6 +871,19 @@ function normalizeUserDetailOptions(options) {
|
|
|
869
871
|
userId: readRequiredString(options.userId, 'navigation.openAppPage userId 必须是非空字符串'),
|
|
870
872
|
};
|
|
871
873
|
}
|
|
874
|
+
function normalizePostDetailOptions(options) {
|
|
875
|
+
const payload = {
|
|
876
|
+
target: 'post_detail',
|
|
877
|
+
linkId: readRequiredStringLike(options.linkId, 'navigation.openAppPage linkId 必须是非空字符串或数字'),
|
|
878
|
+
};
|
|
879
|
+
if (options.rootCommentId !== undefined) {
|
|
880
|
+
payload.rootCommentId = readRequiredStringLike(options.rootCommentId, 'navigation.openAppPage rootCommentId 必须是非空字符串或数字');
|
|
881
|
+
}
|
|
882
|
+
if (options.commentId !== undefined) {
|
|
883
|
+
payload.commentId = readRequiredStringLike(options.commentId, 'navigation.openAppPage commentId 必须是非空字符串或数字');
|
|
884
|
+
}
|
|
885
|
+
return payload;
|
|
886
|
+
}
|
|
872
887
|
function readRequiredString(value, message) {
|
|
873
888
|
if (typeof value !== 'string') {
|
|
874
889
|
throw createSDKError('INVALID_PARAMS', message);
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
## Package metadata
|
|
20
20
|
|
|
21
21
|
- Package: `@heybox/hb-sdk`
|
|
22
|
-
- Version at generation time: `0.5.
|
|
22
|
+
- Version at generation time: `0.5.3`
|
|
23
23
|
- Public root export: `@heybox/hb-sdk`
|
|
24
24
|
- Protocol export: `@heybox/hb-sdk/protocol`
|
|
25
25
|
- Vite plugin export: `@heybox/hb-sdk/vite`
|
|
@@ -149,6 +149,8 @@ export type {
|
|
|
149
149
|
OpenAppPageResult,
|
|
150
150
|
OpenGameDetailAppPagePayload,
|
|
151
151
|
OpenGameDetailAppPageOptions,
|
|
152
|
+
OpenPostDetailAppPagePayload,
|
|
153
|
+
OpenPostDetailAppPageOptions,
|
|
152
154
|
OpenUserDetailAppPagePayload,
|
|
153
155
|
OpenUserDetailAppPageOptions,
|
|
154
156
|
ReloadPayload,
|
|
@@ -487,11 +489,18 @@ await navigation.openAppPage({
|
|
|
487
489
|
target: 'user_detail',
|
|
488
490
|
userId: '239040',
|
|
489
491
|
});
|
|
492
|
+
|
|
493
|
+
await navigation.openAppPage({
|
|
494
|
+
target: 'post_detail',
|
|
495
|
+
linkId: 57669242,
|
|
496
|
+
rootCommentId: 123,
|
|
497
|
+
commentId: 456,
|
|
498
|
+
});
|
|
490
499
|
```
|
|
491
500
|
|
|
492
501
|
`navigation.close()` 请求宿主关闭当前小程序容器,`navigation.reload()` 请求宿主重载当前小程序页面/容器。调用后 JS 上下文可能被宿主销毁,不保证后续代码继续执行;这两个能力不接受 `reason`、`force`、`confirm` 或 `fallbackUrl` 等扩展参数。
|
|
493
502
|
|
|
494
|
-
`navigation.openAppPage()` 请求宿主打开受 SDK 白名单约束的黑盒 App 页面。当前支持 `target: 'game_detail'`,必填 `appId` 与 `gameType`;`gameType` 支持 `pc`、`console`、`mobile`,可选 `page: 'game' | 'wiki'`、`hSrc`、`skuId`。也支持 `target: 'user_detail'`,必填 `userId
|
|
503
|
+
`navigation.openAppPage()` 请求宿主打开受 SDK 白名单约束的黑盒 App 页面。当前支持 `target: 'game_detail'`,必填 `appId` 与 `gameType`;`gameType` 支持 `pc`、`console`、`mobile`,可选 `page: 'game' | 'wiki'`、`hSrc`、`skuId`。也支持 `target: 'user_detail'`,必填 `userId`;支持 `target: 'post_detail'`,必填 `linkId`,可选 `rootCommentId` 与 `commentId` 定位评论。
|
|
495
504
|
|
|
496
505
|
### 窗口信息
|
|
497
506
|
|
package/skill/skill.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.5.
|
|
3
|
+
"skillVersion": "0.5.3+skill.1fef97b0740f",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.5.
|
|
7
|
-
"compatibility": "0.5.
|
|
6
|
+
"version": "0.5.3",
|
|
7
|
+
"compatibility": "0.5.3"
|
|
8
8
|
},
|
|
9
9
|
"source": "https://open.xiaoheihe.cn/agent-skills/hb-sdk",
|
|
10
|
-
"integrity": "sha256-
|
|
10
|
+
"integrity": "sha256-1fef97b0740f5976c5d1afc3b6569e5cdf65f11b657e168c5c1c745cab50a13c"
|
|
11
11
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { GetStoragePayload, GetStorageResult, MiniProgramStorageModule, Set
|
|
|
11
11
|
export type { MiniProgramNetworkHeaders, MiniProgramNetworkModule, MiniProgramNetworkParams, MiniProgramNetworkRequestConfig, MiniProgramNetworkRequestMethod, MiniProgramNetworkResponse, MiniProgramNetworkValidateStatus, NetworkRequestPayload, NetworkResponsePayload, } from './modules/network';
|
|
12
12
|
export type { HideLoadingPayload, HideLoadingResult, MiniProgramToastStatus, MiniProgramUiModule, ShowLoadingPayload, ShowLoadingResult, ShowToastPayload, ShowToastResult, } from './modules/ui';
|
|
13
13
|
export type { MiniProgramDeviceModule, MiniProgramVibrateIntensity, SetClipboardPayload, SetClipboardResult, VibratePayload, VibrateResult, } from './modules/device';
|
|
14
|
-
export type { ClosePayload, CloseResult, MiniProgramAppPageTarget, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, MiniProgramNavigationModule, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenGameDetailAppPageOptions, OpenUserDetailAppPagePayload, OpenUserDetailAppPageOptions, ReloadPayload, ReloadResult, } from './modules/navigation';
|
|
14
|
+
export type { ClosePayload, CloseResult, MiniProgramAppPageTarget, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, MiniProgramNavigationModule, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenGameDetailAppPageOptions, OpenPostDetailAppPagePayload, OpenPostDetailAppPageOptions, OpenUserDetailAppPagePayload, OpenUserDetailAppPageOptions, ReloadPayload, ReloadResult, } from './modules/navigation';
|
|
15
15
|
import { off, on, ready } from './core/singleton';
|
|
16
16
|
declare const hbSDK: {
|
|
17
17
|
ready: typeof ready;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { OpenAppPageOptions, OpenAppPagePayload } from './types';
|
|
2
|
-
export type { MiniProgramAppPageTarget, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenGameDetailAppPageOptions, OpenUserDetailAppPagePayload, OpenUserDetailAppPageOptions, } from './types';
|
|
2
|
+
export type { MiniProgramAppPageTarget, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenGameDetailAppPageOptions, OpenPostDetailAppPagePayload, OpenPostDetailAppPageOptions, OpenUserDetailAppPagePayload, OpenUserDetailAppPageOptions, } from './types';
|
|
3
3
|
/** 校验并规范化打开黑盒 App 页面参数。 */
|
|
4
4
|
export declare function normalizeOpenAppPageOptions(options: OpenAppPageOptions): OpenAppPagePayload;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 小程序可请求打开的黑盒 App 页面目标。 */
|
|
2
|
-
export type MiniProgramAppPageTarget = 'game_detail' | 'user_detail';
|
|
2
|
+
export type MiniProgramAppPageTarget = 'game_detail' | 'user_detail' | 'post_detail';
|
|
3
3
|
/** 游戏详情支持的平台类型,与客户端 openGameDetail / RouterPath 文档保持一致。 */
|
|
4
4
|
export type MiniProgramGameDetailGameType = 'pc' | 'console' | 'mobile';
|
|
5
5
|
/** 游戏详情支持的首屏页面。 */
|
|
@@ -26,8 +26,19 @@ export interface OpenUserDetailAppPageOptions {
|
|
|
26
26
|
/** 用户 heybox_id。 */
|
|
27
27
|
userId: string;
|
|
28
28
|
}
|
|
29
|
+
/** 打开帖子详情页的公共参数。 */
|
|
30
|
+
export interface OpenPostDetailAppPageOptions {
|
|
31
|
+
/** 目标页面。 */
|
|
32
|
+
target: 'post_detail';
|
|
33
|
+
/** 帖子 ID。 */
|
|
34
|
+
linkId: string | number;
|
|
35
|
+
/** 可选,置顶评论 ID。 */
|
|
36
|
+
rootCommentId?: string | number;
|
|
37
|
+
/** 可选,评论 ID。 */
|
|
38
|
+
commentId?: string | number;
|
|
39
|
+
}
|
|
29
40
|
/** 打开黑盒 App 页面公共参数。 */
|
|
30
|
-
export type OpenAppPageOptions = OpenGameDetailAppPageOptions | OpenUserDetailAppPageOptions;
|
|
41
|
+
export type OpenAppPageOptions = OpenGameDetailAppPageOptions | OpenUserDetailAppPageOptions | OpenPostDetailAppPageOptions;
|
|
31
42
|
/** `navigation.openAppPage` bridge payload。 */
|
|
32
43
|
export type OpenGameDetailAppPagePayload = Omit<OpenGameDetailAppPageOptions, 'appId' | 'skuId'> & {
|
|
33
44
|
appId: string;
|
|
@@ -37,7 +48,13 @@ export type OpenGameDetailAppPagePayload = Omit<OpenGameDetailAppPageOptions, 'a
|
|
|
37
48
|
export type OpenUserDetailAppPagePayload = Omit<OpenUserDetailAppPageOptions, 'userId'> & {
|
|
38
49
|
userId: string;
|
|
39
50
|
};
|
|
51
|
+
/** `navigation.openAppPage` 打开帖子详情页的 bridge payload。 */
|
|
52
|
+
export type OpenPostDetailAppPagePayload = Omit<OpenPostDetailAppPageOptions, 'linkId' | 'rootCommentId' | 'commentId'> & {
|
|
53
|
+
linkId: string;
|
|
54
|
+
rootCommentId?: string;
|
|
55
|
+
commentId?: string;
|
|
56
|
+
};
|
|
40
57
|
/** `navigation.openAppPage` bridge payload。 */
|
|
41
|
-
export type OpenAppPagePayload = OpenGameDetailAppPagePayload | OpenUserDetailAppPagePayload;
|
|
58
|
+
export type OpenAppPagePayload = OpenGameDetailAppPagePayload | OpenUserDetailAppPagePayload | OpenPostDetailAppPagePayload;
|
|
42
59
|
/** `navigation.openAppPage` 无稳定返回值。 */
|
|
43
60
|
export type OpenAppPageResult = void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MiniProgramRequester } from '../../core/client';
|
|
2
2
|
import { type OpenAppPageOptions } from './app-pages';
|
|
3
3
|
export { NAVIGATION_CLOSE_METHOD, NAVIGATION_OPEN_APP_PAGE_METHOD, NAVIGATION_RELOAD_METHOD, } from '../../protocol/capabilities';
|
|
4
|
-
export type { MiniProgramAppPageTarget, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenGameDetailAppPageOptions, OpenUserDetailAppPagePayload, OpenUserDetailAppPageOptions, } from './app-pages';
|
|
4
|
+
export type { MiniProgramAppPageTarget, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenGameDetailAppPageOptions, OpenPostDetailAppPagePayload, OpenPostDetailAppPageOptions, OpenUserDetailAppPagePayload, OpenUserDetailAppPageOptions, } from './app-pages';
|
|
5
5
|
/** `navigation.close` 不需要入参。 */
|
|
6
6
|
export type ClosePayload = void;
|
|
7
7
|
/** `navigation.close` 无稳定返回值。 */
|
package/types/protocol.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ export type { GetWindowInfoPayload, GetWindowInfoResult, MiniProgramNavigationBa
|
|
|
13
13
|
export type { MiniProgramNetworkHeaders, MiniProgramNetworkParams, MiniProgramNetworkRequestConfig, MiniProgramNetworkRequestMethod, MiniProgramNetworkResponse, MiniProgramNetworkValidateStatus, NetworkRequestPayload, NetworkResponsePayload, } from './modules/network';
|
|
14
14
|
export type { HideLoadingPayload, HideLoadingResult, MiniProgramToastStatus, ShowLoadingPayload, ShowLoadingResult, ShowToastPayload, ShowToastResult, } from './modules/ui';
|
|
15
15
|
export type { MiniProgramVibrateIntensity, SetClipboardPayload, SetClipboardResult, VibratePayload, VibrateResult, } from './modules/device';
|
|
16
|
-
export type { ClosePayload, CloseResult, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenUserDetailAppPagePayload, ReloadPayload, ReloadResult, } from './modules/navigation';
|
|
16
|
+
export type { ClosePayload, CloseResult, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenPostDetailAppPagePayload, OpenUserDetailAppPagePayload, ReloadPayload, ReloadResult, } from './modules/navigation';
|