@heybox/hb-sdk 0.9.9-alpha.0 → 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 +6 -0
- package/README.md +2 -0
- package/dist/cli-chunks/{build-Vi5Zyplz.cjs → build-vZ5iT2JO.cjs} +5 -5
- package/dist/cli-chunks/{create-Cfz1IcYf.cjs → create-DJseFABS.cjs} +2 -2
- package/dist/cli-chunks/{dev-C2dtgF42.cjs → dev-CsuAVpLX.cjs} +15 -10
- package/dist/cli-chunks/{doctor-D-zMCLIA.cjs → doctor-BYzYg-oP.cjs} +1 -1
- package/dist/cli-chunks/{game-binding-guide-z3X6h8ck.cjs → game-binding-guide-BfKQ4e83.cjs} +3 -3
- package/dist/cli-chunks/{game-bindings-DiVP8PdD.cjs → game-bindings-DWOIBCax.cjs} +4 -4
- package/dist/cli-chunks/{games-THhcga6y.cjs → games-DmPaqaDd.cjs} +1 -1
- package/dist/cli-chunks/{index-H9U6-mLY.cjs → index-D5rcGk_z.cjs} +40 -25
- package/dist/cli-chunks/{index-BuYCoach.cjs → index-DPEhBPfc.cjs} +1 -1
- package/dist/cli-chunks/{index.esm-D8lqHXUQ.cjs → index.esm-CenYK5Bl.cjs} +72 -3
- package/dist/cli-chunks/{index.esm-XiyiK7eH.cjs → index.esm-DYWovNyE.cjs} +9 -9
- package/dist/cli-chunks/{login-Bw_1UJ8i.cjs → login-o1LQxi8P.cjs} +1 -1
- package/dist/cli-chunks/{project-vite-CFfq-fV7.cjs → project-vite-CGIy1XaL.cjs} +1 -1
- package/dist/cli-chunks/{remote-CU88U8t8.cjs → remote-BQ3O-aiB.cjs} +114 -26
- package/dist/cli-chunks/{runtime-permission-env-BtxzR-dv.cjs → runtime-permission-env-soFtqTxP.cjs} +24 -4
- package/dist/cli-chunks/{skill-7RZJxGDO.cjs → skill-BHighcnl.cjs} +2 -2
- package/dist/cli-chunks/{version-COTSItDf.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-az2quV7I.js → desktop-app-launch-FZ3iQQs-.js} +1 -1
- package/dist/devtools/browser-dev-host/assets/{index-o5r5oqtq.js → index-CVzVitcL.js} +3 -3
- package/dist/devtools/browser-dev-host/index.html +2 -2
- package/dist/index.cjs.js +149 -4
- package/dist/index.esm.js +149 -5
- package/dist/miniapp-publish.cjs.js +64 -1
- package/dist/miniapp-publish.esm.js +63 -2
- package/dist/protocol.cjs.js +51 -5
- package/dist/protocol.esm.js +51 -5
- package/dist/vite.cjs.js +59 -2
- package/dist/vite.esm.js +59 -2
- package/package.json +5 -5
- package/skill/skill.json +4 -4
- 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-CHdD15qt.js +0 -221
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index_esm = require('./index.esm-
|
|
4
|
-
var runtimePermissionEnv = require('./runtime-permission-env-
|
|
3
|
+
var index_esm = require('./index.esm-CenYK5Bl.cjs');
|
|
4
|
+
var runtimePermissionEnv = require('./runtime-permission-env-soFtqTxP.cjs');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
6
|
var fs = require('node:fs/promises');
|
|
7
7
|
var path = require('node:path');
|
|
8
8
|
var fs$1 = require('node:fs');
|
|
9
9
|
var sharp = require('sharp');
|
|
10
|
-
var gameBindingGuide = require('./game-binding-guide-
|
|
10
|
+
var gameBindingGuide = require('./game-binding-guide-BfKQ4e83.cjs');
|
|
11
11
|
var promises = require('node:readline/promises');
|
|
12
|
-
var index = require('./index-
|
|
12
|
+
var index = require('./index-D5rcGk_z.cjs');
|
|
13
13
|
var childProcess = require('node:child_process');
|
|
14
14
|
require('node:zlib');
|
|
15
15
|
|
|
@@ -509,7 +509,7 @@ function createDefaultCosClient(uploadToken, COS) {
|
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
async function loadCosConstructor() {
|
|
512
|
-
const cosModule = await Promise.resolve().then(function () { return require('./index-
|
|
512
|
+
const cosModule = await Promise.resolve().then(function () { return require('./index-DPEhBPfc.cjs'); }).then(function (n) { return n.index; });
|
|
513
513
|
return cosModule.default;
|
|
514
514
|
}
|
|
515
515
|
function formatSize(bytes) {
|
|
@@ -578,6 +578,9 @@ async function computeMiniappArtifactReceipt(files, runtime = {}) {
|
|
|
578
578
|
|
|
579
579
|
function createRemoteApiClient(options) {
|
|
580
580
|
return {
|
|
581
|
+
getPostBinding: (request) => remoteGet(runtimePermissionEnv.USER_MINIPROGRAM_POST_BINDING_API_PATH, request, options),
|
|
582
|
+
previewPostBinding: (request) => remotePostForm(runtimePermissionEnv.USER_MINIPROGRAM_POST_PREVIEW_API_PATH, request, options),
|
|
583
|
+
setPostBinding: (request) => remotePostForm(`${runtimePermissionEnv.USER_MINIPROGRAM_POST_BINDING_API_PATH}/update`, request, options),
|
|
581
584
|
listPermissionApplications: (request) => remoteGet(runtimePermissionEnv.LIST_USER_MINIPROGRAM_PERMISSION_APPLICATION_API_PATH, request, options),
|
|
582
585
|
submitPermissionApplication: (request) => remotePostForm(runtimePermissionEnv.SUBMIT_USER_MINIPROGRAM_PERMISSION_APPLICATION_API_PATH, request, options),
|
|
583
586
|
listDeveloperEntities: () => listDeveloperEntities(options),
|
|
@@ -648,7 +651,9 @@ async function precheckUserMiniprogramVersion(options, runtime) {
|
|
|
648
651
|
}
|
|
649
652
|
async function submitUserMiniprogramAudit(options, runtime) {
|
|
650
653
|
return remotePostForm(runtimePermissionEnv.SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH, {
|
|
651
|
-
mini_program_id: options.mini_program_id,
|
|
654
|
+
mini_program_id: options.mini_program_id,
|
|
655
|
+
session_id: options.session_id,
|
|
656
|
+
preflight_token: options.preflight_token,
|
|
652
657
|
}, runtime);
|
|
653
658
|
}
|
|
654
659
|
async function getVersionPreviewInfo(options, runtime) {
|
|
@@ -877,12 +882,12 @@ function createDevRuntimePermissions(snapshot, state, useOfficialDomain) {
|
|
|
877
882
|
status: state.networkRequest.status,
|
|
878
883
|
config: { useOfficialDomain },
|
|
879
884
|
}
|
|
880
|
-
: key === 'user_game_data'
|
|
885
|
+
: key === 'user_game_data' || key === 'post'
|
|
881
886
|
? {
|
|
882
887
|
key,
|
|
883
888
|
status: entry.status,
|
|
884
|
-
//
|
|
885
|
-
config: {
|
|
889
|
+
// 浏览器模拟不能丢掉资源清单或关联帖的读写声明。
|
|
890
|
+
config: { ...entry.config },
|
|
886
891
|
}
|
|
887
892
|
: {
|
|
888
893
|
key,
|
|
@@ -1439,6 +1444,11 @@ async function runRemoteCommand(options, runtime = {}) {
|
|
|
1439
1444
|
}
|
|
1440
1445
|
const context = await createRemoteCommandContext(options, runtime);
|
|
1441
1446
|
switch (options.command) {
|
|
1447
|
+
case 'post:get':
|
|
1448
|
+
case 'post:preview':
|
|
1449
|
+
case 'post:bind':
|
|
1450
|
+
case 'post:unbind':
|
|
1451
|
+
return remotePostBinding(options, context, runtime);
|
|
1442
1452
|
case 'permission:list':
|
|
1443
1453
|
return remotePermissionList(options, context, runtime);
|
|
1444
1454
|
case 'permission:apply':
|
|
@@ -1555,6 +1565,13 @@ async function createRemoteCommandContext(options, runtime) {
|
|
|
1555
1565
|
}
|
|
1556
1566
|
function adaptRemoteApiClient(api) {
|
|
1557
1567
|
return {
|
|
1568
|
+
getPostBinding: (miniProgramId) => api.getPostBinding({ mini_program_id: miniProgramId }),
|
|
1569
|
+
previewPostBinding: ({ miniProgramId, postId }) => api.previewPostBinding({ mini_program_id: miniProgramId, post_id: postId }),
|
|
1570
|
+
setPostBinding: ({ miniProgramId, postId, expectedRevision }) => api.setPostBinding({
|
|
1571
|
+
mini_program_id: miniProgramId,
|
|
1572
|
+
post_id: postId,
|
|
1573
|
+
expected_revision: expectedRevision,
|
|
1574
|
+
}),
|
|
1558
1575
|
listPermissionApplications: (miniProgramId) => api.listPermissionApplications({ mini_program_id: miniProgramId }),
|
|
1559
1576
|
submitPermissionApplication: ({ miniProgramId, key, reason, domains }) => api.submitPermissionApplication({ mini_program_id: miniProgramId, permission_key: key, reason, domains }),
|
|
1560
1577
|
accessStatus: () => api.getDeveloperAccessStatus(),
|
|
@@ -1721,6 +1738,39 @@ async function remoteBind(options, context, runtime) {
|
|
|
1721
1738
|
}
|
|
1722
1739
|
return finishRemoteCommand(options, runtime, output);
|
|
1723
1740
|
}
|
|
1741
|
+
async function remotePostBinding(options, context, runtime) {
|
|
1742
|
+
const miniProgramId = requireBinding(context);
|
|
1743
|
+
if (options.command === 'post:get') {
|
|
1744
|
+
const result = await context.api.getPostBinding(miniProgramId);
|
|
1745
|
+
if (!options.json)
|
|
1746
|
+
context.logger.info(`关联帖子:${result.post_id || '未绑定'}`);
|
|
1747
|
+
return finishRemoteCommand(options, runtime, {
|
|
1748
|
+
changed: false,
|
|
1749
|
+
miniProgramId,
|
|
1750
|
+
binding: { postId: result.post_id },
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
const postId = options.command === 'post:unbind' ? '' : requireNonEmpty(options.postId, '必须传入帖子 ID');
|
|
1754
|
+
if (postId && (!/^[1-9]\d{0,18}$/.test(postId) || BigInt(postId) > 9223372036854775807n)) {
|
|
1755
|
+
throw new Error('帖子 ID 必须为有效的正整数');
|
|
1756
|
+
}
|
|
1757
|
+
if (options.command === 'post:preview') {
|
|
1758
|
+
const result = await context.api.previewPostBinding({ miniProgramId, postId });
|
|
1759
|
+
if (!options.json)
|
|
1760
|
+
context.logger.info(`${result.title || '无标题帖子'}(${result.post_id}),作者:${result.author_name}`);
|
|
1761
|
+
return finishRemoteCommand(options, runtime, { changed: false, miniProgramId, post: toCamelCaseDeep(result) });
|
|
1762
|
+
}
|
|
1763
|
+
await assertBoundMiniProgramEntityMatchesCurrent(context, miniProgramId);
|
|
1764
|
+
const binding = await context.api.getPostBinding(miniProgramId);
|
|
1765
|
+
const expectedRevision = binding.revision;
|
|
1766
|
+
if (typeof expectedRevision !== 'string' || !/^(0|[1-9]\d{0,18})$/.test(expectedRevision) || BigInt(expectedRevision) >= 9223372036854775807n) {
|
|
1767
|
+
throw new Error('当前关联信息无效,请稍后重试');
|
|
1768
|
+
}
|
|
1769
|
+
const result = await context.api.setPostBinding({ miniProgramId, postId, expectedRevision });
|
|
1770
|
+
if (!options.json)
|
|
1771
|
+
context.logger.success(postId ? `已关联帖子:${postId}` : '已解除关联');
|
|
1772
|
+
return finishRemoteCommand(options, runtime, { changed: true, miniProgramId, binding: { postId: result.post_id } });
|
|
1773
|
+
}
|
|
1724
1774
|
/** 工作台扫码只读取版本和协议,复用认证与项目绑定,避免图片比对和详情输出。 */
|
|
1725
1775
|
async function readRemoteMiniProgramPreview(options, runtime = {}) {
|
|
1726
1776
|
const context = await createRemoteCommandContext({ env: options.env }, runtime);
|
|
@@ -1751,7 +1801,20 @@ async function remoteInfo(options, context, runtime) {
|
|
|
1751
1801
|
const removed = currentBindApps.filter((item) => !localIDs.has(item.appid));
|
|
1752
1802
|
const bindings = { local, current: currentBindApps, added, removed };
|
|
1753
1803
|
const basicInfo = await compareBasicInfo(context.packageJson.projectRoot, detail, runtime.fetchImpl);
|
|
1754
|
-
const output = {
|
|
1804
|
+
const output = {
|
|
1805
|
+
changed: false,
|
|
1806
|
+
miniProgramId,
|
|
1807
|
+
detail: toCamelCaseDeep(detail),
|
|
1808
|
+
permissions: permissionViews,
|
|
1809
|
+
permissionSources: {
|
|
1810
|
+
localDeclaration: localPermissions.permissions ?? null,
|
|
1811
|
+
onlineManifest: detail.manifest ?? null,
|
|
1812
|
+
onlineRuntimeSnapshot: detail.effective_runtime_permissions ?? null,
|
|
1813
|
+
platformApprovals: detail.runtime_permissions ?? null,
|
|
1814
|
+
},
|
|
1815
|
+
bindings,
|
|
1816
|
+
basicInfo,
|
|
1817
|
+
};
|
|
1755
1818
|
if (!options.json)
|
|
1756
1819
|
context.logger.info(`版本资料:${basicInfo.status}`);
|
|
1757
1820
|
if (!options.json) {
|
|
@@ -1798,11 +1861,11 @@ async function remotePermissionList(options, context, runtime) {
|
|
|
1798
1861
|
const localPermissions = runtimePermissionEnv.readMiniappPermissionsFromPackageJson(context.packageJson.projectRoot, runtimePermissionEnv.resolveMiniappSdkVersion());
|
|
1799
1862
|
const { views } = runtimePermissionEnv.composeMiniappRuntimePermissions(localPermissions, result.runtime_permissions, detail.party_type);
|
|
1800
1863
|
if (!options.json) {
|
|
1801
|
-
for (const view of views.filter(entry => entry.access === 'platform-approval')) {
|
|
1802
|
-
const item = result.items.find(entry => entry.permission_key === view.key);
|
|
1864
|
+
for (const view of views.filter((entry) => entry.access === 'platform-approval')) {
|
|
1865
|
+
const item = result.items.find((entry) => entry.permission_key === view.key);
|
|
1803
1866
|
const application = item?.latest_application;
|
|
1804
|
-
const name = item?.permission_name ?? index_esm.MINI_PROGRAM_PERMISSION_CATALOG.find(entry => entry.key === view.key)?.name ?? view.key;
|
|
1805
|
-
const approval = result.runtime_permissions?.entries?.find(entry => entry.key === view.key);
|
|
1867
|
+
const name = item?.permission_name ?? index_esm.MINI_PROGRAM_PERMISSION_CATALOG.find((entry) => entry.key === view.key)?.name ?? view.key;
|
|
1868
|
+
const approval = result.runtime_permissions?.entries?.find((entry) => entry.key === view.key);
|
|
1806
1869
|
const source = view.approvalSource === 'first-party' ? ' 批准来源=第一方自动批准' : '';
|
|
1807
1870
|
context.logger.info(`${view.key} (${name}) 原始审批=${approval?.status ?? 'disabled'}${source} 本地生效=${view.effective ? 'enabled' : 'disabled'} 最近申请=${application?.status ?? '未申请'}`);
|
|
1808
1871
|
if (application?.application_id)
|
|
@@ -1811,7 +1874,13 @@ async function remotePermissionList(options, context, runtime) {
|
|
|
1811
1874
|
context.logger.info(`审核意见:${application.review_remark}`);
|
|
1812
1875
|
}
|
|
1813
1876
|
}
|
|
1814
|
-
return finishRemoteCommand(options, runtime, {
|
|
1877
|
+
return finishRemoteCommand(options, runtime, {
|
|
1878
|
+
changed: false,
|
|
1879
|
+
miniProgramId,
|
|
1880
|
+
items: toCamelCaseDeep(result.items),
|
|
1881
|
+
runtimePermissions: toCamelCaseDeep(result.runtime_permissions),
|
|
1882
|
+
permissions: views,
|
|
1883
|
+
});
|
|
1815
1884
|
}
|
|
1816
1885
|
async function remotePermissionApply(options, context, runtime) {
|
|
1817
1886
|
const miniProgramId = requireBinding(context);
|
|
@@ -1827,10 +1896,15 @@ async function remotePermissionApply(options, context, runtime) {
|
|
|
1827
1896
|
throw new Error('申请理由不能超过 500 字');
|
|
1828
1897
|
let domains;
|
|
1829
1898
|
if (key === 'network') {
|
|
1830
|
-
const values = [
|
|
1899
|
+
const values = [
|
|
1900
|
+
...new Set(requireNonEmpty(options.domains, 'network 申请必须传 --domains,多个域名用逗号分隔')
|
|
1901
|
+
.split(',')
|
|
1902
|
+
.map((value) => value.trim())
|
|
1903
|
+
.filter(Boolean)),
|
|
1904
|
+
];
|
|
1831
1905
|
if (!values.length || values.length > 20)
|
|
1832
1906
|
throw new Error('请填写 1 至 20 个访问域名');
|
|
1833
|
-
if (values.some(value => /[\s/:?#@*\\]/.test(value)))
|
|
1907
|
+
if (values.some((value) => /[\s/:?#@*\\]/.test(value)))
|
|
1834
1908
|
throw new Error('请填写域名,不含协议、端口、路径或通配符');
|
|
1835
1909
|
domains = values.join(',');
|
|
1836
1910
|
}
|
|
@@ -2296,9 +2370,7 @@ async function confirmDangerousRemoteChange(options, runtime, logger, context) {
|
|
|
2296
2370
|
throw new Error(`非交互环境执行 hb-sdk remote ${context.operation} 必须传 --yes`);
|
|
2297
2371
|
}
|
|
2298
2372
|
const confirmation = `${context.permissionWarning ? `${context.permissionWarning}\n` : ''}确认执行 ${context.operation}?`;
|
|
2299
|
-
const accepted = runtime.promptConfirm
|
|
2300
|
-
? await runtime.promptConfirm(confirmation)
|
|
2301
|
-
: await promptConfirm(`${confirmation}输入 yes 继续: `, runtime);
|
|
2373
|
+
const accepted = runtime.promptConfirm ? await runtime.promptConfirm(confirmation) : await promptConfirm(`${confirmation}输入 yes 继续: `, runtime);
|
|
2302
2374
|
if (!accepted) {
|
|
2303
2375
|
throw new Error('已取消操作');
|
|
2304
2376
|
}
|
|
@@ -2330,19 +2402,35 @@ function printMiniProgramDetail(logger, detail, permissionViews, bindings) {
|
|
|
2330
2402
|
const manifest = detail.manifest && typeof detail.manifest === 'object' ? detail.manifest : undefined;
|
|
2331
2403
|
let online;
|
|
2332
2404
|
try {
|
|
2333
|
-
online = manifest
|
|
2405
|
+
online = manifest
|
|
2406
|
+
? runtimePermissionEnv.parseMiniappPermissions(manifest.permissions, {
|
|
2407
|
+
present: Object.hasOwn(manifest, 'permissions'),
|
|
2408
|
+
sdkVersion: typeof detail.sdk_version === 'string' ? detail.sdk_version : '0.8.0',
|
|
2409
|
+
})
|
|
2410
|
+
: undefined;
|
|
2411
|
+
}
|
|
2412
|
+
catch {
|
|
2413
|
+
/* 缺失或未知声明保持未知,不能推断线上可用。 */
|
|
2334
2414
|
}
|
|
2335
|
-
catch { /* 缺失或未知声明保持未知,不能推断线上可用。 */ }
|
|
2336
2415
|
const publishedRuntime = index_esm.parseMiniProgramRuntimePermissions(detail.effective_runtime_permissions);
|
|
2337
2416
|
let differs = false;
|
|
2338
2417
|
for (const view of permissionViews) {
|
|
2339
2418
|
const published = online ? online.permissions?.[view.key]?.enabled === true : undefined;
|
|
2340
2419
|
const requested = online?.permissions?.[view.key];
|
|
2341
|
-
const changed = published !== undefined &&
|
|
2342
|
-
(
|
|
2420
|
+
const changed = published !== undefined &&
|
|
2421
|
+
(published !== view.declared ||
|
|
2422
|
+
(view.key === 'network' &&
|
|
2423
|
+
published &&
|
|
2424
|
+
view.requestedConfig?.useOfficialDomain !== (requested && 'useOfficialDomain' in requested ? requested.useOfficialDomain : undefined)));
|
|
2343
2425
|
differs ||= changed;
|
|
2344
|
-
const approval = view.access === 'platform-approval'
|
|
2345
|
-
|
|
2426
|
+
const approval = view.access === 'platform-approval'
|
|
2427
|
+
? view.approvalSource === 'first-party'
|
|
2428
|
+
? '第一方自动批准'
|
|
2429
|
+
: view.approved
|
|
2430
|
+
? '已批准'
|
|
2431
|
+
: '未批准'
|
|
2432
|
+
: '无需审批';
|
|
2433
|
+
logger.info(` ${view.key}: 本地声明=${view.declared ? '是' : '否'} 线上版本声明=${published === undefined ? '未知' : published ? '是' : '否'} 平台批准=${approval} 线上快照=${publishedRuntime.valid ? (publishedRuntime.permissions[view.key]?.status ?? '缺少条目') : '未知'}${changed ? ' [不一致]' : ''}`);
|
|
2346
2434
|
}
|
|
2347
2435
|
if (differs)
|
|
2348
2436
|
logger.warn('本地声明与线上版本不一致;本地调试结果不代表线上生效,需发布包含声明的新版本。');
|
package/dist/cli-chunks/{runtime-permission-env-BtxzR-dv.cjs → runtime-permission-env-soFtqTxP.cjs}
RENAMED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var fs = require('node:fs');
|
|
4
4
|
var path = require('node:path');
|
|
5
|
-
var version = require('./version-
|
|
5
|
+
var version = require('./version-CAh_EBAH.cjs');
|
|
6
6
|
var bindings = require('./bindings-B9HSKhmy.cjs');
|
|
7
7
|
var fs$1 = require('node:fs/promises');
|
|
8
|
-
var index_esm = require('./index.esm-
|
|
9
|
-
var index = require('./index-
|
|
8
|
+
var index_esm = require('./index.esm-CenYK5Bl.cjs');
|
|
9
|
+
var index = require('./index-D5rcGk_z.cjs');
|
|
10
10
|
var node_crypto = require('node:crypto');
|
|
11
11
|
require('node:zlib');
|
|
12
12
|
require('node:module');
|
|
@@ -165,6 +165,16 @@ function parseMiniappPermissions(value, options) {
|
|
|
165
165
|
}
|
|
166
166
|
useOfficialDomain = declaration.useOfficialDomain === true;
|
|
167
167
|
}
|
|
168
|
+
if (key === 'post') {
|
|
169
|
+
for (const field of ['read', 'write']) {
|
|
170
|
+
if (declaration[field] !== undefined && typeof declaration[field] !== 'boolean') {
|
|
171
|
+
throw new Error(`${itemLabel}.${field} 必须是 boolean`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (declaration.enabled)
|
|
175
|
+
permissions.post = { enabled: true, read: declaration.read === true, write: declaration.write === true };
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
168
178
|
if (key === 'user_game_data') {
|
|
169
179
|
// 即使声明关闭也校验资源清单:enabled:false 不能隐藏非法字段。
|
|
170
180
|
const resources = parseUserGameDataResources(declaration.resources, itemLabel);
|
|
@@ -218,7 +228,11 @@ partyType) {
|
|
|
218
228
|
entries.push({
|
|
219
229
|
key: definition.key,
|
|
220
230
|
status: 'enabled',
|
|
221
|
-
config: definition.key === 'user_game_data'
|
|
231
|
+
config: definition.key === 'user_game_data'
|
|
232
|
+
? { resources: normalizeUserGameDataResources(local.permissions?.user_game_data) }
|
|
233
|
+
: definition.key === 'post'
|
|
234
|
+
? { read: local.permissions?.post?.read === true, write: local.permissions?.post?.write === true }
|
|
235
|
+
: {},
|
|
222
236
|
});
|
|
223
237
|
}
|
|
224
238
|
continue;
|
|
@@ -210896,6 +210910,10 @@ const LIST_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/list';
|
|
|
210896
210910
|
const CREATE_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/create';
|
|
210897
210911
|
/** 查询单个小程序详情的开放平台 API 路径。 */
|
|
210898
210912
|
const DETAIL_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/detail';
|
|
210913
|
+
/** 查询和更新小程序关联帖子的开放平台 API 路径。 */
|
|
210914
|
+
const USER_MINIPROGRAM_POST_BINDING_API_PATH = '/mall/developer/user_miniprogram/post/binding';
|
|
210915
|
+
/** 校验并预览待关联的帖子。 */
|
|
210916
|
+
const USER_MINIPROGRAM_POST_PREVIEW_API_PATH = '/mall/developer/user_miniprogram/post/preview';
|
|
210899
210917
|
/** 创建本地开发启动凭据的开放平台 API 路径。 */
|
|
210900
210918
|
const CREATE_USER_MINIPROGRAM_LOCAL_DEV_LAUNCH_TOKEN_API_PATH = '/mall/developer/user_miniprogram/local_dev_launch_token';
|
|
210901
210919
|
/** 查询小程序预览白名单的开放平台 API 路径。 */
|
|
@@ -211773,6 +211791,8 @@ exports.TAKE_DOWN_USER_MINIPROGRAM_API_PATH = TAKE_DOWN_USER_MINIPROGRAM_API_PAT
|
|
|
211773
211791
|
exports.UPDATE_SQUARE_DISPLAY_API_PATH = UPDATE_SQUARE_DISPLAY_API_PATH;
|
|
211774
211792
|
exports.UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH;
|
|
211775
211793
|
exports.USER_MINIPROGRAM_ACCESS_STATUS_API_PATH = USER_MINIPROGRAM_ACCESS_STATUS_API_PATH;
|
|
211794
|
+
exports.USER_MINIPROGRAM_POST_BINDING_API_PATH = USER_MINIPROGRAM_POST_BINDING_API_PATH;
|
|
211795
|
+
exports.USER_MINIPROGRAM_POST_PREVIEW_API_PATH = USER_MINIPROGRAM_POST_PREVIEW_API_PATH;
|
|
211776
211796
|
exports.USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH;
|
|
211777
211797
|
exports.USER_MINIPROGRAM_VERSION_PREVIEW_INFO_API_PATH = USER_MINIPROGRAM_VERSION_PREVIEW_INFO_API_PATH;
|
|
211778
211798
|
exports.WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH = WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var version = require('./version-
|
|
3
|
+
var version = require('./version-CAh_EBAH.cjs');
|
|
4
4
|
var fs = require('node:fs/promises');
|
|
5
5
|
var path = require('node:path');
|
|
6
6
|
var childProcess = require('node:child_process');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-D5rcGk_z.cjs');
|
|
8
8
|
require('node:module');
|
|
9
9
|
require('readline');
|
|
10
10
|
require('os');
|