@heybox/hb-sdk 0.9.6-alpha.0 → 0.9.6-alpha.10
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 +91 -5
- package/README.md +35 -555
- package/dist/cli-chunks/{artifact-Cmg87Tf5.cjs → artifact-BaZzEQjq.cjs} +3 -3
- package/dist/cli-chunks/{build-C3etivt0.cjs → build-Ykhw1sz9.cjs} +8 -6
- package/dist/cli-chunks/{create-Blk6X1Yg.cjs → create-BEjKsD1y.cjs} +3 -1
- package/dist/cli-chunks/{dev-Bz2su6LB.cjs → dev-DpkBN4ir.cjs} +9613 -616
- package/dist/cli-chunks/{dev-context-CEkb1z-v.cjs → dev-context-B3Y_EcXC.cjs} +4 -6
- package/dist/cli-chunks/{doctor-DRod5jqN.cjs → doctor-DPELjB83.cjs} +3 -1
- package/dist/cli-chunks/{games-C__m_OWO.cjs → games-D2hnnWKY.cjs} +3 -1
- package/dist/cli-chunks/{index-Bkp6luz7.cjs → index-DCj9vtVv.cjs} +1 -1
- package/dist/cli-chunks/{index-Ce_VEy0u.cjs → index-DIgSsTuu.cjs} +1754 -120
- package/dist/cli-chunks/index.esm-t29GC7yg.cjs +154 -0
- package/dist/cli-chunks/{login-1OQQ9hax.cjs → login-C5XmcbRa.cjs} +3 -3
- package/dist/cli-chunks/{project-vite-DpG6qqyH.cjs → project-vite-B12EMgRq.cjs} +3 -18
- package/dist/cli-chunks/{remote-DDCv6nEF.cjs → remote-lFAA88Zl.cjs} +12 -21
- package/dist/cli-chunks/{runtime-permission-env-CSex_ggc.cjs → runtime-permission-env-CYbLBtWo.cjs} +61 -12
- package/dist/cli-chunks/{skill-BRQotwcs.cjs → skill-AilHsggi.cjs} +3 -2
- package/dist/cli-chunks/{version-Dl4XqQrU.cjs → version-KZTUyIiC.cjs} +1 -1
- package/dist/cli.cjs +3 -1
- package/dist/dev.cjs +1358 -0
- package/dist/dev.mjs +1356 -0
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-C0_lx52X.js +100 -0
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-CPk4dD63.js +6 -0
- package/dist/devtools/browser-dev-host/assets/index-BzOC7Q8l.js +586 -0
- package/dist/devtools/browser-dev-host/assets/index-CHYEXFEg.css +1 -0
- package/dist/devtools/browser-dev-host/index.html +3 -3
- package/dist/index.cjs.js +63 -112
- package/dist/index.esm.js +63 -112
- package/dist/miniapp-publish.cjs.js +1 -1
- package/dist/miniapp-publish.esm.js +1 -1
- package/dist/protocol.cjs.js +2 -0
- package/dist/protocol.esm.js +2 -0
- package/dist/vite.cjs.js +1059 -202
- package/dist/vite.esm.js +1060 -203
- package/docs/appreciation-code.md +67 -0
- package/docs/device-logs.md +39 -22
- package/package.json +24 -10
- package/skill/skill.json +4 -4
- package/types/dev/index.d.cts +386 -0
- package/types/dev/index.d.mts +386 -0
- package/types/dev/vendor/playwright-core/LICENSE +202 -0
- package/types/dev/vendor/playwright-core/NOTICE +5 -0
- package/types/dev/vendor/playwright-core/UPSTREAM.json +5 -0
- package/types/dev/vendor/playwright-core/types/protocol.d.ts +24776 -0
- package/types/dev/vendor/playwright-core/types/structs.d.ts +52 -0
- package/types/dev/vendor/playwright-core/types/types.d.ts +27167 -0
- package/types/index.d.ts +30 -4
- package/types/protocol.d.ts +3 -2
- package/types/vite/index.d.ts +5 -4
- package/dist/cli-chunks/index.esm-KLaZWTou.cjs +0 -5216
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-HqISBdtQ.js +0 -103
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-JFfHePS2.js +0 -6
- package/dist/devtools/browser-dev-host/assets/index-DSTlrpnQ.css +0 -1
- package/dist/devtools/browser-dev-host/assets/index-MBLQu8hw.js +0 -567
- package/docs/runtime-host-migration.md +0 -128
package/dist/index.esm.js
CHANGED
|
@@ -252,7 +252,7 @@ function redactUrlSearchParams(params) {
|
|
|
252
252
|
return changed;
|
|
253
253
|
}
|
|
254
254
|
function redactSensitivePairsInRawText(text) {
|
|
255
|
-
return text.replace(/([?&#]|^|[?&])([^=&#\s]+)=([^&#\s]*)/g, (full, prefix, key
|
|
255
|
+
return text.replace(/([?&#]|^|[?&])([^=&#\s]+)=([^&#\s]*)/g, (full, prefix, key) => {
|
|
256
256
|
if (!isSensitiveNetworkKey(key)) {
|
|
257
257
|
return full;
|
|
258
258
|
}
|
|
@@ -420,6 +420,7 @@ const GAME_SAVES_READ_PARSED_DATA_METHOD = 'gameSaves.readParsedData';
|
|
|
420
420
|
const USER_GET_INFO_METHOD = 'user.getInfo';
|
|
421
421
|
const USER_REVOKE_AUTHORIZATION_METHOD = 'user.revokeAuthorization';
|
|
422
422
|
const USER_GET_STEAM_GAME_LIST_METHOD = 'user.getSteamGameList';
|
|
423
|
+
const USER_SHOW_APPRECIATION_METHOD = 'user.showAppreciation';
|
|
423
424
|
const SHARE_COPY_LINK_METHOD = 'share.copyLink';
|
|
424
425
|
const SHARE_SHOW_SHARE_MENU_METHOD = 'share.showShareMenu';
|
|
425
426
|
const SHARE_SCREENSHOT_METHOD = 'share.screenshot';
|
|
@@ -7504,7 +7505,7 @@ function createMessageId() {
|
|
|
7504
7505
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
7505
7506
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
7506
7507
|
? undefined
|
|
7507
|
-
: '0.9.6-alpha.
|
|
7508
|
+
: '0.9.6-alpha.10';
|
|
7508
7509
|
|
|
7509
7510
|
const RUNTIME_MODES = new Set(['production', 'preview', 'development', 'unknown']);
|
|
7510
7511
|
const OPERATING_SYSTEM_NAMES = new Set(['android', 'ios', 'ohos', 'windows', 'macos', 'linux', 'unknown']);
|
|
@@ -7634,18 +7635,52 @@ class MiniProgramBridgeClient {
|
|
|
7634
7635
|
}
|
|
7635
7636
|
/** 调用父容器开放能力。 */
|
|
7636
7637
|
async request(method, ...args) {
|
|
7637
|
-
|
|
7638
|
-
const result = await this.performRequest(method, args[0], !HOST_MANAGED_TIMEOUT_METHODS.has(method));
|
|
7639
|
-
if (method === 'auth.getAccountState' && accountVersion !== this.accountEventVersion) {
|
|
7640
|
-
throw createSDKError('AUTHORIZATION_CONTEXT_CHANGED', '读取期间账号状态发生变化,请保留较新的事件状态');
|
|
7641
|
-
}
|
|
7642
|
-
return result;
|
|
7638
|
+
return this.performRequest(method, args[0], !HOST_MANAGED_TIMEOUT_METHODS.has(method), undefined, true);
|
|
7643
7639
|
}
|
|
7644
7640
|
/** 发起不使用固定总时长 timer 的长操作。 */
|
|
7645
7641
|
async requestOperation(method, payload, options = {}) {
|
|
7646
7642
|
return this.performRequest(method, payload, false, options);
|
|
7647
7643
|
}
|
|
7648
|
-
async performRequest(method, payload, useTimeout, options = {}) {
|
|
7644
|
+
async performRequest(method, payload, useTimeout, options = {}, validateAccountState = false) {
|
|
7645
|
+
const id = createMessageId();
|
|
7646
|
+
// 接收端仅由开发 HTML 安装;读取和回调均隔离,不改变业务结果。
|
|
7647
|
+
let observer;
|
|
7648
|
+
try {
|
|
7649
|
+
const candidate = this.selfWindow?.__hbSdkDevObserver;
|
|
7650
|
+
if (typeof candidate === 'function')
|
|
7651
|
+
observer = candidate;
|
|
7652
|
+
}
|
|
7653
|
+
catch { /* 自定义 Window 的访问器也不能阻断请求。 */ }
|
|
7654
|
+
if (!observer)
|
|
7655
|
+
return this.executeRequest(id, method, payload, useTimeout, options, validateAccountState);
|
|
7656
|
+
const startedAt = Date.now();
|
|
7657
|
+
const startedMonotonic = diagnosticNow();
|
|
7658
|
+
const report = (outcome, error) => {
|
|
7659
|
+
try {
|
|
7660
|
+
const errorCode = error instanceof HbMiniProgramSDKError ? error.code : undefined;
|
|
7661
|
+
observer({ phase: 'client', method, callId: id, outcome, timestamp: Date.now(), startedAt,
|
|
7662
|
+
durationMs: Math.max(0, diagnosticNow() - startedMonotonic), ...(errorCode ? { errorCode } : {}) });
|
|
7663
|
+
}
|
|
7664
|
+
catch { /* 调试观察不得影响 SDK 调用。 */ }
|
|
7665
|
+
};
|
|
7666
|
+
report('started');
|
|
7667
|
+
try {
|
|
7668
|
+
const value = await this.executeRequest(id, method, payload, useTimeout, options, validateAccountState);
|
|
7669
|
+
report('success');
|
|
7670
|
+
return value;
|
|
7671
|
+
}
|
|
7672
|
+
catch (error) {
|
|
7673
|
+
let cancelled = false;
|
|
7674
|
+
try {
|
|
7675
|
+
cancelled = error instanceof HbMiniProgramSDKError && (error.code === 'REQUEST_CANCELLED' || error.code === 'OPERATION_CANCELLED');
|
|
7676
|
+
}
|
|
7677
|
+
catch { /* 自定义拒绝值可包含抛错的 Proxy,仍须保留原拒绝值。 */ }
|
|
7678
|
+
report(cancelled || options.signal?.aborted ? 'cancelled' : 'error', error);
|
|
7679
|
+
throw error;
|
|
7680
|
+
}
|
|
7681
|
+
}
|
|
7682
|
+
async executeRequest(id, method, payload, useTimeout, options, validateAccountState) {
|
|
7683
|
+
const accountVersion = this.accountEventVersion;
|
|
7649
7684
|
if (this.destroyed) {
|
|
7650
7685
|
throw createSDKError('SDK_DESTROYED', '小程序 SDK 已销毁');
|
|
7651
7686
|
}
|
|
@@ -7675,7 +7710,6 @@ class MiniProgramBridgeClient {
|
|
|
7675
7710
|
if (options.signal?.aborted) {
|
|
7676
7711
|
throw options.createAbortError?.() ?? createSDKError('REQUEST_CANCELLED', `${method} 已取消`);
|
|
7677
7712
|
}
|
|
7678
|
-
const id = createMessageId();
|
|
7679
7713
|
const message = {
|
|
7680
7714
|
namespace: MINI_PROGRAM_MESSAGE_NAMESPACE,
|
|
7681
7715
|
version: MINI_PROGRAM_MESSAGE_VERSION,
|
|
@@ -7685,18 +7719,7 @@ class MiniProgramBridgeClient {
|
|
|
7685
7719
|
method,
|
|
7686
7720
|
payload,
|
|
7687
7721
|
};
|
|
7688
|
-
const
|
|
7689
|
-
const report = (outcome, error) => {
|
|
7690
|
-
if (typeof false === 'undefined' || !false)
|
|
7691
|
-
return;
|
|
7692
|
-
try {
|
|
7693
|
-
const target = this.selfWindow;
|
|
7694
|
-
const errorCode = error instanceof HbMiniProgramSDKError ? error.code : undefined;
|
|
7695
|
-
target?.__hbSdkDeviceLog?.({ method, callId: id, outcome, durationMs: Date.now() - startedAt, errorCode });
|
|
7696
|
-
}
|
|
7697
|
-
catch { /* 调试输出不能改变 SDK 调用结果。 */ }
|
|
7698
|
-
};
|
|
7699
|
-
return new Promise((resolve, reject) => {
|
|
7722
|
+
const result = await new Promise((resolve, reject) => {
|
|
7700
7723
|
const pending = {
|
|
7701
7724
|
resolve: resolve,
|
|
7702
7725
|
reject,
|
|
@@ -7744,7 +7767,11 @@ class MiniProgramBridgeClient {
|
|
|
7744
7767
|
pending.abortHandler();
|
|
7745
7768
|
}
|
|
7746
7769
|
}
|
|
7747
|
-
})
|
|
7770
|
+
});
|
|
7771
|
+
if (validateAccountState && method === 'auth.getAccountState' && accountVersion !== this.accountEventVersion) {
|
|
7772
|
+
throw createSDKError('AUTHORIZATION_CONTEXT_CHANGED', '读取期间账号状态发生变化,请保留较新的事件状态');
|
|
7773
|
+
}
|
|
7774
|
+
return result;
|
|
7748
7775
|
}
|
|
7749
7776
|
/** 销毁 SDK 实例,并拒绝尚未完成的请求。 */
|
|
7750
7777
|
destroy() {
|
|
@@ -8071,6 +8098,10 @@ function waitForHandshakeOrAbort(handshake, signal, createAbortError, getTermina
|
|
|
8071
8098
|
onAbort();
|
|
8072
8099
|
});
|
|
8073
8100
|
}
|
|
8101
|
+
/** 诊断耗时独立于墙钟校时。 */
|
|
8102
|
+
function diagnosticNow() {
|
|
8103
|
+
return typeof performance === 'undefined' ? Date.now() : performance.now();
|
|
8104
|
+
}
|
|
8074
8105
|
|
|
8075
8106
|
/**
|
|
8076
8107
|
* 获取短期授权码。
|
|
@@ -11384,13 +11415,18 @@ function getFollowStatus(requester) {
|
|
|
11384
11415
|
*
|
|
11385
11416
|
* @throws {@link HbMiniProgramSDKError} `userInfo` 未声明或不可用、握手失败、Host 不支持该能力、
|
|
11386
11417
|
* 当前小程序身份缺失、账号/隔离身份读取失败、返回结构不合法、Runtime 终止,或请求期间
|
|
11387
|
-
*
|
|
11418
|
+
* 账号与授权上下文变化时抛出。第三方联网小程序的身份读取返回 `SERVER_API_REQUIRED`。
|
|
11388
11419
|
*
|
|
11389
11420
|
* @remarks
|
|
11421
|
+
* **网络权限决定用户信息的读取入口:`local` 模式使用本方法;联网的 `server` 模式
|
|
11422
|
+
* 使用 `auth.login()` 与服务端换票,调用本方法读取身份会返回 `SERVER_API_REQUIRED`。**
|
|
11423
|
+
*
|
|
11390
11424
|
* 当前账号未登录属于正常返回分支,不抛错。账号已登录时,该能力不展示授权 UI,也不要求
|
|
11391
11425
|
* 可信用户手势;Runtime 会静默建立或读取当前小程序的隔离 `app_user_id`,并授予
|
|
11392
11426
|
* `identity` 与 `profile`。它只要求 Manifest 中声明 `userInfo`,不要求公开 `network`
|
|
11393
|
-
*
|
|
11427
|
+
* 权限,也不返回可供服务端换票的授权码。第三方小程序在启用网络权限的 `server` 模式下
|
|
11428
|
+
* 会以 `SERVER_API_REQUIRED` 拒绝身份读取,应改用 `auth.login()` 并由开发者服务端换票;
|
|
11429
|
+
* `local` 与兼容 `legacy` 模式保留直接读取能力。
|
|
11394
11430
|
*
|
|
11395
11431
|
* @example
|
|
11396
11432
|
* ```ts
|
|
@@ -11442,6 +11478,7 @@ function createUserModule(requester) {
|
|
|
11442
11478
|
return {
|
|
11443
11479
|
requestFollowAuthor: () => requestFollowAuthor(requester),
|
|
11444
11480
|
getFollowStatus: () => getFollowStatus(requester),
|
|
11481
|
+
showAppreciation: () => requester.request(USER_SHOW_APPRECIATION_METHOD),
|
|
11445
11482
|
getInfo: () => getInfo(requester),
|
|
11446
11483
|
revokeAuthorization: () => revokeAuthorization(requester),
|
|
11447
11484
|
getSteamGameList: (options) => getSteamGameList(requester, options),
|
|
@@ -11814,94 +11851,7 @@ function createMiniProgramSDK(options) {
|
|
|
11814
11851
|
return new MiniProgramSDK(options);
|
|
11815
11852
|
}
|
|
11816
11853
|
|
|
11817
|
-
/**
|
|
11818
|
-
* iframe 与调试台页面的开发期 console 捕获转发。
|
|
11819
|
-
*
|
|
11820
|
-
* 双条件门控(iframe 转发):
|
|
11821
|
-
* 1. 构建期:`hb-sdk dev`(vite serve)注入 `false`;`hb-sdk build` /
|
|
11822
|
-
* `vite build`(生产)永不注入或替换为 `false`,本模块被死代码消除。
|
|
11823
|
-
* 2. 运行期:仅在 `window.name` 为 `__hb_sdk_mini_dev__` 的调试 iframe 中激活,
|
|
11824
|
-
* 用户设备上的正式运行环境没有该标记。
|
|
11825
|
-
*
|
|
11826
|
-
* 无侵入 patch `console.log/debug/info/warn/error`:原样放行(DevTools 不受影响)+
|
|
11827
|
-
* 通过 `window.parent.postMessage` 转发给调试台(CSP 的 connect-src 不约束 postMessage,
|
|
11828
|
-
* 网络上报由调试台页面代理)。发送全程静默:失败不得回打 console,避免自触发死循环。
|
|
11829
|
-
*
|
|
11830
|
-
* 激活时机:由 SDK 默认单例初始化时调用(业务 `import '@heybox/hb-sdk'` 即生效);
|
|
11831
|
-
* iframe 标记由调试台 `iframe.name` 与 vite dev 注入的无依赖 bootstrap 共同设置。
|
|
11832
|
-
* 调试台页面自身(runtime 跑在这里,`[hb-sdk-runtime]` 日志不经过 iframe)另用
|
|
11833
|
-
* `installMiniDevConsoleSelfCapture` 接入「日志」页签(source: 'host')。
|
|
11834
|
-
*/
|
|
11835
|
-
const MINI_DEV_IFRAME_WINDOW_NAME = '__hb_sdk_mini_dev__';
|
|
11836
|
-
const MINI_DEV_CONSOLE_EVENT_TYPE = 'hb-sdk:mini-dev-console';
|
|
11837
|
-
/** 调试台页面与 iframe bootstrap 共用的已安装标记(window/console 上的属性名)。 */
|
|
11838
|
-
const MINI_DEV_CONSOLE_INSTALL_FLAG = '__hb_sdk_mini_dev_console_installed__';
|
|
11839
|
-
/** 调试台页面自捕获(source: 'host')与 iframe 转发共用的已安装标记。 */
|
|
11840
|
-
const INSTALL_FLAG = MINI_DEV_CONSOLE_INSTALL_FLAG;
|
|
11841
|
-
function isDevLoggingEnabled() {
|
|
11842
|
-
if (typeof false !== 'undefined' && false !== true) {
|
|
11843
|
-
return false;
|
|
11844
|
-
}
|
|
11845
|
-
return typeof window !== 'undefined' && window.name === MINI_DEV_IFRAME_WINDOW_NAME;
|
|
11846
|
-
}
|
|
11847
|
-
const levels = ['log', 'debug', 'info', 'warn', 'error'];
|
|
11848
|
-
function patchConsoleLevels(consoleRef, deliver, owner) {
|
|
11849
|
-
if (!owner || owner[INSTALL_FLAG] === true) {
|
|
11850
|
-
return false;
|
|
11851
|
-
}
|
|
11852
|
-
let patched = false;
|
|
11853
|
-
for (const level of levels) {
|
|
11854
|
-
const original = consoleRef[level];
|
|
11855
|
-
if (typeof original !== 'function') {
|
|
11856
|
-
continue;
|
|
11857
|
-
}
|
|
11858
|
-
const forward = function (...args) {
|
|
11859
|
-
try {
|
|
11860
|
-
deliver(level, args);
|
|
11861
|
-
}
|
|
11862
|
-
catch {
|
|
11863
|
-
/* 转发失败必须静默,禁止回打 console 造成自触发循环。 */
|
|
11864
|
-
}
|
|
11865
|
-
return original.apply(this, args);
|
|
11866
|
-
};
|
|
11867
|
-
try {
|
|
11868
|
-
consoleRef[level] = forward;
|
|
11869
|
-
patched = true;
|
|
11870
|
-
}
|
|
11871
|
-
catch {
|
|
11872
|
-
return patched;
|
|
11873
|
-
}
|
|
11874
|
-
}
|
|
11875
|
-
if (patched) {
|
|
11876
|
-
owner[INSTALL_FLAG] = true;
|
|
11877
|
-
}
|
|
11878
|
-
return patched;
|
|
11879
|
-
}
|
|
11880
|
-
function installMiniDevConsoleForwarding(consoleRef = console) {
|
|
11881
|
-
if (!isDevLoggingEnabled()) {
|
|
11882
|
-
return;
|
|
11883
|
-
}
|
|
11884
|
-
patchConsoleLevels(consoleRef, (level, args) => {
|
|
11885
|
-
const message = {
|
|
11886
|
-
type: MINI_DEV_CONSOLE_EVENT_TYPE,
|
|
11887
|
-
detail: { level, args, timestamp: Date.now() },
|
|
11888
|
-
};
|
|
11889
|
-
window.parent?.postMessage(message, '*');
|
|
11890
|
-
}, typeof window === 'undefined' ? undefined : window);
|
|
11891
|
-
}
|
|
11892
|
-
|
|
11893
11854
|
let defaultSDK = createMiniProgramSDK();
|
|
11894
|
-
if (typeof false !== 'undefined' && false && typeof window !== 'undefined') {
|
|
11895
|
-
window.__hbSdkSandboxList = async (path) => (await getDefaultSDK().files.sandbox.directory(path).list({ limit: 200 })).map((entry) => ({ name: entry.name, kind: entry.kind }));
|
|
11896
|
-
}
|
|
11897
|
-
// 开发期调试台 console 捕获:双条件门控(vite serve 注入 define + 调试 iframe 标记),
|
|
11898
|
-
// 生产构建被死代码消除,正式环境无副作用。失败静默,绝不影响 SDK 初始化。
|
|
11899
|
-
try {
|
|
11900
|
-
installMiniDevConsoleForwarding();
|
|
11901
|
-
}
|
|
11902
|
-
catch {
|
|
11903
|
-
/* 捕获层异常不得阻断 SDK 单例创建。 */
|
|
11904
|
-
}
|
|
11905
11855
|
function getDefaultSDK() {
|
|
11906
11856
|
if (!defaultSDK) {
|
|
11907
11857
|
defaultSDK = createMiniProgramSDK();
|
|
@@ -12254,6 +12204,7 @@ const auth = {
|
|
|
12254
12204
|
const user = {
|
|
12255
12205
|
requestFollowAuthor: () => getDefaultSDK().user.requestFollowAuthor(),
|
|
12256
12206
|
getFollowStatus: () => getDefaultSDK().user.getFollowStatus(),
|
|
12207
|
+
showAppreciation: () => getDefaultSDK().user.showAppreciation(),
|
|
12257
12208
|
getInfo: () => getDefaultSDK().user.getInfo(),
|
|
12258
12209
|
revokeAuthorization: () => getDefaultSDK().user.revokeAuthorization(),
|
|
12259
12210
|
getSteamGameList: (options) => getDefaultSDK().user.getSteamGameList(options),
|
|
@@ -32,7 +32,7 @@ const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
|
32
32
|
risk: 'high',
|
|
33
33
|
config: {},
|
|
34
34
|
methods: ['gameSaves.list', 'gameSaves.sync', 'gameSaves.getFile', 'gameSaves.readParsedData'],
|
|
35
|
-
conditions: ['
|
|
35
|
+
conditions: ['需声明权限并校验当前 Steam 账号,无需额外授权弹窗;可读取受支持游戏已有的完整结构化数据,不触发解析。同步需有效 Steam 登录,文件下载另需宿主支持文件读取。'],
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
key: 'userInfo',
|
|
@@ -30,7 +30,7 @@ const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
|
30
30
|
risk: 'high',
|
|
31
31
|
config: {},
|
|
32
32
|
methods: ['gameSaves.list', 'gameSaves.sync', 'gameSaves.getFile', 'gameSaves.readParsedData'],
|
|
33
|
-
conditions: ['
|
|
33
|
+
conditions: ['需声明权限并校验当前 Steam 账号,无需额外授权弹窗;可读取受支持游戏已有的完整结构化数据,不触发解析。同步需有效 Steam 登录,文件下载另需宿主支持文件读取。'],
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
key: 'userInfo',
|
package/dist/protocol.cjs.js
CHANGED
|
@@ -43,6 +43,7 @@ const GAME_SAVES_READ_PARSED_DATA_METHOD = 'gameSaves.readParsedData';
|
|
|
43
43
|
const USER_GET_INFO_METHOD = 'user.getInfo';
|
|
44
44
|
const USER_REVOKE_AUTHORIZATION_METHOD = 'user.revokeAuthorization';
|
|
45
45
|
const USER_GET_STEAM_GAME_LIST_METHOD = 'user.getSteamGameList';
|
|
46
|
+
const USER_SHOW_APPRECIATION_METHOD = 'user.showAppreciation';
|
|
46
47
|
const SHARE_COPY_LINK_METHOD = 'share.copyLink';
|
|
47
48
|
const SHARE_SHOW_SHARE_MENU_METHOD = 'share.showShareMenu';
|
|
48
49
|
const SHARE_SCREENSHOT_METHOD = 'share.screenshot';
|
|
@@ -177,6 +178,7 @@ const MINI_PROGRAM_PROTOCOL_CAPABILITIES = [
|
|
|
177
178
|
requirement: { kind: 'all', permissions: ['steamLibrary'] },
|
|
178
179
|
risk: 'high',
|
|
179
180
|
},
|
|
181
|
+
{ method: USER_SHOW_APPRECIATION_METHOD, module: 'user', capability: USER_SHOW_APPRECIATION_METHOD, requirement: { kind: 'none' }, risk: 'medium' },
|
|
180
182
|
{
|
|
181
183
|
method: SHARE_COPY_LINK_METHOD,
|
|
182
184
|
module: 'share',
|
package/dist/protocol.esm.js
CHANGED
|
@@ -41,6 +41,7 @@ const GAME_SAVES_READ_PARSED_DATA_METHOD = 'gameSaves.readParsedData';
|
|
|
41
41
|
const USER_GET_INFO_METHOD = 'user.getInfo';
|
|
42
42
|
const USER_REVOKE_AUTHORIZATION_METHOD = 'user.revokeAuthorization';
|
|
43
43
|
const USER_GET_STEAM_GAME_LIST_METHOD = 'user.getSteamGameList';
|
|
44
|
+
const USER_SHOW_APPRECIATION_METHOD = 'user.showAppreciation';
|
|
44
45
|
const SHARE_COPY_LINK_METHOD = 'share.copyLink';
|
|
45
46
|
const SHARE_SHOW_SHARE_MENU_METHOD = 'share.showShareMenu';
|
|
46
47
|
const SHARE_SCREENSHOT_METHOD = 'share.screenshot';
|
|
@@ -175,6 +176,7 @@ const MINI_PROGRAM_PROTOCOL_CAPABILITIES = [
|
|
|
175
176
|
requirement: { kind: 'all', permissions: ['steamLibrary'] },
|
|
176
177
|
risk: 'high',
|
|
177
178
|
},
|
|
179
|
+
{ method: USER_SHOW_APPRECIATION_METHOD, module: 'user', capability: USER_SHOW_APPRECIATION_METHOD, requirement: { kind: 'none' }, risk: 'medium' },
|
|
178
180
|
{
|
|
179
181
|
method: SHARE_COPY_LINK_METHOD,
|
|
180
182
|
module: 'share',
|