@ray-js/lock-sdk 1.2.0-beta.12 → 1.2.0-beta.14

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.
@@ -0,0 +1,11 @@
1
+ export interface GestureStatus {
2
+ status: boolean;
3
+ password: string;
4
+ [k: string]: any;
5
+ }
6
+ export declare const getGestureStatusApi: (devId: string) => Promise<GestureStatus>;
7
+ export declare const setGestureStatusApi: (params: {
8
+ devId: string;
9
+ password: string;
10
+ open: boolean;
11
+ }) => Promise<boolean>;
@@ -0,0 +1,18 @@
1
+ import { THING } from "../utils/constant";
2
+ import { requestApi } from "./request";
3
+ export const getGestureStatusApi = (devId) => {
4
+ return requestApi({
5
+ logName: "getGestureStatus",
6
+ api: `${THING}.m.device.lock.gesturepwd.check`,
7
+ version: "1.0",
8
+ data: { devId },
9
+ });
10
+ };
11
+ export const setGestureStatusApi = (params) => {
12
+ return requestApi({
13
+ logName: "setGestureStatus",
14
+ api: `${THING}.m.device.lock.gesturepwd.set`,
15
+ version: "1.0",
16
+ data: params,
17
+ });
18
+ };
@@ -4,3 +4,4 @@ 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 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, getDeviceCapabilitiesForRuntime, } from "../../../feature/misc/capability";
3
3
  export function hasCapability(capability) {
4
4
  return hasCapabilityForRuntime(resolveRuntimeFromExportThis(this), capability);
5
5
  }
@@ -15,3 +15,6 @@ export async function isActiveThread() {
15
15
  export async function getDeviceAdvancedAbilities() {
16
16
  return getDeviceAdvancedAbilitiesForRuntime(resolveRuntimeFromExportThis(this));
17
17
  }
18
+ export function getDeviceCapabilities() {
19
+ return getDeviceCapabilitiesForRuntime(resolveRuntimeFromExportThis(this));
20
+ }
@@ -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
+ }
@@ -14,6 +14,7 @@ export * from "./misc";
14
14
  export * from "./service";
15
15
  export * from "./notify";
16
16
  export * from "./voip";
17
+ export * from "./gesture";
17
18
  export * from "./media";
18
19
  export * from "./voice-file";
19
20
  export * from "./linkage";
@@ -14,6 +14,7 @@ export * from "./misc";
14
14
  export * from "./service";
15
15
  export * from "./notify";
16
16
  export * from "./voip";
17
+ export * from "./gesture";
17
18
  export * from "./media";
18
19
  export * from "./voice-file";
19
20
  export * from "./linkage";
@@ -0,0 +1,6 @@
1
+ import type { LockDeviceRuntime } from "../../runtime/LockDeviceRuntime";
2
+ export declare const getGestureStatusForRuntime: (rt: LockDeviceRuntime) => Promise<import("../../api/gesture").GestureStatus>;
3
+ export declare const updateGestureStatusForRuntime: (rt: LockDeviceRuntime, params: {
4
+ password: string;
5
+ open: boolean;
6
+ }) => Promise<boolean>;
@@ -0,0 +1,3 @@
1
+ import { getGestureStatusApi, setGestureStatusApi } from "../../api/gesture";
2
+ export const getGestureStatusForRuntime = (rt) => getGestureStatusApi(rt.config.devInfo.devId);
3
+ export const updateGestureStatusForRuntime = (rt, params) => setGestureStatusApi({ devId: rt.config.devInfo.devId, ...params });
@@ -6,7 +6,7 @@ import { LOGCHANGE } from "../../utils/constant";
6
6
  import emitter from "../../utils/event";
7
7
  import { handleLocalOperation } from "../../utils/log";
8
8
  import { parseWeek } from "../../utils";
9
- import { cameraPositionMap } from "src/constant";
9
+ import { cameraPositionMap } from "../../constant";
10
10
  export function getLogsRefreshEvent(runtime) {
11
11
  return `${LOGCHANGE}_${runtime.devId}`;
12
12
  }
@@ -6,3 +6,4 @@ export declare const isBlePureDeviceForRuntime: (rt: LockDeviceRuntime) => boole
6
6
  export declare const isShareTheadForRuntime: (rt: LockDeviceRuntime) => boolean;
7
7
  export declare const isActiveThreadForRuntime: (rt: LockDeviceRuntime) => Promise<boolean>;
8
8
  export declare const getDeviceAdvancedAbilitiesForRuntime: (rt: LockDeviceRuntime) => Promise<DeviceAdvancedAbility>;
9
+ export declare const getDeviceCapabilitiesForRuntime: (rt: LockDeviceRuntime) => import("../../interface").CapabilityInfo | null;
@@ -186,3 +186,6 @@ export const getDeviceAdvancedAbilitiesForRuntime = async (rt) => {
186
186
  rt.cache.deviceAdvanceAbilityCache = deviceAdvanceAbilityCache;
187
187
  return deviceAdvanceAbilityCache;
188
188
  };
189
+ export const getDeviceCapabilitiesForRuntime = (rt) => {
190
+ return rt.config.capabilities;
191
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lock-sdk",
3
- "version": "1.2.0-beta.12",
3
+ "version": "1.2.0-beta.14",
4
4
  "files": [
5
5
  "lib",
6
6
  "LICENSE.md"