@heybox/hb-sdk 0.9.8-alpha.3 → 0.9.8-alpha.4
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 +8 -0
- package/dist/cli-chunks/{build-wK5IcYmp.cjs → build-Dy-XNxvH.cjs} +16 -17
- package/dist/cli-chunks/{create-D1DAg4er.cjs → create-BsnNVF3S.cjs} +1 -1
- package/dist/cli-chunks/{dev-zh_Wb9WZ.cjs → dev-Z173QHNa.cjs} +378 -187
- package/dist/cli-chunks/{doctor-Br31MP94.cjs → doctor-BPSBJZ-1.cjs} +1 -1
- package/dist/cli-chunks/{games-B5bUkOCp.cjs → games-BOEcnynH.cjs} +1 -1
- package/dist/cli-chunks/{index-B8tKOZ1w.cjs → index-BWM8RdCP.cjs} +17 -17
- package/dist/cli-chunks/{index-CkPh8IQn.cjs → index-DAAXOHZz.cjs} +1 -1
- package/dist/cli-chunks/{index.esm-DOvuMPDE.cjs → index.esm-BRVjOxG6.cjs} +13 -11
- package/dist/cli-chunks/{login-BGxsC07i.cjs → login-exwaROqC.cjs} +1 -1
- package/dist/cli-chunks/{project-vite-DU7Wp4o5.cjs → project-vite-B4zLrFt4.cjs} +1 -1
- package/dist/cli-chunks/{remote-HX0wMZ6W.cjs → remote-BvSowNUB.cjs} +733 -66
- package/dist/cli-chunks/{artifact-C4JTa7D5.cjs → runtime-permission-env-DdCaD_QO.cjs} +9878 -12
- package/dist/cli-chunks/{skill-B6KtNum4.cjs → skill-Ka66hZFi.cjs} +2 -2
- package/dist/cli-chunks/{version-DIhLu9jy.cjs → version-BnLlT4-z.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-BGslB0WH.js +221 -0
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-1BY4EF_h.js +13 -0
- package/dist/devtools/browser-dev-host/assets/index-B-hYOhqM.js +567 -0
- package/dist/devtools/browser-dev-host/assets/index-Bk5RxHO3.css +1 -0
- package/dist/devtools/browser-dev-host/index.html +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.esm.js +1 -1
- package/package.json +4 -4
- package/skill/skill.json +4 -4
- package/dist/cli-chunks/dev-context-4ZGqANND.cjs +0 -669
- package/dist/cli-chunks/runtime-permission-env-CAnNV2Lw.cjs +0 -9884
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-5lgAW5KL.js +0 -228
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-B4cpTP3G.js +0 -6
- package/dist/devtools/browser-dev-host/assets/index-DxL85blk.js +0 -567
- package/dist/devtools/browser-dev-host/assets/index-ophYZqpX.css +0 -1
|
@@ -1,669 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-B8tKOZ1w.cjs');
|
|
4
|
-
var runtimePermissionEnv = require('./runtime-permission-env-CAnNV2Lw.cjs');
|
|
5
|
-
var node_crypto = require('node:crypto');
|
|
6
|
-
var fs = require('node:fs/promises');
|
|
7
|
-
var path = require('node:path');
|
|
8
|
-
var fs$1 = require('node:fs');
|
|
9
|
-
var sharp = require('sharp');
|
|
10
|
-
var index_esm = require('./index.esm-CvMA_ppV.cjs');
|
|
11
|
-
|
|
12
|
-
function createRemoteApiClient(options) {
|
|
13
|
-
return {
|
|
14
|
-
listPermissionApplications: (request) => remoteGet(runtimePermissionEnv.LIST_USER_MINIPROGRAM_PERMISSION_APPLICATION_API_PATH, request, options),
|
|
15
|
-
submitPermissionApplication: (request) => remotePostForm(runtimePermissionEnv.SUBMIT_USER_MINIPROGRAM_PERMISSION_APPLICATION_API_PATH, request, options),
|
|
16
|
-
listDeveloperEntities: () => listDeveloperEntities(options),
|
|
17
|
-
switchDeveloperEntity: (requestOptions) => switchDeveloperEntity(requestOptions, options),
|
|
18
|
-
getDeveloperAccessStatus: () => getDeveloperAccessStatus(options),
|
|
19
|
-
listUserMiniprograms: (requestOptions = {}) => listUserMiniprograms(requestOptions, options),
|
|
20
|
-
createUserMiniprogram: () => createUserMiniprogram(options),
|
|
21
|
-
getUserMiniprogramDetail: (requestOptions) => getUserMiniprogramDetail(requestOptions, options),
|
|
22
|
-
createLocalDevLaunchToken: (requestOptions) => createLocalDevLaunchToken$1(requestOptions, options),
|
|
23
|
-
getPreviewAllowlist: (requestOptions) => getPreviewAllowlist(requestOptions, options),
|
|
24
|
-
updatePreviewAllowlist: (requestOptions) => updatePreviewAllowlist(requestOptions, options),
|
|
25
|
-
createUserMiniprogramLeaderboard: (requestOptions) => createUserMiniprogramLeaderboard(requestOptions, options),
|
|
26
|
-
getUserMiniprogramLeaderboard: (requestOptions) => getUserMiniprogramLeaderboard(requestOptions, options),
|
|
27
|
-
listUserMiniprogramLeaderboards: (requestOptions) => listUserMiniprogramLeaderboards(requestOptions, options),
|
|
28
|
-
deleteUserMiniprogramLeaderboard: (requestOptions) => deleteUserMiniprogramLeaderboard(requestOptions, options),
|
|
29
|
-
precheckUserMiniprogramVersion: (requestOptions) => precheckUserMiniprogramVersion(requestOptions, options),
|
|
30
|
-
submitUserMiniprogramAudit: (requestOptions) => submitUserMiniprogramAudit(requestOptions, options),
|
|
31
|
-
getVersionPreviewInfo: (requestOptions) => getVersionPreviewInfo(requestOptions, options),
|
|
32
|
-
withdrawUserMiniprogramVersion: (requestOptions) => withdrawUserMiniprogramVersion(requestOptions, options),
|
|
33
|
-
releaseUserMiniprogramVersion: (requestOptions) => releaseUserMiniprogramVersion(requestOptions, options),
|
|
34
|
-
takeDownUserMiniprogram: (requestOptions) => takeDownUserMiniprogram(requestOptions, options),
|
|
35
|
-
reopenUserMiniprogram: (requestOptions) => reopenUserMiniprogram(requestOptions, options),
|
|
36
|
-
updateSquareDisplay: (requestOptions) => updateSquareDisplay(requestOptions, options),
|
|
37
|
-
listUserMiniprogramVersions: (requestOptions) => listUserMiniprogramVersions(requestOptions, options),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
async function listDeveloperEntities(runtime) {
|
|
41
|
-
return remoteGet(runtimePermissionEnv.DEVELOPER_ENTITY_LIST_API_PATH, {}, runtime);
|
|
42
|
-
}
|
|
43
|
-
async function switchDeveloperEntity(options, runtime) {
|
|
44
|
-
return (await remotePostForm(runtimePermissionEnv.DEVELOPER_ENTITY_SWITCH_API_PATH, options, runtime, { requireResult: false })) ?? {};
|
|
45
|
-
}
|
|
46
|
-
async function getDeveloperAccessStatus(runtime) {
|
|
47
|
-
return remoteGet(runtimePermissionEnv.USER_MINIPROGRAM_ACCESS_STATUS_API_PATH, {}, runtime);
|
|
48
|
-
}
|
|
49
|
-
async function listUserMiniprograms(options, runtime) {
|
|
50
|
-
return remoteGet(runtimePermissionEnv.LIST_USER_MINIPROGRAM_API_PATH, options, runtime);
|
|
51
|
-
}
|
|
52
|
-
async function createUserMiniprogram(runtime) {
|
|
53
|
-
return remotePostForm(runtimePermissionEnv.CREATE_USER_MINIPROGRAM_API_PATH, {}, runtime);
|
|
54
|
-
}
|
|
55
|
-
async function getUserMiniprogramDetail(options, runtime) {
|
|
56
|
-
return remoteGet(runtimePermissionEnv.DETAIL_USER_MINIPROGRAM_API_PATH, options, runtime);
|
|
57
|
-
}
|
|
58
|
-
async function createLocalDevLaunchToken$1(options, runtime) {
|
|
59
|
-
return remotePostForm(runtimePermissionEnv.CREATE_USER_MINIPROGRAM_LOCAL_DEV_LAUNCH_TOKEN_API_PATH, options, runtime);
|
|
60
|
-
}
|
|
61
|
-
async function getPreviewAllowlist(options, runtime) {
|
|
62
|
-
return remoteGet(runtimePermissionEnv.USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, options, runtime);
|
|
63
|
-
}
|
|
64
|
-
async function updatePreviewAllowlist(options, runtime) {
|
|
65
|
-
return remotePostForm(runtimePermissionEnv.UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, options, runtime);
|
|
66
|
-
}
|
|
67
|
-
async function createUserMiniprogramLeaderboard(options, runtime) {
|
|
68
|
-
return remotePostForm(runtimePermissionEnv.CREATE_USER_MINIPROGRAM_LEADERBOARD_API_PATH, options, runtime);
|
|
69
|
-
}
|
|
70
|
-
async function getUserMiniprogramLeaderboard(options, runtime) {
|
|
71
|
-
return remoteGet(runtimePermissionEnv.DETAIL_USER_MINIPROGRAM_LEADERBOARD_API_PATH, options, runtime);
|
|
72
|
-
}
|
|
73
|
-
async function listUserMiniprogramLeaderboards(options, runtime) {
|
|
74
|
-
return remoteGet(runtimePermissionEnv.LIST_USER_MINIPROGRAM_LEADERBOARD_API_PATH, options, runtime);
|
|
75
|
-
}
|
|
76
|
-
async function deleteUserMiniprogramLeaderboard(options, runtime) {
|
|
77
|
-
return ((await remotePostForm(runtimePermissionEnv.DELETE_USER_MINIPROGRAM_LEADERBOARD_API_PATH, options, runtime, { requireResult: false })) ?? {});
|
|
78
|
-
}
|
|
79
|
-
async function precheckUserMiniprogramVersion(options, runtime) {
|
|
80
|
-
return remotePostForm(runtimePermissionEnv.PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH, options, runtime);
|
|
81
|
-
}
|
|
82
|
-
async function submitUserMiniprogramAudit(options, runtime) {
|
|
83
|
-
return remotePostForm(runtimePermissionEnv.SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH, {
|
|
84
|
-
mini_program_id: options.mini_program_id, session_id: options.session_id, preflight_token: options.preflight_token,
|
|
85
|
-
}, runtime);
|
|
86
|
-
}
|
|
87
|
-
async function getVersionPreviewInfo(options, runtime) {
|
|
88
|
-
return remoteGet(runtimePermissionEnv.USER_MINIPROGRAM_VERSION_PREVIEW_INFO_API_PATH, {
|
|
89
|
-
mini_program_id: options.mini_program_id,
|
|
90
|
-
preview_version: options.version,
|
|
91
|
-
}, runtime);
|
|
92
|
-
}
|
|
93
|
-
async function withdrawUserMiniprogramVersion(options, runtime) {
|
|
94
|
-
return remotePostForm(runtimePermissionEnv.WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH, options, runtime);
|
|
95
|
-
}
|
|
96
|
-
async function releaseUserMiniprogramVersion(options, runtime) {
|
|
97
|
-
return remotePostForm(runtimePermissionEnv.RELEASE_USER_MINIPROGRAM_VERSION_API_PATH, options, runtime);
|
|
98
|
-
}
|
|
99
|
-
async function takeDownUserMiniprogram(options, runtime) {
|
|
100
|
-
return remotePostForm(runtimePermissionEnv.TAKE_DOWN_USER_MINIPROGRAM_API_PATH, options, runtime);
|
|
101
|
-
}
|
|
102
|
-
async function reopenUserMiniprogram(options, runtime) {
|
|
103
|
-
return remotePostForm(runtimePermissionEnv.REOPEN_USER_MINIPROGRAM_API_PATH, options, runtime);
|
|
104
|
-
}
|
|
105
|
-
async function updateSquareDisplay(options, runtime) {
|
|
106
|
-
return remotePostForm(runtimePermissionEnv.UPDATE_SQUARE_DISPLAY_API_PATH, options, runtime);
|
|
107
|
-
}
|
|
108
|
-
async function listUserMiniprogramVersions(options, runtime) {
|
|
109
|
-
return remoteGet(runtimePermissionEnv.LIST_USER_MINIPROGRAM_VERSION_API_PATH, options, runtime);
|
|
110
|
-
}
|
|
111
|
-
async function remoteGet(path, query, runtime) {
|
|
112
|
-
const pathWithQuery = createPathWithQuery(path, query);
|
|
113
|
-
const context = index.createHeyboxOpenPlatformRequestContext(runtime.session, pathWithQuery);
|
|
114
|
-
const fetchImpl = runtime.fetchImpl ?? fetch;
|
|
115
|
-
const response = await fetchImpl(index.createHeyboxApiUrl(runtime.baseUrl ?? context.baseUrl, pathWithQuery, context.platformParams), {
|
|
116
|
-
method: 'GET',
|
|
117
|
-
headers: context.headers,
|
|
118
|
-
});
|
|
119
|
-
return readRequiredResult(response, pathWithQuery);
|
|
120
|
-
}
|
|
121
|
-
async function remotePostForm(path, fields, runtime, options = {}) {
|
|
122
|
-
const context = index.createHeyboxOpenPlatformRequestContext(runtime.session, path, {
|
|
123
|
-
contentType: 'application/x-www-form-urlencoded',
|
|
124
|
-
});
|
|
125
|
-
const fetchImpl = runtime.fetchImpl ?? fetch;
|
|
126
|
-
const response = await fetchImpl(index.createHeyboxApiUrl(runtime.baseUrl ?? context.baseUrl, path, context.platformParams), {
|
|
127
|
-
method: 'POST',
|
|
128
|
-
headers: context.headers,
|
|
129
|
-
body: createFormBody(fields),
|
|
130
|
-
});
|
|
131
|
-
if (options.requireResult === false) {
|
|
132
|
-
return readOptionalResult(response, path);
|
|
133
|
-
}
|
|
134
|
-
return readRequiredResult(response, path);
|
|
135
|
-
}
|
|
136
|
-
async function readRequiredResult(response, pathWithQuery) {
|
|
137
|
-
const result = await index.readHeyboxApiEnvelope(response, { pathWithQuery, requireResult: true });
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
140
|
-
async function readOptionalResult(response, pathWithQuery) {
|
|
141
|
-
return index.readHeyboxApiEnvelope(response, { pathWithQuery, requireResult: false });
|
|
142
|
-
}
|
|
143
|
-
function createPathWithQuery(path, query) {
|
|
144
|
-
const params = new URLSearchParams();
|
|
145
|
-
for (const [key, value] of Object.entries(query)) {
|
|
146
|
-
if (value !== undefined && value !== null && value !== '') {
|
|
147
|
-
params.set(key, String(value));
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
const queryString = params.toString();
|
|
151
|
-
return queryString ? `${path}?${queryString}` : path;
|
|
152
|
-
}
|
|
153
|
-
function createFormBody(fields) {
|
|
154
|
-
const body = new URLSearchParams();
|
|
155
|
-
for (const [key, value] of Object.entries(fields)) {
|
|
156
|
-
if (value === undefined || value === null) {
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
if (Array.isArray(value)) {
|
|
160
|
-
body.set(key, value.join(','));
|
|
161
|
-
continue;
|
|
162
|
-
}
|
|
163
|
-
if (typeof value === 'object') {
|
|
164
|
-
body.set(key, JSON.stringify(value));
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
body.set(key, String(value));
|
|
168
|
-
}
|
|
169
|
-
return body.toString();
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
class MiniProgramProjectBindingError extends Error {
|
|
173
|
-
code;
|
|
174
|
-
constructor(message, code) {
|
|
175
|
-
super(message);
|
|
176
|
-
this.code = code;
|
|
177
|
-
this.name = 'MiniProgramProjectBindingError';
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function findMiniProgramProjectRoot(startDir) {
|
|
181
|
-
let current = path.resolve(startDir);
|
|
182
|
-
while (true) {
|
|
183
|
-
if (fs$1.existsSync(path.join(current, 'package.json'))) {
|
|
184
|
-
return current;
|
|
185
|
-
}
|
|
186
|
-
const parent = path.dirname(current);
|
|
187
|
-
if (parent === current) {
|
|
188
|
-
throw new MiniProgramProjectBindingError('当前目录或父目录未找到 package.json', 'PACKAGE_JSON_NOT_FOUND');
|
|
189
|
-
}
|
|
190
|
-
current = parent;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
async function readMiniProgramProjectPackage(startDir) {
|
|
194
|
-
const projectRoot = findMiniProgramProjectRoot(startDir);
|
|
195
|
-
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
196
|
-
const raw = await fs.readFile(packageJsonPath, 'utf8');
|
|
197
|
-
let packageJson;
|
|
198
|
-
try {
|
|
199
|
-
packageJson = JSON.parse(raw);
|
|
200
|
-
}
|
|
201
|
-
catch (error) {
|
|
202
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
203
|
-
throw new MiniProgramProjectBindingError(`package.json 不是合法 JSON:${packageJsonPath}\n${message}`, 'PACKAGE_JSON_INVALID');
|
|
204
|
-
}
|
|
205
|
-
return {
|
|
206
|
-
projectRoot,
|
|
207
|
-
packageJsonPath,
|
|
208
|
-
packageJson,
|
|
209
|
-
raw,
|
|
210
|
-
indent: detectJsonIndent(raw),
|
|
211
|
-
trailingNewline: raw.endsWith('\r\n') ? '\r\n' : raw.endsWith('\n') ? '\n' : '',
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
function readBoundMiniProgramIdFromPackageJson(packageJson) {
|
|
215
|
-
const value = packageJson.heybox?.miniProgramId;
|
|
216
|
-
return typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
217
|
-
}
|
|
218
|
-
async function readBoundMiniProgramId(startDir) {
|
|
219
|
-
return readBoundMiniProgramIdFromPackageJson((await readMiniProgramProjectPackage(startDir)).packageJson);
|
|
220
|
-
}
|
|
221
|
-
async function requireBoundMiniProgramId(startDir) {
|
|
222
|
-
const context = await readMiniProgramProjectPackage(startDir);
|
|
223
|
-
const miniProgramId = readBoundMiniProgramIdFromPackageJson(context.packageJson);
|
|
224
|
-
if (!miniProgramId) {
|
|
225
|
-
throw new MiniProgramProjectBindingError(`当前项目未绑定小程序。请先运行 hb-sdk remote create 或 hb-sdk remote bind <mini-program-id>。\n配置位置:${context.packageJsonPath}#heybox.miniProgramId`, 'MINI_PROGRAM_UNBOUND');
|
|
226
|
-
}
|
|
227
|
-
return { ...context, miniProgramId };
|
|
228
|
-
}
|
|
229
|
-
async function writeBoundMiniProgramId(startDir, miniProgramId, options = {}) {
|
|
230
|
-
const context = await readMiniProgramProjectPackage(startDir);
|
|
231
|
-
const normalizedMiniProgramId = String(miniProgramId).trim();
|
|
232
|
-
if (!normalizedMiniProgramId) {
|
|
233
|
-
throw new MiniProgramProjectBindingError('miniProgramId 不能为空', 'PACKAGE_JSON_INVALID');
|
|
234
|
-
}
|
|
235
|
-
const currentMiniProgramId = readBoundMiniProgramIdFromPackageJson(context.packageJson);
|
|
236
|
-
if (currentMiniProgramId && currentMiniProgramId !== normalizedMiniProgramId && !options.force) {
|
|
237
|
-
throw new MiniProgramProjectBindingError(`当前项目已绑定小程序 ${currentMiniProgramId}。如需覆盖本地绑定,请使用 --force。`, 'MINI_PROGRAM_BINDING_EXISTS');
|
|
238
|
-
}
|
|
239
|
-
if (currentMiniProgramId === normalizedMiniProgramId) {
|
|
240
|
-
return {
|
|
241
|
-
...context,
|
|
242
|
-
changed: false,
|
|
243
|
-
miniProgramId: normalizedMiniProgramId,
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
if (context.packageJson.heybox !== undefined && !isPlainObject(context.packageJson.heybox)) {
|
|
247
|
-
throw new MiniProgramProjectBindingError('package.json heybox 字段必须是对象,不能写入 miniProgramId', 'PACKAGE_JSON_HEYBOX_INVALID');
|
|
248
|
-
}
|
|
249
|
-
context.packageJson.heybox = {
|
|
250
|
-
...(context.packageJson.heybox ?? {}),
|
|
251
|
-
miniProgramId: normalizedMiniProgramId,
|
|
252
|
-
};
|
|
253
|
-
await fs.writeFile(context.packageJsonPath, `${JSON.stringify(context.packageJson, null, context.indent)}${context.trailingNewline || '\n'}`, 'utf8');
|
|
254
|
-
return {
|
|
255
|
-
...context,
|
|
256
|
-
changed: true,
|
|
257
|
-
miniProgramId: normalizedMiniProgramId,
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
function detectJsonIndent(raw) {
|
|
261
|
-
const match = raw.match(/\n(\s+)"[^"]+":/);
|
|
262
|
-
return match?.[1] ?? 2;
|
|
263
|
-
}
|
|
264
|
-
function isPlainObject(value) {
|
|
265
|
-
return Object.prototype.toString.call(value) === '[object Object]';
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
async function resolveRemoteEnvironment(options = {}, runtime = {}) {
|
|
269
|
-
const env = options.env ?? process.env;
|
|
270
|
-
const apiBaseUrl = index.resolveHeyboxApiBaseUrl({ ...options, env });
|
|
271
|
-
const loginBaseUrl = index.resolveHeyboxLoginBaseUrl({ ...options, env });
|
|
272
|
-
const session = options.session ?? (await (runtime.requireAuthSession ?? index.requireHeyboxAuthSession)({ loginBaseUrl }));
|
|
273
|
-
return {
|
|
274
|
-
apiBaseUrl,
|
|
275
|
-
loginBaseUrl,
|
|
276
|
-
allowUnsafeApiBaseUrl: options.allowUnsafeApiBaseUrl === true || isTruthyEnvFlag(env.HB_SDK_ALLOW_UNSAFE_API_BASE_URL),
|
|
277
|
-
env,
|
|
278
|
-
fetchImpl: runtime.fetchImpl ?? options.fetchImpl ?? fetch,
|
|
279
|
-
session,
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
function createRemoteApiClientForEnvironment(environment) {
|
|
283
|
-
return createRemoteApiClient({
|
|
284
|
-
baseUrl: environment.apiBaseUrl,
|
|
285
|
-
fetchImpl: environment.fetchImpl,
|
|
286
|
-
session: environment.session,
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
async function getBoundMiniProgram(options = {}, runtime = {}) {
|
|
290
|
-
const cwd = options.cwd ?? process.cwd();
|
|
291
|
-
const binding = await requireBoundMiniProgramId(cwd);
|
|
292
|
-
const api = await resolveRemoteApiClient(options, runtime);
|
|
293
|
-
const detail = await api.getUserMiniprogramDetail({ mini_program_id: binding.miniProgramId });
|
|
294
|
-
return {
|
|
295
|
-
...binding,
|
|
296
|
-
detail,
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
async function createLocalDevLaunchToken(options, runtime = {}) {
|
|
300
|
-
const miniProgramId = options.miniProgramId.trim();
|
|
301
|
-
if (!miniProgramId) {
|
|
302
|
-
throw new Error('mini-program-id 不能为空');
|
|
303
|
-
}
|
|
304
|
-
const api = await resolveRemoteApiClient(options, runtime);
|
|
305
|
-
return api.createLocalDevLaunchToken({
|
|
306
|
-
mini_program_id: miniProgramId,
|
|
307
|
-
...(options.developmentSnapshot ? { development_snapshot: options.developmentSnapshot } : {}),
|
|
308
|
-
...(options.companionManifestSha256
|
|
309
|
-
? { companion_manifest_sha256: options.companionManifestSha256 }
|
|
310
|
-
: {}),
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
async function resolveRemoteApiClient(options, runtime) {
|
|
314
|
-
if (runtime.apiClient) {
|
|
315
|
-
return runtime.apiClient;
|
|
316
|
-
}
|
|
317
|
-
return createRemoteApiClientForEnvironment(await resolveRemoteEnvironment(options, runtime));
|
|
318
|
-
}
|
|
319
|
-
function isTruthyEnvFlag(value) {
|
|
320
|
-
return ['1', 'true', 'yes', 'on'].includes(String(value ?? '')
|
|
321
|
-
.trim()
|
|
322
|
-
.toLowerCase());
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
async function inspectBasicInfoImage(bytes, sourcePath, kind) {
|
|
326
|
-
const inspected = await inspectDecodedBasicInfoImage(bytes, kind);
|
|
327
|
-
const extensions = { jpg: ['jpg', 'jpeg'], png: ['png'], gif: ['gif'], webp: ['webp'] };
|
|
328
|
-
const ext = sourcePath.split('.').pop().toLowerCase();
|
|
329
|
-
if (!extensions[inspected.extension]?.includes(ext))
|
|
330
|
-
throw new Error('资料图片格式与扩展名不一致');
|
|
331
|
-
return inspected;
|
|
332
|
-
}
|
|
333
|
-
async function inspectRemoteBasicInfoImage(bytes, kind) {
|
|
334
|
-
return inspectDecodedBasicInfoImage(bytes, kind);
|
|
335
|
-
}
|
|
336
|
-
async function inspectDecodedBasicInfoImage(bytes, kind) {
|
|
337
|
-
if (!bytes.length || bytes.length > runtimePermissionEnv.BASIC_INFO_MAX_BYTES)
|
|
338
|
-
throw new Error('资料图片不得为空或超过 10 MiB');
|
|
339
|
-
const decoder = sharp(bytes, { limitInputPixels: runtimePermissionEnv.BASIC_INFO_MAX_PIXELS, failOn: 'warning' });
|
|
340
|
-
const metadata = await decoder.metadata();
|
|
341
|
-
const extensions = { jpeg: 'jpg', png: 'png', gif: 'gif', webp: 'webp' };
|
|
342
|
-
if (!metadata.format || !extensions[metadata.format])
|
|
343
|
-
throw new Error('资料图片格式不支持');
|
|
344
|
-
const width = metadata.width ?? 0;
|
|
345
|
-
const height = metadata.pageHeight ?? metadata.height ?? 0;
|
|
346
|
-
if (!width || !height || width * height > runtimePermissionEnv.BASIC_INFO_MAX_PIXELS)
|
|
347
|
-
throw new Error('资料图片不得超过 4000 万像素');
|
|
348
|
-
if (kind === 'icon' && (width !== 200 || height !== 200))
|
|
349
|
-
throw new Error('icon 必须是 200×200');
|
|
350
|
-
// 强制解码而非只信任图片头;不将解码结果写回图片。
|
|
351
|
-
await decoder.stats();
|
|
352
|
-
return { sha256: node_crypto.createHash('sha256').update(bytes).digest('hex'), extension: extensions[metadata.format] };
|
|
353
|
-
}
|
|
354
|
-
async function readBasicInfoSource(projectRoot, relative, kind) {
|
|
355
|
-
runtimePermissionEnv.validateBasicInfoPath(relative);
|
|
356
|
-
const root = await fs.realpath(projectRoot);
|
|
357
|
-
const target = await fs.realpath(path.join(root, relative));
|
|
358
|
-
const resolvedRelative = path.relative(root, target).split(path.sep).join('/');
|
|
359
|
-
runtimePermissionEnv.validateBasicInfoPath(resolvedRelative);
|
|
360
|
-
if (resolvedRelative.startsWith('../') || path.isAbsolute(resolvedRelative))
|
|
361
|
-
throw new Error('资料图片不能逃逸项目目录');
|
|
362
|
-
const info = await fs.stat(target);
|
|
363
|
-
if (!info.isFile() || info.size > runtimePermissionEnv.BASIC_INFO_MAX_BYTES)
|
|
364
|
-
throw new Error('资料图片必须为不超过 10 MiB 的普通文件');
|
|
365
|
-
const file = await fs.open(target, fs$1.constants.O_RDONLY | fs$1.constants.O_NOFOLLOW);
|
|
366
|
-
try {
|
|
367
|
-
const actual = await file.stat();
|
|
368
|
-
if (!actual.isFile() || actual.size > runtimePermissionEnv.BASIC_INFO_MAX_BYTES)
|
|
369
|
-
throw new Error('资料图片文件已变化');
|
|
370
|
-
const bytes = await file.readFile();
|
|
371
|
-
return { bytes, ...(await inspectBasicInfoImage(bytes, relative, kind)) };
|
|
372
|
-
}
|
|
373
|
-
finally {
|
|
374
|
-
await file.close();
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
/** 逐级校验真实目录,避免保留目录或迁移目录中的符号链接将写入带到项目外。 */
|
|
378
|
-
async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
379
|
-
const root = await fs.realpath(rootPath);
|
|
380
|
-
let current = root;
|
|
381
|
-
for (const part of relative.split('/')) {
|
|
382
|
-
if (!part || part === '.' || part === '..')
|
|
383
|
-
throw new Error('资料目录不合法');
|
|
384
|
-
current = path.join(current, part);
|
|
385
|
-
await fs.mkdir(current).catch((error) => {
|
|
386
|
-
if (error.code !== 'EEXIST')
|
|
387
|
-
throw error;
|
|
388
|
-
});
|
|
389
|
-
const resolved = await fs.realpath(current);
|
|
390
|
-
const within = path.relative(root, resolved);
|
|
391
|
-
if (within.startsWith('..') || path.isAbsolute(within))
|
|
392
|
-
throw new Error('资料目录不能逃逸项目');
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
function trustedProfileUrl(raw) {
|
|
397
|
-
const url = new URL(raw);
|
|
398
|
-
const trusted = ['max-c.com', 'xiaoheihe.cn', 'heybox.com'];
|
|
399
|
-
if (url.protocol !== 'https:' ||
|
|
400
|
-
url.username ||
|
|
401
|
-
url.password ||
|
|
402
|
-
(url.port && url.port !== '443') ||
|
|
403
|
-
!trusted.some((host) => url.hostname === host || url.hostname.endsWith(`.${host}`)))
|
|
404
|
-
throw new Error('线上资料图片 URL 不受信任');
|
|
405
|
-
return url;
|
|
406
|
-
}
|
|
407
|
-
async function downloadImage(raw, fetchImpl) {
|
|
408
|
-
const response = await fetchImpl(trustedProfileUrl(raw), { redirect: 'error', signal: AbortSignal.timeout(15_000) });
|
|
409
|
-
if (!response.ok || !response.body)
|
|
410
|
-
throw new Error('下载线上资料图片失败');
|
|
411
|
-
if (Number(response.headers.get('content-length')) > runtimePermissionEnv.BASIC_INFO_MAX_BYTES)
|
|
412
|
-
throw new Error('图片超过 10 MiB');
|
|
413
|
-
const chunks = [];
|
|
414
|
-
let size = 0;
|
|
415
|
-
const reader = response.body.getReader();
|
|
416
|
-
try {
|
|
417
|
-
for (;;) {
|
|
418
|
-
const part = await reader.read();
|
|
419
|
-
if (part.done)
|
|
420
|
-
break;
|
|
421
|
-
size += part.value.length;
|
|
422
|
-
if (size > runtimePermissionEnv.BASIC_INFO_MAX_BYTES)
|
|
423
|
-
throw new Error('图片超过 10 MiB');
|
|
424
|
-
chunks.push(part.value);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
finally {
|
|
428
|
-
await reader.cancel();
|
|
429
|
-
}
|
|
430
|
-
return Buffer.concat(chunks);
|
|
431
|
-
}
|
|
432
|
-
/** package-last 提交:失败只清理本次新增素材,原配置始终保留。 */
|
|
433
|
-
async function migrateBasicInfo(cwd, detail, miniProgramId, fetchImpl = fetch, force = false) {
|
|
434
|
-
const context = await readMiniProgramProjectPackage(cwd);
|
|
435
|
-
const heybox = context.packageJson.heybox ?? {};
|
|
436
|
-
const existing = heybox.miniProgramId;
|
|
437
|
-
if (existing && existing !== miniProgramId && !force)
|
|
438
|
-
throw new Error('当前项目已绑定其他小程序,请使用 --force');
|
|
439
|
-
const fields = ['name', 'icon', 'coverImages'];
|
|
440
|
-
const present = fields.filter((key) => Object.prototype.hasOwnProperty.call(heybox, key));
|
|
441
|
-
if (present.length && present.length !== 3)
|
|
442
|
-
throw new Error(`资料配置不完整,请补齐 ${fields.filter((key) => !present.includes(key)).join('、')}`);
|
|
443
|
-
const created = [];
|
|
444
|
-
const temp = `${context.packageJsonPath}.${node_crypto.randomUUID()}.tmp`;
|
|
445
|
-
try {
|
|
446
|
-
let profile = present.length ? runtimePermissionEnv.parseMiniappBasicInfo(heybox) : undefined;
|
|
447
|
-
if (profile) {
|
|
448
|
-
await readBasicInfoSource(context.projectRoot, profile.icon, 'icon');
|
|
449
|
-
for (const cover of profile.coverImages)
|
|
450
|
-
await readBasicInfoSource(context.projectRoot, cover, 'cover');
|
|
451
|
-
if (existing === miniProgramId)
|
|
452
|
-
return { changed: false, miniProgramId };
|
|
453
|
-
}
|
|
454
|
-
else {
|
|
455
|
-
if (detail.mini_program_id !== miniProgramId)
|
|
456
|
-
throw new Error('远端小程序身份不一致');
|
|
457
|
-
const snapshot = detail.published_basic_info;
|
|
458
|
-
if (!snapshot?.version ||
|
|
459
|
-
!snapshot.icon_url ||
|
|
460
|
-
!Array.isArray(snapshot.cover_image_urls) ||
|
|
461
|
-
snapshot.cover_image_urls.length < 1 ||
|
|
462
|
-
snapshot.cover_image_urls.length > 5)
|
|
463
|
-
throw new Error('没有当前正式发布快照,请手工配置 heybox.name/icon/coverImages');
|
|
464
|
-
profile = { name: runtimePermissionEnv.normalizeBasicInfoName(snapshot.name), icon: '', coverImages: [] };
|
|
465
|
-
const entries = [
|
|
466
|
-
{ url: snapshot.icon_url, kind: 'icon', label: 'icon' },
|
|
467
|
-
...snapshot.cover_image_urls.map((url, i) => ({ url, kind: 'cover', label: `cover-${String(i + 1).padStart(2, '0')}` })),
|
|
468
|
-
];
|
|
469
|
-
for (const entry of entries) {
|
|
470
|
-
const bytes = await downloadImage(entry.url, fetchImpl);
|
|
471
|
-
const image = await inspectRemoteBasicInfoImage(bytes, entry.kind);
|
|
472
|
-
const relative = `assets/heybox/${entry.label}.${image.sha256.slice(0, 12)}.${image.extension}`;
|
|
473
|
-
const target = path.join(context.projectRoot, relative);
|
|
474
|
-
await ensureBasicInfoDirectory(context.projectRoot, 'assets/heybox');
|
|
475
|
-
try {
|
|
476
|
-
await fs.writeFile(target, bytes, { flag: 'wx' });
|
|
477
|
-
created.push(target);
|
|
478
|
-
}
|
|
479
|
-
catch (error) {
|
|
480
|
-
if (error.code !== 'EEXIST' ||
|
|
481
|
-
!(await readBasicInfoSource(context.projectRoot, relative, entry.kind).then((existing) => existing.bytes.equals(bytes), () => false)))
|
|
482
|
-
throw new Error('迁移素材名称冲突,未覆盖已有文件');
|
|
483
|
-
}
|
|
484
|
-
if (entry.kind === 'icon')
|
|
485
|
-
profile.icon = relative;
|
|
486
|
-
else
|
|
487
|
-
profile.coverImages.push(relative);
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
// 避免覆盖用户在下载期间修改的配置。
|
|
491
|
-
if ((await fs.readFile(context.packageJsonPath, 'utf8')) !== context.raw)
|
|
492
|
-
throw new Error('package.json 已变化,请重试迁移');
|
|
493
|
-
context.packageJson.heybox = { ...heybox, miniProgramId, ...profile };
|
|
494
|
-
await fs.writeFile(temp, JSON.stringify(context.packageJson, null, context.indent) + context.trailingNewline, { flag: 'wx' });
|
|
495
|
-
await fs.rename(temp, context.packageJsonPath);
|
|
496
|
-
return { changed: true, miniProgramId };
|
|
497
|
-
}
|
|
498
|
-
catch (error) {
|
|
499
|
-
// 若用户同时修改了 package,保留可能已被引用的素材供重试复用。
|
|
500
|
-
if ((await fs.readFile(context.packageJsonPath, 'utf8').catch(() => '')) === context.raw) {
|
|
501
|
-
await Promise.all(created.map((file) => fs.unlink(file).catch(() => { })));
|
|
502
|
-
}
|
|
503
|
-
throw error;
|
|
504
|
-
}
|
|
505
|
-
finally {
|
|
506
|
-
await fs.unlink(temp).catch(() => { });
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
async function compareBasicInfo(cwd, detail, fetchImpl = fetch) {
|
|
510
|
-
const context = await readMiniProgramProjectPackage(cwd);
|
|
511
|
-
const published = detail.published_basic_info;
|
|
512
|
-
let local;
|
|
513
|
-
try {
|
|
514
|
-
local = runtimePermissionEnv.parseMiniappBasicInfo(context.packageJson.heybox ?? {});
|
|
515
|
-
}
|
|
516
|
-
catch {
|
|
517
|
-
return { status: 'unavailable' };
|
|
518
|
-
}
|
|
519
|
-
if (!local || !published?.version)
|
|
520
|
-
return { status: 'unavailable', local, published };
|
|
521
|
-
try {
|
|
522
|
-
const pairs = [
|
|
523
|
-
{ local: local.icon, remote: published.icon_url, kind: 'icon' },
|
|
524
|
-
...local.coverImages.map((p, i) => ({ local: p, remote: published.cover_image_urls[i], kind: 'cover' })),
|
|
525
|
-
];
|
|
526
|
-
let changed = local.name !== runtimePermissionEnv.normalizeBasicInfoName(published.name) || local.coverImages.length !== published.cover_image_urls.length;
|
|
527
|
-
for (const pair of pairs) {
|
|
528
|
-
if (!pair.remote) {
|
|
529
|
-
changed = true;
|
|
530
|
-
continue;
|
|
531
|
-
}
|
|
532
|
-
const source = await readBasicInfoSource(context.projectRoot, pair.local, pair.kind);
|
|
533
|
-
const bytes = await downloadImage(pair.remote, fetchImpl);
|
|
534
|
-
const remote = await inspectRemoteBasicInfoImage(bytes, pair.kind);
|
|
535
|
-
changed ||= source.sha256 !== remote.sha256;
|
|
536
|
-
}
|
|
537
|
-
return { status: changed ? 'changed' : 'unchanged', local, published };
|
|
538
|
-
}
|
|
539
|
-
catch {
|
|
540
|
-
return { status: 'unavailable', local, published };
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
/** Browser Fake 与 channel 共用的本地 grant 有效性校验。 */
|
|
545
|
-
function resolveBrowserFakeContext(context, now = Date.now()) {
|
|
546
|
-
if (context.localDevGrant === undefined)
|
|
547
|
-
return context;
|
|
548
|
-
const parsed = index_esm.parseMiniProgramLocalDevGrant(context.localDevGrant);
|
|
549
|
-
if (!parsed.valid ||
|
|
550
|
-
!context.devSessionId?.trim() ||
|
|
551
|
-
!Number.isSafeInteger(context.contextRevision) ||
|
|
552
|
-
context.contextRevision !== parsed.grant.revision ||
|
|
553
|
-
!context.expiresAt ||
|
|
554
|
-
!Number.isFinite(context.expiresAt) ||
|
|
555
|
-
(context.source !== 'remote' && context.expiresAt <= now)) {
|
|
556
|
-
return { ...context, localDevGrant: undefined, warning: '本地临时授权无效或已过期,已降权' };
|
|
557
|
-
}
|
|
558
|
-
return {
|
|
559
|
-
...context,
|
|
560
|
-
...(context.expiresAt <= now ? { source: 'anonymous', localDevLaunchToken: undefined, expiresAt: now + 30_000 } : {}),
|
|
561
|
-
localDevGrant: index_esm.createMiniProgramLocalDevGrant({
|
|
562
|
-
declaredPermissions: context.declaredPermissions ?? {},
|
|
563
|
-
runtimePermissions: context.runtimePermissions,
|
|
564
|
-
revision: parsed.grant.revision,
|
|
565
|
-
eligiblePermissionKeys: context.platforms?.some((platform) => ['windows', 'macos', 'linux'].includes(platform))
|
|
566
|
-
? ['network', 'companion', 'appProtocol']
|
|
567
|
-
: ['network', 'appProtocol'],
|
|
568
|
-
}),
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
function shouldSkipMiniappPlatformCsp(_runtimePermissions) {
|
|
572
|
-
return false;
|
|
573
|
-
}
|
|
574
|
-
const DEFAULT_PERMISSION_STATE = {
|
|
575
|
-
networkRequest: {
|
|
576
|
-
status: 'disabled',
|
|
577
|
-
useOfficialDomain: false,
|
|
578
|
-
},
|
|
579
|
-
};
|
|
580
|
-
function createBrowserDevPermissionState(context) {
|
|
581
|
-
const parsed = index_esm.parseMiniProgramRuntimePermissions(context.localDevGrant
|
|
582
|
-
? index_esm.composeLocalDevRuntimePermissions({ declaredPermissions: context.declaredPermissions ?? {}, runtimePermissions: context.runtimePermissions,
|
|
583
|
-
localDevGrant: context.localDevGrant }).runtimePermissions
|
|
584
|
-
: context.runtimePermissions);
|
|
585
|
-
const networkRequest = parsed.permissions.network;
|
|
586
|
-
return parsed.valid && networkRequest
|
|
587
|
-
? {
|
|
588
|
-
networkRequest: {
|
|
589
|
-
status: networkRequest.status,
|
|
590
|
-
useOfficialDomain: networkRequest.config.useOfficialDomain === true,
|
|
591
|
-
},
|
|
592
|
-
}
|
|
593
|
-
: cloneDefaultPermissionState();
|
|
594
|
-
}
|
|
595
|
-
/** Mobile Dev Session 使用本地声明与平台基线,不读取 Browser 模拟权限状态。 */
|
|
596
|
-
function createMobileDevSessionRuntimePermissions(context) {
|
|
597
|
-
if (context.source !== 'remote') {
|
|
598
|
-
return { schema_version: 1, entries: [] };
|
|
599
|
-
}
|
|
600
|
-
// 历史内部调用没有本地声明,沿用旧快照适配;新 CLI 始终显式提供声明(可为空)。
|
|
601
|
-
if (context.declaredPermissions === undefined) {
|
|
602
|
-
const state = createBrowserDevPermissionState(context);
|
|
603
|
-
return createDevRuntimePermissions(context.runtimePermissions, state, state.networkRequest.useOfficialDomain);
|
|
604
|
-
}
|
|
605
|
-
return index_esm.composeLocalDevRuntimePermissions({ declaredPermissions: context.declaredPermissions, runtimePermissions: context.runtimePermissions }).runtimePermissions;
|
|
606
|
-
}
|
|
607
|
-
function cloneDefaultPermissionState() {
|
|
608
|
-
return {
|
|
609
|
-
networkRequest: { ...DEFAULT_PERMISSION_STATE.networkRequest },
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
|
-
function createDevRuntimePermissions(snapshot, state, useOfficialDomain) {
|
|
613
|
-
const parsed = index_esm.parseMiniProgramRuntimePermissions(snapshot);
|
|
614
|
-
if (!parsed.valid) {
|
|
615
|
-
return { schema_version: 1, entries: [] };
|
|
616
|
-
}
|
|
617
|
-
const entries = [];
|
|
618
|
-
for (const key of index_esm.MINI_PROGRAM_PERMISSION_KEYS) {
|
|
619
|
-
const entry = parsed.permissions[key];
|
|
620
|
-
if (!entry)
|
|
621
|
-
continue;
|
|
622
|
-
entries.push(key === 'network'
|
|
623
|
-
? {
|
|
624
|
-
key,
|
|
625
|
-
status: state.networkRequest.status,
|
|
626
|
-
config: { useOfficialDomain },
|
|
627
|
-
}
|
|
628
|
-
: key === 'user_game_data'
|
|
629
|
-
? {
|
|
630
|
-
key,
|
|
631
|
-
status: entry.status,
|
|
632
|
-
// 精确资源清单是 snapshot 的合法必需项:浏览器模拟只调整开关,不能丢掉 Manifest 声明。
|
|
633
|
-
config: { resources: entry.config.resources },
|
|
634
|
-
}
|
|
635
|
-
: {
|
|
636
|
-
key,
|
|
637
|
-
status: entry.status,
|
|
638
|
-
config: {},
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
const revision = isPlainRecord(snapshot) && typeof snapshot.revision === 'number' && Number.isInteger(snapshot.revision) && snapshot.revision >= 0
|
|
642
|
-
? snapshot.revision
|
|
643
|
-
: undefined;
|
|
644
|
-
return {
|
|
645
|
-
schema_version: 1,
|
|
646
|
-
...(revision === undefined ? {} : { revision }),
|
|
647
|
-
entries,
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
function isPlainRecord(value) {
|
|
651
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
exports.MiniProgramProjectBindingError = MiniProgramProjectBindingError;
|
|
655
|
-
exports.compareBasicInfo = compareBasicInfo;
|
|
656
|
-
exports.createBrowserDevPermissionState = createBrowserDevPermissionState;
|
|
657
|
-
exports.createLocalDevLaunchToken = createLocalDevLaunchToken;
|
|
658
|
-
exports.createMobileDevSessionRuntimePermissions = createMobileDevSessionRuntimePermissions;
|
|
659
|
-
exports.createRemoteApiClientForEnvironment = createRemoteApiClientForEnvironment;
|
|
660
|
-
exports.getBoundMiniProgram = getBoundMiniProgram;
|
|
661
|
-
exports.migrateBasicInfo = migrateBasicInfo;
|
|
662
|
-
exports.readBasicInfoSource = readBasicInfoSource;
|
|
663
|
-
exports.readBoundMiniProgramId = readBoundMiniProgramId;
|
|
664
|
-
exports.readBoundMiniProgramIdFromPackageJson = readBoundMiniProgramIdFromPackageJson;
|
|
665
|
-
exports.readMiniProgramProjectPackage = readMiniProgramProjectPackage;
|
|
666
|
-
exports.resolveBrowserFakeContext = resolveBrowserFakeContext;
|
|
667
|
-
exports.resolveRemoteEnvironment = resolveRemoteEnvironment;
|
|
668
|
-
exports.shouldSkipMiniappPlatformCsp = shouldSkipMiniappPlatformCsp;
|
|
669
|
-
exports.writeBoundMiniProgramId = writeBoundMiniProgramId;
|