@ray-js/lock-sdk 1.2.0-beta.11 → 1.2.0-beta.13

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
+ };
package/lib/api/log.d.ts CHANGED
@@ -151,6 +151,11 @@ interface AlbumItem {
151
151
  fileUrl: string;
152
152
  mediaBucket: string;
153
153
  mediaKey: string;
154
+ width: number;
155
+ height: number;
156
+ angle: number;
157
+ position: number;
158
+ vr: 0 | 1;
154
159
  }
155
160
  export declare const getAlbumMessages: (params: GetAlbumMessagesParams) => Promise<{
156
161
  hasNext: boolean;
package/lib/constant.d.ts CHANGED
@@ -76,3 +76,4 @@ export declare enum RemotePermissionType {
76
76
  ADMINS_ONLY = "adminsOnly",
77
77
  NO_ONE = "noOne"
78
78
  }
79
+ export declare const cameraPositionMap: Record<number, number>;
package/lib/constant.js CHANGED
@@ -87,3 +87,9 @@ export var RemotePermissionType;
87
87
  RemotePermissionType["ADMINS_ONLY"] = "adminsOnly";
88
88
  RemotePermissionType["NO_ONE"] = "noOne";
89
89
  })(RemotePermissionType || (RemotePermissionType = {}));
90
+ export const cameraPositionMap = {
91
+ 0: 4,
92
+ 1: 3,
93
+ 2: 5,
94
+ 3: 6,
95
+ };
@@ -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,6 +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 "../../constant";
9
10
  export function getLogsRefreshEvent(runtime) {
10
11
  return `${LOGCHANGE}_${runtime.devId}`;
11
12
  }
@@ -418,6 +419,11 @@ export async function getAlbumsForRuntime(rt, params) {
418
419
  })),
419
420
  type: item.eventType,
420
421
  createTime: item.uploadMilTime,
422
+ width: item.width,
423
+ height: item.height,
424
+ angle: item.angle,
425
+ position: cameraPositionMap[item.position],
426
+ isVR: !!item.vr,
421
427
  })),
422
428
  allAitypes: data.allAitypes,
423
429
  types: data.eventTypes,
@@ -1,6 +1,6 @@
1
1
  import { getDeviceProperties } from "../../api/setting";
2
2
  import { getDataWithPreFetchForRuntime } from "../utils";
3
- import { RemotePermissionType } from "../../constant";
3
+ import { cameraPositionMap, RemotePermissionType } from "../../constant";
4
4
  export const permissions = [
5
5
  RemotePermissionType.ADMINS_ONLY,
6
6
  RemotePermissionType.EVERY_ONE,
@@ -37,7 +37,7 @@ export async function fetchDeviceProperties(runtime, isForce) {
37
37
  width: item.w,
38
38
  height: item.h,
39
39
  rotate: item.al,
40
- localtion: item.p,
40
+ localtion: cameraPositionMap[item.p],
41
41
  }));
42
42
  }
43
43
  catch (e) {
@@ -255,6 +255,11 @@ export interface MediaInfo {
255
255
  fileUrl: string;
256
256
  mediaBucket: string;
257
257
  mediaKey: string;
258
+ width: number;
259
+ height: number;
260
+ angle: number;
261
+ position: number;
262
+ isVR: boolean;
258
263
  }
259
264
  export type LogType = "alarm_record" | "close_record" | "unlock_record" | "operation" | "local_operation";
260
265
  export type CloseValue = "UNDEFINED" | "VOICE_REMOTE" | "APP_REMOTE" | "AUTO" | "LOCAL_MANUAL" | "FITTINGS" | "APP" | "GEO_FENCE";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lock-sdk",
3
- "version": "1.2.0-beta.11",
3
+ "version": "1.2.0-beta.13",
4
4
  "files": [
5
5
  "lib",
6
6
  "LICENSE.md"