@ray-js/lock-sdk 1.2.0-beta.3 → 1.2.0-beta.30
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/notify.d.ts +28 -0
- package/lib/api/notify.js +17 -0
- package/lib/api/service.d.ts +26 -0
- package/lib/api/service.js +25 -0
- package/lib/api/temp.d.ts +21 -0
- package/lib/api/temp.js +24 -0
- package/lib/api/video.d.ts +9 -0
- package/lib/api/video.js +30 -0
- package/lib/api/voip.d.ts +10 -0
- package/lib/api/voip.js +17 -0
- package/lib/config/dp-code/index.d.ts +2 -1
- package/lib/config/dp-code/index.js +2 -0
- package/lib/config/dp-map/media.d.ts +13 -0
- package/lib/config/dp-map/media.js +19 -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 +8 -0
- package/lib/entries/main/exports/index.js +8 -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 +10 -1
- package/lib/entries/main/exports/media.js +29 -1
- package/lib/entries/main/exports/misc.d.ts +4 -2
- package/lib/entries/main/exports/misc.js +2 -2
- package/lib/entries/main/exports/notify.d.ts +7 -0
- package/lib/entries/main/exports/notify.js +8 -0
- package/lib/entries/main/exports/service.d.ts +4 -0
- package/lib/entries/main/exports/service.js +11 -0
- package/lib/entries/main/exports/voip.d.ts +3 -0
- package/lib/entries/main/exports/voip.js +8 -0
- 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 +18 -0
- package/lib/feature/media/camera.js +36 -0
- package/lib/feature/media/media.d.ts +10 -0
- package/lib/feature/media/media.js +31 -0
- package/lib/feature/misc/ble-control.js +2 -2
- package/lib/feature/misc/capability.d.ts +2 -0
- package/lib/feature/misc/capability.js +84 -11
- 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/notify/notify.d.ts +4 -0
- package/lib/feature/notify/notify.js +3 -0
- package/lib/feature/password/temporary/custom-dp.js +59 -54
- 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 +3 -2
- package/lib/feature/service/goto-service.js +7 -1
- package/lib/feature/service/value-added.d.ts +4 -0
- package/lib/feature/service/value-added.js +4 -0
- package/lib/feature/state/clear.js +1 -0
- package/lib/feature/state/device-status.js +17 -6
- package/lib/feature/state/init-state.js +20 -12
- 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/index.d.ts +5 -0
- package/lib/feature/storage/index.js +32 -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/unlock/sync/unlock-method.js +3 -0
- 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/feature/voip/voip.d.ts +3 -0
- package/lib/feature/voip/voip.js +3 -0
- package/lib/interface.d.ts +42 -1
- package/lib/platform/device.d.ts +4 -3
- package/lib/platform/index.d.ts +1 -0
- package/lib/platform/index.js +1 -0
- package/lib/platform/ipc.d.ts +3 -0
- package/lib/platform/ipc.js +13 -0
- package/lib/platform/storage.d.ts +3 -0
- package/lib/platform/storage.js +9 -0
- 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/errors.js +3 -1
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/parse.js +1 -1
- 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,12 +1,27 @@
|
|
|
1
|
-
import { addEvents } from "../../../feature/state/platform-routing";
|
|
1
|
+
import { addEvents, removeEvents, } from "../../../feature/state/platform-routing";
|
|
2
2
|
import { initState } from "../../../feature/state/init-state";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { clearStateForRuntime } from "../../../feature/state/clear";
|
|
4
|
+
import { registerRuntime, unregisterRuntime, getRegisteredRuntimeCount, } from "../../../runtime/registry";
|
|
5
|
+
import { buildSDKInstance } from "../build-instance";
|
|
5
6
|
import { createBootstrappedRuntime } from "./bootstrap";
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
import { startFitSyncReportForRuntime } from "../../../feature/fit/sync";
|
|
8
|
+
export async function bootstrapRegisteredInstance(kind, options) {
|
|
9
|
+
const runtime = await createBootstrappedRuntime(kind, options);
|
|
8
10
|
registerRuntime(runtime);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
try {
|
|
12
|
+
addEvents(runtime);
|
|
13
|
+
await initState(runtime);
|
|
14
|
+
if (kind === "fit") {
|
|
15
|
+
startFitSyncReportForRuntime(runtime);
|
|
16
|
+
}
|
|
17
|
+
return { runtime, instance: buildSDKInstance(runtime) };
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
unregisterRuntime(runtime.devId);
|
|
21
|
+
clearStateForRuntime(runtime);
|
|
22
|
+
if (getRegisteredRuntimeCount() === 0) {
|
|
23
|
+
removeEvents();
|
|
24
|
+
}
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
12
27
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LockSDKOption } from "../../../interface";
|
|
2
2
|
import { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
|
|
3
|
-
export
|
|
4
|
-
export declare function
|
|
3
|
+
export type SDKKind = "lock" | "fit" | "screen";
|
|
4
|
+
export declare function applyOptionsToRuntime(runtime: LockDeviceRuntime, kind: SDKKind, options?: LockSDKOption): Promise<void>;
|
|
5
|
+
export declare function createBootstrappedRuntime(kind: SDKKind, options?: LockSDKOption): Promise<LockDeviceRuntime>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import dpCodes from "../../../config/dp-code";
|
|
2
2
|
import { getCapabilities } from "../../../utils";
|
|
3
|
-
import { getDeviceInfo, trackEvent
|
|
3
|
+
import { getDeviceInfo, trackEvent } from "../../../platform/device";
|
|
4
4
|
import { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
|
|
5
5
|
import { sdkLog, setSDKLogConfig } from "../../../utils/sdk-log";
|
|
6
|
-
export async function
|
|
6
|
+
export async function applyOptionsToRuntime(runtime, kind, options) {
|
|
7
|
+
const isFit = kind === "fit";
|
|
7
8
|
setSDKLogConfig({
|
|
8
9
|
level: options?.logLevel ?? "warn",
|
|
9
10
|
sink: options?.logger,
|
|
@@ -12,7 +13,7 @@ export async function applyLockOptionsToRuntime(runtime, options) {
|
|
|
12
13
|
const { config } = runtime;
|
|
13
14
|
let { devInfo, deviceId } = options || {};
|
|
14
15
|
if (!devInfo && !deviceId) {
|
|
15
|
-
throw new Error(
|
|
16
|
+
throw new Error(`deviceId is required in ${isFit ? "fit" : "lock"} sdk`);
|
|
16
17
|
}
|
|
17
18
|
if (deviceId && (!devInfo || devInfo.devId !== deviceId)) {
|
|
18
19
|
devInfo = await getDeviceInfo(deviceId);
|
|
@@ -36,6 +37,7 @@ export async function applyLockOptionsToRuntime(runtime, options) {
|
|
|
36
37
|
idsByCode[item.code] = item.id;
|
|
37
38
|
});
|
|
38
39
|
}
|
|
40
|
+
config.isFitting = isFit;
|
|
39
41
|
config.strictMode = options?.strictMode ?? true;
|
|
40
42
|
config.passwordDigitalBase = options?.passwordDigitalBase ?? 10;
|
|
41
43
|
config.passwordSupportZero = options?.passwordSupportZero ?? true;
|
|
@@ -47,8 +49,10 @@ export async function applyLockOptionsToRuntime(runtime, options) {
|
|
|
47
49
|
config.idsByCode = idsByCode;
|
|
48
50
|
config.supportBigData = !!dpSchema[dpCodes.synchMethodW];
|
|
49
51
|
config.preFetch = options?.preFetch ?? false;
|
|
52
|
+
config.localCache = options?.localCache ?? true;
|
|
53
|
+
config.notSupportWake = options?.notSupportWake ?? false;
|
|
50
54
|
config.communication = getCapabilities(devInfo.capability).map((item) => item.id);
|
|
51
|
-
sdkLog("info", "bootstrap", "applyOptions", {
|
|
55
|
+
sdkLog("info", isFit ? "fit-bootstrap" : "bootstrap", "applyOptions", {
|
|
52
56
|
devId: config.devInfo.devId,
|
|
53
57
|
data: {
|
|
54
58
|
productId: config.devInfo.productId,
|
|
@@ -62,8 +66,8 @@ export async function applyLockOptionsToRuntime(runtime, options) {
|
|
|
62
66
|
pid: devInfo.productId,
|
|
63
67
|
});
|
|
64
68
|
}
|
|
65
|
-
export async function createBootstrappedRuntime(options) {
|
|
69
|
+
export async function createBootstrappedRuntime(kind, options) {
|
|
66
70
|
const runtime = new LockDeviceRuntime();
|
|
67
|
-
await
|
|
71
|
+
await applyOptionsToRuntime(runtime, kind, options);
|
|
68
72
|
return runtime;
|
|
69
73
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
|
|
2
|
-
|
|
3
|
-
export declare function setPrimaryLockSDKInstance(instance: LockSDKInstance): void;
|
|
2
|
+
export declare function setPrimaryLockSDKInstance(instance: object): void;
|
|
4
3
|
export declare function getPrimaryLockSDKRuntime(): LockDeviceRuntime | null;
|
|
5
4
|
export declare function clearPrimaryLockSDKInstance(): void;
|
|
6
5
|
export declare function clearPrimaryLockSDKInstanceIfDevId(devId: string): void;
|
|
@@ -4,7 +4,7 @@ let primaryRuntime = null;
|
|
|
4
4
|
export function setPrimaryLockSDKInstance(instance) {
|
|
5
5
|
const runtime = getRuntimeForLockSDKInstance(instance);
|
|
6
6
|
if (!runtime) {
|
|
7
|
-
throw new Error("setPrimaryLockSDKInstance: instance must be returned by
|
|
7
|
+
throw new Error("setPrimaryLockSDKInstance: instance must be returned by createSDK or init");
|
|
8
8
|
}
|
|
9
9
|
primaryDevId = runtime.devId;
|
|
10
10
|
primaryRuntime = runtime;
|
|
@@ -21,7 +21,7 @@ export function resolveRuntimeFromExportThis(thisArg) {
|
|
|
21
21
|
}
|
|
22
22
|
const rt = getRuntimeByDevId(devId);
|
|
23
23
|
if (!rt) {
|
|
24
|
-
throw new Error(`Lock SDK: no registered runtime for devId "${devId}"; use
|
|
24
|
+
throw new Error(`Lock SDK: no registered runtime for devId "${devId}"; use createSDK or init first`);
|
|
25
25
|
}
|
|
26
26
|
return rt;
|
|
27
27
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { LockDeviceRuntime } from "../../runtime/LockDeviceRuntime";
|
|
2
|
+
import { type UpdateConfigParams } from "../../feature/misc/update-config";
|
|
2
3
|
import * as DeviceExports from "./exports";
|
|
3
|
-
export
|
|
4
|
+
export type LockSDKInstance = {
|
|
4
5
|
destroy(): void;
|
|
5
|
-
|
|
6
|
+
updateConfig(options: UpdateConfigParams): void;
|
|
7
|
+
} & Omit<typeof DeviceExports, "updateConfig">;
|
|
8
|
+
export type FitSDKInstance = LockSDKInstance;
|
|
6
9
|
export declare function getFlatInstanceMethodKeysForTests(): string[];
|
|
7
|
-
export declare function
|
|
10
|
+
export declare function buildSDKInstance(runtime: LockDeviceRuntime): LockSDKInstance;
|
|
@@ -4,6 +4,8 @@ import { unregisterRuntime, getRegisteredRuntimeCount, } from "../../runtime/reg
|
|
|
4
4
|
import { clearStateForRuntime } from "../../feature/state/clear";
|
|
5
5
|
import { removeEvents } from "../../feature/state/platform-routing";
|
|
6
6
|
import { sdkLog } from "../../utils/sdk-log";
|
|
7
|
+
import { stopFitSyncReportForRuntime } from "../../feature/fit/sync";
|
|
8
|
+
import { updateConfigForRuntime, } from "../../feature/misc/update-config";
|
|
7
9
|
import * as DeviceExports from "./exports";
|
|
8
10
|
const RESERVED_INSTANCE_METHOD_KEYS = new Set(["destroy", "updateConfig"]);
|
|
9
11
|
let cachedFlatExportKeys = null;
|
|
@@ -20,17 +22,27 @@ function collectFlatInstanceExportKeys() {
|
|
|
20
22
|
export function getFlatInstanceMethodKeysForTests() {
|
|
21
23
|
return collectFlatInstanceExportKeys();
|
|
22
24
|
}
|
|
23
|
-
export function
|
|
25
|
+
export function buildSDKInstance(runtime) {
|
|
24
26
|
const instance = {
|
|
25
27
|
destroy() {
|
|
26
28
|
sdkLog("info", "lifecycle", "destroy", { devId: runtime.devId });
|
|
27
29
|
unregisterRuntime(runtime.devId);
|
|
28
30
|
clearPrimaryLockSDKInstanceIfDevId(runtime.devId);
|
|
31
|
+
if (runtime.config.isFitting) {
|
|
32
|
+
stopFitSyncReportForRuntime(runtime);
|
|
33
|
+
}
|
|
29
34
|
clearStateForRuntime(runtime);
|
|
30
35
|
if (getRegisteredRuntimeCount() === 0) {
|
|
31
36
|
removeEvents();
|
|
32
37
|
}
|
|
33
38
|
},
|
|
39
|
+
updateConfig(options) {
|
|
40
|
+
sdkLog("info", "lifecycle", "updateConfig", {
|
|
41
|
+
devId: runtime.devId,
|
|
42
|
+
data: { keys: Object.keys(options) },
|
|
43
|
+
});
|
|
44
|
+
updateConfigForRuntime(runtime, options);
|
|
45
|
+
},
|
|
34
46
|
};
|
|
35
47
|
registerLockSDKInstanceRuntime(instance, runtime);
|
|
36
48
|
sdkLog("info", "lifecycle", "createInstance", { devId: runtime.devId });
|
|
@@ -4,3 +4,5 @@ export declare function isBlePureDevice(): boolean;
|
|
|
4
4
|
export declare function isShareThead(): boolean;
|
|
5
5
|
export declare function isActiveThread(): Promise<boolean>;
|
|
6
6
|
export declare function getDeviceAdvancedAbilities(): Promise<import("../../..").DeviceAdvancedAbility>;
|
|
7
|
+
export declare function getDeviceAdvancedAbilitiesSync(): import("../../..").DeviceAdvancedAbility | undefined;
|
|
8
|
+
export declare function getDeviceCapabilities(): import("../../..").CapabilityInfo | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
2
|
-
import { hasCapabilityForRuntime, isBlePureDeviceForRuntime, isShareTheadForRuntime, isActiveThreadForRuntime, getDeviceAdvancedAbilitiesForRuntime, } from "../../../feature/misc/capability";
|
|
2
|
+
import { hasCapabilityForRuntime, isBlePureDeviceForRuntime, isShareTheadForRuntime, isActiveThreadForRuntime, getDeviceAdvancedAbilitiesForRuntime, getDeviceAdvancedAbilitiesSyncForRuntime, getDeviceCapabilitiesForRuntime, } from "../../../feature/misc/capability";
|
|
3
3
|
export function hasCapability(capability) {
|
|
4
4
|
return hasCapabilityForRuntime(resolveRuntimeFromExportThis(this), capability);
|
|
5
5
|
}
|
|
@@ -15,3 +15,9 @@ export async function isActiveThread() {
|
|
|
15
15
|
export async function getDeviceAdvancedAbilities() {
|
|
16
16
|
return getDeviceAdvancedAbilitiesForRuntime(resolveRuntimeFromExportThis(this));
|
|
17
17
|
}
|
|
18
|
+
export function getDeviceAdvancedAbilitiesSync() {
|
|
19
|
+
return getDeviceAdvancedAbilitiesSyncForRuntime(resolveRuntimeFromExportThis(this));
|
|
20
|
+
}
|
|
21
|
+
export function getDeviceCapabilities() {
|
|
22
|
+
return getDeviceCapabilitiesForRuntime(resolveRuntimeFromExportThis(this));
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type BoundLockListItem, type FitLockUnbindableReason, type UnbindLockListItem } from "../../../../feature/fit/list";
|
|
2
|
+
import { BoundFitLockItem, UnbindLockItem } from "../../../../api/fit";
|
|
3
|
+
export type { BoundFitLockItem, BoundLockListItem, UnbindLockItem, UnbindLockListItem, FitLockUnbindableReason, };
|
|
4
|
+
export declare function getBoundLockList(): Promise<BoundLockListItem[]>;
|
|
5
|
+
export declare function getUnbindLockList(): Promise<UnbindLockListItem[]>;
|
|
6
|
+
export declare function bindLockToFit(lock: UnbindLockItem): Promise<unknown>;
|
|
7
|
+
export declare function unbindLockToFit(lock: BoundFitLockItem & {
|
|
8
|
+
bindingId: string;
|
|
9
|
+
}): Promise<unknown>;
|
|
10
|
+
export declare function activateLockToFit(lock: BoundFitLockItem): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getBoundLockListForRuntime, getUnbindLockListForRuntime, } from "
|
|
2
|
-
import { bindLockToFitForRuntime, unbindLockToFitForRuntime, } from "
|
|
3
|
-
import { resolveRuntimeFromExportThis } from "
|
|
1
|
+
import { getBoundLockListForRuntime, getUnbindLockListForRuntime, } from "../../../../feature/fit/list";
|
|
2
|
+
import { activateLockToFitForRuntime, bindLockToFitForRuntime, unbindLockToFitForRuntime, } from "../../../../feature/fit/bind-lock-to-fit";
|
|
3
|
+
import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
|
|
4
4
|
export function getBoundLockList() {
|
|
5
5
|
return getBoundLockListForRuntime(resolveRuntimeFromExportThis(this));
|
|
6
6
|
}
|
|
@@ -13,3 +13,6 @@ export function bindLockToFit(lock) {
|
|
|
13
13
|
export function unbindLockToFit(lock) {
|
|
14
14
|
return unbindLockToFitForRuntime(resolveRuntimeFromExportThis(this), lock);
|
|
15
15
|
}
|
|
16
|
+
export function activateLockToFit(lock) {
|
|
17
|
+
return activateLockToFitForRuntime(resolveRuntimeFromExportThis(this), lock);
|
|
18
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type FitStartAddUnlockMethodResult } from "
|
|
2
|
-
import type { FitAddPasswordParams, FitAddUnlockMethodEvent, FitAddUnlockMethodListener, FitCancelAddUnlockMethodParams, FitStartAddUnlockMethodParams, FitUnlockMethodDevice, FitUnlockMethodItem, FitUpdateUnlockMethodParams, GetFitUnlockMethodListParams } from "
|
|
3
|
-
import {
|
|
4
|
-
import { type FitUserItem } from "
|
|
5
|
-
|
|
1
|
+
import { type FitStartAddUnlockMethodResult } from "../../../../feature/fit/method/add-flow";
|
|
2
|
+
import type { FitAddPasswordParams, FitAddUnlockMethodEvent, FitAddUnlockMethodListener, FitCancelAddUnlockMethodParams, FitStartAddUnlockMethodParams, FitUnlockMethodDevice, FitUnlockMethodItem, FitUpdateUnlockMethodParams, GetFitUnlockMethodListParams } from "../../../../feature/fit/method/types";
|
|
3
|
+
import { CreateTemporaryBleKeyParams, UpdateTemporaryBleKeyParams, RenameFitBleKeyParams } from "../../../../feature/fit/ble-key";
|
|
4
|
+
import { type FitUserItem } from "../../../../feature/fit/users";
|
|
5
|
+
import type { FitBleKeyItem } from "../../../../interface";
|
|
6
|
+
export type { FitAddPasswordParams, FitStartAddUnlockMethodParams, FitCancelAddUnlockMethodParams, FitUpdateUnlockMethodParams, FitAddUnlockMethodEvent, FitAddUnlockMethodListener, FitStartAddUnlockMethodResult, FitUserItem, FitUnlockMethodDevice, FitUnlockMethodItem, GetFitUnlockMethodListParams, FitBleKeyItem, CreateTemporaryBleKeyParams, };
|
|
6
7
|
export declare function fitAddPassword(params: FitAddPasswordParams): Promise<void>;
|
|
7
8
|
export declare function fitStartAddUnlockMethod(params: FitStartAddUnlockMethodParams): Promise<FitStartAddUnlockMethodResult>;
|
|
8
9
|
export declare function fitCancelAddUnlockMethod(params: FitCancelAddUnlockMethodParams): Promise<void>;
|
|
@@ -11,12 +12,12 @@ export declare function offFitAddUnlockMethod(listener: FitAddUnlockMethodListen
|
|
|
11
12
|
export declare function fitUpdateUnlockMethod(params: FitUpdateUnlockMethodParams): Promise<void>;
|
|
12
13
|
export declare function fitDeleteUnlockMethod(id: number, lockDevId?: string): Promise<void>;
|
|
13
14
|
export declare function getFitUnlockMethodList(params: GetFitUnlockMethodListParams): Promise<FitUnlockMethodItem[]>;
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function syncOpenModeRise(dpIds: string): Promise<unknown>;
|
|
17
|
-
export declare function getFitBleKeyList(): Promise<unknown[]>;
|
|
15
|
+
export declare function syncOpenModeRise(dpCodes?: string[]): Promise<import("../../../../api/fit").SyncOpenModeRiseResult>;
|
|
16
|
+
export declare function getFitBleKeyList(): Promise<FitBleKeyItem[]>;
|
|
18
17
|
export declare function addFitBleKey(params: Record<string, unknown>): Promise<unknown>;
|
|
19
|
-
export declare function
|
|
18
|
+
export declare function createFitPermanentBleKey(userId: string): Promise<unknown>;
|
|
19
|
+
export declare function createFitTemporaryBleKey(params: CreateTemporaryBleKeyParams): Promise<unknown>;
|
|
20
|
+
export declare function updateFitTemporaryBleKey(params: UpdateTemporaryBleKeyParams): Promise<unknown>;
|
|
20
21
|
interface RemoveFitBleKeyParams {
|
|
21
22
|
id: string;
|
|
22
23
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { resolveRuntimeFromExportThis } from "
|
|
2
|
-
import { fitAddPasswordForRuntime } from "
|
|
3
|
-
import { fitCancelAddUnlockMethodForRuntime, fitStartAddUnlockMethodForRuntime, } from "
|
|
4
|
-
import { fitDeleteUnlockMethodForRuntime, fitUpdateUnlockMethodForRuntime, } from "
|
|
5
|
-
import { offFitAddUnlockMethodForRuntime, onFitAddUnlockMethodForRuntime, } from "
|
|
6
|
-
import { getFitUnlockMethodListForRuntime } from "
|
|
7
|
-
import {
|
|
8
|
-
import { getFitBleKeyListForRuntime, addFitBleKeyForRuntime,
|
|
9
|
-
import { setFitSettingForRuntime } from "
|
|
10
|
-
import { getFitUsersForRuntime, } from "
|
|
1
|
+
import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
|
|
2
|
+
import { fitAddPasswordForRuntime } from "../../../../feature/fit/method/add-password";
|
|
3
|
+
import { fitCancelAddUnlockMethodForRuntime, fitStartAddUnlockMethodForRuntime, } from "../../../../feature/fit/method/add-flow";
|
|
4
|
+
import { fitDeleteUnlockMethodForRuntime, fitUpdateUnlockMethodForRuntime, } from "../../../../feature/fit/method/update-remove";
|
|
5
|
+
import { offFitAddUnlockMethodForRuntime, onFitAddUnlockMethodForRuntime, } from "../../../../feature/fit/method/add-method-events";
|
|
6
|
+
import { getFitUnlockMethodListForRuntime } from "../../../../feature/fit/method/list";
|
|
7
|
+
import { syncOpenModeRiseForRuntime } from "../../../../feature/fit/sync";
|
|
8
|
+
import { getFitBleKeyListForRuntime, addFitBleKeyForRuntime, createFitPermanentBleKeyForRuntime, createFitTemporaryBleKeyForRuntime, updateFitTemporaryBleKeyForRuntime, removeFitBleKeyForRuntime, renameFitBleKeyForRuntime, } from "../../../../feature/fit/ble-key";
|
|
9
|
+
import { setFitSettingForRuntime } from "../../../../feature/fit/setting";
|
|
10
|
+
import { getFitUsersForRuntime, } from "../../../../feature/fit/users";
|
|
11
11
|
export function fitAddPassword(params) {
|
|
12
12
|
return fitAddPasswordForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
13
13
|
}
|
|
@@ -32,14 +32,8 @@ export function fitDeleteUnlockMethod(id, lockDevId) {
|
|
|
32
32
|
export function getFitUnlockMethodList(params) {
|
|
33
33
|
return getFitUnlockMethodListForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
34
34
|
}
|
|
35
|
-
export function
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
export function syncFitReport(ins) {
|
|
39
|
-
return syncFitReportForRuntime(resolveRuntimeFromExportThis(this), ins);
|
|
40
|
-
}
|
|
41
|
-
export function syncOpenModeRise(dpIds) {
|
|
42
|
-
return syncOpenModeRiseForRuntime(resolveRuntimeFromExportThis(this), dpIds);
|
|
35
|
+
export function syncOpenModeRise(dpCodes) {
|
|
36
|
+
return syncOpenModeRiseForRuntime(resolveRuntimeFromExportThis(this), dpCodes);
|
|
43
37
|
}
|
|
44
38
|
export function getFitBleKeyList() {
|
|
45
39
|
return getFitBleKeyListForRuntime(resolveRuntimeFromExportThis(this));
|
|
@@ -47,8 +41,14 @@ export function getFitBleKeyList() {
|
|
|
47
41
|
export function addFitBleKey(params) {
|
|
48
42
|
return addFitBleKeyForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
49
43
|
}
|
|
50
|
-
export function
|
|
51
|
-
return
|
|
44
|
+
export function createFitPermanentBleKey(userId) {
|
|
45
|
+
return createFitPermanentBleKeyForRuntime(resolveRuntimeFromExportThis(this), userId);
|
|
46
|
+
}
|
|
47
|
+
export function createFitTemporaryBleKey(params) {
|
|
48
|
+
return createFitTemporaryBleKeyForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
49
|
+
}
|
|
50
|
+
export function updateFitTemporaryBleKey(params) {
|
|
51
|
+
return updateFitTemporaryBleKeyForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
52
52
|
}
|
|
53
53
|
export function removeFitBleKey(params) {
|
|
54
54
|
return removeFitBleKeyForRuntime(resolveRuntimeFromExportThis(this), params.id);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
|
|
2
|
+
import { getFitLogsForRuntime, } from "../../../../feature/fit/log";
|
|
3
|
+
export async function getFitLogs(params) {
|
|
4
|
+
return getFitLogsForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
5
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type FitOnlinePasswordItem, type FitOfflinePasswordItem } from "../../../../feature/fit/password-list";
|
|
2
|
+
import { type AddFitTempPwdParams, type RemoveFitTempPwdParams, type RenameFitTempPwdParams, type RenameFitOfflineTempPwdParams, type RevokeFitOfflineTempPwdParams, type FitOfflineClearCodeResult, type ResendFitTempPwdParams, type UpdateFitTempPwdParams } from "../../../../feature/fit/temp-password";
|
|
3
|
+
import { type ClearFitInvalidPwdParams, type GetFitInvalidPwdListParams } from "../../../../feature/fit/invalid-password";
|
|
4
|
+
import { type FitOfflineOnceResult } from "../../../../feature/password/temporary/offline-create";
|
|
5
|
+
import type { LimitOfflinePwdItem, OfflinePwdAvailableResult } from "../../../../api/temp";
|
|
6
|
+
import type { TempPasswordResult } from "../../../../interface";
|
|
7
|
+
export declare function getFitPasswordList(): Promise<{
|
|
8
|
+
id: number;
|
|
9
|
+
unlockId: string;
|
|
10
|
+
unlockName: string;
|
|
11
|
+
photoUnlock: boolean;
|
|
12
|
+
userName: string;
|
|
13
|
+
lockUserId: number;
|
|
14
|
+
userType: number;
|
|
15
|
+
devLockId: string;
|
|
16
|
+
effective: import("../../../../interface").EffectiveConfig;
|
|
17
|
+
}[]>;
|
|
18
|
+
export declare function getFitOnlinePasswordList(): Promise<FitOnlinePasswordItem[]>;
|
|
19
|
+
export declare function getFitOfflinePasswordList(): Promise<FitOfflinePasswordItem[]>;
|
|
20
|
+
export declare function addFitTempPwd(params: AddFitTempPwdParams): Promise<{
|
|
21
|
+
pwdId: number;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function removeFitTempPwd(params: RemoveFitTempPwdParams): Promise<void>;
|
|
24
|
+
export declare function updateFitTempPwd(params: UpdateFitTempPwdParams): Promise<void>;
|
|
25
|
+
export declare function renameFitTempPwd(params: RenameFitTempPwdParams): Promise<void>;
|
|
26
|
+
export declare function renameFitOfflineTempPwd(params: RenameFitOfflineTempPwdParams): Promise<void>;
|
|
27
|
+
export declare function revokeFitOfflineTempPwd(params: RevokeFitOfflineTempPwdParams): Promise<FitOfflineClearCodeResult>;
|
|
28
|
+
export declare function resendFitTempPwd(params: ResendFitTempPwdParams): Promise<boolean>;
|
|
29
|
+
export declare function getFitInvalidPwdList(params?: GetFitInvalidPwdListParams): Promise<import("../../../../api/fit").FitInvalidPwdListResult>;
|
|
30
|
+
export declare function clearFitInvalidPwd(params?: ClearFitInvalidPwdParams): Promise<boolean>;
|
|
31
|
+
export declare function getFitDynamicPassword(): Promise<TempPasswordResult>;
|
|
32
|
+
export declare function getFitOfflineOncePassword(): Promise<FitOfflineOnceResult>;
|
|
33
|
+
export declare function getFitOfflineLimitPassword(params: {
|
|
34
|
+
effectiveTime: number;
|
|
35
|
+
invalidTime: number;
|
|
36
|
+
}): Promise<FitOfflineOnceResult>;
|
|
37
|
+
export declare function getFitOfflineClearAllCode(): Promise<FitOfflineOnceResult>;
|
|
38
|
+
export declare function getFitOfflineRevocableList(): Promise<LimitOfflinePwdItem[]>;
|
|
39
|
+
export declare function getFitOfflinePwdAvailable(pwdType: string): Promise<OfflinePwdAvailableResult>;
|
|
40
|
+
export type { AddFitTempPwdParams, RemoveFitTempPwdParams, UpdateFitTempPwdParams, RenameFitTempPwdParams, RenameFitOfflineTempPwdParams, RevokeFitOfflineTempPwdParams, FitOfflineClearCodeResult, ResendFitTempPwdParams, GetFitInvalidPwdListParams, ClearFitInvalidPwdParams, FitOnlinePasswordItem, FitOfflinePasswordItem, FitOfflineOnceResult, OfflinePwdAvailableResult, LimitOfflinePwdItem, };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getFitPasswordListForRuntime, getFitOnlinePasswordListForRuntime, getFitOfflinePasswordListForRuntime, } from "../../../../feature/fit/password-list";
|
|
2
|
+
import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
|
|
3
|
+
import { fitAddTempPwdForRuntime, fitRemoveTempPwdForRuntime, fitRenameTempPwdForRuntime, fitRenameOfflineTempPwdForRuntime, fitRevokeOfflineTempPwdForRuntime, fitResendTempPwdForRuntime, fitUpdateTempPwdForRuntime, } from "../../../../feature/fit/temp-password";
|
|
4
|
+
import { clearFitInvalidPwdForRuntime, getFitInvalidPwdListForRuntime, } from "../../../../feature/fit/invalid-password";
|
|
5
|
+
import { createTempDynamicForRuntime, createFitOfflineOnceForRuntime, createFitOfflineLimitForRuntime, createFitOfflineClearAllForRuntime, getFitOfflineRevocableListForRuntime, getFitOfflinePwdAvailableForRuntime, } from "../../../../feature/password/temporary/offline-create";
|
|
6
|
+
export function getFitPasswordList() {
|
|
7
|
+
return getFitPasswordListForRuntime(resolveRuntimeFromExportThis(this));
|
|
8
|
+
}
|
|
9
|
+
export function getFitOnlinePasswordList() {
|
|
10
|
+
return getFitOnlinePasswordListForRuntime(resolveRuntimeFromExportThis(this));
|
|
11
|
+
}
|
|
12
|
+
export function getFitOfflinePasswordList() {
|
|
13
|
+
return getFitOfflinePasswordListForRuntime(resolveRuntimeFromExportThis(this));
|
|
14
|
+
}
|
|
15
|
+
export function addFitTempPwd(params) {
|
|
16
|
+
return fitAddTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
17
|
+
}
|
|
18
|
+
export function removeFitTempPwd(params) {
|
|
19
|
+
return fitRemoveTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
20
|
+
}
|
|
21
|
+
export function updateFitTempPwd(params) {
|
|
22
|
+
return fitUpdateTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
23
|
+
}
|
|
24
|
+
export function renameFitTempPwd(params) {
|
|
25
|
+
return fitRenameTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
26
|
+
}
|
|
27
|
+
export function renameFitOfflineTempPwd(params) {
|
|
28
|
+
return fitRenameOfflineTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
29
|
+
}
|
|
30
|
+
export function revokeFitOfflineTempPwd(params) {
|
|
31
|
+
return fitRevokeOfflineTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
32
|
+
}
|
|
33
|
+
export function resendFitTempPwd(params) {
|
|
34
|
+
return fitResendTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
35
|
+
}
|
|
36
|
+
export function getFitInvalidPwdList(params) {
|
|
37
|
+
return getFitInvalidPwdListForRuntime(resolveRuntimeFromExportThis(this), params ?? {});
|
|
38
|
+
}
|
|
39
|
+
export function clearFitInvalidPwd(params) {
|
|
40
|
+
return clearFitInvalidPwdForRuntime(resolveRuntimeFromExportThis(this), params ?? {});
|
|
41
|
+
}
|
|
42
|
+
export function getFitDynamicPassword() {
|
|
43
|
+
return createTempDynamicForRuntime(resolveRuntimeFromExportThis(this));
|
|
44
|
+
}
|
|
45
|
+
export function getFitOfflineOncePassword() {
|
|
46
|
+
return createFitOfflineOnceForRuntime(resolveRuntimeFromExportThis(this));
|
|
47
|
+
}
|
|
48
|
+
export function getFitOfflineLimitPassword(params) {
|
|
49
|
+
return createFitOfflineLimitForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
50
|
+
}
|
|
51
|
+
export function getFitOfflineClearAllCode() {
|
|
52
|
+
return createFitOfflineClearAllForRuntime(resolveRuntimeFromExportThis(this));
|
|
53
|
+
}
|
|
54
|
+
export function getFitOfflineRevocableList() {
|
|
55
|
+
return getFitOfflineRevocableListForRuntime(resolveRuntimeFromExportThis(this));
|
|
56
|
+
}
|
|
57
|
+
export function getFitOfflinePwdAvailable(pwdType) {
|
|
58
|
+
return getFitOfflinePwdAvailableForRuntime(resolveRuntimeFromExportThis(this), pwdType);
|
|
59
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { GestureStatus } from "../../../api/gesture";
|
|
2
|
+
export declare function getGestureStatus(): Promise<import("../../../api/gesture").GestureStatus>;
|
|
3
|
+
export declare function updateGestureStatus(params: {
|
|
4
|
+
password: string;
|
|
5
|
+
open: boolean;
|
|
6
|
+
}): Promise<boolean>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
2
|
+
import { getGestureStatusForRuntime, updateGestureStatusForRuntime, } from "../../../feature/gesture/gesture";
|
|
3
|
+
export async function getGestureStatus() {
|
|
4
|
+
return getGestureStatusForRuntime(resolveRuntimeFromExportThis(this));
|
|
5
|
+
}
|
|
6
|
+
export async function updateGestureStatus(params) {
|
|
7
|
+
return updateGestureStatusForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
8
|
+
}
|
|
@@ -11,6 +11,10 @@ export * from "./log";
|
|
|
11
11
|
export * from "./signal";
|
|
12
12
|
export * from "./sleep";
|
|
13
13
|
export * from "./misc";
|
|
14
|
+
export * from "./service";
|
|
15
|
+
export * from "./notify";
|
|
16
|
+
export * from "./voip";
|
|
17
|
+
export * from "./gesture";
|
|
14
18
|
export * from "./media";
|
|
15
19
|
export * from "./voice-file";
|
|
16
20
|
export * from "./linkage";
|
|
@@ -19,3 +23,7 @@ export * from "./ai";
|
|
|
19
23
|
export * from "./accessory-binding";
|
|
20
24
|
export * from "./screen/list";
|
|
21
25
|
export * from "./screen/bind";
|
|
26
|
+
export * from "./fit-sdk/binding";
|
|
27
|
+
export * from "./fit-sdk/device";
|
|
28
|
+
export * from "./fit-sdk/log";
|
|
29
|
+
export * from "./fit-sdk/temp";
|
|
@@ -11,6 +11,10 @@ export * from "./log";
|
|
|
11
11
|
export * from "./signal";
|
|
12
12
|
export * from "./sleep";
|
|
13
13
|
export * from "./misc";
|
|
14
|
+
export * from "./service";
|
|
15
|
+
export * from "./notify";
|
|
16
|
+
export * from "./voip";
|
|
17
|
+
export * from "./gesture";
|
|
14
18
|
export * from "./media";
|
|
15
19
|
export * from "./voice-file";
|
|
16
20
|
export * from "./linkage";
|
|
@@ -19,3 +23,7 @@ export * from "./ai";
|
|
|
19
23
|
export * from "./accessory-binding";
|
|
20
24
|
export * from "./screen/list";
|
|
21
25
|
export * from "./screen/bind";
|
|
26
|
+
export * from "./fit-sdk/binding";
|
|
27
|
+
export * from "./fit-sdk/device";
|
|
28
|
+
export * from "./fit-sdk/log";
|
|
29
|
+
export * from "./fit-sdk/temp";
|
|
@@ -8,3 +8,5 @@ export declare function getLogs(params?: GetLogsParams): Promise<import("../../.
|
|
|
8
8
|
export declare function getAlarms(params?: GetAlarmsParams): Promise<import("../../../feature/log/log").GetAlarmsResult>;
|
|
9
9
|
export declare function getAlbums(params?: GetAlbumsParams): Promise<import("../../../feature/log/log").GetAlbumsResult>;
|
|
10
10
|
export declare function getLockLogList(params: GetLockLogListParams): Promise<import("../../../feature/log/log").GetLockLogListResult>;
|
|
11
|
+
export declare function getAlarmUnreadCount(): Promise<number>;
|
|
12
|
+
export declare function getActivePeriod(): Promise<number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
2
|
-
import { getLatestLogsForRuntime, getLogsForRuntime, getAlarmsForRuntime, getAlbumsForRuntime, onLogsRefreshForRuntime, offLogsRefreshForRuntime, getLockLogListForRuntime, } from "../../../feature/log/log";
|
|
2
|
+
import { getLatestLogsForRuntime, getLogsForRuntime, getAlarmsForRuntime, getAlbumsForRuntime, onLogsRefreshForRuntime, offLogsRefreshForRuntime, getLockLogListForRuntime, getAlarmUnreadCountForRuntime, getActivePeriodForRuntime, } from "../../../feature/log/log";
|
|
3
3
|
export function onLogsRefresh(cb) {
|
|
4
4
|
onLogsRefreshForRuntime(resolveRuntimeFromExportThis(this), cb);
|
|
5
5
|
}
|
|
@@ -22,3 +22,9 @@ export async function getAlbums(params) {
|
|
|
22
22
|
export async function getLockLogList(params) {
|
|
23
23
|
return getLockLogListForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
24
24
|
}
|
|
25
|
+
export async function getAlarmUnreadCount() {
|
|
26
|
+
return getAlarmUnreadCountForRuntime(resolveRuntimeFromExportThis(this));
|
|
27
|
+
}
|
|
28
|
+
export async function getActivePeriod() {
|
|
29
|
+
return getActivePeriodForRuntime(resolveRuntimeFromExportThis(this));
|
|
30
|
+
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { GetMediaUrlParams, OpenLocalAlbumParams } from "../../../feature/media/media";
|
|
1
|
+
import { GetMediaUrlParams, OpenLocalAlbumParams, GotoPlaybackParams } from "../../../feature/media/media";
|
|
2
2
|
export declare function getMediaUrl(params: GetMediaUrlParams): Promise<import("../../../feature/media/media").MediaUrlResult>;
|
|
3
3
|
export declare function isSupportMedia(): boolean;
|
|
4
4
|
export declare function getMediaRotate(): import("../../../feature/media/rotate").MediaRotate;
|
|
5
5
|
export declare function getMediaInfo(): import("../../../feature/media/media").MediaInfo;
|
|
6
6
|
export declare function openLocalAlbum(params?: OpenLocalAlbumParams): Promise<void>;
|
|
7
|
+
export declare function gotoPlayback(params?: GotoPlaybackParams): Promise<void>;
|
|
8
|
+
export declare function isSupportMultiCamera(): boolean;
|
|
9
|
+
export declare function getCameraInfo(): import("../../../feature/media/camera").CameraDpInfo | undefined;
|
|
10
|
+
export declare function queryCameraInfo(): Promise<import("../../../feature/media/camera").CameraInfo | undefined>;
|
|
11
|
+
export declare function switchCamera(index: number): Promise<true>;
|
|
12
|
+
export declare function getMediaViewTimes(): Promise<import("../../../api/video").MediaViewTimesResult>;
|
|
13
|
+
export declare function addMediaViewTimes(): Promise<import("../../../api/video").MediaViewTimesResult>;
|
|
14
|
+
export declare function getAlbumDateList(): Promise<import("../../../api/video").getAlbumDateListResult>;
|
|
15
|
+
export declare function getCameraConfig(): import("../../..").CameraConfig[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
2
|
-
import { getMediaUrlForRuntime, isSupportMediaForRuntime, openLocalAlbumForRuntime, getMediaInfoForRuntime, } from "../../../feature/media/media";
|
|
2
|
+
import { getMediaUrlForRuntime, isSupportMediaForRuntime, openLocalAlbumForRuntime, gotoPlaybackForRuntime, getMediaInfoForRuntime, getMediaViewTimesForRuntime, setMediaViewTimesForRuntime, getAlbumDateListForRuntime, } from "../../../feature/media/media";
|
|
3
3
|
import { getMediaRotateForRuntime } from "../../../feature/media/rotate";
|
|
4
|
+
import { isSupportMultiCameraForRuntime, getCameraInfoForRuntime, queryCameraInfoForRuntime, switchCameraForRuntime, getCameraConfigForRuntime, } from "../../../feature/media/camera";
|
|
4
5
|
export async function getMediaUrl(params) {
|
|
5
6
|
return getMediaUrlForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
6
7
|
}
|
|
@@ -16,3 +17,30 @@ export function getMediaInfo() {
|
|
|
16
17
|
export function openLocalAlbum(params) {
|
|
17
18
|
return openLocalAlbumForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
18
19
|
}
|
|
20
|
+
export function gotoPlayback(params) {
|
|
21
|
+
return gotoPlaybackForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
22
|
+
}
|
|
23
|
+
export function isSupportMultiCamera() {
|
|
24
|
+
return isSupportMultiCameraForRuntime(resolveRuntimeFromExportThis(this));
|
|
25
|
+
}
|
|
26
|
+
export function getCameraInfo() {
|
|
27
|
+
return getCameraInfoForRuntime(resolveRuntimeFromExportThis(this));
|
|
28
|
+
}
|
|
29
|
+
export async function queryCameraInfo() {
|
|
30
|
+
return queryCameraInfoForRuntime(resolveRuntimeFromExportThis(this));
|
|
31
|
+
}
|
|
32
|
+
export async function switchCamera(index) {
|
|
33
|
+
return switchCameraForRuntime(resolveRuntimeFromExportThis(this), index);
|
|
34
|
+
}
|
|
35
|
+
export async function getMediaViewTimes() {
|
|
36
|
+
return getMediaViewTimesForRuntime(resolveRuntimeFromExportThis(this));
|
|
37
|
+
}
|
|
38
|
+
export async function addMediaViewTimes() {
|
|
39
|
+
return setMediaViewTimesForRuntime(resolveRuntimeFromExportThis(this));
|
|
40
|
+
}
|
|
41
|
+
export async function getAlbumDateList() {
|
|
42
|
+
return getAlbumDateListForRuntime(resolveRuntimeFromExportThis(this));
|
|
43
|
+
}
|
|
44
|
+
export function getCameraConfig() {
|
|
45
|
+
return getCameraConfigForRuntime(resolveRuntimeFromExportThis(this));
|
|
46
|
+
}
|
|
@@ -13,6 +13,8 @@ export interface UpdateDpPeriodTimeOption {
|
|
|
13
13
|
offlineDp?: boolean;
|
|
14
14
|
}
|
|
15
15
|
export declare function updateDpPeriodTime(dpCode: string, data: UpdateDpPeriodTimeParams, option?: UpdateDpPeriodTimeOption): Promise<void>;
|
|
16
|
-
export declare function connectDevice(
|
|
17
|
-
|
|
16
|
+
export declare function connectDevice(options?: {
|
|
17
|
+
timeout?: number;
|
|
18
|
+
}): Promise<true>;
|
|
19
|
+
export declare function gotoService(params?: GotoServiceParams): Promise<void>;
|
|
18
20
|
export declare function validatePwdComplexity(password: string): Promise<boolean>;
|