@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,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;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { clearStateForRuntime } from "../../feature/state/clear";
|
|
2
|
-
import { removeEvents } from "../../feature/state/platform-routing";
|
|
3
|
-
import { bootstrapRegisteredScreenInstance } from "./bootstrap/bootstrap-lock-instance";
|
|
4
|
-
import { clearPrimaryScreenSDKInstance, setPrimaryScreenSDKInstance, } 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 createScreenSDK = async (options) => {
|
|
10
|
-
const { instance } = await bootstrapRegisteredScreenInstance({
|
|
11
|
-
...options,
|
|
12
|
-
preFetch: false,
|
|
13
|
-
});
|
|
14
|
-
return instance;
|
|
15
|
-
};
|
|
16
|
-
export const initScreen = 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 bootstrapRegisteredScreenInstance(opts);
|
|
27
|
-
setPrimaryScreenSDKInstance(instance);
|
|
28
|
-
};
|
|
29
|
-
export const destroyScreen = () => {
|
|
30
|
-
removeEvents();
|
|
31
|
-
for (const rt of listRegisteredRuntimes()) {
|
|
32
|
-
clearStateForRuntime(rt);
|
|
33
|
-
}
|
|
34
|
-
clearAllRuntimes();
|
|
35
|
-
clearPrimaryScreenSDKInstance();
|
|
36
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { parallelOnlyForRuntime } from "../../utils";
|
|
2
|
-
import { checkRemoteEnabledForRuntime } from "./check-remote";
|
|
3
|
-
import { getCurrentUserForRuntime } from "../../user/current-user";
|
|
4
|
-
import { resolveOpenClosePath } from "./open-close-path";
|
|
5
|
-
import { executeOpenCloseMatterLan } from "./door-matter-lan";
|
|
6
|
-
import { executeOpenCloseNearDualMode } from "./door-near-dual-mode";
|
|
7
|
-
import { executeOpenCloseBleOnly } from "./door-ble-only";
|
|
8
|
-
import { executeOpenCloseRemoteCloud } from "./door-remote-cloud";
|
|
9
|
-
export const doOpenCloseActionForRuntime = parallelOnlyForRuntime(async function doOpenCloseActionForRuntime(rt, isOpen, timeout) {
|
|
10
|
-
await checkRemoteEnabledForRuntime(rt);
|
|
11
|
-
const path = resolveOpenClosePath(rt);
|
|
12
|
-
const currentUser = await getCurrentUserForRuntime(rt);
|
|
13
|
-
const memberId = currentUser.lockUserId !== 0 ? currentUser.lockUserId : currentUser.userId;
|
|
14
|
-
switch (path) {
|
|
15
|
-
case "matter_lan":
|
|
16
|
-
await executeOpenCloseMatterLan(rt, isOpen);
|
|
17
|
-
return;
|
|
18
|
-
case "near_dual_mode":
|
|
19
|
-
await executeOpenCloseNearDualMode(rt, isOpen, timeout, memberId);
|
|
20
|
-
return;
|
|
21
|
-
case "ble_only":
|
|
22
|
-
await executeOpenCloseBleOnly(rt, isOpen, timeout, memberId);
|
|
23
|
-
return;
|
|
24
|
-
case "remote_cloud":
|
|
25
|
-
await executeOpenCloseRemoteCloud(rt, isOpen, timeout, memberId);
|
|
26
|
-
return;
|
|
27
|
-
default: {
|
|
28
|
-
const _exhaustive = path;
|
|
29
|
-
return _exhaustive;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
package/lib/fit.d.ts
DELETED
package/lib/fit.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ProductCommunicationType } from "../../constant";
|
|
2
|
-
import type { DeviceStatus } from "../../interface";
|
|
3
|
-
export type ComputeDeviceStatusConfigSlice = {
|
|
4
|
-
onlineType: number;
|
|
5
|
-
devInfo: {
|
|
6
|
-
isCloudOnline: boolean;
|
|
7
|
-
isOnline: boolean;
|
|
8
|
-
wifiEnableState?: number;
|
|
9
|
-
isMatter?: boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export type ComputeDeviceStatusDeps = {
|
|
13
|
-
hasCapability: (t: ProductCommunicationType) => boolean;
|
|
14
|
-
hasDp: (code: string) => boolean;
|
|
15
|
-
getDpValue: (code: string) => unknown;
|
|
16
|
-
isSupportBleControl: () => boolean;
|
|
17
|
-
isShareThread: () => boolean;
|
|
18
|
-
readIsSleep: () => boolean;
|
|
19
|
-
registeredRuntimeCount: number;
|
|
20
|
-
getDormantPeriod: () => {
|
|
21
|
-
start: number;
|
|
22
|
-
end: number;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare function computeDeviceStatus(config: ComputeDeviceStatusConfigSlice, deps: ComputeDeviceStatusDeps): DeviceStatus;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import dpCodes from "../../config/dp-code";
|
|
2
|
-
import { ProductCommunicationType } from "../../constant";
|
|
3
|
-
import { isOnlineByType } from "../../utils";
|
|
4
|
-
export function computeDeviceStatus(config, deps) {
|
|
5
|
-
const { onlineType, devInfo: { isCloudOnline, isOnline, wifiEnableState, isMatter }, } = config;
|
|
6
|
-
const supportWifi = deps.hasCapability(ProductCommunicationType.WIFI);
|
|
7
|
-
const supportBle = deps.hasCapability(ProductCommunicationType.BLUETOOTH);
|
|
8
|
-
const supportThread = deps.hasCapability(ProductCommunicationType.THREAD);
|
|
9
|
-
const status = {
|
|
10
|
-
type: isOnline ? "online" : "offline",
|
|
11
|
-
connectEnable: false,
|
|
12
|
-
onlineType: "unknown",
|
|
13
|
-
onlineTypes: [],
|
|
14
|
-
isWifiActive: wifiEnableState !== 1,
|
|
15
|
-
isWifiMatter: !!isMatter && supportWifi,
|
|
16
|
-
};
|
|
17
|
-
const isMatterLocal = isOnlineByType(onlineType, 8);
|
|
18
|
-
const isBleOnline = isOnlineByType(onlineType, 2);
|
|
19
|
-
const isLocalOnline = !isCloudOnline && isOnlineByType(onlineType, 1);
|
|
20
|
-
const hasWirelessAwakeDp = deps.hasDp(dpCodes.wirelessAwake);
|
|
21
|
-
const wirelessAwake = deps.getDpValue(dpCodes.wirelessAwake);
|
|
22
|
-
status.connectEnable = deps.isSupportBleControl() && !isOnline;
|
|
23
|
-
if (supportWifi) {
|
|
24
|
-
if (!status.connectEnable) {
|
|
25
|
-
if (isCloudOnline) {
|
|
26
|
-
status.connectEnable =
|
|
27
|
-
hasWirelessAwakeDp && wirelessAwake === false && !isBleOnline;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (isOnline) {
|
|
32
|
-
if (isCloudOnline) {
|
|
33
|
-
if (hasWirelessAwakeDp) {
|
|
34
|
-
if (wirelessAwake) {
|
|
35
|
-
status.onlineTypes.push("cloud");
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
status.type = "offline";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
status.onlineTypes.push("cloud");
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (isLocalOnline) {
|
|
46
|
-
status.onlineTypes.push("local");
|
|
47
|
-
}
|
|
48
|
-
if (isMatterLocal) {
|
|
49
|
-
if (!status.onlineTypes.includes("local")) {
|
|
50
|
-
status.onlineTypes.push("local");
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (isBleOnline) {
|
|
54
|
-
status.onlineTypes.push("ble");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (status.onlineTypes.length === 0 && isOnline) {
|
|
58
|
-
status.onlineTypes.push("unknown");
|
|
59
|
-
}
|
|
60
|
-
if (supportThread && supportBle) {
|
|
61
|
-
const isShareThread = deps.isShareThread();
|
|
62
|
-
if (isShareThread && isOnline) {
|
|
63
|
-
if (!status.onlineTypes.includes("local")) {
|
|
64
|
-
status.onlineTypes = ["local"];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (status.onlineTypes.includes("ble")) {
|
|
69
|
-
status.onlineType = "ble";
|
|
70
|
-
}
|
|
71
|
-
else if (status.onlineTypes.includes("cloud")) {
|
|
72
|
-
status.onlineType = "cloud";
|
|
73
|
-
}
|
|
74
|
-
else if (status.onlineTypes.includes("local")) {
|
|
75
|
-
status.onlineType = "local";
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
status.onlineType = "unknown";
|
|
79
|
-
}
|
|
80
|
-
if (!isOnline) {
|
|
81
|
-
if (deps.readIsSleep()) {
|
|
82
|
-
status.type = "sleep";
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (status.type === "sleep") {
|
|
86
|
-
if (deps.getDpValue(dpCodes.dormantSwitch) ||
|
|
87
|
-
deps.getDpValue(dpCodes.onlineSwitch)) {
|
|
88
|
-
if (deps.registeredRuntimeCount === 1) {
|
|
89
|
-
status.sleepPeriod = deps.getDormantPeriod();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return status;
|
|
94
|
-
}
|
package/lib/screen.d.ts
DELETED
package/lib/screen.js
DELETED