@wevu/api 0.2.17 → 0.3.0
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 +28 -320
- package/dist/index.d.mts +1 -8429
- package/dist/index.mjs +2 -2677
- package/dist/vitest/setup.d.mts +1 -0
- package/dist/vitest/setup.mjs +5 -0
- package/dist/vitest.d.mts +1 -0
- package/dist/vitest.mjs +2 -0
- package/package.json +29 -18
- package/types/index.d.ts +1 -164
package/dist/index.mjs
CHANGED
|
@@ -1,2677 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description 静态解析当前运行环境的全局根对象,兼容不提供 globalThis 的小程序 worker。
|
|
5
|
-
*/
|
|
6
|
-
function resolveRuntimeRoots() {
|
|
7
|
-
const roots = [];
|
|
8
|
-
const appendRoot = (root) => {
|
|
9
|
-
if (root && !roots.includes(root)) roots.push(root);
|
|
10
|
-
};
|
|
11
|
-
if (typeof globalThis !== "undefined") appendRoot(globalThis);
|
|
12
|
-
if (typeof self !== "undefined") appendRoot(self);
|
|
13
|
-
if (typeof window !== "undefined") appendRoot(window);
|
|
14
|
-
if (typeof global !== "undefined") appendRoot(global);
|
|
15
|
-
return roots;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @description 静态解析当前运行环境的首个全局根对象。
|
|
19
|
-
*/
|
|
20
|
-
function resolveRuntimeRoot() {
|
|
21
|
-
return resolveRuntimeRoots()[0];
|
|
22
|
-
}
|
|
23
|
-
function resolveTopLevelRuntimeValue(key) {
|
|
24
|
-
switch (key) {
|
|
25
|
-
case "wx": return typeof wx !== "undefined" ? wx : void 0;
|
|
26
|
-
case "my": return typeof my !== "undefined" ? my : void 0;
|
|
27
|
-
case "tt": return typeof tt !== "undefined" ? tt : void 0;
|
|
28
|
-
case "swan": return typeof swan !== "undefined" ? swan : void 0;
|
|
29
|
-
case "jd": return typeof jd !== "undefined" ? jd : void 0;
|
|
30
|
-
case "xhs": return typeof xhs !== "undefined" ? xhs : void 0;
|
|
31
|
-
case "qq": return typeof qq !== "undefined" ? qq : void 0;
|
|
32
|
-
case "ks": return typeof ks !== "undefined" ? ks : void 0;
|
|
33
|
-
case "dd": return typeof dd !== "undefined" ? dd : void 0;
|
|
34
|
-
case "qa": return typeof qa !== "undefined" ? qa : void 0;
|
|
35
|
-
case "qapp": return typeof qapp !== "undefined" ? qapp : void 0;
|
|
36
|
-
case "uni": return typeof uni !== "undefined" ? uni : void 0;
|
|
37
|
-
case "__wxConfig": return typeof __wxConfig !== "undefined" ? __wxConfig : void 0;
|
|
38
|
-
default: return;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @description 从全局根对象或小程序顶层全局变量读取运行时值。
|
|
43
|
-
*/
|
|
44
|
-
function resolveRuntimeGlobalValue(key, root = resolveRuntimeRoot()) {
|
|
45
|
-
const roots = root ? [root, ...resolveRuntimeRoots().filter((item) => item !== root)] : resolveRuntimeRoots();
|
|
46
|
-
for (const item of roots) {
|
|
47
|
-
const value = item[key];
|
|
48
|
-
if (value !== void 0) return value;
|
|
49
|
-
}
|
|
50
|
-
return resolveTopLevelRuntimeValue(key);
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/core/adapter.ts
|
|
54
|
-
const GLOBAL_ADAPTER_KEYS = [
|
|
55
|
-
...getMiniProgramRuntimeGlobalKeys().map((key) => ({
|
|
56
|
-
platform: key,
|
|
57
|
-
key
|
|
58
|
-
})),
|
|
59
|
-
{
|
|
60
|
-
platform: "qq",
|
|
61
|
-
key: "qq"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
platform: "ks",
|
|
65
|
-
key: "ks"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
platform: "dd",
|
|
69
|
-
key: "dd"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
platform: "qa",
|
|
73
|
-
key: "qa"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
platform: "qapp",
|
|
77
|
-
key: "qapp"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
platform: "uni",
|
|
81
|
-
key: "uni"
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
function isAdapterCandidate(value) {
|
|
85
|
-
return typeof value === "object" || typeof value === "function";
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* @description 侦测当前运行环境的全局 API 对象
|
|
89
|
-
*/
|
|
90
|
-
function detectGlobalAdapter() {
|
|
91
|
-
const root = resolveRuntimeRoot();
|
|
92
|
-
for (const item of GLOBAL_ADAPTER_KEYS) {
|
|
93
|
-
const candidate = resolveRuntimeGlobalValue(item.key, root);
|
|
94
|
-
if (isAdapterCandidate(candidate)) return {
|
|
95
|
-
adapter: candidate,
|
|
96
|
-
platform: item.platform
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
return {};
|
|
100
|
-
}
|
|
101
|
-
const WEAPI_NON_PROMISIFIED_METHOD_NAME_SET = /* @__PURE__ */ new Set([
|
|
102
|
-
"arrayBufferToBase64",
|
|
103
|
-
"base64ToArrayBuffer",
|
|
104
|
-
"canIUse",
|
|
105
|
-
"cancelIdleCallback",
|
|
106
|
-
"createAnimation",
|
|
107
|
-
"createAudioContext",
|
|
108
|
-
"createCameraContext",
|
|
109
|
-
"createCanvasContext",
|
|
110
|
-
"createEditorContext",
|
|
111
|
-
"createInnerAudioContext",
|
|
112
|
-
"createIntersectionObserver",
|
|
113
|
-
"createInterstitialAd",
|
|
114
|
-
"createLivePlayerContext",
|
|
115
|
-
"createLivePusherContext",
|
|
116
|
-
"createMapContext",
|
|
117
|
-
"createMediaAudioPlayer",
|
|
118
|
-
"createMediaContainer",
|
|
119
|
-
"createMediaRecorder",
|
|
120
|
-
"createOffscreenCanvas",
|
|
121
|
-
"createRewardedVideoAd",
|
|
122
|
-
"createSelectorQuery",
|
|
123
|
-
"createTCPSocket",
|
|
124
|
-
"createUDPSocket",
|
|
125
|
-
"createVKSession",
|
|
126
|
-
"createVideoContext",
|
|
127
|
-
"createWebAudioContext",
|
|
128
|
-
"createWorker",
|
|
129
|
-
"getBackgroundAudioManager",
|
|
130
|
-
"getFileSystemManager",
|
|
131
|
-
"getLogManager",
|
|
132
|
-
"getMenuButtonBoundingClientRect",
|
|
133
|
-
"getNFCAdapter",
|
|
134
|
-
"getOpenDataContext",
|
|
135
|
-
"getPerformance",
|
|
136
|
-
"getRealtimeLogManager",
|
|
137
|
-
"getRecorderManager",
|
|
138
|
-
"getUpdateManager",
|
|
139
|
-
"getUserCryptoManager",
|
|
140
|
-
"getXrFrameSystem",
|
|
141
|
-
"nextTick",
|
|
142
|
-
"reportAnalytics",
|
|
143
|
-
"requestIdleCallback"
|
|
144
|
-
]);
|
|
145
|
-
/**
|
|
146
|
-
* @description 判断方法是否应保留原始同步返回值,而不是包装为 Promise。
|
|
147
|
-
*/
|
|
148
|
-
function isNonPromisifiedMethod(name) {
|
|
149
|
-
return WEAPI_NON_PROMISIFIED_METHOD_NAME_SET.has(name);
|
|
150
|
-
}
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/core/utils.ts
|
|
153
|
-
function isPlainObject(value) {
|
|
154
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
155
|
-
}
|
|
156
|
-
function hasOwn(source, key) {
|
|
157
|
-
return Object.prototype.hasOwnProperty.call(source, key);
|
|
158
|
-
}
|
|
159
|
-
function hasCallbacks(value) {
|
|
160
|
-
if (!isPlainObject(value)) return false;
|
|
161
|
-
return typeof value.success === "function" || typeof value.fail === "function" || typeof value.complete === "function";
|
|
162
|
-
}
|
|
163
|
-
function isSyncMethod(name) {
|
|
164
|
-
return name.endsWith("Sync");
|
|
165
|
-
}
|
|
166
|
-
const ON_EVENT_RE = /^on[A-Z]/;
|
|
167
|
-
const OFF_EVENT_RE = /^off[A-Z]/;
|
|
168
|
-
function isEventMethod(name) {
|
|
169
|
-
return ON_EVENT_RE.test(name) || OFF_EVENT_RE.test(name);
|
|
170
|
-
}
|
|
171
|
-
function shouldSkipPromise(name) {
|
|
172
|
-
return isSyncMethod(name) || isEventMethod(name) || isNonPromisifiedMethod(name);
|
|
173
|
-
}
|
|
174
|
-
function createNotSupportedError(methodName, platform) {
|
|
175
|
-
return { errMsg: `${platform ? `${platform}.${methodName}` : methodName}:fail method not supported` };
|
|
176
|
-
}
|
|
177
|
-
//#endregion
|
|
178
|
-
//#region src/core/callBridge.ts
|
|
179
|
-
function resolveOptionsArg$1(args) {
|
|
180
|
-
const nextArgs = args.slice();
|
|
181
|
-
const lastArg = nextArgs.length > 0 ? nextArgs[nextArgs.length - 1] : void 0;
|
|
182
|
-
if (isPlainObject(lastArg)) {
|
|
183
|
-
const options = { ...lastArg };
|
|
184
|
-
nextArgs[nextArgs.length - 1] = options;
|
|
185
|
-
return {
|
|
186
|
-
args: nextArgs,
|
|
187
|
-
options
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
const options = {};
|
|
191
|
-
nextArgs.push(options);
|
|
192
|
-
return {
|
|
193
|
-
args: nextArgs,
|
|
194
|
-
options
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* @description 将错误按小程序回调风格分发;若无回调则返回 reject Promise。
|
|
199
|
-
*/
|
|
200
|
-
function callWithError(error, args) {
|
|
201
|
-
const lastArg = args.length > 0 ? args[args.length - 1] : void 0;
|
|
202
|
-
if (hasCallbacks(lastArg)) {
|
|
203
|
-
lastArg.fail?.(error);
|
|
204
|
-
lastArg.complete?.(error);
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
return Promise.reject(error);
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* @description 统一 Promise 调用桥接,支持在 options/runtime result 阶段注入 hook。
|
|
211
|
-
*/
|
|
212
|
-
function callWithPromise(context, method, args, mapResult, hooks) {
|
|
213
|
-
return new Promise((resolve, reject) => {
|
|
214
|
-
const { args: nextArgs, options } = resolveOptionsArg$1(args);
|
|
215
|
-
let settled = false;
|
|
216
|
-
options.success = (res) => {
|
|
217
|
-
settled = true;
|
|
218
|
-
resolve(mapResult ? mapResult(res, args) : res);
|
|
219
|
-
};
|
|
220
|
-
options.fail = (err) => {
|
|
221
|
-
settled = true;
|
|
222
|
-
reject(err);
|
|
223
|
-
};
|
|
224
|
-
options.complete = (res) => {
|
|
225
|
-
if (!settled) resolve(mapResult ? mapResult(res, args) : res);
|
|
226
|
-
};
|
|
227
|
-
try {
|
|
228
|
-
hooks?.onOptions?.(options, nextArgs);
|
|
229
|
-
const invoke = () => {
|
|
230
|
-
try {
|
|
231
|
-
const invokeResult = method.apply(context, nextArgs);
|
|
232
|
-
hooks?.onInvokeResult?.(invokeResult);
|
|
233
|
-
return invokeResult;
|
|
234
|
-
} catch (err) {
|
|
235
|
-
hooks?.onInvokeError?.(err);
|
|
236
|
-
reject(err);
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
if (hooks?.invoke) hooks.invoke(invoke);
|
|
241
|
-
else invoke();
|
|
242
|
-
} catch (err) {
|
|
243
|
-
hooks?.onInvokeError?.(err);
|
|
244
|
-
reject(err);
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* @description 处理方法缺失时的回调/Promise 行为。
|
|
250
|
-
*/
|
|
251
|
-
function callMissingApi(methodName, platform, args) {
|
|
252
|
-
return callWithError(createNotSupportedError(methodName, platform), args);
|
|
253
|
-
}
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region src/core/apiCatalog/myMethodsAddPhoneContactToOnGyroscopeChange.ts
|
|
256
|
-
/**
|
|
257
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
258
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
259
|
-
*/
|
|
260
|
-
const WEAPI_MY_METHODS_ADD_PHONE_CONTACT_TO_ON_GYROSCOPE_CHANGE = [
|
|
261
|
-
"addPhoneContact",
|
|
262
|
-
"alert",
|
|
263
|
-
"arrayBufferToBase64",
|
|
264
|
-
"base64ToArrayBuffer",
|
|
265
|
-
"calculateRoute",
|
|
266
|
-
"call",
|
|
267
|
-
"cancelBluetoothPair",
|
|
268
|
-
"canIUse",
|
|
269
|
-
"canvasToTempFilePath",
|
|
270
|
-
"checkBeforeAddOrder",
|
|
271
|
-
"checkIsIfaaEnrolledInDevice",
|
|
272
|
-
"checkIsSupportIfaaAuthentication",
|
|
273
|
-
"chooseAlipayContact",
|
|
274
|
-
"chooseCity",
|
|
275
|
-
"chooseContact",
|
|
276
|
-
"chooseDistrict",
|
|
277
|
-
"chooseImage",
|
|
278
|
-
"chooseLocation",
|
|
279
|
-
"choosePhoneContact",
|
|
280
|
-
"chooseVideo",
|
|
281
|
-
"clearStorage",
|
|
282
|
-
"clearStorageSync",
|
|
283
|
-
"closeBluetoothAdapter",
|
|
284
|
-
"closeSocket",
|
|
285
|
-
"compressImage",
|
|
286
|
-
"confirm",
|
|
287
|
-
"connectBLEDevice",
|
|
288
|
-
"connectSocket",
|
|
289
|
-
"connectWifi",
|
|
290
|
-
"createAnimation",
|
|
291
|
-
"createCanvasContext",
|
|
292
|
-
"createInnerAudioContext",
|
|
293
|
-
"createIntersectionObserver",
|
|
294
|
-
"createLottieContext",
|
|
295
|
-
"createMapContext",
|
|
296
|
-
"createOffscreenCanvas",
|
|
297
|
-
"createRewardedAd",
|
|
298
|
-
"createSelectorQuery",
|
|
299
|
-
"createVideoContext",
|
|
300
|
-
"createWebViewContext",
|
|
301
|
-
"createWorker",
|
|
302
|
-
"datePicker",
|
|
303
|
-
"detectFileType",
|
|
304
|
-
"disableAlertBeforeUnload",
|
|
305
|
-
"disconnectBLEDevice",
|
|
306
|
-
"downloadFile",
|
|
307
|
-
"enableAlertBeforeUnload",
|
|
308
|
-
"exitMiniProgram",
|
|
309
|
-
"generateImageFromCode",
|
|
310
|
-
"getAccessibilityManager",
|
|
311
|
-
"getAccountInfoSync",
|
|
312
|
-
"getAddress",
|
|
313
|
-
"getAppAuthorizeSetting",
|
|
314
|
-
"getAppBaseInfo",
|
|
315
|
-
"getAppIdSync",
|
|
316
|
-
"getAuthCode",
|
|
317
|
-
"getAvailableAudioSources",
|
|
318
|
-
"getBackgroundAudioManager",
|
|
319
|
-
"getBackgroundFetchData",
|
|
320
|
-
"getBatteryInfo",
|
|
321
|
-
"getBatteryInfoSync",
|
|
322
|
-
"getBeacons",
|
|
323
|
-
"getBLEDeviceCharacteristics",
|
|
324
|
-
"getBLEDeviceRSSI",
|
|
325
|
-
"getBLEDeviceServices",
|
|
326
|
-
"getBLEDeviceStatus",
|
|
327
|
-
"getBLEMTU",
|
|
328
|
-
"getBluetoothAdapterState",
|
|
329
|
-
"getBluetoothDevices",
|
|
330
|
-
"getBluetoothPairs",
|
|
331
|
-
"getClipboard",
|
|
332
|
-
"getConnectedBluetoothDevices",
|
|
333
|
-
"getConnectedWifi",
|
|
334
|
-
"getEnterOptionsSync",
|
|
335
|
-
"getExtConfig",
|
|
336
|
-
"getExtConfigSync",
|
|
337
|
-
"getFileInfo",
|
|
338
|
-
"getFileSystemManager",
|
|
339
|
-
"getGeocoder",
|
|
340
|
-
"getImageInfo",
|
|
341
|
-
"getLaunchOptionsSync",
|
|
342
|
-
"getLeftButtonsBoundingClientRect",
|
|
343
|
-
"getLocalIPAddress",
|
|
344
|
-
"getLocation",
|
|
345
|
-
"getMapInfo",
|
|
346
|
-
"getMenuButtonBoundingClientRect",
|
|
347
|
-
"getNetworkType",
|
|
348
|
-
"getOpenUserInfo",
|
|
349
|
-
"getParentAppId",
|
|
350
|
-
"getParentAppIdSync",
|
|
351
|
-
"getPhoneNumber",
|
|
352
|
-
"getPluginIdSync",
|
|
353
|
-
"getRecorderManager",
|
|
354
|
-
"getRunData",
|
|
355
|
-
"getRunScene",
|
|
356
|
-
"getSavedFileInfo",
|
|
357
|
-
"getSavedFileList",
|
|
358
|
-
"getScreenBrightness",
|
|
359
|
-
"getServerTime",
|
|
360
|
-
"getSetting",
|
|
361
|
-
"getStorage",
|
|
362
|
-
"getStorageInfo",
|
|
363
|
-
"getStorageInfoSync",
|
|
364
|
-
"getStorageSync",
|
|
365
|
-
"getSystemInfo",
|
|
366
|
-
"getSystemInfoSync",
|
|
367
|
-
"getSystemSetting",
|
|
368
|
-
"getTitleColor",
|
|
369
|
-
"getUpdateManager",
|
|
370
|
-
"getVideoInfo",
|
|
371
|
-
"getWifiList",
|
|
372
|
-
"getWindowInfo",
|
|
373
|
-
"hideAddToDesktopMenu",
|
|
374
|
-
"hideAllAddToDesktopMenu",
|
|
375
|
-
"hideBackHome",
|
|
376
|
-
"hideKeyboard",
|
|
377
|
-
"hideLoading",
|
|
378
|
-
"hideNavigationBarLoading",
|
|
379
|
-
"hideShareMenu",
|
|
380
|
-
"hideTabBar",
|
|
381
|
-
"hideTabBarRedDot",
|
|
382
|
-
"hideToast",
|
|
383
|
-
"isScreenReaderEnabled",
|
|
384
|
-
"loadFontFace",
|
|
385
|
-
"loadPlugin",
|
|
386
|
-
"makeBluetoothPair",
|
|
387
|
-
"makePhoneCall",
|
|
388
|
-
"multiLevelSelect",
|
|
389
|
-
"navigateBack",
|
|
390
|
-
"navigateBackMiniProgram",
|
|
391
|
-
"navigateTo",
|
|
392
|
-
"navigateToMiniProgram",
|
|
393
|
-
"notifyBLECharacteristicValueChange",
|
|
394
|
-
"off",
|
|
395
|
-
"offAccelerometerChange",
|
|
396
|
-
"offAppHide",
|
|
397
|
-
"offAppShow",
|
|
398
|
-
"offAudioInterruptionBegin",
|
|
399
|
-
"offAudioInterruptionEnd",
|
|
400
|
-
"offBeaconServiceChange",
|
|
401
|
-
"offBeaconUpdate",
|
|
402
|
-
"offBLECharacteristicValueChange",
|
|
403
|
-
"offBLEConnectionStateChanged",
|
|
404
|
-
"offBluetoothAdapterStateChange",
|
|
405
|
-
"offBluetoothDeviceFound",
|
|
406
|
-
"offCompassChange",
|
|
407
|
-
"offComponentError",
|
|
408
|
-
"offDeviceMotionChange",
|
|
409
|
-
"offError",
|
|
410
|
-
"offGetWifiList",
|
|
411
|
-
"offGyroscopeChange",
|
|
412
|
-
"offLocatedComplete",
|
|
413
|
-
"offMemoryWarning",
|
|
414
|
-
"offNetworkStatusChange",
|
|
415
|
-
"offPageNotFound",
|
|
416
|
-
"offSocketClose",
|
|
417
|
-
"offSocketError",
|
|
418
|
-
"offSocketMessage",
|
|
419
|
-
"offSocketOpen",
|
|
420
|
-
"offUnhandledRejection",
|
|
421
|
-
"offUserCaptureScreen",
|
|
422
|
-
"offWifiConnected",
|
|
423
|
-
"on",
|
|
424
|
-
"onAccelerometerChange",
|
|
425
|
-
"onAppHide",
|
|
426
|
-
"onAppShow",
|
|
427
|
-
"onAudioInterruptionBegin",
|
|
428
|
-
"onAudioInterruptionEnd",
|
|
429
|
-
"onBeaconServiceChange",
|
|
430
|
-
"onBeaconUpdate",
|
|
431
|
-
"onBLECharacteristicValueChange",
|
|
432
|
-
"onBLEConnectionStateChanged",
|
|
433
|
-
"onBluetoothAdapterStateChange",
|
|
434
|
-
"onBluetoothDeviceFound",
|
|
435
|
-
"onCompassChange",
|
|
436
|
-
"onComponentError",
|
|
437
|
-
"onDeviceMotionChange",
|
|
438
|
-
"onError",
|
|
439
|
-
"onGetWifiList",
|
|
440
|
-
"onGyroscopeChange"
|
|
441
|
-
];
|
|
442
|
-
//#endregion
|
|
443
|
-
//#region src/core/apiCatalog/myMethodsOnLocatedCompleteToWriteBLECharacteristicValue.ts
|
|
444
|
-
/**
|
|
445
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
446
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
447
|
-
*/
|
|
448
|
-
const WEAPI_MY_METHODS_ON_LOCATED_COMPLETE_TO_WRITE_BLECHARACTERISTIC_VALUE = [
|
|
449
|
-
"onLocatedComplete",
|
|
450
|
-
"onMemoryWarning",
|
|
451
|
-
"onNetworkStatusChange",
|
|
452
|
-
"onPageNotFound",
|
|
453
|
-
"onSocketClose",
|
|
454
|
-
"onSocketError",
|
|
455
|
-
"onSocketMessage",
|
|
456
|
-
"onSocketOpen",
|
|
457
|
-
"onUnhandledRejection",
|
|
458
|
-
"onUserCaptureScreen",
|
|
459
|
-
"onWifiConnected",
|
|
460
|
-
"openBluetoothAdapter",
|
|
461
|
-
"openDocument",
|
|
462
|
-
"openKBVoucherDetail",
|
|
463
|
-
"openLocation",
|
|
464
|
-
"openMerchantTicketList",
|
|
465
|
-
"openMerchantVoucherList",
|
|
466
|
-
"openOtherApp",
|
|
467
|
-
"openSetting",
|
|
468
|
-
"openTicketDetail",
|
|
469
|
-
"openTicketList",
|
|
470
|
-
"openVoucherDetail",
|
|
471
|
-
"openVoucherList",
|
|
472
|
-
"optionsSelect",
|
|
473
|
-
"pageScrollTo",
|
|
474
|
-
"paySignCenter",
|
|
475
|
-
"previewImage",
|
|
476
|
-
"prompt",
|
|
477
|
-
"readBLECharacteristicValue",
|
|
478
|
-
"redirectTo",
|
|
479
|
-
"regionPicker",
|
|
480
|
-
"registerSSID",
|
|
481
|
-
"reLaunch",
|
|
482
|
-
"removeSavedFile",
|
|
483
|
-
"removeStorage",
|
|
484
|
-
"removeStorageSync",
|
|
485
|
-
"removeTabBarBadge",
|
|
486
|
-
"request",
|
|
487
|
-
"requestSubscribeMessage",
|
|
488
|
-
"rsa",
|
|
489
|
-
"saveFile",
|
|
490
|
-
"saveFileToDisk",
|
|
491
|
-
"saveImage",
|
|
492
|
-
"saveImageToPhotosAlbum",
|
|
493
|
-
"saveVideoToPhotosAlbum",
|
|
494
|
-
"scan",
|
|
495
|
-
"sendSocketMessage",
|
|
496
|
-
"setBackgroundColor",
|
|
497
|
-
"setBackgroundTextStyle",
|
|
498
|
-
"setBLEMTU",
|
|
499
|
-
"setCanPullDown",
|
|
500
|
-
"setClipboard",
|
|
501
|
-
"setKeepScreenOn",
|
|
502
|
-
"setLocatedCity",
|
|
503
|
-
"setNavigationBar",
|
|
504
|
-
"setNavigationBarBottomLineColor",
|
|
505
|
-
"setNavigationBarColor",
|
|
506
|
-
"setNavigationBarTitle",
|
|
507
|
-
"setScreenBrightness",
|
|
508
|
-
"setStorage",
|
|
509
|
-
"setStorageSync",
|
|
510
|
-
"setTabBarBadge",
|
|
511
|
-
"setTabBarItem",
|
|
512
|
-
"setTabBarStyle",
|
|
513
|
-
"setVisualEffectOnCapture",
|
|
514
|
-
"setWifiList",
|
|
515
|
-
"showActionSheet",
|
|
516
|
-
"showAuthGuide",
|
|
517
|
-
"showBLEPermissionGuide",
|
|
518
|
-
"showLoading",
|
|
519
|
-
"showModal",
|
|
520
|
-
"showNavigationBarLoading",
|
|
521
|
-
"showShareMenu",
|
|
522
|
-
"showSharePanel",
|
|
523
|
-
"showTabBar",
|
|
524
|
-
"showTabBarRedDot",
|
|
525
|
-
"showToast",
|
|
526
|
-
"startAccelerometer",
|
|
527
|
-
"startAPVerify",
|
|
528
|
-
"startBeaconDiscovery",
|
|
529
|
-
"startBluetoothDevicesDiscovery",
|
|
530
|
-
"startCompass",
|
|
531
|
-
"startGyroscope",
|
|
532
|
-
"startIfaaAuthentication",
|
|
533
|
-
"startPullDownRefresh",
|
|
534
|
-
"startWifi",
|
|
535
|
-
"stopAccelerometer",
|
|
536
|
-
"stopBeaconDiscovery",
|
|
537
|
-
"stopBluetoothDevicesDiscovery",
|
|
538
|
-
"stopCompass",
|
|
539
|
-
"stopGyroscope",
|
|
540
|
-
"stopPullDownRefresh",
|
|
541
|
-
"stopWifi",
|
|
542
|
-
"switchTab",
|
|
543
|
-
"tradePay",
|
|
544
|
-
"unregisterSSID",
|
|
545
|
-
"unsubscribeMessage",
|
|
546
|
-
"uploadFile",
|
|
547
|
-
"vibrate",
|
|
548
|
-
"vibrateLong",
|
|
549
|
-
"vibrateShort",
|
|
550
|
-
"watchShake",
|
|
551
|
-
"writeBLECharacteristicValue"
|
|
552
|
-
];
|
|
553
|
-
//#endregion
|
|
554
|
-
//#region src/core/apiCatalog/myMethods.ts
|
|
555
|
-
/**
|
|
556
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
557
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
558
|
-
*/
|
|
559
|
-
const WEAPI_MY_METHODS = [...WEAPI_MY_METHODS_ADD_PHONE_CONTACT_TO_ON_GYROSCOPE_CHANGE, ...WEAPI_MY_METHODS_ON_LOCATED_COMPLETE_TO_WRITE_BLECHARACTERISTIC_VALUE];
|
|
560
|
-
//#endregion
|
|
561
|
-
//#region src/core/apiCatalog/ttMethodsApplyEcCouponToUnsubscribeAllSpecifiedUserComment.ts
|
|
562
|
-
/**
|
|
563
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
564
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
565
|
-
*/
|
|
566
|
-
const WEAPI_TT_METHODS_APPLY_EC_COUPON_TO_UNSUBSCRIBE_ALL_SPECIFIED_USER_COMMENT = [
|
|
567
|
-
"applyEcCoupon",
|
|
568
|
-
"applyRefund",
|
|
569
|
-
"arrayBufferToBase64",
|
|
570
|
-
"authorize",
|
|
571
|
-
"base64ToArrayBuffer",
|
|
572
|
-
"canIPutStuffOverComponent",
|
|
573
|
-
"canIUse",
|
|
574
|
-
"canvasToTempFilePath",
|
|
575
|
-
"checkFollowAwemeState",
|
|
576
|
-
"checkFollowState",
|
|
577
|
-
"checkSession",
|
|
578
|
-
"chooseAddress",
|
|
579
|
-
"chooseImage",
|
|
580
|
-
"chooseLocation",
|
|
581
|
-
"chooseMedia",
|
|
582
|
-
"clearStorage",
|
|
583
|
-
"clearStorageSync",
|
|
584
|
-
"completePaySync",
|
|
585
|
-
"completeRefundSync",
|
|
586
|
-
"compressImage",
|
|
587
|
-
"connectSocket",
|
|
588
|
-
"continueToPay",
|
|
589
|
-
"createAnimation",
|
|
590
|
-
"createBytennEngineContext",
|
|
591
|
-
"createCanvasContext",
|
|
592
|
-
"createCloud",
|
|
593
|
-
"createInnerAudioContext",
|
|
594
|
-
"createIntersectionObserver",
|
|
595
|
-
"createInterstitialAd",
|
|
596
|
-
"createLivePlayerContext",
|
|
597
|
-
"createMapContext",
|
|
598
|
-
"createMediaRecorder",
|
|
599
|
-
"createMerchantOrder",
|
|
600
|
-
"createOffscreenCanvas",
|
|
601
|
-
"createOrder",
|
|
602
|
-
"createRefundOrder",
|
|
603
|
-
"createRewardedVideoAd",
|
|
604
|
-
"createRtcRoomContext",
|
|
605
|
-
"createSelectorQuery",
|
|
606
|
-
"createStickerManager",
|
|
607
|
-
"createVideoContext",
|
|
608
|
-
"createWorker",
|
|
609
|
-
"downloadFile",
|
|
610
|
-
"exitMiniProgram",
|
|
611
|
-
"followAwemeUser",
|
|
612
|
-
"followOfficialAccount",
|
|
613
|
-
"getAnalysisInfo",
|
|
614
|
-
"getBackgroundAudioManager",
|
|
615
|
-
"getClipboardData",
|
|
616
|
-
"getConnectedWifi",
|
|
617
|
-
"getCustomButtonBoundingClientRect",
|
|
618
|
-
"getEnvInfoSync",
|
|
619
|
-
"getExtConfig",
|
|
620
|
-
"getExtConfigSync",
|
|
621
|
-
"getFileInfo",
|
|
622
|
-
"getFileSystemManager",
|
|
623
|
-
"getImageInfo",
|
|
624
|
-
"getLaunchOptionsSync",
|
|
625
|
-
"getLiveUserInfo",
|
|
626
|
-
"getLocation",
|
|
627
|
-
"getMenuButtonBoundingClientRect",
|
|
628
|
-
"getMenuButtonLayout",
|
|
629
|
-
"getMicroappInfo",
|
|
630
|
-
"getRecorderManager",
|
|
631
|
-
"getRefundOrder",
|
|
632
|
-
"getRoomInfo",
|
|
633
|
-
"getSavedFileList",
|
|
634
|
-
"getScreenBrightness",
|
|
635
|
-
"getSelfCommentCountDuringPluginRunning",
|
|
636
|
-
"getSetting",
|
|
637
|
-
"getShopRecordToken",
|
|
638
|
-
"getSidebarActivity",
|
|
639
|
-
"getStorage",
|
|
640
|
-
"getStorageInfo",
|
|
641
|
-
"getStorageInfoSync",
|
|
642
|
-
"getStorageSync",
|
|
643
|
-
"getSystemInfo",
|
|
644
|
-
"getSystemInfoSync",
|
|
645
|
-
"getUpdateManager",
|
|
646
|
-
"getUserInfo",
|
|
647
|
-
"getUserProfile",
|
|
648
|
-
"getWifiList",
|
|
649
|
-
"hideHomeButton",
|
|
650
|
-
"hideInteractionBar",
|
|
651
|
-
"hideKeyboard",
|
|
652
|
-
"hideLoading",
|
|
653
|
-
"hideNavigationBarLoading",
|
|
654
|
-
"hideShareMenu",
|
|
655
|
-
"hideTabBar",
|
|
656
|
-
"hideTabBarRedDot",
|
|
657
|
-
"hideToast",
|
|
658
|
-
"isFollowingAnchor",
|
|
659
|
-
"login",
|
|
660
|
-
"makePhoneCall",
|
|
661
|
-
"navigateBack",
|
|
662
|
-
"navigateBackMiniProgram",
|
|
663
|
-
"navigateTo",
|
|
664
|
-
"navigateToMiniProgram",
|
|
665
|
-
"navigateToScene",
|
|
666
|
-
"navigateToVideoView",
|
|
667
|
-
"offAppHide",
|
|
668
|
-
"offAppShow",
|
|
669
|
-
"offCompassChange",
|
|
670
|
-
"offError",
|
|
671
|
-
"offGetWifiList",
|
|
672
|
-
"offLazyLoadError",
|
|
673
|
-
"offNetworkStatusChange",
|
|
674
|
-
"offPageNotFound",
|
|
675
|
-
"offUnhandledRejection",
|
|
676
|
-
"offUserCaptureScreen",
|
|
677
|
-
"offWindowResize",
|
|
678
|
-
"onAccelerometerChange",
|
|
679
|
-
"onAppHide",
|
|
680
|
-
"onAppShow",
|
|
681
|
-
"onCompassChange",
|
|
682
|
-
"onError",
|
|
683
|
-
"onGetWifiList",
|
|
684
|
-
"onLazyLoadError",
|
|
685
|
-
"onMemoryWarning",
|
|
686
|
-
"onNetworkStatusChange",
|
|
687
|
-
"onPageNotFound",
|
|
688
|
-
"onReceiveAudiencesFollowAction",
|
|
689
|
-
"onReceiveSpecifiedComment",
|
|
690
|
-
"onUnhandledRejection",
|
|
691
|
-
"onUserCaptureScreen",
|
|
692
|
-
"onWindowResize",
|
|
693
|
-
"openAwemeUserProfile",
|
|
694
|
-
"openLocation",
|
|
695
|
-
"openSetting",
|
|
696
|
-
"pageScrollTo",
|
|
697
|
-
"pay",
|
|
698
|
-
"preloadDrawAd",
|
|
699
|
-
"prerenderVideo",
|
|
700
|
-
"previewImage",
|
|
701
|
-
"redirectTo",
|
|
702
|
-
"reLaunch",
|
|
703
|
-
"removeSavedFile",
|
|
704
|
-
"removeStorage",
|
|
705
|
-
"removeStorageSync",
|
|
706
|
-
"removeTabBarBadge",
|
|
707
|
-
"reportAnalytics",
|
|
708
|
-
"request",
|
|
709
|
-
"requestSubscribeMessage",
|
|
710
|
-
"saveFile",
|
|
711
|
-
"saveImageToPhotosAlbum",
|
|
712
|
-
"scanCode",
|
|
713
|
-
"setClipboardData",
|
|
714
|
-
"setKeepScreenOn",
|
|
715
|
-
"setNavigationBarColor",
|
|
716
|
-
"setNavigationBarTitle",
|
|
717
|
-
"setScreenBrightness",
|
|
718
|
-
"setStorage",
|
|
719
|
-
"setStorageSync",
|
|
720
|
-
"setTabBarBadge",
|
|
721
|
-
"setTabBarItem",
|
|
722
|
-
"setTabBarStyle",
|
|
723
|
-
"showActionSheet",
|
|
724
|
-
"showDouyinOpenAuth",
|
|
725
|
-
"showFavoriteGuide",
|
|
726
|
-
"showInteractionBar",
|
|
727
|
-
"showLoading",
|
|
728
|
-
"showModal",
|
|
729
|
-
"showNavigationBarLoading",
|
|
730
|
-
"showShareMenu",
|
|
731
|
-
"showTabBar",
|
|
732
|
-
"showTabBarRedDot",
|
|
733
|
-
"showToast",
|
|
734
|
-
"startAccelerometer",
|
|
735
|
-
"startCompass",
|
|
736
|
-
"startPullDownRefresh",
|
|
737
|
-
"stopAccelerometer",
|
|
738
|
-
"stopCompass",
|
|
739
|
-
"stopPullDownRefresh",
|
|
740
|
-
"submitEcCustomGoods",
|
|
741
|
-
"subscribeAudiencesFollowAction",
|
|
742
|
-
"subscribeSpecifiedContentComment",
|
|
743
|
-
"subscribeSpecifiedUserComment",
|
|
744
|
-
"switchTab",
|
|
745
|
-
"unsubscribeAllSpecifiedContentComment",
|
|
746
|
-
"unsubscribeAllSpecifiedUserComment"
|
|
747
|
-
];
|
|
748
|
-
//#endregion
|
|
749
|
-
//#region src/core/apiCatalog/ttMethodsUnsubscribeAudiencesFollowActionToVibrateShort.ts
|
|
750
|
-
/**
|
|
751
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
752
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
753
|
-
*/
|
|
754
|
-
const WEAPI_TT_METHODS_UNSUBSCRIBE_AUDIENCES_FOLLOW_ACTION_TO_VIBRATE_SHORT = [
|
|
755
|
-
"unsubscribeAudiencesFollowAction",
|
|
756
|
-
"updateExitGuideWindowInfo",
|
|
757
|
-
"updateShopMemberPoints",
|
|
758
|
-
"updateSidebarActivity",
|
|
759
|
-
"uploadFile",
|
|
760
|
-
"vibrateLong",
|
|
761
|
-
"vibrateShort"
|
|
762
|
-
];
|
|
763
|
-
//#endregion
|
|
764
|
-
//#region src/core/apiCatalog/ttMethods.ts
|
|
765
|
-
/**
|
|
766
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
767
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
768
|
-
*/
|
|
769
|
-
const WEAPI_TT_METHODS = [...WEAPI_TT_METHODS_APPLY_EC_COUPON_TO_UNSUBSCRIBE_ALL_SPECIFIED_USER_COMMENT, ...WEAPI_TT_METHODS_UNSUBSCRIBE_AUDIENCES_FOLLOW_ACTION_TO_VIBRATE_SHORT];
|
|
770
|
-
//#endregion
|
|
771
|
-
//#region src/core/apiCatalog/typeSources.ts
|
|
772
|
-
/**
|
|
773
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
774
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
775
|
-
*/
|
|
776
|
-
const WEAPI_TYPE_SOURCES = {
|
|
777
|
-
default: {
|
|
778
|
-
package: "miniprogram-api-typings",
|
|
779
|
-
version: "5.2.3"
|
|
780
|
-
},
|
|
781
|
-
wechat: {
|
|
782
|
-
package: "miniprogram-api-typings",
|
|
783
|
-
version: "5.2.3"
|
|
784
|
-
},
|
|
785
|
-
alipay: {
|
|
786
|
-
package: "@mini-types/alipay",
|
|
787
|
-
version: "3.0.14"
|
|
788
|
-
},
|
|
789
|
-
douyin: {
|
|
790
|
-
package: "@douyin-microapp/typings",
|
|
791
|
-
version: "1.3.1"
|
|
792
|
-
},
|
|
793
|
-
wx: {
|
|
794
|
-
package: "miniprogram-api-typings",
|
|
795
|
-
version: "5.2.3"
|
|
796
|
-
},
|
|
797
|
-
my: {
|
|
798
|
-
package: "@mini-types/alipay",
|
|
799
|
-
version: "3.0.14"
|
|
800
|
-
},
|
|
801
|
-
tt: {
|
|
802
|
-
package: "@douyin-microapp/typings",
|
|
803
|
-
version: "1.3.1"
|
|
804
|
-
}
|
|
805
|
-
};
|
|
806
|
-
const WEAPI_PLATFORM_TYPE_SOURCES = {
|
|
807
|
-
default: WEAPI_TYPE_SOURCES.default,
|
|
808
|
-
wechat: WEAPI_TYPE_SOURCES.wechat,
|
|
809
|
-
alipay: WEAPI_TYPE_SOURCES.alipay,
|
|
810
|
-
douyin: WEAPI_TYPE_SOURCES.douyin
|
|
811
|
-
};
|
|
812
|
-
const WEAPI_RUNTIME_TYPE_SOURCES = {
|
|
813
|
-
wx: WEAPI_TYPE_SOURCES.wx,
|
|
814
|
-
my: WEAPI_TYPE_SOURCES.my,
|
|
815
|
-
tt: WEAPI_TYPE_SOURCES.tt
|
|
816
|
-
};
|
|
817
|
-
//#endregion
|
|
818
|
-
//#region src/core/apiCatalog/wxMethodsAddCardToHideShareMenu.ts
|
|
819
|
-
/**
|
|
820
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
821
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
822
|
-
*/
|
|
823
|
-
const WEAPI_WX_METHODS_ADD_CARD_TO_HIDE_SHARE_MENU = [
|
|
824
|
-
"addCard",
|
|
825
|
-
"addFileToFavorites",
|
|
826
|
-
"addPaymentPassFinish",
|
|
827
|
-
"addPaymentPassGetCertificateData",
|
|
828
|
-
"addPhoneCalendar",
|
|
829
|
-
"addPhoneContact",
|
|
830
|
-
"addPhoneRepeatCalendar",
|
|
831
|
-
"addVideoToFavorites",
|
|
832
|
-
"arrayBufferToBase64",
|
|
833
|
-
"authorize",
|
|
834
|
-
"authorizeForMiniProgram",
|
|
835
|
-
"authPrivateMessage",
|
|
836
|
-
"base64ToArrayBuffer",
|
|
837
|
-
"batchGetStorage",
|
|
838
|
-
"batchGetStorageSync",
|
|
839
|
-
"batchSetStorage",
|
|
840
|
-
"batchSetStorageSync",
|
|
841
|
-
"bindEmployeeRelation",
|
|
842
|
-
"canAddSecureElementPass",
|
|
843
|
-
"cancelIdleCallback",
|
|
844
|
-
"canIUse",
|
|
845
|
-
"canvasGetImageData",
|
|
846
|
-
"canvasPutImageData",
|
|
847
|
-
"canvasToTempFilePath",
|
|
848
|
-
"checkDeviceSupportHevc",
|
|
849
|
-
"checkEmployeeRelation",
|
|
850
|
-
"checkIsAddedToMyMiniProgram",
|
|
851
|
-
"checkIsOpenAccessibility",
|
|
852
|
-
"checkIsPictureInPictureActive",
|
|
853
|
-
"checkIsSoterEnrolledInDevice",
|
|
854
|
-
"checkIsSupportFacialRecognition",
|
|
855
|
-
"checkIsSupportSoterAuthentication",
|
|
856
|
-
"checkSession",
|
|
857
|
-
"checkTransitCardSupport",
|
|
858
|
-
"chooseAddress",
|
|
859
|
-
"chooseContact",
|
|
860
|
-
"chooseImage",
|
|
861
|
-
"chooseInvoice",
|
|
862
|
-
"chooseInvoiceTitle",
|
|
863
|
-
"chooseLicensePlate",
|
|
864
|
-
"chooseLocation",
|
|
865
|
-
"chooseMedia",
|
|
866
|
-
"chooseMessageFile",
|
|
867
|
-
"choosePoi",
|
|
868
|
-
"chooseVideo",
|
|
869
|
-
"clearStorage",
|
|
870
|
-
"clearStorageSync",
|
|
871
|
-
"closeBLEConnection",
|
|
872
|
-
"closeBluetoothAdapter",
|
|
873
|
-
"closeSocket",
|
|
874
|
-
"compressImage",
|
|
875
|
-
"compressVideo",
|
|
876
|
-
"connectSocket",
|
|
877
|
-
"connectWifi",
|
|
878
|
-
"createAnimation",
|
|
879
|
-
"createAudioContext",
|
|
880
|
-
"createBLEConnection",
|
|
881
|
-
"createBLEPeripheralServer",
|
|
882
|
-
"createBufferURL",
|
|
883
|
-
"createCacheManager",
|
|
884
|
-
"createCameraContext",
|
|
885
|
-
"createCanvasContext",
|
|
886
|
-
"createGlobalPayment",
|
|
887
|
-
"createInferenceSession",
|
|
888
|
-
"createInnerAudioContext",
|
|
889
|
-
"createIntersectionObserver",
|
|
890
|
-
"createInterstitialAd",
|
|
891
|
-
"createLivePlayerContext",
|
|
892
|
-
"createLivePusherContext",
|
|
893
|
-
"createMapContext",
|
|
894
|
-
"createMediaAudioPlayer",
|
|
895
|
-
"createMediaContainer",
|
|
896
|
-
"createMediaRecorder",
|
|
897
|
-
"createOffscreenCanvas",
|
|
898
|
-
"createRewardedVideoAd",
|
|
899
|
-
"createSelectorQuery",
|
|
900
|
-
"createTCPSocket",
|
|
901
|
-
"createUDPSocket",
|
|
902
|
-
"createVideoContext",
|
|
903
|
-
"createVideoDecoder",
|
|
904
|
-
"createVKSession",
|
|
905
|
-
"createWebAudioContext",
|
|
906
|
-
"createWorker",
|
|
907
|
-
"cropImage",
|
|
908
|
-
"deleteTransitCard",
|
|
909
|
-
"disableAlertBeforeUnload",
|
|
910
|
-
"downloadFile",
|
|
911
|
-
"editImage",
|
|
912
|
-
"enableAlertBeforeUnload",
|
|
913
|
-
"enterChatToolMode",
|
|
914
|
-
"exitMiniProgram",
|
|
915
|
-
"exitVoIPChat",
|
|
916
|
-
"faceDetect",
|
|
917
|
-
"getAccountInfoSync",
|
|
918
|
-
"getApiCategory",
|
|
919
|
-
"getAppAuthorizeSetting",
|
|
920
|
-
"getAppBaseInfo",
|
|
921
|
-
"getAvailableAudioSources",
|
|
922
|
-
"getBackgroundAudioManager",
|
|
923
|
-
"getBackgroundAudioPlayerState",
|
|
924
|
-
"getBackgroundFetchData",
|
|
925
|
-
"getBackgroundFetchToken",
|
|
926
|
-
"getBatteryInfo",
|
|
927
|
-
"getBatteryInfoSync",
|
|
928
|
-
"getBeacons",
|
|
929
|
-
"getBLEDeviceCharacteristics",
|
|
930
|
-
"getBLEDeviceRSSI",
|
|
931
|
-
"getBLEDeviceServices",
|
|
932
|
-
"getBLEMTU",
|
|
933
|
-
"getBluetoothAdapterState",
|
|
934
|
-
"getBluetoothDevices",
|
|
935
|
-
"getChannelsLiveInfo",
|
|
936
|
-
"getChannelsLiveNoticeInfo",
|
|
937
|
-
"getChannelsShareKey",
|
|
938
|
-
"getChatToolInfo",
|
|
939
|
-
"getClipboardData",
|
|
940
|
-
"getCommonConfig",
|
|
941
|
-
"getConnectedBluetoothDevices",
|
|
942
|
-
"getConnectedWifi",
|
|
943
|
-
"getDeviceBenchmarkInfo",
|
|
944
|
-
"getDeviceInfo",
|
|
945
|
-
"getDeviceVoIPList",
|
|
946
|
-
"getEnterOptionsSync",
|
|
947
|
-
"getExptInfoSync",
|
|
948
|
-
"getExtConfig",
|
|
949
|
-
"getExtConfigSync",
|
|
950
|
-
"getFileSystemManager",
|
|
951
|
-
"getFuzzyLocation",
|
|
952
|
-
"getGroupEnterInfo",
|
|
953
|
-
"getHCEState",
|
|
954
|
-
"getImageInfo",
|
|
955
|
-
"getInferenceEnvInfo",
|
|
956
|
-
"getLaunchOptionsSync",
|
|
957
|
-
"getLocalIPAddress",
|
|
958
|
-
"getLocation",
|
|
959
|
-
"getLogManager",
|
|
960
|
-
"getMenuButtonBoundingClientRect",
|
|
961
|
-
"getNetworkType",
|
|
962
|
-
"getNFCAdapter",
|
|
963
|
-
"getPerformance",
|
|
964
|
-
"getPluginUpdateManager",
|
|
965
|
-
"getPrivacySetting",
|
|
966
|
-
"getRandomValues",
|
|
967
|
-
"getRealtimeLogManager",
|
|
968
|
-
"getRecorderManager",
|
|
969
|
-
"getRendererUserAgent",
|
|
970
|
-
"getScreenBrightness",
|
|
971
|
-
"getScreenRecordingState",
|
|
972
|
-
"getSecureElementPasses",
|
|
973
|
-
"getSelectedTextRange",
|
|
974
|
-
"getSetting",
|
|
975
|
-
"getShareInfo",
|
|
976
|
-
"getShowSplashAdStatus",
|
|
977
|
-
"getSkylineInfo",
|
|
978
|
-
"getSkylineInfoSync",
|
|
979
|
-
"getStorage",
|
|
980
|
-
"getStorageInfo",
|
|
981
|
-
"getStorageInfoSync",
|
|
982
|
-
"getStorageSync",
|
|
983
|
-
"getSystemInfo",
|
|
984
|
-
"getSystemInfoAsync",
|
|
985
|
-
"getSystemInfoSync",
|
|
986
|
-
"getSystemSetting",
|
|
987
|
-
"getTransitCardCPLC",
|
|
988
|
-
"getTransitCardInfo",
|
|
989
|
-
"getTransitCardList",
|
|
990
|
-
"getUpdateManager",
|
|
991
|
-
"getUserCryptoManager",
|
|
992
|
-
"getUserInfo",
|
|
993
|
-
"getUserProfile",
|
|
994
|
-
"getVideoInfo",
|
|
995
|
-
"getWeRunData",
|
|
996
|
-
"getWifiList",
|
|
997
|
-
"getWindowInfo",
|
|
998
|
-
"getXrFrameSystem",
|
|
999
|
-
"hideHomeButton",
|
|
1000
|
-
"hideKeyboard",
|
|
1001
|
-
"hideLoading",
|
|
1002
|
-
"hideNavigationBarLoading",
|
|
1003
|
-
"hideShareMenu"
|
|
1004
|
-
];
|
|
1005
|
-
//#endregion
|
|
1006
|
-
//#region src/core/apiCatalog/wxMethodsHideTabBarToOpenStoreCouponDetail.ts
|
|
1007
|
-
/**
|
|
1008
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
1009
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
1010
|
-
*/
|
|
1011
|
-
const WEAPI_WX_METHODS_HIDE_TAB_BAR_TO_OPEN_STORE_COUPON_DETAIL = [
|
|
1012
|
-
"hideTabBar",
|
|
1013
|
-
"hideTabBarRedDot",
|
|
1014
|
-
"hideToast",
|
|
1015
|
-
"initFaceDetect",
|
|
1016
|
-
"isBluetoothDevicePaired",
|
|
1017
|
-
"issueTransitCard",
|
|
1018
|
-
"isVKSupport",
|
|
1019
|
-
"join1v1Chat",
|
|
1020
|
-
"joinVoIPChat",
|
|
1021
|
-
"jumpToOfflinePay",
|
|
1022
|
-
"loadBuiltInFontFace",
|
|
1023
|
-
"loadFontFace",
|
|
1024
|
-
"login",
|
|
1025
|
-
"makeBluetoothPair",
|
|
1026
|
-
"makePhoneCall",
|
|
1027
|
-
"navigateBack",
|
|
1028
|
-
"navigateBackMiniProgram",
|
|
1029
|
-
"navigateTo",
|
|
1030
|
-
"navigateToMiniProgram",
|
|
1031
|
-
"nextTick",
|
|
1032
|
-
"notifyBLECharacteristicValueChange",
|
|
1033
|
-
"notifyGroupMembers",
|
|
1034
|
-
"offAccelerometerChange",
|
|
1035
|
-
"offAfterPageLoad",
|
|
1036
|
-
"offAfterPageUnload",
|
|
1037
|
-
"offApiCategoryChange",
|
|
1038
|
-
"offAppHide",
|
|
1039
|
-
"offAppRoute",
|
|
1040
|
-
"offAppRouteDone",
|
|
1041
|
-
"offAppShow",
|
|
1042
|
-
"offAudioInterruptionBegin",
|
|
1043
|
-
"offAudioInterruptionEnd",
|
|
1044
|
-
"offBatteryInfoChange",
|
|
1045
|
-
"offBeaconServiceChange",
|
|
1046
|
-
"offBeaconUpdate",
|
|
1047
|
-
"offBeforeAppRoute",
|
|
1048
|
-
"offBeforePageLoad",
|
|
1049
|
-
"offBeforePageUnload",
|
|
1050
|
-
"offBLECharacteristicValueChange",
|
|
1051
|
-
"offBLEConnectionStateChange",
|
|
1052
|
-
"offBLEMTUChange",
|
|
1053
|
-
"offBLEPeripheralConnectionStateChanged",
|
|
1054
|
-
"offBluetoothAdapterStateChange",
|
|
1055
|
-
"offBluetoothDeviceFound",
|
|
1056
|
-
"offCompassChange",
|
|
1057
|
-
"offCopyUrl",
|
|
1058
|
-
"offDeviceMotionChange",
|
|
1059
|
-
"offEmbeddedMiniProgramHeightChange",
|
|
1060
|
-
"offError",
|
|
1061
|
-
"offGeneratePoster",
|
|
1062
|
-
"offGetWifiList",
|
|
1063
|
-
"offGyroscopeChange",
|
|
1064
|
-
"offHCEMessage",
|
|
1065
|
-
"offKeyboardHeightChange",
|
|
1066
|
-
"offKeyDown",
|
|
1067
|
-
"offKeyUp",
|
|
1068
|
-
"offLazyLoadError",
|
|
1069
|
-
"offLocalServiceDiscoveryStop",
|
|
1070
|
-
"offLocalServiceFound",
|
|
1071
|
-
"offLocalServiceLost",
|
|
1072
|
-
"offLocalServiceResolveFail",
|
|
1073
|
-
"offLocationChange",
|
|
1074
|
-
"offLocationChangeError",
|
|
1075
|
-
"offMemoryWarning",
|
|
1076
|
-
"offMenuButtonBoundingClientRectWeightChange",
|
|
1077
|
-
"offNetworkStatusChange",
|
|
1078
|
-
"offNetworkWeakChange",
|
|
1079
|
-
"offPageNotFound",
|
|
1080
|
-
"offParallelStateChange",
|
|
1081
|
-
"offScreenRecordingStateChanged",
|
|
1082
|
-
"offThemeChange",
|
|
1083
|
-
"offUnhandledRejection",
|
|
1084
|
-
"offUserCaptureScreen",
|
|
1085
|
-
"offUserOffTranslation",
|
|
1086
|
-
"offUserTriggerTranslation",
|
|
1087
|
-
"offVoIPChatInterrupted",
|
|
1088
|
-
"offVoIPChatMembersChanged",
|
|
1089
|
-
"offVoIPChatSpeakersChanged",
|
|
1090
|
-
"offVoIPChatStateChanged",
|
|
1091
|
-
"offVoIPVideoMembersChanged",
|
|
1092
|
-
"offWifiConnected",
|
|
1093
|
-
"offWifiConnectedWithPartialInfo",
|
|
1094
|
-
"offWindowResize",
|
|
1095
|
-
"offWindowStateChange",
|
|
1096
|
-
"onAccelerometerChange",
|
|
1097
|
-
"onAfterPageLoad",
|
|
1098
|
-
"onAfterPageUnload",
|
|
1099
|
-
"onApiCategoryChange",
|
|
1100
|
-
"onAppHide",
|
|
1101
|
-
"onAppRoute",
|
|
1102
|
-
"onAppRouteDone",
|
|
1103
|
-
"onAppShow",
|
|
1104
|
-
"onAudioInterruptionBegin",
|
|
1105
|
-
"onAudioInterruptionEnd",
|
|
1106
|
-
"onBackgroundAudioPause",
|
|
1107
|
-
"onBackgroundAudioPlay",
|
|
1108
|
-
"onBackgroundAudioStop",
|
|
1109
|
-
"onBackgroundFetchData",
|
|
1110
|
-
"onBatteryInfoChange",
|
|
1111
|
-
"onBeaconServiceChange",
|
|
1112
|
-
"onBeaconUpdate",
|
|
1113
|
-
"onBeforeAppRoute",
|
|
1114
|
-
"onBeforePageLoad",
|
|
1115
|
-
"onBeforePageUnload",
|
|
1116
|
-
"onBLECharacteristicValueChange",
|
|
1117
|
-
"onBLEConnectionStateChange",
|
|
1118
|
-
"onBLEMTUChange",
|
|
1119
|
-
"onBLEPeripheralConnectionStateChanged",
|
|
1120
|
-
"onBluetoothAdapterStateChange",
|
|
1121
|
-
"onBluetoothDeviceFound",
|
|
1122
|
-
"onCompassChange",
|
|
1123
|
-
"onCopyUrl",
|
|
1124
|
-
"onDeviceMotionChange",
|
|
1125
|
-
"onEmbeddedMiniProgramHeightChange",
|
|
1126
|
-
"onError",
|
|
1127
|
-
"onGeneratePoster",
|
|
1128
|
-
"onGetWifiList",
|
|
1129
|
-
"onGyroscopeChange",
|
|
1130
|
-
"onHCEMessage",
|
|
1131
|
-
"onKeyboardHeightChange",
|
|
1132
|
-
"onKeyDown",
|
|
1133
|
-
"onKeyUp",
|
|
1134
|
-
"onLazyLoadError",
|
|
1135
|
-
"onLocalServiceDiscoveryStop",
|
|
1136
|
-
"onLocalServiceFound",
|
|
1137
|
-
"onLocalServiceLost",
|
|
1138
|
-
"onLocalServiceResolveFail",
|
|
1139
|
-
"onLocationChange",
|
|
1140
|
-
"onLocationChangeError",
|
|
1141
|
-
"onMemoryWarning",
|
|
1142
|
-
"onMenuButtonBoundingClientRectWeightChange",
|
|
1143
|
-
"onNeedPrivacyAuthorization",
|
|
1144
|
-
"onNetworkStatusChange",
|
|
1145
|
-
"onNetworkWeakChange",
|
|
1146
|
-
"onPageNotFound",
|
|
1147
|
-
"onParallelStateChange",
|
|
1148
|
-
"onScreenRecordingStateChanged",
|
|
1149
|
-
"onSocketClose",
|
|
1150
|
-
"onSocketError",
|
|
1151
|
-
"onSocketMessage",
|
|
1152
|
-
"onSocketOpen",
|
|
1153
|
-
"onThemeChange",
|
|
1154
|
-
"onUnhandledRejection",
|
|
1155
|
-
"onUserCaptureScreen",
|
|
1156
|
-
"onUserOffTranslation",
|
|
1157
|
-
"onUserTriggerTranslation",
|
|
1158
|
-
"onVoIPChatInterrupted",
|
|
1159
|
-
"onVoIPChatMembersChanged",
|
|
1160
|
-
"onVoIPChatSpeakersChanged",
|
|
1161
|
-
"onVoIPChatStateChanged",
|
|
1162
|
-
"onVoIPVideoMembersChanged",
|
|
1163
|
-
"onWifiConnected",
|
|
1164
|
-
"onWifiConnectedWithPartialInfo",
|
|
1165
|
-
"onWindowResize",
|
|
1166
|
-
"onWindowStateChange",
|
|
1167
|
-
"openAppAuthorizeSetting",
|
|
1168
|
-
"openBluetoothAdapter",
|
|
1169
|
-
"openCard",
|
|
1170
|
-
"openChannelsActivity",
|
|
1171
|
-
"openChannelsEvent",
|
|
1172
|
-
"openChannelsLive",
|
|
1173
|
-
"openChannelsLiveNoticeInfo",
|
|
1174
|
-
"openChannelsUserProfile",
|
|
1175
|
-
"openChatTool",
|
|
1176
|
-
"openCustomerServiceChat",
|
|
1177
|
-
"openDesignerProfile",
|
|
1178
|
-
"openDocument",
|
|
1179
|
-
"openEmbeddedMiniProgram",
|
|
1180
|
-
"openHKOfflinePayView",
|
|
1181
|
-
"openInquiriesTopic",
|
|
1182
|
-
"openLocation",
|
|
1183
|
-
"openOfficialAccountArticle",
|
|
1184
|
-
"openOfficialAccountChat",
|
|
1185
|
-
"openOfficialAccountProfile",
|
|
1186
|
-
"openPrivacyContract",
|
|
1187
|
-
"openSetting",
|
|
1188
|
-
"openSingleStickerView",
|
|
1189
|
-
"openStickerIPView",
|
|
1190
|
-
"openStickerSetView",
|
|
1191
|
-
"openStoreCouponDetail"
|
|
1192
|
-
];
|
|
1193
|
-
//#endregion
|
|
1194
|
-
//#region src/core/apiCatalog/wxMethodsOpenStoreOrderDetailToWriteBLECharacteristicValue.ts
|
|
1195
|
-
/**
|
|
1196
|
-
* @description 三端 API 名单(由 typings 自动提取,请勿手工修改)
|
|
1197
|
-
* @generated by scripts/sync-api-catalog.mjs
|
|
1198
|
-
*/
|
|
1199
|
-
const WEAPI_WX_METHODS_OPEN_STORE_ORDER_DETAIL_TO_WRITE_BLECHARACTERISTIC_VALUE = [
|
|
1200
|
-
"openStoreOrderDetail",
|
|
1201
|
-
"openSystemBluetoothSetting",
|
|
1202
|
-
"openVideoEditor",
|
|
1203
|
-
"pageScrollTo",
|
|
1204
|
-
"pauseBackgroundAudio",
|
|
1205
|
-
"pauseVoice",
|
|
1206
|
-
"playBackgroundAudio",
|
|
1207
|
-
"playVoice",
|
|
1208
|
-
"pluginLogin",
|
|
1209
|
-
"postMessageToReferrerMiniProgram",
|
|
1210
|
-
"postMessageToReferrerPage",
|
|
1211
|
-
"preDownloadSubpackage",
|
|
1212
|
-
"preloadAssets",
|
|
1213
|
-
"preloadSkylineView",
|
|
1214
|
-
"preloadWebview",
|
|
1215
|
-
"previewImage",
|
|
1216
|
-
"previewMedia",
|
|
1217
|
-
"readBLECharacteristicValue",
|
|
1218
|
-
"rechargeTransitCard",
|
|
1219
|
-
"redirectTo",
|
|
1220
|
-
"reLaunch",
|
|
1221
|
-
"removeSecureElementPass",
|
|
1222
|
-
"removeStorage",
|
|
1223
|
-
"removeStorageSync",
|
|
1224
|
-
"removeTabBarBadge",
|
|
1225
|
-
"reportAnalytics",
|
|
1226
|
-
"reportEvent",
|
|
1227
|
-
"reportMonitor",
|
|
1228
|
-
"reportPerformance",
|
|
1229
|
-
"request",
|
|
1230
|
-
"requestAppleSubscribeSign",
|
|
1231
|
-
"requestCommonPayment",
|
|
1232
|
-
"requestDeviceVoIP",
|
|
1233
|
-
"requestFacialVerify",
|
|
1234
|
-
"requestIdleCallback",
|
|
1235
|
-
"requestMerchantTransfer",
|
|
1236
|
-
"requestOrderPayment",
|
|
1237
|
-
"requestPayment",
|
|
1238
|
-
"requestPluginPayment",
|
|
1239
|
-
"requestSubscribeDeviceMessage",
|
|
1240
|
-
"requestSubscribeEmployeeMessage",
|
|
1241
|
-
"requestSubscribeMessage",
|
|
1242
|
-
"requestVirtualPayment",
|
|
1243
|
-
"requirePrivacyAuthorize",
|
|
1244
|
-
"reserveChannelsLive",
|
|
1245
|
-
"restartMiniProgram",
|
|
1246
|
-
"revokeBufferURL",
|
|
1247
|
-
"rewriteRoute",
|
|
1248
|
-
"saveFileToDisk",
|
|
1249
|
-
"saveImageToPhotosAlbum",
|
|
1250
|
-
"saveVideoToPhotosAlbum",
|
|
1251
|
-
"scanCode",
|
|
1252
|
-
"seekBackgroundAudio",
|
|
1253
|
-
"selectGroupMembers",
|
|
1254
|
-
"sendHCEMessage",
|
|
1255
|
-
"sendSms",
|
|
1256
|
-
"sendSocketMessage",
|
|
1257
|
-
"setBackgroundColor",
|
|
1258
|
-
"setBackgroundFetchToken",
|
|
1259
|
-
"setBackgroundTextStyle",
|
|
1260
|
-
"setBLEMTU",
|
|
1261
|
-
"setClipboardData",
|
|
1262
|
-
"setEnable1v1Chat",
|
|
1263
|
-
"setEnableDebug",
|
|
1264
|
-
"setInnerAudioOption",
|
|
1265
|
-
"setKeepScreenOn",
|
|
1266
|
-
"setNavigationBarColor",
|
|
1267
|
-
"setNavigationBarTitle",
|
|
1268
|
-
"setScreenBrightness",
|
|
1269
|
-
"setStorage",
|
|
1270
|
-
"setStorageSync",
|
|
1271
|
-
"setTabBarBadge",
|
|
1272
|
-
"setTabBarItem",
|
|
1273
|
-
"setTabBarStyle",
|
|
1274
|
-
"setTopBarText",
|
|
1275
|
-
"setVisualEffectOnCapture",
|
|
1276
|
-
"setWifiList",
|
|
1277
|
-
"setWindowSize",
|
|
1278
|
-
"shareAppMessageToGroup",
|
|
1279
|
-
"shareEmojiToGroup",
|
|
1280
|
-
"shareFileMessage",
|
|
1281
|
-
"shareFileToGroup",
|
|
1282
|
-
"shareImageToGroup",
|
|
1283
|
-
"shareToOfficialAccount",
|
|
1284
|
-
"shareToWeRun",
|
|
1285
|
-
"shareVideoMessage",
|
|
1286
|
-
"shareVideoToGroup",
|
|
1287
|
-
"showActionSheet",
|
|
1288
|
-
"showLoading",
|
|
1289
|
-
"showModal",
|
|
1290
|
-
"showNavigationBarLoading",
|
|
1291
|
-
"showRedPackage",
|
|
1292
|
-
"showShareImageMenu",
|
|
1293
|
-
"showShareMenu",
|
|
1294
|
-
"showTabBar",
|
|
1295
|
-
"showTabBarRedDot",
|
|
1296
|
-
"showToast",
|
|
1297
|
-
"startAccelerometer",
|
|
1298
|
-
"startBeaconDiscovery",
|
|
1299
|
-
"startBluetoothDevicesDiscovery",
|
|
1300
|
-
"startCompass",
|
|
1301
|
-
"startDeviceMotionListening",
|
|
1302
|
-
"startGyroscope",
|
|
1303
|
-
"startHCE",
|
|
1304
|
-
"startLocalServiceDiscovery",
|
|
1305
|
-
"startLocationUpdate",
|
|
1306
|
-
"startLocationUpdateBackground",
|
|
1307
|
-
"startPullDownRefresh",
|
|
1308
|
-
"startRecord",
|
|
1309
|
-
"startSoterAuthentication",
|
|
1310
|
-
"startWifi",
|
|
1311
|
-
"stopAccelerometer",
|
|
1312
|
-
"stopBackgroundAudio",
|
|
1313
|
-
"stopBeaconDiscovery",
|
|
1314
|
-
"stopBluetoothDevicesDiscovery",
|
|
1315
|
-
"stopCompass",
|
|
1316
|
-
"stopDeviceMotionListening",
|
|
1317
|
-
"stopFaceDetect",
|
|
1318
|
-
"stopGyroscope",
|
|
1319
|
-
"stopHCE",
|
|
1320
|
-
"stopLocalServiceDiscovery",
|
|
1321
|
-
"stopLocationUpdate",
|
|
1322
|
-
"stopPullDownRefresh",
|
|
1323
|
-
"stopRecord",
|
|
1324
|
-
"stopVoice",
|
|
1325
|
-
"stopWifi",
|
|
1326
|
-
"subscribeVoIPVideoMembers",
|
|
1327
|
-
"switchTab",
|
|
1328
|
-
"updateShareMenu",
|
|
1329
|
-
"updateVoIPChatMuteConfig",
|
|
1330
|
-
"updateWeChatApp",
|
|
1331
|
-
"uploadFile",
|
|
1332
|
-
"vibrateLong",
|
|
1333
|
-
"vibrateShort",
|
|
1334
|
-
"writeBLECharacteristicValue"
|
|
1335
|
-
];
|
|
1336
|
-
//#endregion
|
|
1337
|
-
//#region src/core/apiCatalog/index.ts
|
|
1338
|
-
const WEAPI_WECHAT_METHODS = [
|
|
1339
|
-
...WEAPI_WX_METHODS_ADD_CARD_TO_HIDE_SHARE_MENU,
|
|
1340
|
-
...WEAPI_WX_METHODS_HIDE_TAB_BAR_TO_OPEN_STORE_COUPON_DETAIL,
|
|
1341
|
-
...WEAPI_WX_METHODS_OPEN_STORE_ORDER_DETAIL_TO_WRITE_BLECHARACTERISTIC_VALUE
|
|
1342
|
-
];
|
|
1343
|
-
const WEAPI_ALIPAY_METHODS = WEAPI_MY_METHODS;
|
|
1344
|
-
const WEAPI_DOUYIN_METHODS = WEAPI_TT_METHODS;
|
|
1345
|
-
const WEAPI_MINIPROGRAM_METHODS = WEAPI_WECHAT_METHODS;
|
|
1346
|
-
//#endregion
|
|
1347
|
-
//#region src/core/methodMapping/rules/helpersDeviceAndStorage.ts
|
|
1348
|
-
const PLATFORM_ALIASES$1 = { kuaishou: "ks" };
|
|
1349
|
-
function mapSaveFileArgs(args) {
|
|
1350
|
-
if (args.length === 0) return args;
|
|
1351
|
-
const nextArgs = [...args];
|
|
1352
|
-
const lastIndex = nextArgs.length - 1;
|
|
1353
|
-
const lastArg = nextArgs[lastIndex];
|
|
1354
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1355
|
-
const nextOptions = { ...lastArg };
|
|
1356
|
-
if (!hasOwn(nextOptions, "apFilePath") && hasOwn(nextOptions, "tempFilePath")) nextOptions.apFilePath = nextOptions.tempFilePath;
|
|
1357
|
-
nextArgs[lastIndex] = nextOptions;
|
|
1358
|
-
return nextArgs;
|
|
1359
|
-
}
|
|
1360
|
-
function mapCreateRewardedVideoAdArgs(args) {
|
|
1361
|
-
if (args.length === 0) return args;
|
|
1362
|
-
const nextArgs = [...args];
|
|
1363
|
-
const lastIndex = nextArgs.length - 1;
|
|
1364
|
-
const lastArg = nextArgs[lastIndex];
|
|
1365
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1366
|
-
if (hasOwn(lastArg, "multiton") && lastArg.multiton === true) throw createNotSupportedError("createRewardedVideoAd", "my");
|
|
1367
|
-
if (hasOwn(lastArg, "disableFallbackSharePage") && lastArg.disableFallbackSharePage === true) throw createNotSupportedError("createRewardedVideoAd", "my");
|
|
1368
|
-
const adUnitId = lastArg.adUnitId;
|
|
1369
|
-
if (typeof adUnitId === "string" && adUnitId.length > 0) nextArgs[lastIndex] = adUnitId;
|
|
1370
|
-
return nextArgs;
|
|
1371
|
-
}
|
|
1372
|
-
function mapRewardedAdInstance(result, args = []) {
|
|
1373
|
-
if (typeof result !== "object" || result === null) return result;
|
|
1374
|
-
const adUnitIdArg = args.length > 0 ? args[args.length - 1] : void 0;
|
|
1375
|
-
const adUnitId = typeof adUnitIdArg === "string" ? adUnitIdArg : void 0;
|
|
1376
|
-
if (!adUnitId) return result;
|
|
1377
|
-
const rewardedAd = result;
|
|
1378
|
-
const wrapMethod = (name) => {
|
|
1379
|
-
const method = rewardedAd[name];
|
|
1380
|
-
if (typeof method !== "function") return method;
|
|
1381
|
-
return (options) => {
|
|
1382
|
-
if (isPlainObject(options)) return method.call(rewardedAd, {
|
|
1383
|
-
...options,
|
|
1384
|
-
adUnitId
|
|
1385
|
-
});
|
|
1386
|
-
if (options === void 0) return method.call(rewardedAd, { adUnitId });
|
|
1387
|
-
return method.call(rewardedAd, options);
|
|
1388
|
-
};
|
|
1389
|
-
};
|
|
1390
|
-
const nextRewardedAd = Object.create(rewardedAd);
|
|
1391
|
-
nextRewardedAd.destroy = wrapMethod("destroy");
|
|
1392
|
-
nextRewardedAd.load = wrapMethod("load");
|
|
1393
|
-
nextRewardedAd.show = wrapMethod("show");
|
|
1394
|
-
return nextRewardedAd;
|
|
1395
|
-
}
|
|
1396
|
-
function mapCheckIsSoterEnrolledInDeviceArgs(args) {
|
|
1397
|
-
if (args.length === 0) return args;
|
|
1398
|
-
const nextArgs = [...args];
|
|
1399
|
-
const lastArg = nextArgs[nextArgs.length - 1];
|
|
1400
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1401
|
-
if (lastArg.checkAuthMode === "speech") throw createNotSupportedError("checkIsSoterEnrolledInDevice", "my");
|
|
1402
|
-
return nextArgs;
|
|
1403
|
-
}
|
|
1404
|
-
function mapSoterCheckResult(methodName, result) {
|
|
1405
|
-
if (!isPlainObject(result)) return result;
|
|
1406
|
-
if (hasOwn(result, "errMsg")) return result;
|
|
1407
|
-
return {
|
|
1408
|
-
...result,
|
|
1409
|
-
errMsg: `${methodName}:ok`
|
|
1410
|
-
};
|
|
1411
|
-
}
|
|
1412
|
-
function toNumberCode(value) {
|
|
1413
|
-
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
1414
|
-
if (typeof value === "string") {
|
|
1415
|
-
const parsed = Number(value);
|
|
1416
|
-
if (Number.isFinite(parsed)) return parsed;
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
function mapBleConnectionResult(methodName, codeKey, result) {
|
|
1420
|
-
if (!isPlainObject(result)) return result;
|
|
1421
|
-
const nextResult = { ...result };
|
|
1422
|
-
if (!hasOwn(nextResult, "errCode")) {
|
|
1423
|
-
const code = toNumberCode(nextResult[codeKey]);
|
|
1424
|
-
if (typeof code === "number") nextResult.errCode = code;
|
|
1425
|
-
}
|
|
1426
|
-
if (!hasOwn(nextResult, "errMsg")) {
|
|
1427
|
-
if (typeof nextResult.errorMessage === "string" && nextResult.errorMessage.length > 0) nextResult.errMsg = nextResult.errorMessage;
|
|
1428
|
-
else if (nextResult.errCode === 0) nextResult.errMsg = `${methodName}:ok`;
|
|
1429
|
-
}
|
|
1430
|
-
return nextResult;
|
|
1431
|
-
}
|
|
1432
|
-
function mapCreateBleConnectionResult(result) {
|
|
1433
|
-
return mapBleConnectionResult("createBLEConnection", "error", result);
|
|
1434
|
-
}
|
|
1435
|
-
function mapCloseBleConnectionResult(result) {
|
|
1436
|
-
return mapBleConnectionResult("closeBLEConnection", "errorCode", result);
|
|
1437
|
-
}
|
|
1438
|
-
function mapSaveFileResult(result) {
|
|
1439
|
-
if (!isPlainObject(result)) return result;
|
|
1440
|
-
if (!hasOwn(result, "savedFilePath") && hasOwn(result, "apFilePath")) return {
|
|
1441
|
-
...result,
|
|
1442
|
-
savedFilePath: result.apFilePath
|
|
1443
|
-
};
|
|
1444
|
-
return result;
|
|
1445
|
-
}
|
|
1446
|
-
function mapDouyinSaveFileResult(result) {
|
|
1447
|
-
if (!isPlainObject(result)) return result;
|
|
1448
|
-
if (!hasOwn(result, "savedFilePath") && hasOwn(result, "filePath")) return {
|
|
1449
|
-
...result,
|
|
1450
|
-
savedFilePath: result.filePath
|
|
1451
|
-
};
|
|
1452
|
-
return result;
|
|
1453
|
-
}
|
|
1454
|
-
function normalizePlatformName$1(value) {
|
|
1455
|
-
const normalized = normalizeMiniProgramPlatform(value);
|
|
1456
|
-
if (!normalized) return;
|
|
1457
|
-
const miniProgramPlatform = resolveMiniProgramPlatform(normalized);
|
|
1458
|
-
if (miniProgramPlatform) return getMiniProgramRuntimeGlobalKey(miniProgramPlatform);
|
|
1459
|
-
return PLATFORM_ALIASES$1[normalized] ?? normalized;
|
|
1460
|
-
}
|
|
1461
|
-
//#endregion
|
|
1462
|
-
//#region src/core/methodMapping/rules/helpersUi.ts
|
|
1463
|
-
function mapToastType(type) {
|
|
1464
|
-
if (type === "error") return "fail";
|
|
1465
|
-
if (type === "loading") return "none";
|
|
1466
|
-
return type;
|
|
1467
|
-
}
|
|
1468
|
-
function mapToastArgs(args) {
|
|
1469
|
-
if (args.length === 0) return args;
|
|
1470
|
-
const nextArgs = [...args];
|
|
1471
|
-
const lastIndex = nextArgs.length - 1;
|
|
1472
|
-
const lastArg = nextArgs[lastIndex];
|
|
1473
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1474
|
-
const nextOptions = { ...lastArg };
|
|
1475
|
-
if (!hasOwn(nextOptions, "content") && hasOwn(nextOptions, "title")) nextOptions.content = nextOptions.title;
|
|
1476
|
-
if (hasOwn(nextOptions, "icon")) nextOptions.type = mapToastType(nextOptions.icon);
|
|
1477
|
-
nextArgs[lastIndex] = nextOptions;
|
|
1478
|
-
return nextArgs;
|
|
1479
|
-
}
|
|
1480
|
-
function mapDouyinToastArgs(args) {
|
|
1481
|
-
if (args.length === 0) return args;
|
|
1482
|
-
const nextArgs = [...args];
|
|
1483
|
-
const lastIndex = nextArgs.length - 1;
|
|
1484
|
-
const lastArg = nextArgs[lastIndex];
|
|
1485
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1486
|
-
const nextOptions = { ...lastArg };
|
|
1487
|
-
if (nextOptions.icon === "error") nextOptions.icon = "fail";
|
|
1488
|
-
nextArgs[lastIndex] = nextOptions;
|
|
1489
|
-
return nextArgs;
|
|
1490
|
-
}
|
|
1491
|
-
function mapLoadingArgs(args) {
|
|
1492
|
-
if (args.length === 0) return args;
|
|
1493
|
-
const nextArgs = [...args];
|
|
1494
|
-
const lastIndex = nextArgs.length - 1;
|
|
1495
|
-
const lastArg = nextArgs[lastIndex];
|
|
1496
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1497
|
-
const nextOptions = { ...lastArg };
|
|
1498
|
-
if (!hasOwn(nextOptions, "content") && hasOwn(nextOptions, "title")) nextOptions.content = nextOptions.title;
|
|
1499
|
-
nextArgs[lastIndex] = nextOptions;
|
|
1500
|
-
return nextArgs;
|
|
1501
|
-
}
|
|
1502
|
-
function mapActionSheetArgs(args) {
|
|
1503
|
-
if (args.length === 0) return args;
|
|
1504
|
-
const nextArgs = [...args];
|
|
1505
|
-
const lastIndex = nextArgs.length - 1;
|
|
1506
|
-
const lastArg = nextArgs[lastIndex];
|
|
1507
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1508
|
-
const nextOptions = { ...lastArg };
|
|
1509
|
-
if (!hasOwn(nextOptions, "items") && Array.isArray(nextOptions.itemList)) nextOptions.items = nextOptions.itemList;
|
|
1510
|
-
nextArgs[lastIndex] = nextOptions;
|
|
1511
|
-
return nextArgs;
|
|
1512
|
-
}
|
|
1513
|
-
function mapActionSheetResult(result) {
|
|
1514
|
-
if (!isPlainObject(result)) return result;
|
|
1515
|
-
if (!hasOwn(result, "tapIndex") && hasOwn(result, "index")) return {
|
|
1516
|
-
...result,
|
|
1517
|
-
tapIndex: result.index
|
|
1518
|
-
};
|
|
1519
|
-
return result;
|
|
1520
|
-
}
|
|
1521
|
-
function mapModalArgs(args) {
|
|
1522
|
-
if (args.length === 0) return args;
|
|
1523
|
-
const nextArgs = [...args];
|
|
1524
|
-
const lastIndex = nextArgs.length - 1;
|
|
1525
|
-
const lastArg = nextArgs[lastIndex];
|
|
1526
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1527
|
-
const nextOptions = { ...lastArg };
|
|
1528
|
-
if (hasOwn(nextOptions, "showCancel") && nextOptions.showCancel === false) throw createNotSupportedError("showModal", "my");
|
|
1529
|
-
if (hasOwn(nextOptions, "editable") && nextOptions.editable === true) throw createNotSupportedError("showModal", "my");
|
|
1530
|
-
if (hasOwn(nextOptions, "placeholderText")) throw createNotSupportedError("showModal", "my");
|
|
1531
|
-
if (!hasOwn(nextOptions, "confirmButtonText") && hasOwn(nextOptions, "confirmText")) nextOptions.confirmButtonText = nextOptions.confirmText;
|
|
1532
|
-
if (!hasOwn(nextOptions, "cancelButtonText") && hasOwn(nextOptions, "cancelText")) nextOptions.cancelButtonText = nextOptions.cancelText;
|
|
1533
|
-
nextArgs[lastIndex] = nextOptions;
|
|
1534
|
-
return nextArgs;
|
|
1535
|
-
}
|
|
1536
|
-
function mapModalResult(result) {
|
|
1537
|
-
if (!isPlainObject(result)) return result;
|
|
1538
|
-
let changed = false;
|
|
1539
|
-
const nextResult = { ...result };
|
|
1540
|
-
if (!hasOwn(nextResult, "cancel") && hasOwn(nextResult, "confirm")) {
|
|
1541
|
-
nextResult.cancel = !nextResult.confirm;
|
|
1542
|
-
changed = true;
|
|
1543
|
-
}
|
|
1544
|
-
if (!hasOwn(nextResult, "content")) {
|
|
1545
|
-
nextResult.content = "";
|
|
1546
|
-
changed = true;
|
|
1547
|
-
}
|
|
1548
|
-
return changed ? nextResult : result;
|
|
1549
|
-
}
|
|
1550
|
-
function mapChooseImageResult(result) {
|
|
1551
|
-
if (!isPlainObject(result)) return result;
|
|
1552
|
-
if (!hasOwn(result, "tempFilePaths") && Array.isArray(result.apFilePaths)) return {
|
|
1553
|
-
...result,
|
|
1554
|
-
tempFilePaths: result.apFilePaths
|
|
1555
|
-
};
|
|
1556
|
-
return result;
|
|
1557
|
-
}
|
|
1558
|
-
function mapDouyinChooseImageResult(result) {
|
|
1559
|
-
if (!isPlainObject(result)) return result;
|
|
1560
|
-
if (typeof result.tempFilePaths === "string") return {
|
|
1561
|
-
...result,
|
|
1562
|
-
tempFilePaths: [result.tempFilePaths]
|
|
1563
|
-
};
|
|
1564
|
-
if (!Array.isArray(result.tempFilePaths) && Array.isArray(result.tempFiles)) {
|
|
1565
|
-
const fallbackPaths = result.tempFiles.map((item) => {
|
|
1566
|
-
if (!isPlainObject(item)) return;
|
|
1567
|
-
const path = item.path;
|
|
1568
|
-
if (typeof path === "string" && path) return path;
|
|
1569
|
-
const filePath = item.filePath;
|
|
1570
|
-
if (typeof filePath === "string" && filePath) return filePath;
|
|
1571
|
-
}).filter((item) => typeof item === "string");
|
|
1572
|
-
if (fallbackPaths.length > 0) return {
|
|
1573
|
-
...result,
|
|
1574
|
-
tempFilePaths: fallbackPaths
|
|
1575
|
-
};
|
|
1576
|
-
}
|
|
1577
|
-
return result;
|
|
1578
|
-
}
|
|
1579
|
-
//#endregion
|
|
1580
|
-
//#region src/core/methodMapping/rules/helpersMediaClipboard.ts
|
|
1581
|
-
function mapSetClipboardArgs(args) {
|
|
1582
|
-
if (args.length === 0) return args;
|
|
1583
|
-
const nextArgs = [...args];
|
|
1584
|
-
const lastIndex = nextArgs.length - 1;
|
|
1585
|
-
const lastArg = nextArgs[lastIndex];
|
|
1586
|
-
if (!isPlainObject(lastArg)) return nextArgs;
|
|
1587
|
-
const nextOptions = { ...lastArg };
|
|
1588
|
-
if (!hasOwn(nextOptions, "text") && hasOwn(nextOptions, "data")) nextOptions.text = nextOptions.data;
|
|
1589
|
-
nextArgs[lastIndex] = nextOptions;
|
|
1590
|
-
return nextArgs;
|
|
1591
|
-
}
|
|
1592
|
-
function mapClipboardResult(result) {
|
|
1593
|
-
if (!isPlainObject(result)) return result;
|
|
1594
|
-
if (!hasOwn(result, "data") && hasOwn(result, "text")) return {
|
|
1595
|
-
...result,
|
|
1596
|
-
data: result.text
|
|
1597
|
-
};
|
|
1598
|
-
return result;
|
|
1599
|
-
}
|
|
1600
|
-
function resolveFilePaths(result) {
|
|
1601
|
-
if (!isPlainObject(result)) return [];
|
|
1602
|
-
if (typeof result.tempFilePaths === "string" && result.tempFilePaths) return [result.tempFilePaths];
|
|
1603
|
-
if (Array.isArray(result.tempFilePaths)) return result.tempFilePaths.filter((item) => typeof item === "string" && item.length > 0);
|
|
1604
|
-
if (Array.isArray(result.apFilePaths)) return result.apFilePaths.filter((item) => typeof item === "string" && item.length > 0);
|
|
1605
|
-
if (Array.isArray(result.tempFiles)) return result.tempFiles.map((item) => {
|
|
1606
|
-
if (!isPlainObject(item)) return;
|
|
1607
|
-
if (typeof item.tempFilePath === "string" && item.tempFilePath) return item.tempFilePath;
|
|
1608
|
-
if (typeof item.path === "string" && item.path) return item.path;
|
|
1609
|
-
if (typeof item.filePath === "string" && item.filePath) return item.filePath;
|
|
1610
|
-
}).filter((item) => typeof item === "string");
|
|
1611
|
-
return [];
|
|
1612
|
-
}
|
|
1613
|
-
function mapChooseMediaResultFromImage(result) {
|
|
1614
|
-
const normalized = mapChooseImageResult(result);
|
|
1615
|
-
if (!isPlainObject(normalized)) return normalized;
|
|
1616
|
-
if (Array.isArray(normalized.tempFiles) && normalized.tempFiles.length > 0) return normalized;
|
|
1617
|
-
const tempFilePaths = resolveFilePaths(normalized);
|
|
1618
|
-
if (tempFilePaths.length === 0) return normalized;
|
|
1619
|
-
return {
|
|
1620
|
-
...normalized,
|
|
1621
|
-
tempFilePaths,
|
|
1622
|
-
tempFiles: tempFilePaths.map((tempFilePath) => ({
|
|
1623
|
-
tempFilePath,
|
|
1624
|
-
fileType: "image"
|
|
1625
|
-
})),
|
|
1626
|
-
type: "image"
|
|
1627
|
-
};
|
|
1628
|
-
}
|
|
1629
|
-
//#endregion
|
|
1630
|
-
//#region src/core/methodMapping/rules/myBindEmployeeRelationToSendHCEMessage.ts
|
|
1631
|
-
const MY_METHOD_MAPPINGS_BIND_EMPLOYEE_RELATION_TO_SEND_HCEMESSAGE = {
|
|
1632
|
-
bindEmployeeRelation: { target: "bindEmployeeRelation" },
|
|
1633
|
-
canAddSecureElementPass: { target: "canAddSecureElementPass" },
|
|
1634
|
-
canvasGetImageData: { target: "canvasGetImageData" },
|
|
1635
|
-
canvasPutImageData: { target: "canvasPutImageData" },
|
|
1636
|
-
checkDeviceSupportHevc: { target: "checkDeviceSupportHevc" },
|
|
1637
|
-
checkEmployeeRelation: { target: "checkEmployeeRelation" },
|
|
1638
|
-
checkIsAddedToMyMiniProgram: { target: "checkIsAddedToMyMiniProgram" },
|
|
1639
|
-
checkIsOpenAccessibility: { target: "checkIsOpenAccessibility" },
|
|
1640
|
-
checkIsPictureInPictureActive: { target: "checkIsPictureInPictureActive" },
|
|
1641
|
-
checkIsSoterEnrolledInDevice: {
|
|
1642
|
-
target: "checkIsIfaaEnrolledInDevice",
|
|
1643
|
-
mapArgs: mapCheckIsSoterEnrolledInDeviceArgs,
|
|
1644
|
-
mapResult: (result) => mapSoterCheckResult("checkIsSoterEnrolledInDevice", result)
|
|
1645
|
-
},
|
|
1646
|
-
checkIsSupportSoterAuthentication: {
|
|
1647
|
-
target: "checkIsSupportIfaaAuthentication",
|
|
1648
|
-
mapResult: (result) => mapSoterCheckResult("checkIsSupportSoterAuthentication", result)
|
|
1649
|
-
},
|
|
1650
|
-
openCard: { target: "openCard" },
|
|
1651
|
-
openChannelsActivity: { target: "openChannelsActivity" },
|
|
1652
|
-
openChannelsEvent: { target: "openChannelsEvent" },
|
|
1653
|
-
openChannelsLive: { target: "openChannelsLive" },
|
|
1654
|
-
openChannelsLiveNoticeInfo: { target: "openChannelsLiveNoticeInfo" },
|
|
1655
|
-
openChannelsUserProfile: { target: "openChannelsUserProfile" },
|
|
1656
|
-
openChatTool: { target: "openChatTool" },
|
|
1657
|
-
openHKOfflinePayView: { target: "openHKOfflinePayView" },
|
|
1658
|
-
openInquiriesTopic: { target: "openInquiriesTopic" },
|
|
1659
|
-
openOfficialAccountArticle: { target: "openOfficialAccountArticle" },
|
|
1660
|
-
openOfficialAccountChat: { target: "openOfficialAccountChat" },
|
|
1661
|
-
openOfficialAccountProfile: { target: "openOfficialAccountProfile" },
|
|
1662
|
-
openPrivacyContract: { target: "openPrivacyContract" },
|
|
1663
|
-
openSystemBluetoothSetting: { target: "openSystemBluetoothSetting" },
|
|
1664
|
-
reportEvent: { target: "reportEvent" },
|
|
1665
|
-
reportMonitor: { target: "reportMonitor" },
|
|
1666
|
-
reportPerformance: { target: "reportPerformance" },
|
|
1667
|
-
openSingleStickerView: { target: "openSingleStickerView" },
|
|
1668
|
-
openStickerIPView: { target: "openStickerIPView" },
|
|
1669
|
-
openStickerSetView: { target: "openStickerSetView" },
|
|
1670
|
-
openStoreCouponDetail: { target: "openStoreCouponDetail" },
|
|
1671
|
-
openStoreOrderDetail: { target: "openStoreOrderDetail" },
|
|
1672
|
-
pauseBackgroundAudio: { target: "pauseBackgroundAudio" },
|
|
1673
|
-
pauseVoice: { target: "pauseVoice" },
|
|
1674
|
-
playBackgroundAudio: { target: "playBackgroundAudio" },
|
|
1675
|
-
playVoice: { target: "playVoice" },
|
|
1676
|
-
postMessageToReferrerMiniProgram: { target: "postMessageToReferrerMiniProgram" },
|
|
1677
|
-
postMessageToReferrerPage: { target: "postMessageToReferrerPage" },
|
|
1678
|
-
preDownloadSubpackage: { target: "preDownloadSubpackage" },
|
|
1679
|
-
preloadAssets: { target: "preloadAssets" },
|
|
1680
|
-
preloadSkylineView: { target: "preloadSkylineView" },
|
|
1681
|
-
preloadWebview: { target: "preloadWebview" },
|
|
1682
|
-
removeSecureElementPass: { target: "removeSecureElementPass" },
|
|
1683
|
-
chooseInvoiceTitle: { target: "chooseInvoiceTitle" },
|
|
1684
|
-
chooseLicensePlate: { target: "chooseLicensePlate" },
|
|
1685
|
-
choosePoi: { target: "choosePoi" },
|
|
1686
|
-
closeBLEConnection: {
|
|
1687
|
-
target: "disconnectBLEDevice",
|
|
1688
|
-
mapResult: mapCloseBleConnectionResult
|
|
1689
|
-
},
|
|
1690
|
-
createBLEConnection: {
|
|
1691
|
-
target: "connectBLEDevice",
|
|
1692
|
-
mapResult: mapCreateBleConnectionResult
|
|
1693
|
-
},
|
|
1694
|
-
cropImage: { target: "cropImage" },
|
|
1695
|
-
editImage: { target: "editImage" },
|
|
1696
|
-
exitVoIPChat: { target: "exitVoIPChat" },
|
|
1697
|
-
faceDetect: { target: "faceDetect" },
|
|
1698
|
-
getApiCategory: { target: "getApiCategory" },
|
|
1699
|
-
getBackgroundFetchToken: { target: "getBackgroundFetchToken" },
|
|
1700
|
-
getChannelsLiveInfo: { target: "getChannelsLiveInfo" },
|
|
1701
|
-
getChannelsLiveNoticeInfo: { target: "getChannelsLiveNoticeInfo" },
|
|
1702
|
-
getChannelsShareKey: { target: "getChannelsShareKey" },
|
|
1703
|
-
getChatToolInfo: { target: "getChatToolInfo" },
|
|
1704
|
-
getCommonConfig: { target: "getCommonConfig" },
|
|
1705
|
-
getGroupEnterInfo: { target: "getGroupEnterInfo" },
|
|
1706
|
-
getPrivacySetting: { target: "getPrivacySetting" },
|
|
1707
|
-
initFaceDetect: { target: "initFaceDetect" },
|
|
1708
|
-
join1v1Chat: { target: "join1v1Chat" },
|
|
1709
|
-
requestCommonPayment: { target: "requestCommonPayment" },
|
|
1710
|
-
requestDeviceVoIP: { target: "requestDeviceVoIP" },
|
|
1711
|
-
requestMerchantTransfer: { target: "requestMerchantTransfer" },
|
|
1712
|
-
requirePrivacyAuthorize: { target: "requirePrivacyAuthorize" },
|
|
1713
|
-
reserveChannelsLive: { target: "reserveChannelsLive" },
|
|
1714
|
-
selectGroupMembers: { target: "selectGroupMembers" },
|
|
1715
|
-
sendHCEMessage: { target: "sendHCEMessage" }
|
|
1716
|
-
};
|
|
1717
|
-
//#endregion
|
|
1718
|
-
//#region src/core/methodMapping/rules/myCreateVKSessionToOffBLEConnectionStateChange.ts
|
|
1719
|
-
const MY_METHOD_MAPPINGS_CREATE_VKSESSION_TO_OFF_BLECONNECTION_STATE_CHANGE = {
|
|
1720
|
-
createVKSession: { target: "createVKSession" },
|
|
1721
|
-
compressVideo: { target: "compressVideo" },
|
|
1722
|
-
openVideoEditor: { target: "openVideoEditor" },
|
|
1723
|
-
getShareInfo: { target: "getShareInfo" },
|
|
1724
|
-
joinVoIPChat: { target: "joinVoIPChat" },
|
|
1725
|
-
openDocument: { target: "openDocument" },
|
|
1726
|
-
saveVideoToPhotosAlbum: { target: "saveVideoToPhotosAlbum" },
|
|
1727
|
-
batchSetStorage: { target: "batchSetStorage" },
|
|
1728
|
-
batchGetStorage: { target: "batchGetStorage" },
|
|
1729
|
-
batchSetStorageSync: { target: "batchSetStorageSync" },
|
|
1730
|
-
batchGetStorageSync: { target: "batchGetStorageSync" },
|
|
1731
|
-
createCameraContext: { target: "createCameraContext" },
|
|
1732
|
-
offMemoryWarning: { target: "offMemoryWarning" },
|
|
1733
|
-
cancelIdleCallback: { target: "cancelIdleCallback" },
|
|
1734
|
-
onBLEConnectionStateChange: { target: "onBLEConnectionStateChanged" },
|
|
1735
|
-
offBLEConnectionStateChange: { target: "offBLEConnectionStateChanged" }
|
|
1736
|
-
};
|
|
1737
|
-
//#endregion
|
|
1738
|
-
//#region src/core/methodMapping/rules/mySendSmsToOpenCustomerServiceChat.ts
|
|
1739
|
-
const MY_METHOD_MAPPINGS_SEND_SMS_TO_OPEN_CUSTOMER_SERVICE_CHAT = {
|
|
1740
|
-
sendSms: { target: "sendSms" },
|
|
1741
|
-
setBackgroundFetchToken: { target: "setBackgroundFetchToken" },
|
|
1742
|
-
setEnable1v1Chat: { target: "setEnable1v1Chat" },
|
|
1743
|
-
setTopBarText: { target: "setTopBarText" },
|
|
1744
|
-
setWindowSize: { target: "setWindowSize" },
|
|
1745
|
-
stopHCE: { target: "stopHCE" },
|
|
1746
|
-
stopLocalServiceDiscovery: { target: "stopLocalServiceDiscovery" },
|
|
1747
|
-
stopLocationUpdate: { target: "stopLocationUpdate" },
|
|
1748
|
-
stopRecord: { target: "stopRecord" },
|
|
1749
|
-
stopVoice: { target: "stopVoice" },
|
|
1750
|
-
subscribeVoIPVideoMembers: { target: "subscribeVoIPVideoMembers" },
|
|
1751
|
-
updateVoIPChatMuteConfig: { target: "updateVoIPChatMuteConfig" },
|
|
1752
|
-
updateWeChatApp: { target: "updateWeChatApp" },
|
|
1753
|
-
getBackgroundAudioPlayerState: { target: "getBackgroundAudioPlayerState" },
|
|
1754
|
-
getDeviceBenchmarkInfo: { target: "getDeviceBenchmarkInfo" },
|
|
1755
|
-
getDeviceVoIPList: { target: "getDeviceVoIPList" },
|
|
1756
|
-
getHCEState: { target: "getHCEState" },
|
|
1757
|
-
getInferenceEnvInfo: { target: "getInferenceEnvInfo" },
|
|
1758
|
-
getNFCAdapter: { target: "getNFCAdapter" },
|
|
1759
|
-
getPerformance: { target: "getPerformance" },
|
|
1760
|
-
getRandomValues: { target: "getRandomValues" },
|
|
1761
|
-
getRealtimeLogManager: { target: "getRealtimeLogManager" },
|
|
1762
|
-
getRendererUserAgent: { target: "getRendererUserAgent" },
|
|
1763
|
-
getScreenRecordingState: { target: "getScreenRecordingState" },
|
|
1764
|
-
getSecureElementPasses: { target: "getSecureElementPasses" },
|
|
1765
|
-
getSelectedTextRange: { target: "getSelectedTextRange" },
|
|
1766
|
-
getShowSplashAdStatus: { target: "getShowSplashAdStatus" },
|
|
1767
|
-
getSkylineInfo: { target: "getSkylineInfo" },
|
|
1768
|
-
getUserCryptoManager: { target: "getUserCryptoManager" },
|
|
1769
|
-
getWeRunData: { target: "getWeRunData" },
|
|
1770
|
-
getXrFrameSystem: { target: "getXrFrameSystem" },
|
|
1771
|
-
isBluetoothDevicePaired: { target: "isBluetoothDevicePaired" },
|
|
1772
|
-
isVKSupport: { target: "isVKSupport" },
|
|
1773
|
-
createBLEPeripheralServer: { target: "createBLEPeripheralServer" },
|
|
1774
|
-
createBufferURL: { target: "createBufferURL" },
|
|
1775
|
-
createCacheManager: { target: "createCacheManager" },
|
|
1776
|
-
createGlobalPayment: { target: "createGlobalPayment" },
|
|
1777
|
-
createInferenceSession: { target: "createInferenceSession" },
|
|
1778
|
-
createMediaAudioPlayer: { target: "createMediaAudioPlayer" },
|
|
1779
|
-
createMediaContainer: { target: "createMediaContainer" },
|
|
1780
|
-
createMediaRecorder: { target: "createMediaRecorder" },
|
|
1781
|
-
createTCPSocket: { target: "createTCPSocket" },
|
|
1782
|
-
createUDPSocket: { target: "createUDPSocket" },
|
|
1783
|
-
createVideoDecoder: { target: "createVideoDecoder" },
|
|
1784
|
-
loadBuiltInFontFace: { target: "loadBuiltInFontFace" },
|
|
1785
|
-
notifyGroupMembers: { target: "notifyGroupMembers" },
|
|
1786
|
-
requestIdleCallback: { target: "requestIdleCallback" },
|
|
1787
|
-
revokeBufferURL: { target: "revokeBufferURL" },
|
|
1788
|
-
rewriteRoute: { target: "rewriteRoute" },
|
|
1789
|
-
seekBackgroundAudio: { target: "seekBackgroundAudio" },
|
|
1790
|
-
setEnableDebug: { target: "setEnableDebug" },
|
|
1791
|
-
setInnerAudioOption: { target: "setInnerAudioOption" },
|
|
1792
|
-
shareAppMessageToGroup: { target: "shareAppMessageToGroup" },
|
|
1793
|
-
shareEmojiToGroup: { target: "shareEmojiToGroup" },
|
|
1794
|
-
shareFileMessage: { target: "shareFileMessage" },
|
|
1795
|
-
shareFileToGroup: { target: "shareFileToGroup" },
|
|
1796
|
-
shareImageToGroup: { target: "shareImageToGroup" },
|
|
1797
|
-
shareToOfficialAccount: { target: "shareToOfficialAccount" },
|
|
1798
|
-
shareToWeRun: { target: "shareToWeRun" },
|
|
1799
|
-
shareVideoMessage: { target: "shareVideoMessage" },
|
|
1800
|
-
shareVideoToGroup: { target: "shareVideoToGroup" },
|
|
1801
|
-
showRedPackage: { target: "showRedPackage" },
|
|
1802
|
-
startDeviceMotionListening: { target: "startDeviceMotionListening" },
|
|
1803
|
-
startHCE: { target: "startHCE" },
|
|
1804
|
-
startLocalServiceDiscovery: { target: "startLocalServiceDiscovery" },
|
|
1805
|
-
startLocationUpdate: { target: "startLocationUpdate" },
|
|
1806
|
-
startLocationUpdateBackground: { target: "startLocationUpdateBackground" },
|
|
1807
|
-
startRecord: { target: "startRecord" },
|
|
1808
|
-
startSoterAuthentication: { target: "startSoterAuthentication" },
|
|
1809
|
-
stopBackgroundAudio: { target: "stopBackgroundAudio" },
|
|
1810
|
-
stopDeviceMotionListening: { target: "stopDeviceMotionListening" },
|
|
1811
|
-
stopFaceDetect: { target: "stopFaceDetect" },
|
|
1812
|
-
openCustomerServiceChat: { target: "openCustomerServiceChat" }
|
|
1813
|
-
};
|
|
1814
|
-
//#endregion
|
|
1815
|
-
//#region src/core/methodMapping/rules/my.ts
|
|
1816
|
-
const MY_METHOD_MAPPINGS = {
|
|
1817
|
-
showToast: {
|
|
1818
|
-
target: "showToast",
|
|
1819
|
-
mapArgs: mapToastArgs
|
|
1820
|
-
},
|
|
1821
|
-
showLoading: {
|
|
1822
|
-
target: "showLoading",
|
|
1823
|
-
mapArgs: mapLoadingArgs
|
|
1824
|
-
},
|
|
1825
|
-
showActionSheet: {
|
|
1826
|
-
target: "showActionSheet",
|
|
1827
|
-
mapArgs: mapActionSheetArgs,
|
|
1828
|
-
mapResult: mapActionSheetResult
|
|
1829
|
-
},
|
|
1830
|
-
showModal: {
|
|
1831
|
-
target: "confirm",
|
|
1832
|
-
mapArgs: mapModalArgs,
|
|
1833
|
-
mapResult: mapModalResult
|
|
1834
|
-
},
|
|
1835
|
-
chooseImage: {
|
|
1836
|
-
target: "chooseImage",
|
|
1837
|
-
mapResult: mapChooseImageResult
|
|
1838
|
-
},
|
|
1839
|
-
chooseMedia: { target: "chooseMedia" },
|
|
1840
|
-
chooseMessageFile: { target: "chooseMessageFile" },
|
|
1841
|
-
getFuzzyLocation: { target: "getFuzzyLocation" },
|
|
1842
|
-
previewMedia: { target: "previewMedia" },
|
|
1843
|
-
createInterstitialAd: { target: "createInterstitialAd" },
|
|
1844
|
-
createRewardedVideoAd: {
|
|
1845
|
-
target: "createRewardedAd",
|
|
1846
|
-
mapArgs: mapCreateRewardedVideoAdArgs,
|
|
1847
|
-
mapResult: mapRewardedAdInstance
|
|
1848
|
-
},
|
|
1849
|
-
createLivePlayerContext: { target: "createLivePlayerContext" },
|
|
1850
|
-
createLivePusherContext: { target: "createLivePusherContext" },
|
|
1851
|
-
getVideoInfo: { target: "getVideoInfo" },
|
|
1852
|
-
saveFile: {
|
|
1853
|
-
target: "saveFile",
|
|
1854
|
-
mapArgs: mapSaveFileArgs,
|
|
1855
|
-
mapResult: mapSaveFileResult
|
|
1856
|
-
},
|
|
1857
|
-
setClipboardData: {
|
|
1858
|
-
target: "setClipboard",
|
|
1859
|
-
mapArgs: mapSetClipboardArgs
|
|
1860
|
-
},
|
|
1861
|
-
getClipboardData: {
|
|
1862
|
-
target: "getClipboard",
|
|
1863
|
-
mapResult: mapClipboardResult
|
|
1864
|
-
},
|
|
1865
|
-
chooseAddress: { target: "chooseAddress" },
|
|
1866
|
-
createAudioContext: { target: "createAudioContext" },
|
|
1867
|
-
createWebAudioContext: { target: "createWebAudioContext" },
|
|
1868
|
-
getSystemInfoAsync: { target: "getSystemInfo" },
|
|
1869
|
-
openAppAuthorizeSetting: { target: "openAppAuthorizeSetting" },
|
|
1870
|
-
pluginLogin: { target: "pluginLogin" },
|
|
1871
|
-
login: { target: "login" },
|
|
1872
|
-
authorize: { target: "authorize" },
|
|
1873
|
-
checkSession: { target: "checkSession" },
|
|
1874
|
-
requestSubscribeDeviceMessage: { target: "requestSubscribeDeviceMessage" },
|
|
1875
|
-
requestSubscribeEmployeeMessage: { target: "requestSubscribeEmployeeMessage" },
|
|
1876
|
-
restartMiniProgram: { target: "restartMiniProgram" },
|
|
1877
|
-
scanCode: { target: "scanCode" },
|
|
1878
|
-
requestPayment: { target: "requestPayment" },
|
|
1879
|
-
requestOrderPayment: { target: "requestOrderPayment" },
|
|
1880
|
-
requestPluginPayment: { target: "requestPluginPayment" },
|
|
1881
|
-
requestVirtualPayment: { target: "requestVirtualPayment" },
|
|
1882
|
-
showShareImageMenu: { target: "showShareImageMenu" },
|
|
1883
|
-
updateShareMenu: { target: "updateShareMenu" },
|
|
1884
|
-
openEmbeddedMiniProgram: { target: "openEmbeddedMiniProgram" },
|
|
1885
|
-
saveFileToDisk: { target: "saveFileToDisk" },
|
|
1886
|
-
getEnterOptionsSync: { target: "getEnterOptionsSync" },
|
|
1887
|
-
getSystemSetting: { target: "getSystemSetting" },
|
|
1888
|
-
getUserProfile: { target: "getUserProfile" },
|
|
1889
|
-
getUserInfo: { target: "getUserInfo" },
|
|
1890
|
-
getAppAuthorizeSetting: { target: "getAppAuthorizeSetting" },
|
|
1891
|
-
getAppBaseInfo: { target: "getAppBaseInfo" },
|
|
1892
|
-
chooseVideo: { target: "chooseVideo" },
|
|
1893
|
-
hideHomeButton: { target: "hideBackHome" },
|
|
1894
|
-
getWindowInfo: { target: "getWindowInfo" },
|
|
1895
|
-
getDeviceInfo: { target: "getDeviceInfo" },
|
|
1896
|
-
getAccountInfoSync: { target: "getAccountInfoSync" },
|
|
1897
|
-
setBackgroundColor: { target: "setBackgroundColor" },
|
|
1898
|
-
setBackgroundTextStyle: { target: "setBackgroundTextStyle" },
|
|
1899
|
-
getNetworkType: { target: "getNetworkType" },
|
|
1900
|
-
getBatteryInfo: { target: "getBatteryInfo" },
|
|
1901
|
-
getBatteryInfoSync: { target: "getBatteryInfoSync" },
|
|
1902
|
-
getLogManager: { target: "getLogManager" },
|
|
1903
|
-
nextTick: { target: "nextTick" },
|
|
1904
|
-
onWindowResize: { target: "onWindowResize" },
|
|
1905
|
-
offWindowResize: { target: "offWindowResize" },
|
|
1906
|
-
reportAnalytics: { target: "reportAnalytics" },
|
|
1907
|
-
addCard: { target: "addCard" },
|
|
1908
|
-
addFileToFavorites: { target: "addFileToFavorites" },
|
|
1909
|
-
addPaymentPassFinish: { target: "addPaymentPassFinish" },
|
|
1910
|
-
addPaymentPassGetCertificateData: { target: "addPaymentPassGetCertificateData" },
|
|
1911
|
-
addPhoneCalendar: { target: "addPhoneCalendar" },
|
|
1912
|
-
addPhoneContact: { target: "addPhoneContact" },
|
|
1913
|
-
addPhoneRepeatCalendar: { target: "addPhoneRepeatCalendar" },
|
|
1914
|
-
addVideoToFavorites: { target: "addVideoToFavorites" },
|
|
1915
|
-
authorizeForMiniProgram: { target: "authorizeForMiniProgram" },
|
|
1916
|
-
authPrivateMessage: { target: "authPrivateMessage" },
|
|
1917
|
-
...MY_METHOD_MAPPINGS_BIND_EMPLOYEE_RELATION_TO_SEND_HCEMESSAGE,
|
|
1918
|
-
...MY_METHOD_MAPPINGS_SEND_SMS_TO_OPEN_CUSTOMER_SERVICE_CHAT,
|
|
1919
|
-
...MY_METHOD_MAPPINGS_CREATE_VKSESSION_TO_OFF_BLECONNECTION_STATE_CHANGE
|
|
1920
|
-
};
|
|
1921
|
-
//#endregion
|
|
1922
|
-
//#region src/core/methodMapping/rules/ttCanvasGetImageDataToSetTopBarText.ts
|
|
1923
|
-
const TT_METHOD_MAPPINGS_CANVAS_GET_IMAGE_DATA_TO_SET_TOP_BAR_TEXT = {
|
|
1924
|
-
canvasGetImageData: { target: "canvasGetImageData" },
|
|
1925
|
-
canvasPutImageData: { target: "canvasPutImageData" },
|
|
1926
|
-
checkDeviceSupportHevc: { target: "checkDeviceSupportHevc" },
|
|
1927
|
-
checkEmployeeRelation: { target: "checkEmployeeRelation" },
|
|
1928
|
-
checkIsAddedToMyMiniProgram: { target: "checkIsAddedToMyMiniProgram" },
|
|
1929
|
-
checkIsOpenAccessibility: { target: "checkIsOpenAccessibility" },
|
|
1930
|
-
checkIsPictureInPictureActive: { target: "checkIsPictureInPictureActive" },
|
|
1931
|
-
checkIsSoterEnrolledInDevice: { target: "checkIsSoterEnrolledInDevice" },
|
|
1932
|
-
checkIsSupportSoterAuthentication: { target: "checkIsSupportSoterAuthentication" },
|
|
1933
|
-
openCard: { target: "openCard" },
|
|
1934
|
-
openChannelsActivity: { target: "openChannelsActivity" },
|
|
1935
|
-
openChannelsEvent: { target: "openChannelsEvent" },
|
|
1936
|
-
openChannelsLive: { target: "openChannelsLive" },
|
|
1937
|
-
openChannelsLiveNoticeInfo: { target: "openChannelsLiveNoticeInfo" },
|
|
1938
|
-
openChannelsUserProfile: { target: "openChannelsUserProfile" },
|
|
1939
|
-
openChatTool: { target: "openChatTool" },
|
|
1940
|
-
openHKOfflinePayView: { target: "openHKOfflinePayView" },
|
|
1941
|
-
openInquiriesTopic: { target: "openInquiriesTopic" },
|
|
1942
|
-
openOfficialAccountArticle: { target: "openOfficialAccountArticle" },
|
|
1943
|
-
openOfficialAccountChat: { target: "openOfficialAccountChat" },
|
|
1944
|
-
openOfficialAccountProfile: { target: "openOfficialAccountProfile" },
|
|
1945
|
-
openPrivacyContract: { target: "openPrivacyContract" },
|
|
1946
|
-
openSystemBluetoothSetting: { target: "openSystemBluetoothSetting" },
|
|
1947
|
-
reportEvent: { target: "reportEvent" },
|
|
1948
|
-
reportMonitor: { target: "reportMonitor" },
|
|
1949
|
-
reportPerformance: { target: "reportPerformance" },
|
|
1950
|
-
openSingleStickerView: { target: "openSingleStickerView" },
|
|
1951
|
-
openStickerIPView: { target: "openStickerIPView" },
|
|
1952
|
-
openStickerSetView: { target: "openStickerSetView" },
|
|
1953
|
-
openStoreCouponDetail: { target: "openStoreCouponDetail" },
|
|
1954
|
-
openStoreOrderDetail: { target: "openStoreOrderDetail" },
|
|
1955
|
-
pauseBackgroundAudio: { target: "pauseBackgroundAudio" },
|
|
1956
|
-
pauseVoice: { target: "pauseVoice" },
|
|
1957
|
-
playBackgroundAudio: { target: "playBackgroundAudio" },
|
|
1958
|
-
playVoice: { target: "playVoice" },
|
|
1959
|
-
postMessageToReferrerMiniProgram: { target: "postMessageToReferrerMiniProgram" },
|
|
1960
|
-
postMessageToReferrerPage: { target: "postMessageToReferrerPage" },
|
|
1961
|
-
preDownloadSubpackage: { target: "preDownloadSubpackage" },
|
|
1962
|
-
preloadAssets: { target: "preloadAssets" },
|
|
1963
|
-
preloadSkylineView: { target: "preloadSkylineView" },
|
|
1964
|
-
preloadWebview: { target: "preloadWebview" },
|
|
1965
|
-
removeSecureElementPass: { target: "removeSecureElementPass" },
|
|
1966
|
-
chooseInvoiceTitle: { target: "chooseInvoiceTitle" },
|
|
1967
|
-
chooseLicensePlate: { target: "chooseLicensePlate" },
|
|
1968
|
-
choosePoi: { target: "choosePoi" },
|
|
1969
|
-
closeBLEConnection: { target: "closeBLEConnection" },
|
|
1970
|
-
createBLEConnection: { target: "createBLEConnection" },
|
|
1971
|
-
cropImage: { target: "cropImage" },
|
|
1972
|
-
editImage: { target: "editImage" },
|
|
1973
|
-
exitVoIPChat: { target: "exitVoIPChat" },
|
|
1974
|
-
faceDetect: { target: "faceDetect" },
|
|
1975
|
-
getApiCategory: { target: "getApiCategory" },
|
|
1976
|
-
getBackgroundFetchToken: { target: "getBackgroundFetchToken" },
|
|
1977
|
-
getChannelsLiveInfo: { target: "getChannelsLiveInfo" },
|
|
1978
|
-
getChannelsLiveNoticeInfo: { target: "getChannelsLiveNoticeInfo" },
|
|
1979
|
-
getChannelsShareKey: { target: "getChannelsShareKey" },
|
|
1980
|
-
getChatToolInfo: { target: "getChatToolInfo" },
|
|
1981
|
-
getCommonConfig: { target: "getCommonConfig" },
|
|
1982
|
-
getGroupEnterInfo: { target: "getGroupEnterInfo" },
|
|
1983
|
-
getPrivacySetting: { target: "getPrivacySetting" },
|
|
1984
|
-
initFaceDetect: { target: "initFaceDetect" },
|
|
1985
|
-
join1v1Chat: { target: "join1v1Chat" },
|
|
1986
|
-
requestCommonPayment: { target: "requestCommonPayment" },
|
|
1987
|
-
requestDeviceVoIP: { target: "requestDeviceVoIP" },
|
|
1988
|
-
requestMerchantTransfer: { target: "requestMerchantTransfer" },
|
|
1989
|
-
requirePrivacyAuthorize: { target: "requirePrivacyAuthorize" },
|
|
1990
|
-
reserveChannelsLive: { target: "reserveChannelsLive" },
|
|
1991
|
-
selectGroupMembers: { target: "selectGroupMembers" },
|
|
1992
|
-
sendHCEMessage: { target: "sendHCEMessage" },
|
|
1993
|
-
sendSms: { target: "sendSms" },
|
|
1994
|
-
setBackgroundFetchToken: { target: "setBackgroundFetchToken" },
|
|
1995
|
-
setEnable1v1Chat: { target: "setEnable1v1Chat" },
|
|
1996
|
-
setTopBarText: { target: "setTopBarText" }
|
|
1997
|
-
};
|
|
1998
|
-
//#endregion
|
|
1999
|
-
//#region src/core/methodMapping/rules/ttJoinVoIPChatToOffBLEConnectionStateChange.ts
|
|
2000
|
-
const TT_METHOD_MAPPINGS_JOIN_VO_IPCHAT_TO_OFF_BLECONNECTION_STATE_CHANGE = {
|
|
2001
|
-
joinVoIPChat: { target: "joinVoIPChat" },
|
|
2002
|
-
openDocument: { target: "openDocument" },
|
|
2003
|
-
saveVideoToPhotosAlbum: { target: "saveVideoToPhotosAlbum" },
|
|
2004
|
-
batchSetStorage: { target: "batchSetStorage" },
|
|
2005
|
-
batchGetStorage: { target: "batchGetStorage" },
|
|
2006
|
-
batchSetStorageSync: { target: "batchSetStorageSync" },
|
|
2007
|
-
batchGetStorageSync: { target: "batchGetStorageSync" },
|
|
2008
|
-
createCameraContext: { target: "createCameraContext" },
|
|
2009
|
-
offMemoryWarning: { target: "offMemoryWarning" },
|
|
2010
|
-
cancelIdleCallback: { target: "cancelIdleCallback" },
|
|
2011
|
-
onBLEConnectionStateChange: { target: "onBLEConnectionStateChange" },
|
|
2012
|
-
offBLEConnectionStateChange: { target: "offBLEConnectionStateChange" }
|
|
2013
|
-
};
|
|
2014
|
-
//#endregion
|
|
2015
|
-
//#region src/core/methodMapping/rules/ttSetWindowSizeToGetShareInfo.ts
|
|
2016
|
-
const TT_METHOD_MAPPINGS_SET_WINDOW_SIZE_TO_GET_SHARE_INFO = {
|
|
2017
|
-
setWindowSize: { target: "setWindowSize" },
|
|
2018
|
-
stopHCE: { target: "stopHCE" },
|
|
2019
|
-
stopLocalServiceDiscovery: { target: "stopLocalServiceDiscovery" },
|
|
2020
|
-
stopLocationUpdate: { target: "stopLocationUpdate" },
|
|
2021
|
-
stopRecord: { target: "stopRecord" },
|
|
2022
|
-
stopVoice: { target: "stopVoice" },
|
|
2023
|
-
subscribeVoIPVideoMembers: { target: "subscribeVoIPVideoMembers" },
|
|
2024
|
-
updateVoIPChatMuteConfig: { target: "updateVoIPChatMuteConfig" },
|
|
2025
|
-
updateWeChatApp: { target: "updateWeChatApp" },
|
|
2026
|
-
getBackgroundAudioPlayerState: { target: "getBackgroundAudioPlayerState" },
|
|
2027
|
-
getDeviceBenchmarkInfo: { target: "getDeviceBenchmarkInfo" },
|
|
2028
|
-
getDeviceVoIPList: { target: "getDeviceVoIPList" },
|
|
2029
|
-
getHCEState: { target: "getHCEState" },
|
|
2030
|
-
getInferenceEnvInfo: { target: "getInferenceEnvInfo" },
|
|
2031
|
-
getNFCAdapter: { target: "getNFCAdapter" },
|
|
2032
|
-
getPerformance: { target: "getPerformance" },
|
|
2033
|
-
getRandomValues: { target: "getRandomValues" },
|
|
2034
|
-
getRealtimeLogManager: { target: "getRealtimeLogManager" },
|
|
2035
|
-
getRendererUserAgent: { target: "getRendererUserAgent" },
|
|
2036
|
-
getScreenRecordingState: { target: "getScreenRecordingState" },
|
|
2037
|
-
getSecureElementPasses: { target: "getSecureElementPasses" },
|
|
2038
|
-
getSelectedTextRange: { target: "getSelectedTextRange" },
|
|
2039
|
-
getShowSplashAdStatus: { target: "getShowSplashAdStatus" },
|
|
2040
|
-
getSkylineInfo: { target: "getSkylineInfo" },
|
|
2041
|
-
getUserCryptoManager: { target: "getUserCryptoManager" },
|
|
2042
|
-
getWeRunData: { target: "getWeRunData" },
|
|
2043
|
-
getXrFrameSystem: { target: "getXrFrameSystem" },
|
|
2044
|
-
isBluetoothDevicePaired: { target: "isBluetoothDevicePaired" },
|
|
2045
|
-
isVKSupport: { target: "isVKSupport" },
|
|
2046
|
-
createBLEPeripheralServer: { target: "createBLEPeripheralServer" },
|
|
2047
|
-
createBufferURL: { target: "createBufferURL" },
|
|
2048
|
-
createCacheManager: { target: "createCacheManager" },
|
|
2049
|
-
createGlobalPayment: { target: "createGlobalPayment" },
|
|
2050
|
-
createInferenceSession: { target: "createInferenceSession" },
|
|
2051
|
-
createMediaAudioPlayer: { target: "createMediaAudioPlayer" },
|
|
2052
|
-
createMediaContainer: { target: "createMediaContainer" },
|
|
2053
|
-
createMediaRecorder: { target: "createMediaRecorder" },
|
|
2054
|
-
createTCPSocket: { target: "createTCPSocket" },
|
|
2055
|
-
createUDPSocket: { target: "createUDPSocket" },
|
|
2056
|
-
createVideoDecoder: { target: "createVideoDecoder" },
|
|
2057
|
-
loadBuiltInFontFace: { target: "loadBuiltInFontFace" },
|
|
2058
|
-
notifyGroupMembers: { target: "notifyGroupMembers" },
|
|
2059
|
-
requestIdleCallback: { target: "requestIdleCallback" },
|
|
2060
|
-
revokeBufferURL: { target: "revokeBufferURL" },
|
|
2061
|
-
rewriteRoute: { target: "rewriteRoute" },
|
|
2062
|
-
seekBackgroundAudio: { target: "seekBackgroundAudio" },
|
|
2063
|
-
setEnableDebug: { target: "setEnableDebug" },
|
|
2064
|
-
setInnerAudioOption: { target: "setInnerAudioOption" },
|
|
2065
|
-
shareAppMessageToGroup: { target: "shareAppMessageToGroup" },
|
|
2066
|
-
shareEmojiToGroup: { target: "shareEmojiToGroup" },
|
|
2067
|
-
shareFileMessage: { target: "shareFileMessage" },
|
|
2068
|
-
shareFileToGroup: { target: "shareFileToGroup" },
|
|
2069
|
-
shareImageToGroup: { target: "shareImageToGroup" },
|
|
2070
|
-
shareToOfficialAccount: { target: "shareToOfficialAccount" },
|
|
2071
|
-
shareToWeRun: { target: "shareToWeRun" },
|
|
2072
|
-
shareVideoMessage: { target: "shareVideoMessage" },
|
|
2073
|
-
shareVideoToGroup: { target: "shareVideoToGroup" },
|
|
2074
|
-
showRedPackage: { target: "showRedPackage" },
|
|
2075
|
-
startDeviceMotionListening: { target: "startDeviceMotionListening" },
|
|
2076
|
-
startHCE: { target: "startHCE" },
|
|
2077
|
-
startLocalServiceDiscovery: { target: "startLocalServiceDiscovery" },
|
|
2078
|
-
startLocationUpdate: { target: "startLocationUpdate" },
|
|
2079
|
-
startLocationUpdateBackground: { target: "startLocationUpdateBackground" },
|
|
2080
|
-
startRecord: { target: "startRecord" },
|
|
2081
|
-
startSoterAuthentication: { target: "startSoterAuthentication" },
|
|
2082
|
-
stopBackgroundAudio: { target: "stopBackgroundAudio" },
|
|
2083
|
-
stopDeviceMotionListening: { target: "stopDeviceMotionListening" },
|
|
2084
|
-
stopFaceDetect: { target: "stopFaceDetect" },
|
|
2085
|
-
openCustomerServiceChat: { target: "openCustomerServiceChat" },
|
|
2086
|
-
createVKSession: { target: "createVKSession" },
|
|
2087
|
-
compressVideo: { target: "compressVideo" },
|
|
2088
|
-
openVideoEditor: { target: "openVideoEditor" },
|
|
2089
|
-
getShareInfo: { target: "getShareInfo" }
|
|
2090
|
-
};
|
|
2091
|
-
//#endregion
|
|
2092
|
-
//#region src/core/methodMapping/rules/index.ts
|
|
2093
|
-
const METHOD_MAPPINGS = {
|
|
2094
|
-
my: MY_METHOD_MAPPINGS,
|
|
2095
|
-
tt: {
|
|
2096
|
-
showToast: {
|
|
2097
|
-
target: "showToast",
|
|
2098
|
-
mapArgs: mapDouyinToastArgs
|
|
2099
|
-
},
|
|
2100
|
-
showLoading: { target: "showLoading" },
|
|
2101
|
-
showActionSheet: {
|
|
2102
|
-
target: "showActionSheet",
|
|
2103
|
-
mapResult: mapActionSheetResult
|
|
2104
|
-
},
|
|
2105
|
-
showModal: { target: "showModal" },
|
|
2106
|
-
chooseImage: {
|
|
2107
|
-
target: "chooseImage",
|
|
2108
|
-
mapResult: mapDouyinChooseImageResult
|
|
2109
|
-
},
|
|
2110
|
-
chooseMedia: {
|
|
2111
|
-
target: "chooseMedia",
|
|
2112
|
-
mapResult: mapChooseMediaResultFromImage
|
|
2113
|
-
},
|
|
2114
|
-
chooseMessageFile: { target: "chooseMessageFile" },
|
|
2115
|
-
getFuzzyLocation: { target: "getFuzzyLocation" },
|
|
2116
|
-
previewMedia: { target: "previewMedia" },
|
|
2117
|
-
createInterstitialAd: { target: "createInterstitialAd" },
|
|
2118
|
-
createRewardedVideoAd: { target: "createRewardedVideoAd" },
|
|
2119
|
-
createLivePlayerContext: { target: "createLivePlayerContext" },
|
|
2120
|
-
createLivePusherContext: { target: "createLivePusherContext" },
|
|
2121
|
-
getVideoInfo: { target: "getVideoInfo" },
|
|
2122
|
-
saveFile: {
|
|
2123
|
-
target: "saveFile",
|
|
2124
|
-
mapResult: mapDouyinSaveFileResult
|
|
2125
|
-
},
|
|
2126
|
-
setClipboardData: { target: "setClipboardData" },
|
|
2127
|
-
getClipboardData: { target: "getClipboardData" },
|
|
2128
|
-
chooseAddress: { target: "chooseAddress" },
|
|
2129
|
-
createAudioContext: { target: "createAudioContext" },
|
|
2130
|
-
createWebAudioContext: { target: "createWebAudioContext" },
|
|
2131
|
-
getSystemInfoAsync: { target: "getSystemInfo" },
|
|
2132
|
-
openAppAuthorizeSetting: { target: "openAppAuthorizeSetting" },
|
|
2133
|
-
pluginLogin: { target: "pluginLogin" },
|
|
2134
|
-
login: { target: "login" },
|
|
2135
|
-
authorize: { target: "authorize" },
|
|
2136
|
-
checkSession: { target: "checkSession" },
|
|
2137
|
-
requestSubscribeDeviceMessage: { target: "requestSubscribeDeviceMessage" },
|
|
2138
|
-
requestSubscribeEmployeeMessage: { target: "requestSubscribeEmployeeMessage" },
|
|
2139
|
-
restartMiniProgram: { target: "restartMiniProgram" },
|
|
2140
|
-
scanCode: { target: "scanCode" },
|
|
2141
|
-
requestPayment: { target: "requestPayment" },
|
|
2142
|
-
requestOrderPayment: { target: "requestOrderPayment" },
|
|
2143
|
-
requestPluginPayment: { target: "requestPluginPayment" },
|
|
2144
|
-
requestVirtualPayment: { target: "requestVirtualPayment" },
|
|
2145
|
-
showShareImageMenu: { target: "showShareImageMenu" },
|
|
2146
|
-
updateShareMenu: { target: "updateShareMenu" },
|
|
2147
|
-
openEmbeddedMiniProgram: { target: "openEmbeddedMiniProgram" },
|
|
2148
|
-
saveFileToDisk: { target: "saveFileToDisk" },
|
|
2149
|
-
getEnterOptionsSync: { target: "getEnterOptionsSync" },
|
|
2150
|
-
getSystemSetting: { target: "getSystemSetting" },
|
|
2151
|
-
getUserProfile: { target: "getUserProfile" },
|
|
2152
|
-
getUserInfo: { target: "getUserInfo" },
|
|
2153
|
-
getAppAuthorizeSetting: { target: "getAppAuthorizeSetting" },
|
|
2154
|
-
getAppBaseInfo: { target: "getAppBaseInfo" },
|
|
2155
|
-
chooseVideo: { target: "chooseVideo" },
|
|
2156
|
-
hideHomeButton: { target: "hideHomeButton" },
|
|
2157
|
-
getWindowInfo: { target: "getWindowInfo" },
|
|
2158
|
-
getDeviceInfo: { target: "getDeviceInfo" },
|
|
2159
|
-
getAccountInfoSync: { target: "getAccountInfoSync" },
|
|
2160
|
-
setBackgroundColor: { target: "setBackgroundColor" },
|
|
2161
|
-
setBackgroundTextStyle: { target: "setBackgroundTextStyle" },
|
|
2162
|
-
getNetworkType: { target: "getNetworkType" },
|
|
2163
|
-
getBatteryInfo: { target: "getBatteryInfo" },
|
|
2164
|
-
getBatteryInfoSync: { target: "getBatteryInfoSync" },
|
|
2165
|
-
getLogManager: { target: "getLogManager" },
|
|
2166
|
-
nextTick: { target: "nextTick" },
|
|
2167
|
-
onWindowResize: { target: "onWindowResize" },
|
|
2168
|
-
offWindowResize: { target: "offWindowResize" },
|
|
2169
|
-
reportAnalytics: { target: "reportAnalytics" },
|
|
2170
|
-
addCard: { target: "addCard" },
|
|
2171
|
-
addFileToFavorites: { target: "addFileToFavorites" },
|
|
2172
|
-
addPaymentPassFinish: { target: "addPaymentPassFinish" },
|
|
2173
|
-
addPaymentPassGetCertificateData: { target: "addPaymentPassGetCertificateData" },
|
|
2174
|
-
addPhoneCalendar: { target: "addPhoneCalendar" },
|
|
2175
|
-
addPhoneContact: { target: "addPhoneContact" },
|
|
2176
|
-
addPhoneRepeatCalendar: { target: "addPhoneRepeatCalendar" },
|
|
2177
|
-
addVideoToFavorites: { target: "addVideoToFavorites" },
|
|
2178
|
-
authorizeForMiniProgram: { target: "authorizeForMiniProgram" },
|
|
2179
|
-
authPrivateMessage: { target: "authPrivateMessage" },
|
|
2180
|
-
bindEmployeeRelation: { target: "bindEmployeeRelation" },
|
|
2181
|
-
canAddSecureElementPass: { target: "canAddSecureElementPass" },
|
|
2182
|
-
...TT_METHOD_MAPPINGS_CANVAS_GET_IMAGE_DATA_TO_SET_TOP_BAR_TEXT,
|
|
2183
|
-
...TT_METHOD_MAPPINGS_SET_WINDOW_SIZE_TO_GET_SHARE_INFO,
|
|
2184
|
-
...TT_METHOD_MAPPINGS_JOIN_VO_IPCHAT_TO_OFF_BLECONNECTION_STATE_CHANGE
|
|
2185
|
-
}
|
|
2186
|
-
};
|
|
2187
|
-
new Set(WEAPI_MINIPROGRAM_METHODS);
|
|
2188
|
-
const PLATFORM_METHOD_SET = {
|
|
2189
|
-
my: new Set(WEAPI_ALIPAY_METHODS),
|
|
2190
|
-
tt: new Set(WEAPI_DOUYIN_METHODS)
|
|
2191
|
-
};
|
|
2192
|
-
function resolveMappingRule(platform, methodName, options = {}) {
|
|
2193
|
-
const methodSet = PLATFORM_METHOD_SET[platform];
|
|
2194
|
-
const explicitRule = METHOD_MAPPINGS[platform]?.[methodName];
|
|
2195
|
-
if (explicitRule) return {
|
|
2196
|
-
target: explicitRule.target,
|
|
2197
|
-
source: "explicit",
|
|
2198
|
-
rule: explicitRule
|
|
2199
|
-
};
|
|
2200
|
-
if (methodSet.has(methodName)) return {
|
|
2201
|
-
target: methodName,
|
|
2202
|
-
source: "identity"
|
|
2203
|
-
};
|
|
2204
|
-
if (options.allowFallback === false) return {
|
|
2205
|
-
target: methodName,
|
|
2206
|
-
source: "identity"
|
|
2207
|
-
};
|
|
2208
|
-
return {
|
|
2209
|
-
target: methodName,
|
|
2210
|
-
source: "identity"
|
|
2211
|
-
};
|
|
2212
|
-
}
|
|
2213
|
-
/**
|
|
2214
|
-
* @description 解析平台 API 映射规则及映射来源
|
|
2215
|
-
*/
|
|
2216
|
-
function resolveMethodMappingWithMeta(platform, methodName, options = {}) {
|
|
2217
|
-
const normalizedPlatform = normalizePlatformName$1(platform);
|
|
2218
|
-
if (!normalizedPlatform) return;
|
|
2219
|
-
if (normalizedPlatform !== "my" && normalizedPlatform !== "tt") return;
|
|
2220
|
-
return resolveMappingRule(normalizedPlatform, methodName, options);
|
|
2221
|
-
}
|
|
2222
|
-
//#endregion
|
|
2223
|
-
//#region src/core/networkRequestPolicy/types.ts
|
|
2224
|
-
const NETWORK_METHODS = /* @__PURE__ */ new Set([
|
|
2225
|
-
"request",
|
|
2226
|
-
"uploadFile",
|
|
2227
|
-
"downloadFile",
|
|
2228
|
-
"connectSocket"
|
|
2229
|
-
]);
|
|
2230
|
-
const HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
2231
|
-
"request",
|
|
2232
|
-
"uploadFile",
|
|
2233
|
-
"downloadFile"
|
|
2234
|
-
]);
|
|
2235
|
-
const DEFAULT_TIMEOUT_CONFIG = {
|
|
2236
|
-
request: 6e4,
|
|
2237
|
-
uploadFile: 6e4,
|
|
2238
|
-
downloadFile: 6e4,
|
|
2239
|
-
connectSocket: 6e4
|
|
2240
|
-
};
|
|
2241
|
-
const NETWORK_BUCKET_LIMIT = {
|
|
2242
|
-
http: 10,
|
|
2243
|
-
socket: 5
|
|
2244
|
-
};
|
|
2245
|
-
const BACKGROUND_INTERRUPT_DELAY = 5e3;
|
|
2246
|
-
//#endregion
|
|
2247
|
-
//#region src/core/networkRequestPolicy/helpers.ts
|
|
2248
|
-
function isFinitePositiveNumber(value) {
|
|
2249
|
-
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
|
2250
|
-
}
|
|
2251
|
-
function resolveQueueSize(value) {
|
|
2252
|
-
if (!isFinitePositiveNumber(value)) return 100;
|
|
2253
|
-
return Math.max(1, Math.floor(value));
|
|
2254
|
-
}
|
|
2255
|
-
function resolveCurrentMiniProgramHostConfig() {
|
|
2256
|
-
const runtimeRoot = resolveRuntimeRoot();
|
|
2257
|
-
for (const globalKey of getMiniProgramRuntimeGlobalKeys()) {
|
|
2258
|
-
if (!resolveRuntimeGlobalValue(globalKey, runtimeRoot)) continue;
|
|
2259
|
-
const platform = getMiniProgramPlatformByRuntimeGlobalKey(globalKey);
|
|
2260
|
-
const hostConfig = resolveRuntimeGlobalValue(getMiniProgramRuntimeHostConfigKey(platform), runtimeRoot);
|
|
2261
|
-
return isPlainObject(hostConfig) ? hostConfig : void 0;
|
|
2262
|
-
}
|
|
2263
|
-
const defaultHostConfig = resolveRuntimeGlobalValue(getMiniProgramRuntimeHostConfigKey(void 0), runtimeRoot);
|
|
2264
|
-
return isPlainObject(defaultHostConfig) ? defaultHostConfig : void 0;
|
|
2265
|
-
}
|
|
2266
|
-
function resolveHostTimeoutConfig() {
|
|
2267
|
-
const networkTimeout = resolveCurrentMiniProgramHostConfig()?.networkTimeout;
|
|
2268
|
-
if (!isPlainObject(networkTimeout)) return {};
|
|
2269
|
-
const result = {};
|
|
2270
|
-
if (isFinitePositiveNumber(networkTimeout.request)) result.request = networkTimeout.request;
|
|
2271
|
-
if (isFinitePositiveNumber(networkTimeout.uploadFile)) result.uploadFile = networkTimeout.uploadFile;
|
|
2272
|
-
if (isFinitePositiveNumber(networkTimeout.downloadFile)) result.downloadFile = networkTimeout.downloadFile;
|
|
2273
|
-
if (isFinitePositiveNumber(networkTimeout.connectSocket)) result.connectSocket = networkTimeout.connectSocket;
|
|
2274
|
-
return result;
|
|
2275
|
-
}
|
|
2276
|
-
function createNetworkError(methodName, platform, reason) {
|
|
2277
|
-
return { errMsg: `${platform ? `${platform}.${methodName}` : methodName}:fail ${reason}` };
|
|
2278
|
-
}
|
|
2279
|
-
function resolveBucket(methodName) {
|
|
2280
|
-
return HTTP_METHODS.has(methodName) ? "http" : "socket";
|
|
2281
|
-
}
|
|
2282
|
-
function clearTimer(timer) {
|
|
2283
|
-
if (timer) clearTimeout(timer);
|
|
2284
|
-
}
|
|
2285
|
-
function resolveOptionsArg(args) {
|
|
2286
|
-
const nextArgs = args.slice();
|
|
2287
|
-
const lastArg = nextArgs.length > 0 ? nextArgs[nextArgs.length - 1] : void 0;
|
|
2288
|
-
if (isPlainObject(lastArg)) {
|
|
2289
|
-
const options = { ...lastArg };
|
|
2290
|
-
nextArgs[nextArgs.length - 1] = options;
|
|
2291
|
-
return {
|
|
2292
|
-
args: nextArgs,
|
|
2293
|
-
options
|
|
2294
|
-
};
|
|
2295
|
-
}
|
|
2296
|
-
const options = {};
|
|
2297
|
-
nextArgs.push(options);
|
|
2298
|
-
return {
|
|
2299
|
-
args: nextArgs,
|
|
2300
|
-
options
|
|
2301
|
-
};
|
|
2302
|
-
}
|
|
2303
|
-
function stripRefererHeader(options) {
|
|
2304
|
-
if (!isPlainObject(options.header)) return;
|
|
2305
|
-
const nextHeader = {};
|
|
2306
|
-
for (const [key, value] of Object.entries(options.header)) {
|
|
2307
|
-
if (key.toLowerCase() === "referer") continue;
|
|
2308
|
-
nextHeader[key] = value;
|
|
2309
|
-
}
|
|
2310
|
-
options.header = nextHeader;
|
|
2311
|
-
}
|
|
2312
|
-
function resolveTimeoutValue(timeout, method, timeoutConfig) {
|
|
2313
|
-
return isFinitePositiveNumber(timeout) ? timeout : timeoutConfig[method];
|
|
2314
|
-
}
|
|
2315
|
-
function toNetworkMethod(name) {
|
|
2316
|
-
return NETWORK_METHODS.has(name) ? name : void 0;
|
|
2317
|
-
}
|
|
2318
|
-
//#endregion
|
|
2319
|
-
//#region src/core/networkRequestPolicy/index.ts
|
|
2320
|
-
/**
|
|
2321
|
-
* @description 创建微信网络请求语义策略(超时、并发、前后台中断、referer 过滤)。
|
|
2322
|
-
*/
|
|
2323
|
-
function createNetworkRequestPolicy(getPlatform, options = void 0) {
|
|
2324
|
-
const boundAdapters = /* @__PURE__ */ new WeakSet();
|
|
2325
|
-
const activeCalls = /* @__PURE__ */ new Set();
|
|
2326
|
-
const queueByBucket = {
|
|
2327
|
-
http: [],
|
|
2328
|
-
socket: []
|
|
2329
|
-
};
|
|
2330
|
-
const activeCountByBucket = {
|
|
2331
|
-
http: 0,
|
|
2332
|
-
socket: 0
|
|
2333
|
-
};
|
|
2334
|
-
const timeoutConfig = {
|
|
2335
|
-
...DEFAULT_TIMEOUT_CONFIG,
|
|
2336
|
-
...resolveHostTimeoutConfig()
|
|
2337
|
-
};
|
|
2338
|
-
const overflowPolicy = options?.overflowPolicy ?? "queue";
|
|
2339
|
-
const maxQueueSize = resolveQueueSize(options?.maxQueueSize);
|
|
2340
|
-
let isBackground = false;
|
|
2341
|
-
const cleanupCall = (call) => {
|
|
2342
|
-
if (call.settled) return;
|
|
2343
|
-
call.settled = true;
|
|
2344
|
-
activeCalls.delete(call);
|
|
2345
|
-
activeCountByBucket[call.bucket] = Math.max(0, activeCountByBucket[call.bucket] - 1);
|
|
2346
|
-
clearTimer(call.timeoutTimer);
|
|
2347
|
-
clearTimer(call.backgroundTimer);
|
|
2348
|
-
};
|
|
2349
|
-
const drainQueue = (bucket) => {
|
|
2350
|
-
if (isBackground) return;
|
|
2351
|
-
const limit = NETWORK_BUCKET_LIMIT[bucket];
|
|
2352
|
-
const queue = queueByBucket[bucket];
|
|
2353
|
-
while (activeCountByBucket[bucket] < limit && queue.length > 0) queue.shift()?.start();
|
|
2354
|
-
};
|
|
2355
|
-
const scheduleBackgroundInterrupt = (call) => {
|
|
2356
|
-
clearTimer(call.backgroundTimer);
|
|
2357
|
-
call.backgroundTimer = setTimeout(() => {
|
|
2358
|
-
call.abort?.();
|
|
2359
|
-
call.failWith(createNetworkError(call.method, call.platform, "interrupted"));
|
|
2360
|
-
}, BACKGROUND_INTERRUPT_DELAY);
|
|
2361
|
-
};
|
|
2362
|
-
const clearBackgroundInterrupt = (call) => {
|
|
2363
|
-
clearTimer(call.backgroundTimer);
|
|
2364
|
-
call.backgroundTimer = void 0;
|
|
2365
|
-
};
|
|
2366
|
-
const setBackgroundState = (nextBackground) => {
|
|
2367
|
-
isBackground = nextBackground;
|
|
2368
|
-
for (const call of activeCalls) if (nextBackground) scheduleBackgroundInterrupt(call);
|
|
2369
|
-
else clearBackgroundInterrupt(call);
|
|
2370
|
-
if (!nextBackground) {
|
|
2371
|
-
drainQueue("http");
|
|
2372
|
-
drainQueue("socket");
|
|
2373
|
-
}
|
|
2374
|
-
};
|
|
2375
|
-
const bindAdapter = (adapter) => {
|
|
2376
|
-
if (!adapter || typeof adapter !== "object") return;
|
|
2377
|
-
if (boundAdapters.has(adapter)) return;
|
|
2378
|
-
boundAdapters.add(adapter);
|
|
2379
|
-
const onAppHide = adapter.onAppHide;
|
|
2380
|
-
if (typeof onAppHide === "function") onAppHide(() => {
|
|
2381
|
-
setBackgroundState(true);
|
|
2382
|
-
});
|
|
2383
|
-
const onAppShow = adapter.onAppShow;
|
|
2384
|
-
if (typeof onAppShow === "function") onAppShow(() => {
|
|
2385
|
-
setBackgroundState(false);
|
|
2386
|
-
});
|
|
2387
|
-
};
|
|
2388
|
-
const prepareCall = (methodName, args) => {
|
|
2389
|
-
const networkMethod = toNetworkMethod(methodName);
|
|
2390
|
-
if (!networkMethod) return;
|
|
2391
|
-
const platform = getPlatform();
|
|
2392
|
-
if (isBackground) return {
|
|
2393
|
-
args,
|
|
2394
|
-
blockedError: createNetworkError(methodName, platform, "interrupted"),
|
|
2395
|
-
invoke() {}
|
|
2396
|
-
};
|
|
2397
|
-
const { args: nextArgs, options } = resolveOptionsArg(args);
|
|
2398
|
-
if (networkMethod !== "connectSocket") stripRefererHeader(options);
|
|
2399
|
-
const timeout = resolveTimeoutValue(options.timeout, networkMethod, timeoutConfig);
|
|
2400
|
-
options.timeout = timeout;
|
|
2401
|
-
const bucket = resolveBucket(networkMethod);
|
|
2402
|
-
const limit = NETWORK_BUCKET_LIMIT[bucket];
|
|
2403
|
-
const queue = queueByBucket[bucket];
|
|
2404
|
-
if (activeCountByBucket[bucket] >= limit && overflowPolicy === "strict") return {
|
|
2405
|
-
args: nextArgs,
|
|
2406
|
-
blockedError: createNetworkError(methodName, platform, `exceed max concurrency limit ${limit}`),
|
|
2407
|
-
invoke() {}
|
|
2408
|
-
};
|
|
2409
|
-
if (activeCountByBucket[bucket] >= limit && queue.length >= maxQueueSize) return {
|
|
2410
|
-
args: nextArgs,
|
|
2411
|
-
blockedError: createNetworkError(methodName, platform, `exceed max queue size ${maxQueueSize}`),
|
|
2412
|
-
invoke() {}
|
|
2413
|
-
};
|
|
2414
|
-
const originalSuccess = options.success;
|
|
2415
|
-
const originalFail = options.fail;
|
|
2416
|
-
const originalComplete = options.complete;
|
|
2417
|
-
const call = {
|
|
2418
|
-
bucket,
|
|
2419
|
-
method: networkMethod,
|
|
2420
|
-
platform,
|
|
2421
|
-
settled: false,
|
|
2422
|
-
failWith: (error) => {
|
|
2423
|
-
if (call.settled) return;
|
|
2424
|
-
cleanupCall(call);
|
|
2425
|
-
originalFail?.(error);
|
|
2426
|
-
originalComplete?.(error);
|
|
2427
|
-
drainQueue(bucket);
|
|
2428
|
-
}
|
|
2429
|
-
};
|
|
2430
|
-
options.success = (res) => {
|
|
2431
|
-
if (call.settled) return;
|
|
2432
|
-
cleanupCall(call);
|
|
2433
|
-
originalSuccess?.(res);
|
|
2434
|
-
drainQueue(bucket);
|
|
2435
|
-
};
|
|
2436
|
-
options.fail = (error) => {
|
|
2437
|
-
if (call.settled) return;
|
|
2438
|
-
cleanupCall(call);
|
|
2439
|
-
originalFail?.(error);
|
|
2440
|
-
drainQueue(bucket);
|
|
2441
|
-
};
|
|
2442
|
-
options.complete = (res) => {
|
|
2443
|
-
if (call.settled) return;
|
|
2444
|
-
cleanupCall(call);
|
|
2445
|
-
originalComplete?.(res);
|
|
2446
|
-
drainQueue(bucket);
|
|
2447
|
-
};
|
|
2448
|
-
const startInvoke = (invokeRuntime) => {
|
|
2449
|
-
if (call.settled) return;
|
|
2450
|
-
activeCountByBucket[bucket] += 1;
|
|
2451
|
-
activeCalls.add(call);
|
|
2452
|
-
call.timeoutTimer = setTimeout(() => {
|
|
2453
|
-
call.abort?.();
|
|
2454
|
-
call.failWith(createNetworkError(methodName, platform, "timeout"));
|
|
2455
|
-
}, timeout);
|
|
2456
|
-
if (isBackground) scheduleBackgroundInterrupt(call);
|
|
2457
|
-
try {
|
|
2458
|
-
const result = invokeRuntime();
|
|
2459
|
-
if (isPlainObject(result) && typeof result.abort === "function") call.abort = result.abort.bind(result);
|
|
2460
|
-
return result;
|
|
2461
|
-
} catch (error) {
|
|
2462
|
-
call.failWith(error);
|
|
2463
|
-
return;
|
|
2464
|
-
}
|
|
2465
|
-
};
|
|
2466
|
-
return {
|
|
2467
|
-
args: nextArgs,
|
|
2468
|
-
invoke(invokeRuntime) {
|
|
2469
|
-
if (activeCountByBucket[bucket] < limit) return startInvoke(invokeRuntime);
|
|
2470
|
-
if (overflowPolicy !== "queue") return;
|
|
2471
|
-
queue.push({ start: () => startInvoke(invokeRuntime) });
|
|
2472
|
-
}
|
|
2473
|
-
};
|
|
2474
|
-
};
|
|
2475
|
-
return {
|
|
2476
|
-
bindAdapter,
|
|
2477
|
-
prepareCall
|
|
2478
|
-
};
|
|
2479
|
-
}
|
|
2480
|
-
//#endregion
|
|
2481
|
-
//#region src/core/createWeapi.ts
|
|
2482
|
-
const INTERNAL_KEYS = /* @__PURE__ */ new Set([
|
|
2483
|
-
"setAdapter",
|
|
2484
|
-
"getAdapter",
|
|
2485
|
-
"platform",
|
|
2486
|
-
"raw",
|
|
2487
|
-
"resolveTarget",
|
|
2488
|
-
"supports"
|
|
2489
|
-
]);
|
|
2490
|
-
const PLATFORM_ALIASES = { kuaishou: "ks" };
|
|
2491
|
-
const WECHAT_FILE_SYSTEM_MANAGER_METHODS = /* @__PURE__ */ new Set(["saveFile", "removeSavedFile"]);
|
|
2492
|
-
function normalizePlatformName(value) {
|
|
2493
|
-
const normalized = normalizeMiniProgramPlatform(value);
|
|
2494
|
-
if (!normalized) return;
|
|
2495
|
-
const miniProgramPlatform = resolveMiniProgramPlatform(normalized);
|
|
2496
|
-
if (miniProgramPlatform) return getMiniProgramRuntimeGlobalKey(miniProgramPlatform);
|
|
2497
|
-
return PLATFORM_ALIASES[normalized] ?? normalized;
|
|
2498
|
-
}
|
|
2499
|
-
/**
|
|
2500
|
-
* @description 创建跨平台 API 实例
|
|
2501
|
-
*/
|
|
2502
|
-
function createWeapi(options = {}) {
|
|
2503
|
-
let adapter = options.adapter;
|
|
2504
|
-
let platformName = normalizePlatformName(options.platform);
|
|
2505
|
-
const allowFallback = false;
|
|
2506
|
-
const cache = /* @__PURE__ */ new Map();
|
|
2507
|
-
const networkPolicy = createNetworkRequestPolicy(() => platformName, options.network);
|
|
2508
|
-
const resolveAdapter = () => {
|
|
2509
|
-
if (adapter) return adapter;
|
|
2510
|
-
const detected = detectGlobalAdapter();
|
|
2511
|
-
if (detected.adapter) {
|
|
2512
|
-
adapter = detected.adapter;
|
|
2513
|
-
platformName = platformName ?? normalizePlatformName(detected.platform);
|
|
2514
|
-
}
|
|
2515
|
-
return adapter;
|
|
2516
|
-
};
|
|
2517
|
-
const setAdapter = (nextAdapter, nextPlatform) => {
|
|
2518
|
-
adapter = nextAdapter;
|
|
2519
|
-
platformName = normalizePlatformName(nextPlatform);
|
|
2520
|
-
cache.clear();
|
|
2521
|
-
};
|
|
2522
|
-
const getAdapter = () => {
|
|
2523
|
-
if (!adapter) resolveAdapter();
|
|
2524
|
-
return adapter;
|
|
2525
|
-
};
|
|
2526
|
-
const getPlatform = () => {
|
|
2527
|
-
if (!platformName) resolveAdapter();
|
|
2528
|
-
return platformName;
|
|
2529
|
-
};
|
|
2530
|
-
const resolveRuntimeMethod = (runtimeAdapter, platform, methodName) => {
|
|
2531
|
-
if (!runtimeAdapter) return;
|
|
2532
|
-
if (platform === "wx" && WECHAT_FILE_SYSTEM_MANAGER_METHODS.has(methodName)) {
|
|
2533
|
-
const getFileSystemManager = runtimeAdapter.getFileSystemManager;
|
|
2534
|
-
if (typeof getFileSystemManager !== "function") return;
|
|
2535
|
-
const fileSystemManager = getFileSystemManager.call(runtimeAdapter);
|
|
2536
|
-
const fileSystemMethod = fileSystemManager?.[methodName];
|
|
2537
|
-
return typeof fileSystemMethod === "function" ? fileSystemMethod.bind(fileSystemManager) : void 0;
|
|
2538
|
-
}
|
|
2539
|
-
return runtimeAdapter[methodName];
|
|
2540
|
-
};
|
|
2541
|
-
const resolveTarget = (methodName) => {
|
|
2542
|
-
const runtimeAdapter = resolveAdapter();
|
|
2543
|
-
const platform = getPlatform();
|
|
2544
|
-
const mappingInfo = resolveMethodMappingWithMeta(platform, methodName, { allowFallback });
|
|
2545
|
-
const target = mappingInfo?.target ?? methodName;
|
|
2546
|
-
const supported = typeof resolveRuntimeMethod(runtimeAdapter, platform, target) === "function";
|
|
2547
|
-
const supportLevel = !supported ? "unsupported" : mappingInfo?.source === "fallback" ? "fallback" : mappingInfo?.source === "explicit" ? "mapped" : "native";
|
|
2548
|
-
return {
|
|
2549
|
-
method: methodName,
|
|
2550
|
-
target,
|
|
2551
|
-
platform,
|
|
2552
|
-
mapped: target !== methodName,
|
|
2553
|
-
supported,
|
|
2554
|
-
supportLevel,
|
|
2555
|
-
semanticAligned: supportLevel === "native" || supportLevel === "mapped"
|
|
2556
|
-
};
|
|
2557
|
-
};
|
|
2558
|
-
const supports = (methodName, queryOptions = {}) => {
|
|
2559
|
-
const resolved = resolveTarget(methodName);
|
|
2560
|
-
if (queryOptions.semantic === true) return resolved.semanticAligned;
|
|
2561
|
-
return resolved.supported;
|
|
2562
|
-
};
|
|
2563
|
-
return new Proxy({}, { get(_target, prop) {
|
|
2564
|
-
if (prop === Symbol.toStringTag) return "Weapi";
|
|
2565
|
-
if (prop === "then") return;
|
|
2566
|
-
if (INTERNAL_KEYS.has(prop)) {
|
|
2567
|
-
if (prop === "setAdapter") return setAdapter;
|
|
2568
|
-
if (prop === "getAdapter") return getAdapter;
|
|
2569
|
-
if (prop === "platform") return getPlatform();
|
|
2570
|
-
if (prop === "raw") return getAdapter();
|
|
2571
|
-
if (prop === "resolveTarget") return resolveTarget;
|
|
2572
|
-
if (prop === "supports") return supports;
|
|
2573
|
-
}
|
|
2574
|
-
if (cache.has(prop)) return cache.get(prop);
|
|
2575
|
-
const currentAdapter = resolveAdapter();
|
|
2576
|
-
if (!currentAdapter) {
|
|
2577
|
-
if (typeof prop !== "string") return;
|
|
2578
|
-
return (...args) => callMissingApi(prop, getPlatform(), args);
|
|
2579
|
-
}
|
|
2580
|
-
const platform = getPlatform();
|
|
2581
|
-
const methodName = (typeof prop === "string" ? resolveMethodMappingWithMeta(platform, prop, { allowFallback }) : void 0)?.target ?? prop;
|
|
2582
|
-
const value = resolveRuntimeMethod(currentAdapter, platform, methodName);
|
|
2583
|
-
if (typeof value !== "function") {
|
|
2584
|
-
if (value === void 0 && typeof prop === "string") {
|
|
2585
|
-
const missing = (...args) => callMissingApi(prop, getPlatform(), args);
|
|
2586
|
-
cache.set(prop, missing);
|
|
2587
|
-
return missing;
|
|
2588
|
-
}
|
|
2589
|
-
cache.set(prop, value);
|
|
2590
|
-
return value;
|
|
2591
|
-
}
|
|
2592
|
-
const wrapped = (...args) => {
|
|
2593
|
-
const runtimeAdapter = resolveAdapter();
|
|
2594
|
-
const platform = getPlatform();
|
|
2595
|
-
const mappingInfo = resolveMethodMappingWithMeta(platform, prop, { allowFallback });
|
|
2596
|
-
const mappingRule = mappingInfo?.rule;
|
|
2597
|
-
const methodName = mappingInfo?.target ?? prop;
|
|
2598
|
-
const runtimeMethod = resolveRuntimeMethod(runtimeAdapter, platform, methodName);
|
|
2599
|
-
let runtimeArgs = args;
|
|
2600
|
-
try {
|
|
2601
|
-
runtimeArgs = mappingRule?.mapArgs ? mappingRule.mapArgs(args) : args;
|
|
2602
|
-
} catch (error) {
|
|
2603
|
-
const lastArg = args.length > 0 ? args[args.length - 1] : void 0;
|
|
2604
|
-
if (hasCallbacks(lastArg)) {
|
|
2605
|
-
lastArg.fail?.(error);
|
|
2606
|
-
lastArg.complete?.(error);
|
|
2607
|
-
return;
|
|
2608
|
-
}
|
|
2609
|
-
return Promise.reject(error);
|
|
2610
|
-
}
|
|
2611
|
-
if (typeof runtimeMethod !== "function") return callMissingApi(prop, getPlatform(), args);
|
|
2612
|
-
if (shouldSkipPromise(prop)) {
|
|
2613
|
-
const result = runtimeMethod.apply(runtimeAdapter, runtimeArgs);
|
|
2614
|
-
return mappingRule?.mapResult ? mappingRule.mapResult(result, runtimeArgs) : result;
|
|
2615
|
-
}
|
|
2616
|
-
const lastArg = runtimeArgs.length > 0 ? runtimeArgs[runtimeArgs.length - 1] : void 0;
|
|
2617
|
-
if (hasCallbacks(lastArg)) {
|
|
2618
|
-
if (mappingRule?.mapResult && isPlainObject(lastArg)) {
|
|
2619
|
-
const options = lastArg;
|
|
2620
|
-
const originalSuccess = options.success;
|
|
2621
|
-
const originalComplete = options.complete;
|
|
2622
|
-
options.success = (res) => {
|
|
2623
|
-
originalSuccess?.(mappingRule.mapResult(res, runtimeArgs));
|
|
2624
|
-
};
|
|
2625
|
-
options.complete = (res) => {
|
|
2626
|
-
originalComplete?.(mappingRule.mapResult(res, runtimeArgs));
|
|
2627
|
-
};
|
|
2628
|
-
}
|
|
2629
|
-
networkPolicy.bindAdapter(runtimeAdapter);
|
|
2630
|
-
const networkCall = networkPolicy.prepareCall(prop, runtimeArgs);
|
|
2631
|
-
if (networkCall?.blockedError) return callWithError(networkCall.blockedError, runtimeArgs);
|
|
2632
|
-
const nextRuntimeArgs = networkCall?.args ?? runtimeArgs;
|
|
2633
|
-
const invokeRuntime = () => runtimeMethod.apply(runtimeAdapter, nextRuntimeArgs);
|
|
2634
|
-
const result = networkCall ? networkCall.invoke(invokeRuntime) : invokeRuntime();
|
|
2635
|
-
return mappingRule?.mapResult ? mappingRule.mapResult(result, nextRuntimeArgs) : result;
|
|
2636
|
-
}
|
|
2637
|
-
let networkCall;
|
|
2638
|
-
return callWithPromise(runtimeAdapter, runtimeMethod, runtimeArgs, mappingRule?.mapResult, {
|
|
2639
|
-
onOptions: (_options, nextArgs) => {
|
|
2640
|
-
networkPolicy.bindAdapter(runtimeAdapter);
|
|
2641
|
-
networkCall = networkPolicy.prepareCall(prop, nextArgs);
|
|
2642
|
-
if (networkCall?.blockedError) throw networkCall.blockedError;
|
|
2643
|
-
if (!networkCall) return;
|
|
2644
|
-
nextArgs.splice(0, nextArgs.length, ...networkCall.args);
|
|
2645
|
-
},
|
|
2646
|
-
invoke: (invoke) => {
|
|
2647
|
-
if (networkCall) {
|
|
2648
|
-
networkCall.invoke(invoke);
|
|
2649
|
-
return;
|
|
2650
|
-
}
|
|
2651
|
-
invoke();
|
|
2652
|
-
}
|
|
2653
|
-
});
|
|
2654
|
-
};
|
|
2655
|
-
cache.set(prop, wrapped);
|
|
2656
|
-
return wrapped;
|
|
2657
|
-
} });
|
|
2658
|
-
}
|
|
2659
|
-
//#endregion
|
|
2660
|
-
//#region src/index.ts
|
|
2661
|
-
/**
|
|
2662
|
-
* @description 默认跨平台 API 实例(推荐使用)
|
|
2663
|
-
*
|
|
2664
|
-
* @generated weapi-platform-matrix:start
|
|
2665
|
-
* | 平台 | 类型来源 | 支持度 |
|
|
2666
|
-
* | --- | --- | --- |
|
|
2667
|
-
* | 微信小程序 (`wx`) | `miniprogram-api-typings` | ✅ 全量 |
|
|
2668
|
-
* | 支付宝小程序 (`my`) | `@mini-types/alipay` | ✅ 全量 |
|
|
2669
|
-
* | 百度智能小程序 (`swan`) | 运行时透传 | ⚠️ 按宿主能力支持 |
|
|
2670
|
-
* | 抖音小程序 (`tt`) | `@douyin-microapp/typings` | ✅ 全量 |
|
|
2671
|
-
* | 京东小程序 (`jd`) | 运行时透传 | ⚠️ 按宿主能力支持 |
|
|
2672
|
-
* | 小红书小程序 (`xhs`) | 运行时透传 | ⚠️ 按宿主能力支持 |
|
|
2673
|
-
* @generated weapi-platform-matrix:end
|
|
2674
|
-
*/
|
|
2675
|
-
const wpi = createWeapi();
|
|
2676
|
-
//#endregion
|
|
2677
|
-
export { WEAPI_PLATFORM_TYPE_SOURCES, WEAPI_RUNTIME_TYPE_SOURCES, WEAPI_TYPE_SOURCES, createWeapi, wpi };
|
|
1
|
+
export * from "@weapp-core/api";
|
|
2
|
+
export {};
|