@ray-js/lock-sdk 1.0.2 → 1.0.3

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/other.d.ts CHANGED
@@ -1,6 +1,11 @@
1
- export declare const openScene: (options?: {
1
+ type ExecutorRange = "unlock" | "lock";
2
+ type Ability = "backHome" | "alarm" | "geographyArrive" | "geographyLeave" | "bleGeofence" | "siriUnlock" | "siriLock";
3
+ interface OpenSceneOptions {
2
4
  themeColor?: string;
3
- }) => Promise<unknown>;
5
+ executorRange?: Array<ExecutorRange>;
6
+ abilities?: Array<Ability>;
7
+ }
8
+ export declare const openScene: (options?: OpenSceneOptions) => Promise<unknown>;
4
9
  export declare const isSupportBleControl: () => import("./interface").DpValue;
5
10
  export declare const getDpPeriodTime: (dpCode: string) => {
6
11
  start: number;
@@ -10,3 +15,4 @@ export declare const updateDpPeriodTime: (dpCode: string, data: {
10
15
  start: number;
11
16
  end: number;
12
17
  }) => Promise<Record<string, import("./interface").DpValue>>;
18
+ export {};
package/lib/other.js CHANGED
@@ -7,6 +7,10 @@ import { openPanel } from "./utils/device";
7
7
  import { getError } from "./utils/errors";
8
8
  import { publishDps } from "./utils/publishDps";
9
9
  const { alarmLock, unlockFingerprint, unlockPassword, unlockCard, unlockKey, unlockPhoneRemote, } = dpCodes;
10
+ const abilityMap = {
11
+ backHome: "supportBackHome",
12
+ alarm: "supportAlarm",
13
+ };
10
14
  export const openScene = async (options) => {
11
15
  const dpIds = [
12
16
  unlockFingerprint,
@@ -21,7 +25,7 @@ export const openScene = async (options) => {
21
25
  }
22
26
  return acc;
23
27
  }, []);
24
- const { themeColor = "", ...res } = options || {};
28
+ const { themeColor = "#ff592a", executorRange = ["unlock", "lock"], abilities = [], } = options || {};
25
29
  return new Promise((resolve, reject) => {
26
30
  openPanel({
27
31
  deviceId: config.devInfo.devId,
@@ -36,7 +40,12 @@ export const openScene = async (options) => {
36
40
  openDpLists: dpIds.join(","),
37
41
  dpCode: alarmLock,
38
42
  themeColor,
39
- ...res,
43
+ withConfig: {
44
+ powerCode: {
45
+ tyabihqarm: abilities.map((ability) => abilityMap[ability] || ability),
46
+ tyabixjkg8: executorRange,
47
+ },
48
+ },
40
49
  },
41
50
  success: resolve,
42
51
  fail: reject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lock-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "files": [
5
5
  "lib",
6
6
  "LICENSE.md"