@ray-js/lock-sdk 1.2.0-beta.2 → 1.2.0-beta.21

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.
Files changed (80) hide show
  1. package/lib/api/gesture.d.ts +11 -0
  2. package/lib/api/gesture.js +18 -0
  3. package/lib/api/log.d.ts +21 -4
  4. package/lib/api/notify.d.ts +28 -0
  5. package/lib/api/notify.js +17 -0
  6. package/lib/api/service.d.ts +26 -0
  7. package/lib/api/service.js +25 -0
  8. package/lib/api/video.d.ts +9 -0
  9. package/lib/api/video.js +30 -0
  10. package/lib/api/voip.d.ts +10 -0
  11. package/lib/api/voip.js +17 -0
  12. package/lib/config/dp-code/index.d.ts +1 -0
  13. package/lib/config/dp-code/index.js +1 -0
  14. package/lib/config/dp-map/media.d.ts +13 -0
  15. package/lib/config/dp-map/media.js +19 -0
  16. package/lib/entries/fit/bootstrap/bootstrap-lock-instance.js +16 -5
  17. package/lib/entries/fit/index.js +1 -1
  18. package/lib/entries/main/bootstrap/bootstrap-lock-instance.js +16 -5
  19. package/lib/entries/main/bootstrap/bootstrap.js +2 -0
  20. package/lib/entries/main/exports/capability.d.ts +2 -0
  21. package/lib/entries/main/exports/capability.js +7 -1
  22. package/lib/entries/main/exports/gesture.d.ts +6 -0
  23. package/lib/entries/main/exports/gesture.js +8 -0
  24. package/lib/entries/main/exports/index.d.ts +4 -0
  25. package/lib/entries/main/exports/index.js +4 -0
  26. package/lib/entries/main/exports/media.d.ts +10 -1
  27. package/lib/entries/main/exports/media.js +29 -1
  28. package/lib/entries/main/exports/misc.d.ts +1 -1
  29. package/lib/entries/main/exports/notify.d.ts +7 -0
  30. package/lib/entries/main/exports/notify.js +8 -0
  31. package/lib/entries/main/exports/service.d.ts +4 -0
  32. package/lib/entries/main/exports/service.js +11 -0
  33. package/lib/entries/main/exports/voip.d.ts +3 -0
  34. package/lib/entries/main/exports/voip.js +8 -0
  35. package/lib/entries/main/index.js +1 -1
  36. package/lib/feature/gesture/gesture.d.ts +6 -0
  37. package/lib/feature/gesture/gesture.js +3 -0
  38. package/lib/feature/log/log.js +34 -2
  39. package/lib/feature/media/camera.d.ts +18 -0
  40. package/lib/feature/media/camera.js +36 -0
  41. package/lib/feature/media/media.d.ts +10 -0
  42. package/lib/feature/media/media.js +31 -0
  43. package/lib/feature/misc/ble-control.js +1 -1
  44. package/lib/feature/misc/capability.d.ts +2 -0
  45. package/lib/feature/misc/capability.js +77 -10
  46. package/lib/feature/misc/connect-device.js +2 -1
  47. package/lib/feature/notify/notify.d.ts +4 -0
  48. package/lib/feature/notify/notify.js +3 -0
  49. package/lib/feature/password/temporary/custom-dp.js +59 -54
  50. package/lib/feature/service/goto-service.d.ts +3 -2
  51. package/lib/feature/service/goto-service.js +7 -1
  52. package/lib/feature/service/value-added.d.ts +4 -0
  53. package/lib/feature/service/value-added.js +4 -0
  54. package/lib/feature/state/device-status.js +2 -2
  55. package/lib/feature/state/init-state.js +17 -11
  56. package/lib/feature/state/platform-routing.js +8 -2
  57. package/lib/feature/state/remote-permissions.js +17 -0
  58. package/lib/feature/storage/index.d.ts +5 -0
  59. package/lib/feature/storage/index.js +32 -0
  60. package/lib/feature/storage/swr-cache.d.ts +7 -0
  61. package/lib/feature/storage/swr-cache.js +54 -0
  62. package/lib/feature/unlock/sync/unlock-method.js +3 -0
  63. package/lib/feature/voip/voip.d.ts +3 -0
  64. package/lib/feature/voip/voip.js +3 -0
  65. package/lib/interface.d.ts +27 -1
  66. package/lib/platform/device.d.ts +4 -3
  67. package/lib/platform/index.d.ts +1 -0
  68. package/lib/platform/index.js +1 -0
  69. package/lib/platform/ipc.d.ts +3 -0
  70. package/lib/platform/ipc.js +13 -0
  71. package/lib/platform/storage.d.ts +3 -0
  72. package/lib/platform/storage.js +9 -0
  73. package/lib/runtime/lock-config.d.ts +4 -1
  74. package/lib/runtime/lock-config.js +3 -0
  75. package/lib/utils/constant.d.ts +1 -0
  76. package/lib/utils/constant.js +6 -0
  77. package/lib/utils/errors.js +3 -1
  78. package/lib/utils/index.d.ts +1 -1
  79. package/lib/utils/parse.js +1 -1
  80. package/package.json +1 -1
@@ -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
@@ -1,4 +1,16 @@
1
- import { DpValue, LocalOperateRecordInfo, MediaInfo } from "../interface";
1
+ import { DpValue, LocalOperateRecordInfo } from "../interface";
2
+ interface MediaInfoRecord {
3
+ mediaPath: string;
4
+ fileKey: string;
5
+ fileUrl: string;
6
+ mediaBucket: string;
7
+ mediaKey: string;
8
+ positionWidth: number;
9
+ positionHeight: number;
10
+ positionAngle: number;
11
+ positionVr: 0 | 1;
12
+ position: number;
13
+ }
2
14
  interface UnionUnlockInfo {
3
15
  userId: string;
4
16
  userName: string;
@@ -37,7 +49,7 @@ interface LogInfo {
37
49
  dps: Record<number, any>[];
38
50
  gmtCreate: number;
39
51
  historyId: number;
40
- mediaInfoList?: MediaInfo[];
52
+ mediaInfoList?: MediaInfoRecord[];
41
53
  memberBindableFlag: 0 | 1;
42
54
  recordId: string;
43
55
  recordType: string;
@@ -77,7 +89,7 @@ export interface LockLogListItem {
77
89
  relateDevName?: string;
78
90
  relateOpMode?: string;
79
91
  unionUnlockInfo?: UnionUnlockInfo[];
80
- mediaInfoList?: MediaInfo[];
92
+ mediaInfoList?: MediaInfoRecord[];
81
93
  localOperateRecordInfo?: LocalOperateRecordInfo;
82
94
  data?: boolean | number | string;
83
95
  dpId: number;
@@ -115,7 +127,7 @@ interface AlarmData {
115
127
  unlockName: string;
116
128
  userId: string;
117
129
  userName: string;
118
- mediaInfoList?: MediaInfo[];
130
+ mediaInfoList?: MediaInfoRecord[];
119
131
  }
120
132
  interface GetAlarmListResult {
121
133
  datas: AlarmData[];
@@ -151,6 +163,11 @@ interface AlbumItem {
151
163
  fileUrl: string;
152
164
  mediaBucket: string;
153
165
  mediaKey: string;
166
+ width: number;
167
+ height: number;
168
+ angle: number;
169
+ position: number;
170
+ vr: 0 | 1;
154
171
  }
155
172
  export declare const getAlbumMessages: (params: GetAlbumMessagesParams) => Promise<{
156
173
  hasNext: boolean;
@@ -0,0 +1,28 @@
1
+ export interface VasNotifyPushConfig {
2
+ appNotify?: boolean;
3
+ iosVoip?: boolean;
4
+ cloudPhone?: boolean;
5
+ }
6
+ export interface VasNotifyScene {
7
+ enable: boolean;
8
+ pushConfig?: VasNotifyPushConfig;
9
+ }
10
+ export interface VasNotifyConfig {
11
+ alert?: boolean | VasNotifyScene;
12
+ doorBell?: VasNotifyScene;
13
+ lockDoor?: VasNotifyScene;
14
+ unlockDoor?: VasNotifyScene & {
15
+ contacts?: Array<Record<string, any>>;
16
+ };
17
+ cloudPhone?: boolean;
18
+ iosVoip?: boolean;
19
+ appNotify?: boolean;
20
+ [k: string]: any;
21
+ }
22
+ export interface UpdateVasNotifyConfigParams {
23
+ key: string;
24
+ enable: boolean;
25
+ userId?: string;
26
+ }
27
+ export declare const getVasNotifyConfigApi: (devId: string) => Promise<VasNotifyConfig>;
28
+ export declare const updateVasNotifyConfigApi: (devId: string, params: UpdateVasNotifyConfigParams) => Promise<VasNotifyConfig>;
@@ -0,0 +1,17 @@
1
+ import { requestApi } from "./request";
2
+ export const getVasNotifyConfigApi = (devId) => {
3
+ return requestApi({
4
+ logName: "getVasNotifyConfig",
5
+ api: "m.lock.vas.notify.config.get",
6
+ version: "1.0",
7
+ data: { devId },
8
+ });
9
+ };
10
+ export const updateVasNotifyConfigApi = (devId, params) => {
11
+ return requestApi({
12
+ logName: "updateVasNotifyConfig",
13
+ api: "m.lock.vas.notify.config.update",
14
+ version: "1.0",
15
+ data: { devId, ...params },
16
+ });
17
+ };
@@ -0,0 +1,26 @@
1
+ export interface CloudServiceStatus {
2
+ isExit: boolean;
3
+ duration: number;
4
+ imgDuration: number;
5
+ hasPurchasedOrder: boolean;
6
+ isFree: boolean;
7
+ }
8
+ export interface ServiceBenefitPopupItem {
9
+ name: string;
10
+ serviceCode: string;
11
+ catalogCode: string;
12
+ batchId: string;
13
+ expireTime: number;
14
+ usedTimes?: number;
15
+ numPerDevice?: number;
16
+ popupType: number;
17
+ }
18
+ export interface ClaimResultItem {
19
+ success: boolean;
20
+ errorCode?: string;
21
+ name?: string;
22
+ purchasedName?: string;
23
+ }
24
+ export declare const getCloudServiceStatusApi: (devId: string) => Promise<CloudServiceStatus>;
25
+ export declare const getServicePopupListApi: (devId: string) => Promise<ServiceBenefitPopupItem[]>;
26
+ export declare const claimServiceApi: (devId: string, batchId: string) => Promise<ClaimResultItem[]>;
@@ -0,0 +1,25 @@
1
+ import { requestApi } from "./request";
2
+ export const getCloudServiceStatusApi = (devId) => {
3
+ return requestApi({
4
+ logName: "getCloudServiceStatus",
5
+ api: "m.lock.media.effect.credential",
6
+ version: "1.0",
7
+ data: { devId },
8
+ });
9
+ };
10
+ export const getServicePopupListApi = (devId) => {
11
+ return requestApi({
12
+ logName: "getServicePopupList",
13
+ api: "m.lock.vas.popup.content",
14
+ version: "1.0",
15
+ data: { devId, catalogCodes: "" },
16
+ });
17
+ };
18
+ export const claimServiceApi = (devId, batchId) => {
19
+ return requestApi({
20
+ logName: "claimService",
21
+ api: "m.lock.vas.collect.trigger",
22
+ version: "1.0",
23
+ data: { devId, catalogCodes: "", batchId },
24
+ });
25
+ };
@@ -28,4 +28,13 @@ export declare const getIPCConfig: (devId: string) => Promise<{
28
28
  hardwareCapability: number[];
29
29
  };
30
30
  }>;
31
+ export interface MediaViewTimesResult {
32
+ count: number;
33
+ }
34
+ export declare const getMediaViewTimes: (devId: string) => Promise<MediaViewTimesResult>;
35
+ export declare const setMediaViewTimes: (devId: string) => Promise<MediaViewTimesResult>;
36
+ export interface getAlbumDateListResult {
37
+ dateList: string[];
38
+ }
39
+ export declare const getAlbumDateList: (devId: string) => Promise<getAlbumDateListResult>;
31
40
  export {};
package/lib/api/video.js CHANGED
@@ -30,3 +30,33 @@ export const getIPCConfig = (devId) => {
30
30
  },
31
31
  });
32
32
  };
33
+ export const getMediaViewTimes = (devId) => {
34
+ return requestApi({
35
+ logName: "getMediaViewTimes",
36
+ api: `${THING}.m.device.lock.media.view.times.get`,
37
+ version: "1.0",
38
+ data: {
39
+ devId,
40
+ },
41
+ });
42
+ };
43
+ export const setMediaViewTimes = (devId) => {
44
+ return requestApi({
45
+ logName: "setMediaViewTimes",
46
+ api: `${THING}.m.device.lock.media.view.times.set`,
47
+ version: "1.0",
48
+ data: {
49
+ devId,
50
+ },
51
+ });
52
+ };
53
+ export const getAlbumDateList = (devId) => {
54
+ return requestApi({
55
+ logName: "getAlbumDateList",
56
+ api: "m.lock.album.media.date.list",
57
+ version: "1.0",
58
+ data: {
59
+ devId,
60
+ },
61
+ });
62
+ };
@@ -0,0 +1,10 @@
1
+ export interface VoipAuth {
2
+ isAuth: boolean;
3
+ isValid: boolean;
4
+ userId: string;
5
+ userName: string;
6
+ avatarUrl: string;
7
+ [k: string]: any;
8
+ }
9
+ export declare const getVoipAuthApi: (devId: string) => Promise<VoipAuth>;
10
+ export declare const saveVoipAuthApi: (devId: string, userId: string) => Promise<boolean>;
@@ -0,0 +1,17 @@
1
+ import { requestApi } from "./request";
2
+ export const getVoipAuthApi = (devId) => {
3
+ return requestApi({
4
+ logName: "getVoipAuth",
5
+ api: "m.lock.device.voip.auth.get",
6
+ version: "1.0",
7
+ data: { devId },
8
+ });
9
+ };
10
+ export const saveVoipAuthApi = (devId, userId) => {
11
+ return requestApi({
12
+ logName: "saveVoipAuth",
13
+ api: "m.lock.device.voip.auth.save",
14
+ version: "1.0",
15
+ data: { devId, userId },
16
+ });
17
+ };
@@ -67,6 +67,7 @@ declare const dpCodes: {
67
67
  readonly doorOpened: "door_opened";
68
68
  readonly unlockApp: "unlock_app";
69
69
  readonly initiativeMessage: "initiative_message";
70
+ readonly locationSelect: "location_select";
70
71
  readonly manualLock: "manual_lock";
71
72
  readonly checkCodeSet: "check_code_set";
72
73
  readonly bleKeyCreate: "ble_key_create";
@@ -67,6 +67,7 @@ const dpCodes = {
67
67
  doorOpened: "door_opened",
68
68
  unlockApp: "unlock_app",
69
69
  initiativeMessage: "initiative_message",
70
+ locationSelect: "location_select",
70
71
  manualLock: "manual_lock",
71
72
  checkCodeSet: "check_code_set",
72
73
  bleKeyCreate: "ble_key_create",
@@ -0,0 +1,13 @@
1
+ export declare const locationSelectReportMap: readonly [{
2
+ readonly name: "status";
3
+ }, {
4
+ readonly name: "list";
5
+ readonly bytes: 2;
6
+ readonly loop: true;
7
+ readonly type: "child";
8
+ readonly childMap: readonly [{
9
+ readonly name: "index";
10
+ }, {
11
+ readonly name: "type";
12
+ }];
13
+ }];
@@ -0,0 +1,19 @@
1
+ export const locationSelectReportMap = [
2
+ {
3
+ name: "status",
4
+ },
5
+ {
6
+ name: "list",
7
+ bytes: 2,
8
+ loop: true,
9
+ type: "child",
10
+ childMap: [
11
+ {
12
+ name: "index",
13
+ },
14
+ {
15
+ name: "type",
16
+ },
17
+ ],
18
+ },
19
+ ];
@@ -1,12 +1,23 @@
1
- import { addEvents } from "../../../feature/state/platform-routing";
1
+ import { addEvents, removeEvents, } from "../../../feature/state/platform-routing";
2
2
  import { initState } from "../../../feature/state/init-state";
3
- import { registerRuntime } from "../../../runtime/registry";
3
+ import { clearStateForRuntime } from "../../../feature/state/clear";
4
+ import { registerRuntime, unregisterRuntime, getRegisteredRuntimeCount, } from "../../../runtime/registry";
4
5
  import { buildFitSDKInstance } from "../build-instance";
5
6
  import { createBootstrappedRuntime } from "./bootstrap";
6
7
  export async function bootstrapRegisteredFitInstance(options) {
7
8
  const runtime = await createBootstrappedRuntime(options);
8
9
  registerRuntime(runtime);
9
- addEvents(runtime);
10
- await initState(runtime);
11
- return { runtime, instance: buildFitSDKInstance(runtime) };
10
+ try {
11
+ addEvents(runtime);
12
+ await initState(runtime);
13
+ return { runtime, instance: buildFitSDKInstance(runtime) };
14
+ }
15
+ catch (error) {
16
+ unregisterRuntime(runtime.devId);
17
+ clearStateForRuntime(runtime);
18
+ if (getRegisteredRuntimeCount() === 0) {
19
+ removeEvents();
20
+ }
21
+ throw error;
22
+ }
12
23
  }
@@ -18,7 +18,7 @@ export const initFit = async (options) => {
18
18
  const { devInfo, deviceId } = opts;
19
19
  if (!devInfo && !deviceId) {
20
20
  const { query } = getLaunchOptionsSync();
21
- opts.deviceId = query.deviceId;
21
+ opts.deviceId = query['deviceId'];
22
22
  if (!opts.deviceId) {
23
23
  throw getError(1000);
24
24
  }
@@ -1,12 +1,23 @@
1
- import { addEvents } from "../../../feature/state/platform-routing";
1
+ import { addEvents, removeEvents, } from "../../../feature/state/platform-routing";
2
2
  import { initState } from "../../../feature/state/init-state";
3
- import { registerRuntime } from "../../../runtime/registry";
3
+ import { clearStateForRuntime } from "../../../feature/state/clear";
4
+ import { registerRuntime, unregisterRuntime, getRegisteredRuntimeCount, } from "../../../runtime/registry";
4
5
  import { buildLockSDKInstance, } from "../build-instance";
5
6
  import { createBootstrappedRuntime } from "./bootstrap";
6
7
  export async function bootstrapRegisteredLockInstance(options) {
7
8
  const runtime = await createBootstrappedRuntime(options);
8
9
  registerRuntime(runtime);
9
- addEvents(runtime);
10
- await initState(runtime);
11
- return { runtime, instance: buildLockSDKInstance(runtime) };
10
+ try {
11
+ addEvents(runtime);
12
+ await initState(runtime);
13
+ return { runtime, instance: buildLockSDKInstance(runtime) };
14
+ }
15
+ catch (error) {
16
+ unregisterRuntime(runtime.devId);
17
+ clearStateForRuntime(runtime);
18
+ if (getRegisteredRuntimeCount() === 0) {
19
+ removeEvents();
20
+ }
21
+ throw error;
22
+ }
12
23
  }
@@ -47,6 +47,8 @@ export async function applyLockOptionsToRuntime(runtime, options) {
47
47
  config.idsByCode = idsByCode;
48
48
  config.supportBigData = !!dpSchema[dpCodes.synchMethodW];
49
49
  config.preFetch = options?.preFetch ?? false;
50
+ config.localCache = options?.localCache ?? true;
51
+ config.notSupportWake = options?.notSupportWake ?? false;
50
52
  config.communication = getCapabilities(devInfo.capability).map((item) => item.id);
51
53
  sdkLog("info", "bootstrap", "applyOptions", {
52
54
  devId: config.devInfo.devId,
@@ -4,3 +4,5 @@ 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 getDeviceAdvancedAbilitiesSync(): import("../../..").DeviceAdvancedAbility | undefined;
8
+ 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, getDeviceAdvancedAbilitiesSyncForRuntime, getDeviceCapabilitiesForRuntime, } from "../../../feature/misc/capability";
3
3
  export function hasCapability(capability) {
4
4
  return hasCapabilityForRuntime(resolveRuntimeFromExportThis(this), capability);
5
5
  }
@@ -15,3 +15,9 @@ export async function isActiveThread() {
15
15
  export async function getDeviceAdvancedAbilities() {
16
16
  return getDeviceAdvancedAbilitiesForRuntime(resolveRuntimeFromExportThis(this));
17
17
  }
18
+ export function getDeviceAdvancedAbilitiesSync() {
19
+ return getDeviceAdvancedAbilitiesSyncForRuntime(resolveRuntimeFromExportThis(this));
20
+ }
21
+ export function getDeviceCapabilities() {
22
+ return getDeviceCapabilitiesForRuntime(resolveRuntimeFromExportThis(this));
23
+ }
@@ -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
+ }
@@ -11,6 +11,10 @@ export * from "./log";
11
11
  export * from "./signal";
12
12
  export * from "./sleep";
13
13
  export * from "./misc";
14
+ export * from "./service";
15
+ export * from "./notify";
16
+ export * from "./voip";
17
+ export * from "./gesture";
14
18
  export * from "./media";
15
19
  export * from "./voice-file";
16
20
  export * from "./linkage";
@@ -11,6 +11,10 @@ export * from "./log";
11
11
  export * from "./signal";
12
12
  export * from "./sleep";
13
13
  export * from "./misc";
14
+ export * from "./service";
15
+ export * from "./notify";
16
+ export * from "./voip";
17
+ export * from "./gesture";
14
18
  export * from "./media";
15
19
  export * from "./voice-file";
16
20
  export * from "./linkage";
@@ -1,6 +1,15 @@
1
- import { GetMediaUrlParams, OpenLocalAlbumParams } from "../../../feature/media/media";
1
+ import { GetMediaUrlParams, OpenLocalAlbumParams, GotoPlaybackParams } from "../../../feature/media/media";
2
2
  export declare function getMediaUrl(params: GetMediaUrlParams): Promise<import("../../../feature/media/media").MediaUrlResult>;
3
3
  export declare function isSupportMedia(): boolean;
4
4
  export declare function getMediaRotate(): import("../../../feature/media/rotate").MediaRotate;
5
5
  export declare function getMediaInfo(): import("../../../feature/media/media").MediaInfo;
6
6
  export declare function openLocalAlbum(params?: OpenLocalAlbumParams): Promise<void>;
7
+ export declare function gotoPlayback(params?: GotoPlaybackParams): Promise<void>;
8
+ export declare function isSupportMultiCamera(): boolean;
9
+ export declare function getCameraInfo(): import("../../../feature/media/camera").CameraDpInfo | undefined;
10
+ export declare function queryCameraInfo(): Promise<import("../../../feature/media/camera").CameraInfo | undefined>;
11
+ export declare function switchCamera(index: number): Promise<true>;
12
+ export declare function getMediaViewTimes(): Promise<import("../../../api/video").MediaViewTimesResult>;
13
+ export declare function addMediaViewTimes(): Promise<import("../../../api/video").MediaViewTimesResult>;
14
+ export declare function getAlbumDateList(): Promise<import("../../../api/video").getAlbumDateListResult>;
15
+ export declare function getCameraConfig(): import("../../..").CameraConfig[];
@@ -1,6 +1,7 @@
1
1
  import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
- import { getMediaUrlForRuntime, isSupportMediaForRuntime, openLocalAlbumForRuntime, getMediaInfoForRuntime, } from "../../../feature/media/media";
2
+ import { getMediaUrlForRuntime, isSupportMediaForRuntime, openLocalAlbumForRuntime, gotoPlaybackForRuntime, getMediaInfoForRuntime, getMediaViewTimesForRuntime, setMediaViewTimesForRuntime, getAlbumDateListForRuntime, } from "../../../feature/media/media";
3
3
  import { getMediaRotateForRuntime } from "../../../feature/media/rotate";
4
+ import { isSupportMultiCameraForRuntime, getCameraInfoForRuntime, queryCameraInfoForRuntime, switchCameraForRuntime, getCameraConfigForRuntime, } from "../../../feature/media/camera";
4
5
  export async function getMediaUrl(params) {
5
6
  return getMediaUrlForRuntime(resolveRuntimeFromExportThis(this), params);
6
7
  }
@@ -16,3 +17,30 @@ export function getMediaInfo() {
16
17
  export function openLocalAlbum(params) {
17
18
  return openLocalAlbumForRuntime(resolveRuntimeFromExportThis(this), params);
18
19
  }
20
+ export function gotoPlayback(params) {
21
+ return gotoPlaybackForRuntime(resolveRuntimeFromExportThis(this), params);
22
+ }
23
+ export function isSupportMultiCamera() {
24
+ return isSupportMultiCameraForRuntime(resolveRuntimeFromExportThis(this));
25
+ }
26
+ export function getCameraInfo() {
27
+ return getCameraInfoForRuntime(resolveRuntimeFromExportThis(this));
28
+ }
29
+ export async function queryCameraInfo() {
30
+ return queryCameraInfoForRuntime(resolveRuntimeFromExportThis(this));
31
+ }
32
+ export async function switchCamera(index) {
33
+ return switchCameraForRuntime(resolveRuntimeFromExportThis(this), index);
34
+ }
35
+ export async function getMediaViewTimes() {
36
+ return getMediaViewTimesForRuntime(resolveRuntimeFromExportThis(this));
37
+ }
38
+ export async function addMediaViewTimes() {
39
+ return setMediaViewTimesForRuntime(resolveRuntimeFromExportThis(this));
40
+ }
41
+ export async function getAlbumDateList() {
42
+ return getAlbumDateListForRuntime(resolveRuntimeFromExportThis(this));
43
+ }
44
+ export function getCameraConfig() {
45
+ return getCameraConfigForRuntime(resolveRuntimeFromExportThis(this));
46
+ }
@@ -14,5 +14,5 @@ export interface UpdateDpPeriodTimeOption {
14
14
  }
15
15
  export declare function updateDpPeriodTime(dpCode: string, data: UpdateDpPeriodTimeParams, option?: UpdateDpPeriodTimeOption): Promise<void>;
16
16
  export declare function connectDevice(): Promise<true>;
17
- export declare function gotoService(params?: GotoServiceParams): Promise<unknown>;
17
+ export declare function gotoService(params?: GotoServiceParams): Promise<void>;
18
18
  export declare function validatePwdComplexity(password: string): Promise<boolean>;
@@ -0,0 +1,7 @@
1
+ export type { VasNotifyConfig, VasNotifyScene, VasNotifyPushConfig, UpdateVasNotifyConfigParams, } from "../../../api/notify";
2
+ export declare function getVasNotifyConfig(): Promise<import("../../../api/notify").VasNotifyConfig>;
3
+ export declare function updateVasNotifyConfig(params: {
4
+ key: string;
5
+ enable: boolean;
6
+ userId?: string;
7
+ }): Promise<import("../../../api/notify").VasNotifyConfig>;
@@ -0,0 +1,8 @@
1
+ import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
+ import { getVasNotifyConfigForRuntime, updateVasNotifyConfigForRuntime, } from "../../../feature/notify/notify";
3
+ export async function getVasNotifyConfig() {
4
+ return getVasNotifyConfigForRuntime(resolveRuntimeFromExportThis(this));
5
+ }
6
+ export async function updateVasNotifyConfig(params) {
7
+ return updateVasNotifyConfigForRuntime(resolveRuntimeFromExportThis(this), params);
8
+ }
@@ -0,0 +1,4 @@
1
+ export type { CloudServiceStatus, ServiceBenefitPopupItem, ClaimResultItem, } from "../../../api/service";
2
+ export declare function getCloudServiceStatus(): Promise<import("../../../api/service").CloudServiceStatus>;
3
+ export declare function getServicePopupList(): Promise<import("../../../api/service").ServiceBenefitPopupItem[]>;
4
+ export declare function claimService(batchId: string): Promise<import("../../../api/service").ClaimResultItem[]>;
@@ -0,0 +1,11 @@
1
+ import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
+ import { getCloudServiceStatusForRuntime, getServicePopupListForRuntime, claimServiceForRuntime, } from "../../../feature/service/value-added";
3
+ export async function getCloudServiceStatus() {
4
+ return getCloudServiceStatusForRuntime(resolveRuntimeFromExportThis(this));
5
+ }
6
+ export async function getServicePopupList() {
7
+ return getServicePopupListForRuntime(resolveRuntimeFromExportThis(this));
8
+ }
9
+ export async function claimService(batchId) {
10
+ return claimServiceForRuntime(resolveRuntimeFromExportThis(this), batchId);
11
+ }
@@ -0,0 +1,3 @@
1
+ export type { VoipAuth } from "../../../api/voip";
2
+ export declare function getVoipAuth(): Promise<import("../../../api/voip").VoipAuth>;
3
+ export declare function saveVoipAuth(userId: string): Promise<boolean>;
@@ -0,0 +1,8 @@
1
+ import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
+ import { getVoipAuthForRuntime, saveVoipAuthForRuntime, } from "../../../feature/voip/voip";
3
+ export async function getVoipAuth() {
4
+ return getVoipAuthForRuntime(resolveRuntimeFromExportThis(this));
5
+ }
6
+ export async function saveVoipAuth(userId) {
7
+ return saveVoipAuthForRuntime(resolveRuntimeFromExportThis(this), userId);
8
+ }
@@ -18,7 +18,7 @@ export const init = async (options) => {
18
18
  const { devInfo, deviceId } = opts;
19
19
  if (!devInfo && !deviceId) {
20
20
  const { query } = getLaunchOptionsSync();
21
- opts.deviceId = query.deviceId;
21
+ opts.deviceId = query['deviceId'];
22
22
  if (!opts.deviceId) {
23
23
  throw getError(1000);
24
24
  }
@@ -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 });