@ray-js/lock-sdk 1.2.0-beta.8 → 1.2.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/lib/api/fit.d.ts +55 -2
- package/lib/api/fit.js +43 -1
- package/lib/api/gesture.d.ts +11 -0
- package/lib/api/gesture.js +18 -0
- package/lib/api/log.d.ts +52 -4
- package/lib/api/log.js +22 -0
- package/lib/api/temp.d.ts +21 -0
- package/lib/api/temp.js +24 -0
- package/lib/api/video.d.ts +4 -0
- package/lib/api/video.js +10 -0
- package/lib/config/dp-code/index.d.ts +1 -1
- package/lib/config/dp-code/index.js +1 -0
- package/lib/entries/main/bootstrap/bootstrap-lock-instance.d.ts +2 -1
- package/lib/entries/main/bootstrap/bootstrap-lock-instance.js +23 -8
- package/lib/entries/main/bootstrap/bootstrap.d.ts +3 -2
- package/lib/entries/main/bootstrap/bootstrap.js +10 -6
- package/lib/entries/main/bootstrap/primary-instance.d.ts +1 -2
- package/lib/entries/main/bootstrap/primary-instance.js +1 -1
- package/lib/entries/main/bootstrap/resolve-runtime-from-export-this.js +1 -1
- package/lib/entries/main/build-instance.d.ts +6 -3
- package/lib/entries/main/build-instance.js +13 -1
- package/lib/entries/main/exports/capability.d.ts +2 -0
- package/lib/entries/main/exports/capability.js +7 -1
- package/lib/entries/main/exports/fit-sdk/binding.d.ts +10 -0
- package/lib/entries/{fit/exports → main/exports/fit-sdk}/binding.js +6 -3
- package/lib/entries/{fit/exports → main/exports/fit-sdk}/device.d.ts +11 -10
- package/lib/entries/{fit/exports → main/exports/fit-sdk}/device.js +20 -20
- package/lib/entries/{fit/exports → main/exports/fit-sdk}/index.d.ts +1 -0
- package/lib/entries/{fit/exports → main/exports/fit-sdk}/index.js +1 -0
- package/lib/entries/main/exports/fit-sdk/log.d.ts +3 -0
- package/lib/entries/main/exports/fit-sdk/log.js +5 -0
- package/lib/entries/main/exports/fit-sdk/temp.d.ts +40 -0
- package/lib/entries/main/exports/fit-sdk/temp.js +59 -0
- package/lib/entries/main/exports/gesture.d.ts +6 -0
- package/lib/entries/main/exports/gesture.js +8 -0
- package/lib/entries/main/exports/index.d.ts +5 -0
- package/lib/entries/main/exports/index.js +5 -0
- package/lib/entries/main/exports/log.d.ts +2 -0
- package/lib/entries/main/exports/log.js +7 -1
- package/lib/entries/main/exports/media.d.ts +3 -1
- package/lib/entries/main/exports/media.js +8 -2
- package/lib/entries/main/exports/misc.d.ts +4 -2
- package/lib/entries/main/exports/misc.js +2 -2
- package/lib/entries/main/index.d.ts +3 -3
- package/lib/entries/main/index.js +11 -5
- package/lib/feature/fit/bind-lock-to-fit.d.ts +1 -0
- package/lib/feature/fit/bind-lock-to-fit.js +53 -0
- package/lib/feature/fit/ble-key.d.ts +10 -4
- package/lib/feature/fit/ble-key.js +145 -4
- package/lib/feature/fit/device-bv.d.ts +2 -0
- package/lib/feature/fit/device-bv.js +15 -0
- package/lib/feature/fit/invalid-password.d.ts +10 -0
- package/lib/feature/fit/invalid-password.js +43 -0
- package/lib/feature/fit/list.d.ts +12 -2
- package/lib/feature/fit/list.js +54 -5
- package/lib/feature/fit/log.d.ts +7 -0
- package/lib/feature/fit/log.js +123 -0
- package/lib/feature/fit/method/add-flow.js +2 -2
- package/lib/feature/fit/method/add-password.js +2 -2
- package/lib/feature/fit/method/update-remove.js +40 -14
- package/lib/feature/fit/password-list.d.ts +37 -0
- package/lib/feature/fit/password-list.js +44 -1
- package/lib/feature/fit/security-channel.d.ts +3 -0
- package/lib/feature/fit/security-channel.js +43 -0
- package/lib/feature/fit/shared.d.ts +8 -0
- package/lib/feature/fit/shared.js +40 -1
- package/lib/feature/fit/sync.d.ts +4 -2
- package/lib/feature/fit/sync.js +63 -22
- package/lib/feature/fit/temp-password.d.ts +23 -0
- package/lib/feature/fit/temp-password.js +95 -3
- package/lib/feature/fit/users.d.ts +1 -0
- package/lib/feature/fit/users.js +1 -0
- package/lib/feature/gesture/gesture.d.ts +6 -0
- package/lib/feature/gesture/gesture.js +3 -0
- package/lib/feature/log/log.d.ts +5 -1
- package/lib/feature/log/log.js +53 -6
- package/lib/feature/media/camera.d.ts +12 -2
- package/lib/feature/media/camera.js +3 -0
- package/lib/feature/media/media.d.ts +2 -1
- package/lib/feature/media/media.js +4 -1
- package/lib/feature/misc/ble-control.js +2 -2
- package/lib/feature/misc/capability.d.ts +2 -0
- package/lib/feature/misc/capability.js +33 -31
- package/lib/feature/misc/connect-device.d.ts +1 -1
- package/lib/feature/misc/connect-device.js +7 -6
- package/lib/feature/misc/is-use-near-channel-for-runtime.js +8 -1
- package/lib/feature/password/temporary/offline-create.d.ts +14 -0
- package/lib/feature/password/temporary/offline-create.js +77 -1
- package/lib/feature/service/goto-service.d.ts +1 -1
- package/lib/feature/state/clear.js +1 -0
- package/lib/feature/state/device-status.js +17 -6
- package/lib/feature/state/init-state.js +18 -10
- package/lib/feature/state/platform-routing.js +12 -3
- package/lib/feature/state/remote-permissions.js +17 -0
- package/lib/feature/state/sync/remote-serect-key.js +7 -0
- package/lib/feature/storage/swr-cache.d.ts +7 -0
- package/lib/feature/storage/swr-cache.js +54 -0
- package/lib/feature/unlock/method/add-flow.js +2 -2
- package/lib/feature/unlock/method/add-password.js +2 -2
- package/lib/feature/user/sync-user.js +4 -2
- package/lib/feature/utils/index.d.ts +1 -0
- package/lib/feature/utils/index.js +1 -0
- package/lib/interface.d.ts +29 -0
- package/lib/platform/device.d.ts +4 -3
- package/lib/platform/ipc.d.ts +3 -0
- package/lib/platform/ipc.js +13 -0
- package/lib/platform/storage.d.ts +1 -1
- package/lib/runtime/LockDeviceRuntime.js +3 -0
- package/lib/runtime/lock-config.d.ts +5 -1
- package/lib/runtime/lock-config.js +6 -0
- package/lib/runtime/runtime-state-types.d.ts +6 -0
- package/lib/utils/constant.d.ts +1 -0
- package/lib/utils/constant.js +6 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +1 -0
- package/package.json +1 -11
- package/lib/bootstrap/bootstrap-lock-instance.d.ts +0 -7
- package/lib/bootstrap/bootstrap-lock-instance.js +0 -16
- package/lib/bootstrap/bootstrap.d.ts +0 -4
- package/lib/bootstrap/bootstrap.js +0 -53
- package/lib/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
- package/lib/bootstrap/lock-instance-runtime-ref.js +0 -7
- package/lib/bootstrap/primary-instance.d.ts +0 -6
- package/lib/bootstrap/primary-instance.js +0 -24
- package/lib/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
- package/lib/bootstrap/resolve-runtime-from-export-this.js +0 -29
- package/lib/bootstrap/top-level-runtime.d.ts +0 -2
- package/lib/bootstrap/top-level-runtime.js +0 -9
- package/lib/entries/ble/bootstrap/bootstrap-lock-instance.d.ts +0 -7
- package/lib/entries/ble/bootstrap/bootstrap-lock-instance.js +0 -12
- package/lib/entries/ble/bootstrap/bootstrap.d.ts +0 -4
- package/lib/entries/ble/bootstrap/bootstrap.js +0 -53
- package/lib/entries/ble/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
- package/lib/entries/ble/bootstrap/lock-instance-runtime-ref.js +0 -7
- package/lib/entries/ble/bootstrap/primary-instance.d.ts +0 -6
- package/lib/entries/ble/bootstrap/primary-instance.js +0 -24
- package/lib/entries/ble/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
- package/lib/entries/ble/bootstrap/resolve-runtime-from-export-this.js +0 -29
- package/lib/entries/ble/bootstrap/top-level-runtime.d.ts +0 -2
- package/lib/entries/ble/bootstrap/top-level-runtime.js +0 -9
- package/lib/entries/ble/build-instance.d.ts +0 -9
- package/lib/entries/ble/build-instance.js +0 -50
- package/lib/entries/ble/exports/capability.d.ts +0 -6
- package/lib/entries/ble/exports/capability.js +0 -17
- package/lib/entries/ble/exports/config.d.ts +0 -3
- package/lib/entries/ble/exports/config.js +0 -5
- package/lib/entries/ble/exports/dp.d.ts +0 -9
- package/lib/entries/ble/exports/dp.js +0 -13
- package/lib/entries/ble/exports/index.d.ts +0 -16
- package/lib/entries/ble/exports/index.js +0 -16
- package/lib/entries/ble/exports/linkage.d.ts +0 -5
- package/lib/entries/ble/exports/linkage.js +0 -15
- package/lib/entries/ble/exports/log.d.ts +0 -9
- package/lib/entries/ble/exports/log.js +0 -21
- package/lib/entries/ble/exports/media.d.ts +0 -4
- package/lib/entries/ble/exports/media.js +0 -12
- package/lib/entries/ble/exports/misc.d.ts +0 -19
- package/lib/entries/ble/exports/misc.js +0 -30
- package/lib/entries/ble/exports/offline-dps.d.ts +0 -8
- package/lib/entries/ble/exports/offline-dps.js +0 -24
- package/lib/entries/ble/exports/open/do-open-close-action.d.ts +0 -2
- package/lib/entries/ble/exports/open/do-open-close-action.js +0 -36
- package/lib/entries/ble/exports/open/index.d.ts +0 -18
- package/lib/entries/ble/exports/open/index.js +0 -45
- package/lib/entries/ble/exports/signal.d.ts +0 -6
- package/lib/entries/ble/exports/signal.js +0 -14
- package/lib/entries/ble/exports/sleep.d.ts +0 -13
- package/lib/entries/ble/exports/sleep.js +0 -31
- package/lib/entries/ble/exports/state.d.ts +0 -6
- package/lib/entries/ble/exports/state.js +0 -19
- package/lib/entries/ble/exports/temporary.d.ts +0 -31
- package/lib/entries/ble/exports/temporary.js +0 -91
- package/lib/entries/ble/exports/unlock/sync.d.ts +0 -1
- package/lib/entries/ble/exports/unlock/sync.js +0 -5
- package/lib/entries/ble/exports/unlock-method.d.ts +0 -19
- package/lib/entries/ble/exports/unlock-method.js +0 -58
- package/lib/entries/ble/exports/user/index.d.ts +0 -23
- package/lib/entries/ble/exports/user/index.js +0 -22
- package/lib/entries/ble/exports/user/sync.d.ts +0 -1
- package/lib/entries/ble/exports/user/sync.js +0 -5
- package/lib/entries/ble/index.d.ts +0 -8
- package/lib/entries/ble/index.js +0 -39
- package/lib/entries/fit/bootstrap/bootstrap-lock-instance.d.ts +0 -7
- package/lib/entries/fit/bootstrap/bootstrap-lock-instance.js +0 -12
- package/lib/entries/fit/bootstrap/bootstrap.d.ts +0 -4
- package/lib/entries/fit/bootstrap/bootstrap.js +0 -69
- package/lib/entries/fit/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
- package/lib/entries/fit/bootstrap/lock-instance-runtime-ref.js +0 -7
- package/lib/entries/fit/bootstrap/primary-instance.d.ts +0 -6
- package/lib/entries/fit/bootstrap/primary-instance.js +0 -24
- package/lib/entries/fit/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
- package/lib/entries/fit/bootstrap/resolve-runtime-from-export-this.js +0 -29
- package/lib/entries/fit/bootstrap/top-level-runtime.d.ts +0 -2
- package/lib/entries/fit/bootstrap/top-level-runtime.js +0 -9
- package/lib/entries/fit/build-instance.d.ts +0 -9
- package/lib/entries/fit/build-instance.js +0 -57
- package/lib/entries/fit/exports/binding.d.ts +0 -8
- package/lib/entries/fit/exports/temp.d.ts +0 -19
- package/lib/entries/fit/exports/temp.js +0 -18
- package/lib/entries/fit/index.d.ts +0 -8
- package/lib/entries/fit/index.js +0 -36
- package/lib/entries/main/exports/open.d.ts +0 -16
- package/lib/entries/main/exports/open.js +0 -44
- package/lib/entries/screen/bootstrap/bootstrap-lock-instance.d.ts +0 -7
- package/lib/entries/screen/bootstrap/bootstrap-lock-instance.js +0 -12
- package/lib/entries/screen/bootstrap/bootstrap.d.ts +0 -4
- package/lib/entries/screen/bootstrap/bootstrap.js +0 -69
- package/lib/entries/screen/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
- package/lib/entries/screen/bootstrap/lock-instance-runtime-ref.js +0 -7
- package/lib/entries/screen/bootstrap/primary-instance.d.ts +0 -6
- package/lib/entries/screen/bootstrap/primary-instance.js +0 -24
- package/lib/entries/screen/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
- package/lib/entries/screen/bootstrap/resolve-runtime-from-export-this.js +0 -29
- package/lib/entries/screen/bootstrap/top-level-runtime.d.ts +0 -2
- package/lib/entries/screen/bootstrap/top-level-runtime.js +0 -9
- package/lib/entries/screen/build-instance.d.ts +0 -9
- package/lib/entries/screen/build-instance.js +0 -57
- package/lib/entries/screen/exports/bind-events.d.ts +0 -4
- package/lib/entries/screen/exports/bind-events.js +0 -8
- package/lib/entries/screen/exports/binding.d.ts +0 -6
- package/lib/entries/screen/exports/binding.js +0 -15
- package/lib/entries/screen/exports/device.d.ts +0 -16
- package/lib/entries/screen/exports/device.js +0 -41
- package/lib/entries/screen/exports/event.d.ts +0 -3
- package/lib/entries/screen/exports/event.js +0 -5
- package/lib/entries/screen/exports/index.d.ts +0 -5
- package/lib/entries/screen/exports/index.js +0 -5
- package/lib/entries/screen/exports/user.d.ts +0 -2
- package/lib/entries/screen/exports/user.js +0 -8
- package/lib/entries/screen/index.d.ts +0 -8
- package/lib/entries/screen/index.js +0 -36
- package/lib/feature/unlock/door/door-action.d.ts +0 -2
- package/lib/feature/unlock/door/door-action.js +0 -32
- package/lib/fit.d.ts +0 -4
- package/lib/fit.js +0 -3
- package/lib/runtime/device-status/compute-device-status.d.ts +0 -25
- package/lib/runtime/device-status/compute-device-status.js +0 -94
- package/lib/screen.d.ts +0 -4
- package/lib/screen.js +0 -3
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { clearPrimaryFitSDKInstanceIfDevId } from "./bootstrap/primary-instance";
|
|
2
|
-
import { registerFitSDKInstanceRuntime } from "./bootstrap/lock-instance-runtime-ref";
|
|
3
|
-
import { getRegisteredRuntimeCount, unregisterRuntime, } from "../../runtime/registry";
|
|
4
|
-
import { clearStateForRuntime } from "../../feature/state/clear";
|
|
5
|
-
import { removeEvents } from "../../feature/state/platform-routing";
|
|
6
|
-
import { updateConfigForRuntime, } from "../../feature/misc/update-config";
|
|
7
|
-
import { sdkLog } from "../../utils/sdk-log";
|
|
8
|
-
import * as FitExports from "./exports";
|
|
9
|
-
const RESERVED_INSTANCE_METHOD_KEYS = new Set(["destroy", "updateConfig"]);
|
|
10
|
-
let cachedFlatExportKeys = null;
|
|
11
|
-
function collectFlatInstanceExportKeys() {
|
|
12
|
-
if (cachedFlatExportKeys !== null) {
|
|
13
|
-
return cachedFlatExportKeys;
|
|
14
|
-
}
|
|
15
|
-
const ex = FitExports;
|
|
16
|
-
cachedFlatExportKeys = Object.keys(ex)
|
|
17
|
-
.filter((k) => k !== "__esModule" && !RESERVED_INSTANCE_METHOD_KEYS.has(k))
|
|
18
|
-
.sort();
|
|
19
|
-
return cachedFlatExportKeys;
|
|
20
|
-
}
|
|
21
|
-
export function getFlatFitInstanceMethodKeysForTests() {
|
|
22
|
-
return collectFlatInstanceExportKeys();
|
|
23
|
-
}
|
|
24
|
-
export function buildFitSDKInstance(runtime) {
|
|
25
|
-
const instance = {
|
|
26
|
-
destroy() {
|
|
27
|
-
sdkLog("info", "fit-lifecycle", "destroy", { devId: runtime.devId });
|
|
28
|
-
unregisterRuntime(runtime.devId);
|
|
29
|
-
clearPrimaryFitSDKInstanceIfDevId(runtime.devId);
|
|
30
|
-
clearStateForRuntime(runtime);
|
|
31
|
-
if (getRegisteredRuntimeCount() === 0) {
|
|
32
|
-
removeEvents();
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
updateConfig(options) {
|
|
36
|
-
sdkLog("info", "fit-lifecycle", "updateConfig", {
|
|
37
|
-
devId: runtime.devId,
|
|
38
|
-
data: { keys: Object.keys(options) },
|
|
39
|
-
});
|
|
40
|
-
updateConfigForRuntime(runtime, options);
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
registerFitSDKInstanceRuntime(instance, runtime);
|
|
44
|
-
sdkLog("info", "fit-lifecycle", "createInstance", { devId: runtime.devId });
|
|
45
|
-
const keys = collectFlatInstanceExportKeys();
|
|
46
|
-
const ex = FitExports;
|
|
47
|
-
for (const key of keys) {
|
|
48
|
-
const val = ex[key];
|
|
49
|
-
if (typeof val === "function") {
|
|
50
|
-
instance[key] = val.bind(instance);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
instance[key] = val;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return instance;
|
|
57
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BoundFitLockItem, UnbindLockItem } from "../../../api/fit";
|
|
2
|
-
export type { BoundFitLockItem, UnbindLockItem };
|
|
3
|
-
export declare function getBoundLockList(): Promise<BoundFitLockItem[]>;
|
|
4
|
-
export declare function getUnbindLockList(): Promise<UnbindLockItem[]>;
|
|
5
|
-
export declare function bindLockToFit(lock: UnbindLockItem): Promise<unknown>;
|
|
6
|
-
export declare function unbindLockToFit(lock: BoundFitLockItem & {
|
|
7
|
-
bindingId: string;
|
|
8
|
-
}): Promise<unknown>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type AddFitTempPwdParams, type RemoveFitTempPwdParams, type RenameFitTempPwdParams, type UpdateFitTempPwdParams } from "../../../feature/fit/temp-password";
|
|
2
|
-
export declare function getFitPasswordList(): Promise<{
|
|
3
|
-
id: number;
|
|
4
|
-
unlockId: string;
|
|
5
|
-
unlockName: string;
|
|
6
|
-
photoUnlock: boolean;
|
|
7
|
-
userName: string;
|
|
8
|
-
lockUserId: number;
|
|
9
|
-
userType: number;
|
|
10
|
-
devLockId: string;
|
|
11
|
-
effective: import("../../..").EffectiveConfig;
|
|
12
|
-
}[]>;
|
|
13
|
-
export declare function addFitTempPwd(params: AddFitTempPwdParams): Promise<{
|
|
14
|
-
pwdId: number;
|
|
15
|
-
}>;
|
|
16
|
-
export declare function removeFitTempPwd(params: RemoveFitTempPwdParams): Promise<void>;
|
|
17
|
-
export declare function updateFitTempPwd(params: UpdateFitTempPwdParams): Promise<void>;
|
|
18
|
-
export declare function renameFitTempPwd(params: RenameFitTempPwdParams): Promise<void>;
|
|
19
|
-
export type { AddFitTempPwdParams, RemoveFitTempPwdParams, UpdateFitTempPwdParams, RenameFitTempPwdParams, };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getFitPasswordListForRuntime } from "../../../feature/fit/password-list";
|
|
2
|
-
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
3
|
-
import { fitAddTempPwdForRuntime, fitRemoveTempPwdForRuntime, fitRenameTempPwdForRuntime, fitUpdateTempPwdForRuntime, } from "../../../feature/fit/temp-password";
|
|
4
|
-
export function getFitPasswordList() {
|
|
5
|
-
return getFitPasswordListForRuntime(resolveRuntimeFromExportThis(this));
|
|
6
|
-
}
|
|
7
|
-
export function addFitTempPwd(params) {
|
|
8
|
-
return fitAddTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
9
|
-
}
|
|
10
|
-
export function removeFitTempPwd(params) {
|
|
11
|
-
return fitRemoveTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
12
|
-
}
|
|
13
|
-
export function updateFitTempPwd(params) {
|
|
14
|
-
return fitUpdateTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
15
|
-
}
|
|
16
|
-
export function renameFitTempPwd(params) {
|
|
17
|
-
return fitRenameTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
18
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { LockSDKOption } from "../../interface";
|
|
2
|
-
import type { FitSDKInstance } from "./build-instance";
|
|
3
|
-
export * from "./exports";
|
|
4
|
-
export type { FitSDKInstance };
|
|
5
|
-
export type { FitSdkBoundExportThis } from "./bootstrap/resolve-runtime-from-export-this";
|
|
6
|
-
export declare const createFitSDK: (options?: Omit<LockSDKOption, "preFetch">) => Promise<FitSDKInstance>;
|
|
7
|
-
export declare const initFit: (options?: LockSDKOption) => Promise<void>;
|
|
8
|
-
export declare const destroyFit: () => void;
|
package/lib/entries/fit/index.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { clearStateForRuntime } from "../../feature/state/clear";
|
|
2
|
-
import { removeEvents } from "../../feature/state/platform-routing";
|
|
3
|
-
import { bootstrapRegisteredFitInstance } from "./bootstrap/bootstrap-lock-instance";
|
|
4
|
-
import { clearPrimaryFitSDKInstance, setPrimaryFitSDKInstance, } from "./bootstrap/primary-instance";
|
|
5
|
-
import { clearAllRuntimes, listRegisteredRuntimes, } from "../../runtime/registry";
|
|
6
|
-
import { getLaunchOptionsSync } from "../../platform/device";
|
|
7
|
-
import { getError } from "../../utils/errors";
|
|
8
|
-
export * from "./exports";
|
|
9
|
-
export const createFitSDK = async (options) => {
|
|
10
|
-
const { instance } = await bootstrapRegisteredFitInstance({
|
|
11
|
-
...options,
|
|
12
|
-
preFetch: false,
|
|
13
|
-
});
|
|
14
|
-
return instance;
|
|
15
|
-
};
|
|
16
|
-
export const initFit = async (options) => {
|
|
17
|
-
const opts = { ...options };
|
|
18
|
-
const { devInfo, deviceId } = opts;
|
|
19
|
-
if (!devInfo && !deviceId) {
|
|
20
|
-
const { query } = getLaunchOptionsSync();
|
|
21
|
-
opts.deviceId = query.deviceId;
|
|
22
|
-
if (!opts.deviceId) {
|
|
23
|
-
throw getError(1000);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const { instance } = await bootstrapRegisteredFitInstance(opts);
|
|
27
|
-
setPrimaryFitSDKInstance(instance);
|
|
28
|
-
};
|
|
29
|
-
export const destroyFit = () => {
|
|
30
|
-
removeEvents();
|
|
31
|
-
for (const rt of listRegisteredRuntimes()) {
|
|
32
|
-
clearStateForRuntime(rt);
|
|
33
|
-
}
|
|
34
|
-
clearAllRuntimes();
|
|
35
|
-
clearPrimaryFitSDKInstance();
|
|
36
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { getRemotePermissionList } from "../../../feature/unlock/door/remote-permission";
|
|
2
|
-
import { type OpenDoorCallOptions } from "../../../feature/unlock/door/types";
|
|
3
|
-
import { RemotePermissionType } from "packages/lock-sdk/src/constant";
|
|
4
|
-
export declare function checkRemoteEnabled(): Promise<void>;
|
|
5
|
-
export declare function openDoor(option?: OpenDoorCallOptions): Promise<void>;
|
|
6
|
-
export declare function closeDoor(option?: OpenDoorCallOptions): Promise<void>;
|
|
7
|
-
export declare function remoteEnabled(state: boolean): Promise<void>;
|
|
8
|
-
export declare function getRemoteEnabled(): boolean;
|
|
9
|
-
export { getRemotePermissionList };
|
|
10
|
-
export declare function getRemotePermission(): RemotePermissionType;
|
|
11
|
-
export declare function updateRemotePermission(permission: RemotePermissionType): Promise<void>;
|
|
12
|
-
export declare function agreeOpenDoor(option?: OpenDoorCallOptions): Promise<void>;
|
|
13
|
-
export declare function rejectOpenDoor(option?: OpenDoorCallOptions): Promise<void>;
|
|
14
|
-
export declare function getVoiceUnlockPwdEnabled(): Promise<boolean>;
|
|
15
|
-
export declare function voiceUnlockPwdDisabled(): Promise<boolean>;
|
|
16
|
-
export declare function updateVoiceUnlockPwd(password: string): Promise<boolean>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
2
|
-
import { checkRemoteEnabledForRuntime } from "../../../feature/unlock/door/check-remote";
|
|
3
|
-
import { doOpenCloseActionForRuntime } from "../../../feature/unlock/door/door-action";
|
|
4
|
-
import { handleOpenDoorForRuntime } from "../../../feature/unlock/door/wifi-pro-confirm";
|
|
5
|
-
import { getRemotePermissionList, remoteEnabledForRuntime, updateRemotePermissionForRuntime, } from "../../../feature/unlock/door/remote-permission";
|
|
6
|
-
import { getVoiceUnlockPwdEnabledForRuntime, voiceUnlockPwdDisabledForRuntime, updateVoiceUnlockPwdForRuntime, } from "../../../feature/unlock/door/voice-unlock-pwd";
|
|
7
|
-
import { OPEN_CLOSE_ACTION_DEFAULT_TIMEOUT_MS, } from "../../../feature/unlock/door/types";
|
|
8
|
-
export async function checkRemoteEnabled() {
|
|
9
|
-
await checkRemoteEnabledForRuntime(resolveRuntimeFromExportThis(this));
|
|
10
|
-
}
|
|
11
|
-
export function openDoor(option) {
|
|
12
|
-
return doOpenCloseActionForRuntime(resolveRuntimeFromExportThis(this), true, option?.timeout ?? OPEN_CLOSE_ACTION_DEFAULT_TIMEOUT_MS);
|
|
13
|
-
}
|
|
14
|
-
export function closeDoor(option) {
|
|
15
|
-
return doOpenCloseActionForRuntime(resolveRuntimeFromExportThis(this), false, option?.timeout ?? OPEN_CLOSE_ACTION_DEFAULT_TIMEOUT_MS);
|
|
16
|
-
}
|
|
17
|
-
export async function remoteEnabled(state) {
|
|
18
|
-
await remoteEnabledForRuntime(resolveRuntimeFromExportThis(this), state);
|
|
19
|
-
}
|
|
20
|
-
export function getRemoteEnabled() {
|
|
21
|
-
return resolveRuntimeFromExportThis(this).config.remoteOpenEnabled;
|
|
22
|
-
}
|
|
23
|
-
export { getRemotePermissionList };
|
|
24
|
-
export function getRemotePermission() {
|
|
25
|
-
return resolveRuntimeFromExportThis(this).config.remoteOpenPermission;
|
|
26
|
-
}
|
|
27
|
-
export async function updateRemotePermission(permission) {
|
|
28
|
-
await updateRemotePermissionForRuntime(resolveRuntimeFromExportThis(this), permission);
|
|
29
|
-
}
|
|
30
|
-
export function agreeOpenDoor(option) {
|
|
31
|
-
return handleOpenDoorForRuntime(resolveRuntimeFromExportThis(this), true, option?.timeout ?? OPEN_CLOSE_ACTION_DEFAULT_TIMEOUT_MS);
|
|
32
|
-
}
|
|
33
|
-
export function rejectOpenDoor(option) {
|
|
34
|
-
return handleOpenDoorForRuntime(resolveRuntimeFromExportThis(this), false, option?.timeout ?? OPEN_CLOSE_ACTION_DEFAULT_TIMEOUT_MS);
|
|
35
|
-
}
|
|
36
|
-
export async function getVoiceUnlockPwdEnabled() {
|
|
37
|
-
return getVoiceUnlockPwdEnabledForRuntime(resolveRuntimeFromExportThis(this));
|
|
38
|
-
}
|
|
39
|
-
export async function voiceUnlockPwdDisabled() {
|
|
40
|
-
return voiceUnlockPwdDisabledForRuntime(resolveRuntimeFromExportThis(this));
|
|
41
|
-
}
|
|
42
|
-
export async function updateVoiceUnlockPwd(password) {
|
|
43
|
-
return updateVoiceUnlockPwdForRuntime(resolveRuntimeFromExportThis(this), password);
|
|
44
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LockSDKOption } from "../../../interface";
|
|
2
|
-
import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
|
|
3
|
-
import { type ScreenSDKInstance } from "../build-instance";
|
|
4
|
-
export declare function bootstrapRegisteredScreenInstance(options?: LockSDKOption): Promise<{
|
|
5
|
-
runtime: LockDeviceRuntime;
|
|
6
|
-
instance: ScreenSDKInstance;
|
|
7
|
-
}>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { addEvents } from "../../../feature/state/platform-routing";
|
|
2
|
-
import { initState } from "../../../feature/state/init-state";
|
|
3
|
-
import { registerRuntime } from "../../../runtime/registry";
|
|
4
|
-
import { buildScreenSDKInstance } from "../build-instance";
|
|
5
|
-
import { createBootstrappedRuntime } from "./bootstrap";
|
|
6
|
-
export async function bootstrapRegisteredScreenInstance(options) {
|
|
7
|
-
const runtime = await createBootstrappedRuntime(options);
|
|
8
|
-
registerRuntime(runtime);
|
|
9
|
-
addEvents(runtime);
|
|
10
|
-
await initState(runtime);
|
|
11
|
-
return { runtime, instance: buildScreenSDKInstance(runtime) };
|
|
12
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { LockSDKOption } from "../../../interface";
|
|
2
|
-
import { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
|
|
3
|
-
export declare function applyScreenOptionsToRuntime(runtime: LockDeviceRuntime, options?: LockSDKOption): Promise<void>;
|
|
4
|
-
export declare function createBootstrappedRuntime(options?: LockSDKOption): Promise<LockDeviceRuntime>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import dpCodes from "../../../config/dp-code";
|
|
2
|
-
import { getCapabilities } from "../../../utils";
|
|
3
|
-
import { getDeviceInfo, trackEvent } from "../../../platform/device";
|
|
4
|
-
import { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
|
|
5
|
-
import { sdkLog, setSDKLogConfig } from "../../../utils/sdk-log";
|
|
6
|
-
export async function applyScreenOptionsToRuntime(runtime, options) {
|
|
7
|
-
setSDKLogConfig({
|
|
8
|
-
level: options?.logLevel ?? "warn",
|
|
9
|
-
sink: options?.logger,
|
|
10
|
-
console: options?.logToConsole ?? false,
|
|
11
|
-
});
|
|
12
|
-
const { config } = runtime;
|
|
13
|
-
let { devInfo, deviceId } = options || {};
|
|
14
|
-
if (!devInfo && !deviceId) {
|
|
15
|
-
throw new Error("deviceId is required in screen sdk");
|
|
16
|
-
}
|
|
17
|
-
if (deviceId && (!devInfo || devInfo.devId !== deviceId)) {
|
|
18
|
-
devInfo = await getDeviceInfo(deviceId);
|
|
19
|
-
}
|
|
20
|
-
let dpSchema = {};
|
|
21
|
-
const codesById = {};
|
|
22
|
-
const idsByCode = {};
|
|
23
|
-
if (devInfo.schema) {
|
|
24
|
-
dpSchema = devInfo.schema.reduce((acc, cur) => {
|
|
25
|
-
acc[cur.code] = cur;
|
|
26
|
-
codesById[cur.id] = cur.code;
|
|
27
|
-
idsByCode[cur.code] = cur.id;
|
|
28
|
-
return acc;
|
|
29
|
-
}, {});
|
|
30
|
-
}
|
|
31
|
-
else if (devInfo.dpSchema) {
|
|
32
|
-
dpSchema = devInfo.dpSchema;
|
|
33
|
-
Object.keys(dpSchema).forEach((key) => {
|
|
34
|
-
const item = dpSchema[key];
|
|
35
|
-
codesById[item.id] = item.code;
|
|
36
|
-
idsByCode[item.code] = item.id;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
config.strictMode = options?.strictMode ?? true;
|
|
40
|
-
config.passwordDigitalBase = options?.passwordDigitalBase ?? 10;
|
|
41
|
-
config.passwordSupportZero = options?.passwordSupportZero ?? true;
|
|
42
|
-
config.supportMultipleFace = options?.supportMultipleFace ?? false;
|
|
43
|
-
config.supportOfflineDps = options?.supportOfflineDps ?? false;
|
|
44
|
-
config.devInfo = devInfo;
|
|
45
|
-
config.dpSchema = dpSchema;
|
|
46
|
-
config.codesById = codesById;
|
|
47
|
-
config.idsByCode = idsByCode;
|
|
48
|
-
config.supportBigData = !!dpSchema[dpCodes.synchMethodW];
|
|
49
|
-
config.preFetch = options?.preFetch ?? false;
|
|
50
|
-
config.communication = getCapabilities(devInfo.capability).map((item) => item.id);
|
|
51
|
-
sdkLog("info", "screen-bootstrap", "applyOptions", {
|
|
52
|
-
devId: config.devInfo.devId,
|
|
53
|
-
data: {
|
|
54
|
-
productId: config.devInfo.productId,
|
|
55
|
-
strictMode: config.strictMode,
|
|
56
|
-
supportOfflineDps: config.supportOfflineDps,
|
|
57
|
-
supportBigData: config.supportBigData,
|
|
58
|
-
communication: config.communication,
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
trackEvent("t$y_UztB3Lj9Qns375R0r7dA0L5Kr2VytH3J".replace("$", ""), {
|
|
62
|
-
pid: devInfo.productId,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
export async function createBootstrappedRuntime(options) {
|
|
66
|
-
const runtime = new LockDeviceRuntime();
|
|
67
|
-
await applyScreenOptionsToRuntime(runtime, options);
|
|
68
|
-
return runtime;
|
|
69
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
|
|
2
|
-
export declare function registerScreenSDKInstanceRuntime(instance: object, runtime: LockDeviceRuntime): void;
|
|
3
|
-
export declare function getRuntimeForScreenSDKInstance(instance: object): LockDeviceRuntime | undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
|
|
2
|
-
import type { ScreenSDKInstance } from "../build-instance";
|
|
3
|
-
export declare function setPrimaryScreenSDKInstance(instance: ScreenSDKInstance): void;
|
|
4
|
-
export declare function getPrimaryScreenSDKRuntime(): LockDeviceRuntime | null;
|
|
5
|
-
export declare function clearPrimaryScreenSDKInstance(): void;
|
|
6
|
-
export declare function clearPrimaryScreenSDKInstanceIfDevId(devId: string): void;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { getRuntimeForScreenSDKInstance } from "./lock-instance-runtime-ref";
|
|
2
|
-
let primaryDevId = null;
|
|
3
|
-
let primaryRuntime = null;
|
|
4
|
-
export function setPrimaryScreenSDKInstance(instance) {
|
|
5
|
-
const runtime = getRuntimeForScreenSDKInstance(instance);
|
|
6
|
-
if (!runtime) {
|
|
7
|
-
throw new Error("setPrimaryScreenSDKInstance: instance must be returned by createScreenSDK or initScreen");
|
|
8
|
-
}
|
|
9
|
-
primaryDevId = runtime.devId;
|
|
10
|
-
primaryRuntime = runtime;
|
|
11
|
-
}
|
|
12
|
-
export function getPrimaryScreenSDKRuntime() {
|
|
13
|
-
return primaryRuntime;
|
|
14
|
-
}
|
|
15
|
-
export function clearPrimaryScreenSDKInstance() {
|
|
16
|
-
primaryDevId = null;
|
|
17
|
-
primaryRuntime = null;
|
|
18
|
-
}
|
|
19
|
-
export function clearPrimaryScreenSDKInstanceIfDevId(devId) {
|
|
20
|
-
if (primaryDevId === devId) {
|
|
21
|
-
primaryDevId = null;
|
|
22
|
-
primaryRuntime = null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { getRuntimeByDevId } from "../../../runtime/registry";
|
|
2
|
-
import { getRuntimeForScreenSDKInstance } from "./lock-instance-runtime-ref";
|
|
3
|
-
import { resolveTopLevelTargetRuntime } from "./top-level-runtime";
|
|
4
|
-
export function resolveRuntimeFromExportThis(thisArg) {
|
|
5
|
-
if (thisArg !== null &&
|
|
6
|
-
thisArg !== undefined &&
|
|
7
|
-
typeof thisArg === "object") {
|
|
8
|
-
const rtFromInstance = getRuntimeForScreenSDKInstance(thisArg);
|
|
9
|
-
if (rtFromInstance) {
|
|
10
|
-
return rtFromInstance;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (thisArg !== null &&
|
|
14
|
-
thisArg !== undefined &&
|
|
15
|
-
typeof thisArg === "object" &&
|
|
16
|
-
"devId" in thisArg &&
|
|
17
|
-
typeof thisArg.devId === "string") {
|
|
18
|
-
const devId = thisArg.devId;
|
|
19
|
-
if (devId.length === 0) {
|
|
20
|
-
throw new Error("Screen SDK: bound context devId must be non-empty");
|
|
21
|
-
}
|
|
22
|
-
const rt = getRuntimeByDevId(devId);
|
|
23
|
-
if (!rt) {
|
|
24
|
-
throw new Error(`Screen SDK: no registered runtime for devId "${devId}"; use createScreenSDK or initScreen first`);
|
|
25
|
-
}
|
|
26
|
-
return rt;
|
|
27
|
-
}
|
|
28
|
-
return resolveTopLevelTargetRuntime();
|
|
29
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { getError } from "../../../utils/errors";
|
|
2
|
-
import { getPrimaryScreenSDKRuntime } from "./primary-instance";
|
|
3
|
-
export function resolveTopLevelTargetRuntime() {
|
|
4
|
-
const primary = getPrimaryScreenSDKRuntime();
|
|
5
|
-
if (!primary) {
|
|
6
|
-
throw getError(1071);
|
|
7
|
-
}
|
|
8
|
-
return primary;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { LockDeviceRuntime } from "../../runtime/LockDeviceRuntime";
|
|
2
|
-
import { type UpdateConfigParams } from "../../feature/misc/update-config";
|
|
3
|
-
import * as ScreenExports from "./exports";
|
|
4
|
-
export type ScreenSDKInstance = {
|
|
5
|
-
destroy(): void;
|
|
6
|
-
updateConfig(options: UpdateConfigParams): void;
|
|
7
|
-
} & Omit<typeof ScreenExports, "updateConfig">;
|
|
8
|
-
export declare function getFlatScreenInstanceMethodKeysForTests(): string[];
|
|
9
|
-
export declare function buildScreenSDKInstance(runtime: LockDeviceRuntime): ScreenSDKInstance;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { clearPrimaryScreenSDKInstanceIfDevId } from "./bootstrap/primary-instance";
|
|
2
|
-
import { registerScreenSDKInstanceRuntime } from "./bootstrap/lock-instance-runtime-ref";
|
|
3
|
-
import { getRegisteredRuntimeCount, unregisterRuntime, } from "../../runtime/registry";
|
|
4
|
-
import { clearStateForRuntime } from "../../feature/state/clear";
|
|
5
|
-
import { removeEvents } from "../../feature/state/platform-routing";
|
|
6
|
-
import { updateConfigForRuntime, } from "../../feature/misc/update-config";
|
|
7
|
-
import { sdkLog } from "../../utils/sdk-log";
|
|
8
|
-
import * as ScreenExports from "./exports";
|
|
9
|
-
const RESERVED_INSTANCE_METHOD_KEYS = new Set(["destroy", "updateConfig"]);
|
|
10
|
-
let cachedFlatExportKeys = null;
|
|
11
|
-
function collectFlatInstanceExportKeys() {
|
|
12
|
-
if (cachedFlatExportKeys !== null) {
|
|
13
|
-
return cachedFlatExportKeys;
|
|
14
|
-
}
|
|
15
|
-
const ex = ScreenExports;
|
|
16
|
-
cachedFlatExportKeys = Object.keys(ex)
|
|
17
|
-
.filter((k) => k !== "__esModule" && !RESERVED_INSTANCE_METHOD_KEYS.has(k))
|
|
18
|
-
.sort();
|
|
19
|
-
return cachedFlatExportKeys;
|
|
20
|
-
}
|
|
21
|
-
export function getFlatScreenInstanceMethodKeysForTests() {
|
|
22
|
-
return collectFlatInstanceExportKeys();
|
|
23
|
-
}
|
|
24
|
-
export function buildScreenSDKInstance(runtime) {
|
|
25
|
-
const instance = {
|
|
26
|
-
destroy() {
|
|
27
|
-
sdkLog("info", "screen-lifecycle", "destroy", { devId: runtime.devId });
|
|
28
|
-
unregisterRuntime(runtime.devId);
|
|
29
|
-
clearPrimaryScreenSDKInstanceIfDevId(runtime.devId);
|
|
30
|
-
clearStateForRuntime(runtime);
|
|
31
|
-
if (getRegisteredRuntimeCount() === 0) {
|
|
32
|
-
removeEvents();
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
updateConfig(options) {
|
|
36
|
-
sdkLog("info", "screen-lifecycle", "updateConfig", {
|
|
37
|
-
devId: runtime.devId,
|
|
38
|
-
data: { keys: Object.keys(options) },
|
|
39
|
-
});
|
|
40
|
-
updateConfigForRuntime(runtime, options);
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
registerScreenSDKInstanceRuntime(instance, runtime);
|
|
44
|
-
sdkLog("info", "screen-lifecycle", "createInstance", { devId: runtime.devId });
|
|
45
|
-
const keys = collectFlatInstanceExportKeys();
|
|
46
|
-
const ex = ScreenExports;
|
|
47
|
-
for (const key of keys) {
|
|
48
|
-
const val = ex[key];
|
|
49
|
-
if (typeof val === "function") {
|
|
50
|
-
instance[key] = val.bind(instance);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
instance[key] = val;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return instance;
|
|
57
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type BindLockToScreenEvent, type BindLockToScreenListener } from "../../../feature/screen/bind-watch";
|
|
2
|
-
export type { BindLockToScreenEvent, BindLockToScreenListener };
|
|
3
|
-
export declare function onBindLockToScreen(listener: BindLockToScreenListener): void;
|
|
4
|
-
export declare function offBindLockToScreen(listener: BindLockToScreenListener): void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { onBindLockToScreenForRuntime, offBindLockToScreenForRuntime, } from "../../../feature/screen/bind-watch";
|
|
2
|
-
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
3
|
-
export function onBindLockToScreen(listener) {
|
|
4
|
-
onBindLockToScreenForRuntime(resolveRuntimeFromExportThis(this), listener);
|
|
5
|
-
}
|
|
6
|
-
export function offBindLockToScreen(listener) {
|
|
7
|
-
offBindLockToScreenForRuntime(resolveRuntimeFromExportThis(this), listener);
|
|
8
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { BindableLockItem, BindableLockListResult, BindingResult, BoundLockItem, BoundLockListResult, UnbindingResult } from "../../../api/screen";
|
|
2
|
-
export type { BindableLockItem, BindableLockListResult, BindingResult, BoundLockItem, BoundLockListResult, UnbindingResult, };
|
|
3
|
-
export declare function getBoundLockList(): Promise<BoundLockListResult>;
|
|
4
|
-
export declare function getBindableLockList(): Promise<BindableLockListResult>;
|
|
5
|
-
export declare function bindLock(lockDevId: string): Promise<BindingResult>;
|
|
6
|
-
export declare function unbindLock(relationId: string): Promise<UnbindingResult>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { getBoundLockListForRuntime, getBindableLockListForRuntime, } from "../../../feature/screen/list";
|
|
2
|
-
import { bindLockForRuntime, unbindLockForRuntime, } from "../../../feature/screen/bind";
|
|
3
|
-
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
4
|
-
export function getBoundLockList() {
|
|
5
|
-
return getBoundLockListForRuntime(resolveRuntimeFromExportThis(this));
|
|
6
|
-
}
|
|
7
|
-
export function getBindableLockList() {
|
|
8
|
-
return getBindableLockListForRuntime(resolveRuntimeFromExportThis(this));
|
|
9
|
-
}
|
|
10
|
-
export function bindLock(lockDevId) {
|
|
11
|
-
return bindLockForRuntime(resolveRuntimeFromExportThis(this), lockDevId);
|
|
12
|
-
}
|
|
13
|
-
export function unbindLock(relationId) {
|
|
14
|
-
return unbindLockForRuntime(resolveRuntimeFromExportThis(this), relationId);
|
|
15
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { WiFiSignalChangeListener } from "../../../feature/misc/signal";
|
|
2
|
-
import { hasDpForRuntime } from "../../../feature/dp/has-dp";
|
|
3
|
-
import type { ProductCommunicationType } from "../../../constant";
|
|
4
|
-
import { type DeviceStatus, type DpValue } from "../../../interface";
|
|
5
|
-
export type { WiFiSignalChangeListener } from "../../../feature/misc/signal";
|
|
6
|
-
export declare function getDeviceStatus(): DeviceStatus;
|
|
7
|
-
export declare function onDeviceStatusChange(callback: (status: DeviceStatus) => void): void;
|
|
8
|
-
export declare function offDeviceStatusChange(callback: (status: DeviceStatus) => void): void;
|
|
9
|
-
export declare function getWiFiSignal(): Promise<void>;
|
|
10
|
-
export declare function onWiFiSignalChange(cb: WiFiSignalChangeListener): void;
|
|
11
|
-
export declare function offWiFiSignalChange(cb: WiFiSignalChangeListener): void;
|
|
12
|
-
export declare function isSupportMedia(): boolean;
|
|
13
|
-
export declare function hasDp(dpCode: string): ReturnType<typeof hasDpForRuntime>;
|
|
14
|
-
export declare function hasCapability(capability: ProductCommunicationType): boolean;
|
|
15
|
-
export declare function publishOfflineDps(dps: Record<string, DpValue>): Promise<void>;
|
|
16
|
-
export declare function getDeviceAdvancedAbilities(): Promise<import("../../../interface").DeviceAdvancedAbility>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { getDeviceStatusForRuntime } from "../../../feature/state/device-status";
|
|
2
|
-
import { onDeviceStatusChangeForRuntime, offDeviceStatusChangeForRuntime, } from "../../../feature/state/device-status-events";
|
|
3
|
-
import { getWiFiSignalForRuntime, onWiFiSignalChangeForRuntime, offWiFiSignalChangeForRuntime, } from "../../../feature/misc/signal";
|
|
4
|
-
import { isSupportMediaForRuntime } from "../../../feature/media/media";
|
|
5
|
-
import { hasDpForRuntime } from "../../../feature/dp/has-dp";
|
|
6
|
-
import { hasCapabilityForRuntime, getDeviceAdvancedAbilitiesForRuntime, } from "../../../feature/misc/capability";
|
|
7
|
-
import { publishOfflineDpsForRuntime } from "../../../feature/offline-dps";
|
|
8
|
-
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
9
|
-
export function getDeviceStatus() {
|
|
10
|
-
return getDeviceStatusForRuntime(resolveRuntimeFromExportThis(this));
|
|
11
|
-
}
|
|
12
|
-
export function onDeviceStatusChange(callback) {
|
|
13
|
-
onDeviceStatusChangeForRuntime(resolveRuntimeFromExportThis(this), callback);
|
|
14
|
-
}
|
|
15
|
-
export function offDeviceStatusChange(callback) {
|
|
16
|
-
offDeviceStatusChangeForRuntime(resolveRuntimeFromExportThis(this), callback);
|
|
17
|
-
}
|
|
18
|
-
export function getWiFiSignal() {
|
|
19
|
-
return getWiFiSignalForRuntime(resolveRuntimeFromExportThis(this));
|
|
20
|
-
}
|
|
21
|
-
export function onWiFiSignalChange(cb) {
|
|
22
|
-
onWiFiSignalChangeForRuntime(resolveRuntimeFromExportThis(this), cb);
|
|
23
|
-
}
|
|
24
|
-
export function offWiFiSignalChange(cb) {
|
|
25
|
-
offWiFiSignalChangeForRuntime(resolveRuntimeFromExportThis(this), cb);
|
|
26
|
-
}
|
|
27
|
-
export function isSupportMedia() {
|
|
28
|
-
return isSupportMediaForRuntime(resolveRuntimeFromExportThis(this));
|
|
29
|
-
}
|
|
30
|
-
export function hasDp(dpCode) {
|
|
31
|
-
return hasDpForRuntime(resolveRuntimeFromExportThis(this), dpCode);
|
|
32
|
-
}
|
|
33
|
-
export function hasCapability(capability) {
|
|
34
|
-
return hasCapabilityForRuntime(resolveRuntimeFromExportThis(this), capability);
|
|
35
|
-
}
|
|
36
|
-
export async function publishOfflineDps(dps) {
|
|
37
|
-
return publishOfflineDpsForRuntime(resolveRuntimeFromExportThis(this), dps);
|
|
38
|
-
}
|
|
39
|
-
export async function getDeviceAdvancedAbilities() {
|
|
40
|
-
return getDeviceAdvancedAbilitiesForRuntime(resolveRuntimeFromExportThis(this));
|
|
41
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ScreenEventItem, ScreenEventListParams, ScreenEventListResult, ScreenEventLogType, ScreenEventType } from "../../../api/screen";
|
|
2
|
-
export type { ScreenEventItem, ScreenEventListParams, ScreenEventListResult, ScreenEventLogType, ScreenEventType, };
|
|
3
|
-
export declare function getEventList(params?: ScreenEventListParams): Promise<ScreenEventListResult>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { getEventListForRuntime } from "../../../feature/screen/event";
|
|
2
|
-
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
3
|
-
export function getEventList(params) {
|
|
4
|
-
return getEventListForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
5
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { getCurrentUserForRuntime } from "../../../feature/user/current-user";
|
|
2
|
-
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
3
|
-
export async function getCurrentUser(isForce) {
|
|
4
|
-
return getCurrentUserForRuntime(resolveRuntimeFromExportThis(this), isForce);
|
|
5
|
-
}
|
|
6
|
-
export function getCurrentUserSync() {
|
|
7
|
-
return resolveRuntimeFromExportThis(this).cache.currentUser;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { LockSDKOption } from "../../interface";
|
|
2
|
-
import type { ScreenSDKInstance } from "./build-instance";
|
|
3
|
-
export * from "./exports";
|
|
4
|
-
export type { ScreenSDKInstance };
|
|
5
|
-
export type { ScreenSdkBoundExportThis } from "./bootstrap/resolve-runtime-from-export-this";
|
|
6
|
-
export declare const createScreenSDK: (options?: Omit<LockSDKOption, "preFetch">) => Promise<ScreenSDKInstance>;
|
|
7
|
-
export declare const initScreen: (options?: LockSDKOption) => Promise<void>;
|
|
8
|
-
export declare const destroyScreen: () => void;
|