@ray-js/lock-sdk 1.2.1-beta.0 → 1.2.1-beta.1
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/video.d.ts +11 -0
- package/lib/api/video.js +10 -0
- package/lib/entries/main/exports/capability.d.ts +0 -2
- package/lib/entries/main/exports/capability.js +1 -7
- package/lib/entries/main/exports/fit-sdk/device.d.ts +0 -1
- package/lib/entries/main/exports/fit-sdk/device.js +0 -4
- package/lib/entries/main/exports/media.d.ts +1 -1
- package/lib/entries/main/index.d.ts +2 -1
- package/lib/feature/media/camera.d.ts +2 -4
- package/lib/feature/misc/capability.d.ts +1 -1
- package/lib/feature/misc/capability.js +1 -1
- package/lib/feature/state/init-state.js +5 -8
- package/lib/feature/state/internal/share-thread-local.js +2 -2
- package/package.json +1 -1
package/lib/api/video.d.ts
CHANGED
|
@@ -37,4 +37,15 @@ export interface getAlbumDateListResult {
|
|
|
37
37
|
dateList: string[];
|
|
38
38
|
}
|
|
39
39
|
export declare const getAlbumDateList: (devId: string) => Promise<getAlbumDateListResult>;
|
|
40
|
+
interface GetDeviceCurrentMeidaConfigResult {
|
|
41
|
+
audioAttributes: {
|
|
42
|
+
callMode: Array<1 | 2>;
|
|
43
|
+
hardwareCapability: Array<1 | 2>;
|
|
44
|
+
};
|
|
45
|
+
maxZoomInTimes: number;
|
|
46
|
+
skill: string;
|
|
47
|
+
vedioClarity: number;
|
|
48
|
+
vedioClaritys: number[];
|
|
49
|
+
}
|
|
50
|
+
export declare const getDeviceCurrentMeidaConfig: (devId: string) => Promise<GetDeviceCurrentMeidaConfigResult>;
|
|
40
51
|
export {};
|
package/lib/api/video.js
CHANGED
|
@@ -60,3 +60,13 @@ export const getAlbumDateList = (devId) => {
|
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
|
+
export const getDeviceCurrentMeidaConfig = (devId) => {
|
|
64
|
+
return requestApi({
|
|
65
|
+
logName: "getDeviceCurrentMeidaConfig",
|
|
66
|
+
api: "m.ipc.device.ability.get",
|
|
67
|
+
version: "1.0",
|
|
68
|
+
data: {
|
|
69
|
+
devId,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ProductCommunicationType } from "../../../constant";
|
|
2
2
|
export declare function hasCapability(capability: ProductCommunicationType): boolean;
|
|
3
3
|
export declare function isBlePureDevice(): boolean;
|
|
4
|
-
export declare function isShareThead(): boolean;
|
|
5
|
-
export declare function isActiveThread(): Promise<boolean>;
|
|
6
4
|
export declare function getDeviceAdvancedAbilities(): Promise<import("../../..").DeviceAdvancedAbility>;
|
|
7
5
|
export declare function getDeviceAdvancedAbilitiesSync(): import("../../..").DeviceAdvancedAbility | undefined;
|
|
8
6
|
export declare function getDeviceCapabilities(): import("../../..").CapabilityInfo | null;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
|
|
2
|
-
import { hasCapabilityForRuntime, isBlePureDeviceForRuntime,
|
|
2
|
+
import { hasCapabilityForRuntime, isBlePureDeviceForRuntime, getDeviceAdvancedAbilitiesForRuntime, getDeviceAdvancedAbilitiesSyncForRuntime, getDeviceCapabilitiesForRuntime, } from "../../../feature/misc/capability";
|
|
3
3
|
export function hasCapability(capability) {
|
|
4
4
|
return hasCapabilityForRuntime(resolveRuntimeFromExportThis(this), capability);
|
|
5
5
|
}
|
|
6
6
|
export function isBlePureDevice() {
|
|
7
7
|
return isBlePureDeviceForRuntime(resolveRuntimeFromExportThis(this));
|
|
8
8
|
}
|
|
9
|
-
export function isShareThead() {
|
|
10
|
-
return isShareTheadForRuntime(resolveRuntimeFromExportThis(this));
|
|
11
|
-
}
|
|
12
|
-
export async function isActiveThread() {
|
|
13
|
-
return isActiveThreadForRuntime(resolveRuntimeFromExportThis(this));
|
|
14
|
-
}
|
|
15
9
|
export async function getDeviceAdvancedAbilities() {
|
|
16
10
|
return getDeviceAdvancedAbilitiesForRuntime(resolveRuntimeFromExportThis(this));
|
|
17
11
|
}
|
|
@@ -24,4 +24,3 @@ interface RemoveFitBleKeyParams {
|
|
|
24
24
|
export declare function removeFitBleKey(params: RemoveFitBleKeyParams): Promise<unknown>;
|
|
25
25
|
export declare function renameFitBleKey(params: RenameFitBleKeyParams): Promise<unknown>;
|
|
26
26
|
export declare function getFitUsers(): Promise<FitUserItem[]>;
|
|
27
|
-
export declare function setFitSetting(dpCode: string, value: string | number | boolean): Promise<void>;
|
|
@@ -6,7 +6,6 @@ import { offFitAddUnlockMethodForRuntime, onFitAddUnlockMethodForRuntime, } from
|
|
|
6
6
|
import { getFitUnlockMethodListForRuntime } from "../../../../feature/fit/method/list";
|
|
7
7
|
import { syncOpenModeRiseForRuntime } from "../../../../feature/fit/sync";
|
|
8
8
|
import { getFitBleKeyListForRuntime, addFitBleKeyForRuntime, createFitPermanentBleKeyForRuntime, createFitTemporaryBleKeyForRuntime, updateFitTemporaryBleKeyForRuntime, removeFitBleKeyForRuntime, renameFitBleKeyForRuntime, } from "../../../../feature/fit/ble-key";
|
|
9
|
-
import { setFitSettingForRuntime } from "../../../../feature/fit/setting";
|
|
10
9
|
import { getFitUsersForRuntime, } from "../../../../feature/fit/users";
|
|
11
10
|
export function fitAddPassword(params) {
|
|
12
11
|
return fitAddPasswordForRuntime(resolveRuntimeFromExportThis(this), params);
|
|
@@ -59,6 +58,3 @@ export function renameFitBleKey(params) {
|
|
|
59
58
|
export function getFitUsers() {
|
|
60
59
|
return getFitUsersForRuntime(resolveRuntimeFromExportThis(this));
|
|
61
60
|
}
|
|
62
|
-
export function setFitSetting(dpCode, value) {
|
|
63
|
-
return setFitSettingForRuntime(resolveRuntimeFromExportThis(this), dpCode, value);
|
|
64
|
-
}
|
|
@@ -7,7 +7,7 @@ export declare function openLocalAlbum(params?: OpenLocalAlbumParams): Promise<v
|
|
|
7
7
|
export declare function gotoPlayback(params?: GotoPlaybackParams): Promise<void>;
|
|
8
8
|
export declare function isSupportMultiCamera(): boolean;
|
|
9
9
|
export declare function getCameraInfo(): import("../../../feature/media/camera").CameraDpInfo | undefined;
|
|
10
|
-
export declare function queryCameraInfo(): Promise<import("../../../feature/media/camera").
|
|
10
|
+
export declare function queryCameraInfo(): Promise<import("../../../feature/media/camera").CameraDpInfo | undefined>;
|
|
11
11
|
export declare function switchCamera(index: number): Promise<true>;
|
|
12
12
|
export declare function getMediaViewTimes(): Promise<import("../../../api/video").MediaViewTimesResult>;
|
|
13
13
|
export declare function addMediaViewTimes(): Promise<import("../../../api/video").MediaViewTimesResult>;
|
|
@@ -3,6 +3,7 @@ import type { LockSDKInstance, FitSDKInstance } from "./build-instance";
|
|
|
3
3
|
export * from "./exports";
|
|
4
4
|
export type { LockSDKInstance, FitSDKInstance };
|
|
5
5
|
export type { LockSdkBoundExportThis } from "./bootstrap/resolve-runtime-from-export-this";
|
|
6
|
-
export
|
|
6
|
+
export type SDKOptions = Omit<LockSDKOption, "preFetch">;
|
|
7
|
+
export declare const createSDK: (options?: SDKOptions) => Promise<LockSDKInstance>;
|
|
7
8
|
export declare const init: (options?: LockSDKOption) => Promise<void>;
|
|
8
9
|
export declare const destroy: () => void;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { LockDeviceRuntime } from "../../runtime/LockDeviceRuntime";
|
|
2
|
-
import type { CameraConfig
|
|
3
|
-
import { locationSelectReportMap } from "../../config/dp-map/media";
|
|
4
|
-
export type CameraInfo = DpMapDataType<typeof locationSelectReportMap>;
|
|
2
|
+
import type { CameraConfig } from "../../interface";
|
|
5
3
|
export declare const isSupportMultiCameraForRuntime: (runtime: LockDeviceRuntime) => boolean;
|
|
6
4
|
interface CameraItem {
|
|
7
5
|
index: number;
|
|
@@ -12,7 +10,7 @@ export interface CameraDpInfo {
|
|
|
12
10
|
list: CameraItem[];
|
|
13
11
|
}
|
|
14
12
|
export declare const getCameraInfoForRuntime: (runtime: LockDeviceRuntime) => CameraDpInfo | undefined;
|
|
15
|
-
export declare const queryCameraInfoForRuntime: (runtime: LockDeviceRuntime) => Promise<
|
|
13
|
+
export declare const queryCameraInfoForRuntime: (runtime: LockDeviceRuntime) => Promise<CameraDpInfo | undefined>;
|
|
16
14
|
export declare const switchCameraForRuntime: (runtime: LockDeviceRuntime, index: number) => Promise<true>;
|
|
17
15
|
export declare const getCameraConfigForRuntime: (runtime: LockDeviceRuntime) => CameraConfig[];
|
|
18
16
|
export {};
|
|
@@ -3,7 +3,7 @@ import { DeviceAdvancedAbility } from "../../interface";
|
|
|
3
3
|
import type { LockDeviceRuntime } from "../../runtime/LockDeviceRuntime";
|
|
4
4
|
export declare const hasCapabilityForRuntime: (runtime: LockDeviceRuntime, capability: ProductCommunicationType) => boolean;
|
|
5
5
|
export declare const isBlePureDeviceForRuntime: (rt: LockDeviceRuntime) => boolean;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const isShareThreadForRuntime: (rt: LockDeviceRuntime) => boolean;
|
|
7
7
|
export declare const isActiveThreadForRuntime: (rt: LockDeviceRuntime) => Promise<boolean>;
|
|
8
8
|
export declare const getDeviceAdvancedAbilitiesSyncForRuntime: (rt: LockDeviceRuntime) => DeviceAdvancedAbility | undefined;
|
|
9
9
|
export declare const getDeviceAdvancedAbilitiesForRuntime: (rt: LockDeviceRuntime) => Promise<DeviceAdvancedAbility>;
|
|
@@ -6,7 +6,7 @@ import { getWithLocalCache } from "../storage/swr-cache";
|
|
|
6
6
|
export const hasCapabilityForRuntime = (runtime, capability) => runtime.config.communication.includes(capability);
|
|
7
7
|
export const isBlePureDeviceForRuntime = (rt) => hasCapabilityForRuntime(rt, ProductCommunicationType.BLUETOOTH) &&
|
|
8
8
|
rt.config.communication.length === 1;
|
|
9
|
-
export const
|
|
9
|
+
export const isShareThreadForRuntime = (rt) => {
|
|
10
10
|
const hasThread = hasCapabilityForRuntime(rt, ProductCommunicationType.THREAD);
|
|
11
11
|
return (hasThread &&
|
|
12
12
|
!rt.config.devInfo.meta?.["threadWithBLE"] &&
|
|
@@ -14,7 +14,7 @@ import syncT0 from "./sync/t0";
|
|
|
14
14
|
import { getDeviceStatusForRuntime, updateOnlineType } from "./device-status";
|
|
15
15
|
import { handleDpChange } from "./dp-change";
|
|
16
16
|
import { fetchDeviceProperties } from "./remote-permissions";
|
|
17
|
-
import { ipc, yuChannelSyncSingleSync
|
|
17
|
+
import { ipc, yuChannelSyncSingleSync } from "../../platform";
|
|
18
18
|
import { sdkLog } from "../../utils/sdk-log";
|
|
19
19
|
import { ProductCommunicationType, RotateType } from "../../constant";
|
|
20
20
|
import { isHarmony } from "../../utils";
|
|
@@ -85,14 +85,11 @@ export const initState = async (runtime) => {
|
|
|
85
85
|
}
|
|
86
86
|
if (ipcConfig.status === "fulfilled" &&
|
|
87
87
|
ipcConfig.value?.audioAttributes?.hardwareCapability?.includes(2)) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
88
|
+
runtime.config.supportTalk = true;
|
|
89
|
+
runtime.config.isTwoWayTalk =
|
|
90
|
+
ipcConfig.value?.audioAttributes?.callMode?.[0] === 2;
|
|
91
|
+
if (!isHarmony()) {
|
|
94
92
|
try {
|
|
95
|
-
runtime.config.supportTalk = true;
|
|
96
93
|
const modeRes = await ipc.getCurrentSupportedTalkMode(devId);
|
|
97
94
|
runtime.config.isTwoWayTalk = modeRes.talkbackMode === 2;
|
|
98
95
|
sdkLog("info", "initState", "supportTalk", {
|