@ray-js/lock-sdk 1.2.0-beta.3 → 1.2.0-beta.30

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 (269) hide show
  1. package/lib/api/fit.d.ts +55 -2
  2. package/lib/api/fit.js +43 -1
  3. package/lib/api/gesture.d.ts +11 -0
  4. package/lib/api/gesture.js +18 -0
  5. package/lib/api/log.d.ts +52 -4
  6. package/lib/api/log.js +22 -0
  7. package/lib/api/notify.d.ts +28 -0
  8. package/lib/api/notify.js +17 -0
  9. package/lib/api/service.d.ts +26 -0
  10. package/lib/api/service.js +25 -0
  11. package/lib/api/temp.d.ts +21 -0
  12. package/lib/api/temp.js +24 -0
  13. package/lib/api/video.d.ts +9 -0
  14. package/lib/api/video.js +30 -0
  15. package/lib/api/voip.d.ts +10 -0
  16. package/lib/api/voip.js +17 -0
  17. package/lib/config/dp-code/index.d.ts +2 -1
  18. package/lib/config/dp-code/index.js +2 -0
  19. package/lib/config/dp-map/media.d.ts +13 -0
  20. package/lib/config/dp-map/media.js +19 -0
  21. package/lib/entries/main/bootstrap/bootstrap-lock-instance.d.ts +2 -1
  22. package/lib/entries/main/bootstrap/bootstrap-lock-instance.js +23 -8
  23. package/lib/entries/main/bootstrap/bootstrap.d.ts +3 -2
  24. package/lib/entries/main/bootstrap/bootstrap.js +10 -6
  25. package/lib/entries/main/bootstrap/primary-instance.d.ts +1 -2
  26. package/lib/entries/main/bootstrap/primary-instance.js +1 -1
  27. package/lib/entries/main/bootstrap/resolve-runtime-from-export-this.js +1 -1
  28. package/lib/entries/main/build-instance.d.ts +6 -3
  29. package/lib/entries/main/build-instance.js +13 -1
  30. package/lib/entries/main/exports/capability.d.ts +2 -0
  31. package/lib/entries/main/exports/capability.js +7 -1
  32. package/lib/entries/main/exports/fit-sdk/binding.d.ts +10 -0
  33. package/lib/entries/{fit/exports → main/exports/fit-sdk}/binding.js +6 -3
  34. package/lib/entries/{fit/exports → main/exports/fit-sdk}/device.d.ts +11 -10
  35. package/lib/entries/{fit/exports → main/exports/fit-sdk}/device.js +20 -20
  36. package/lib/entries/{fit/exports → main/exports/fit-sdk}/index.d.ts +1 -0
  37. package/lib/entries/{fit/exports → main/exports/fit-sdk}/index.js +1 -0
  38. package/lib/entries/main/exports/fit-sdk/log.d.ts +3 -0
  39. package/lib/entries/main/exports/fit-sdk/log.js +5 -0
  40. package/lib/entries/main/exports/fit-sdk/temp.d.ts +40 -0
  41. package/lib/entries/main/exports/fit-sdk/temp.js +59 -0
  42. package/lib/entries/main/exports/gesture.d.ts +6 -0
  43. package/lib/entries/main/exports/gesture.js +8 -0
  44. package/lib/entries/main/exports/index.d.ts +8 -0
  45. package/lib/entries/main/exports/index.js +8 -0
  46. package/lib/entries/main/exports/log.d.ts +2 -0
  47. package/lib/entries/main/exports/log.js +7 -1
  48. package/lib/entries/main/exports/media.d.ts +10 -1
  49. package/lib/entries/main/exports/media.js +29 -1
  50. package/lib/entries/main/exports/misc.d.ts +4 -2
  51. package/lib/entries/main/exports/misc.js +2 -2
  52. package/lib/entries/main/exports/notify.d.ts +7 -0
  53. package/lib/entries/main/exports/notify.js +8 -0
  54. package/lib/entries/main/exports/service.d.ts +4 -0
  55. package/lib/entries/main/exports/service.js +11 -0
  56. package/lib/entries/main/exports/voip.d.ts +3 -0
  57. package/lib/entries/main/exports/voip.js +8 -0
  58. package/lib/entries/main/index.d.ts +3 -3
  59. package/lib/entries/main/index.js +11 -5
  60. package/lib/feature/fit/bind-lock-to-fit.d.ts +1 -0
  61. package/lib/feature/fit/bind-lock-to-fit.js +53 -0
  62. package/lib/feature/fit/ble-key.d.ts +10 -4
  63. package/lib/feature/fit/ble-key.js +145 -4
  64. package/lib/feature/fit/device-bv.d.ts +2 -0
  65. package/lib/feature/fit/device-bv.js +15 -0
  66. package/lib/feature/fit/invalid-password.d.ts +10 -0
  67. package/lib/feature/fit/invalid-password.js +43 -0
  68. package/lib/feature/fit/list.d.ts +12 -2
  69. package/lib/feature/fit/list.js +54 -5
  70. package/lib/feature/fit/log.d.ts +7 -0
  71. package/lib/feature/fit/log.js +123 -0
  72. package/lib/feature/fit/method/add-flow.js +2 -2
  73. package/lib/feature/fit/method/add-password.js +2 -2
  74. package/lib/feature/fit/method/update-remove.js +40 -14
  75. package/lib/feature/fit/password-list.d.ts +37 -0
  76. package/lib/feature/fit/password-list.js +44 -1
  77. package/lib/feature/fit/security-channel.d.ts +3 -0
  78. package/lib/feature/fit/security-channel.js +43 -0
  79. package/lib/feature/fit/shared.d.ts +8 -0
  80. package/lib/feature/fit/shared.js +40 -1
  81. package/lib/feature/fit/sync.d.ts +4 -2
  82. package/lib/feature/fit/sync.js +63 -22
  83. package/lib/feature/fit/temp-password.d.ts +23 -0
  84. package/lib/feature/fit/temp-password.js +95 -3
  85. package/lib/feature/fit/users.d.ts +1 -0
  86. package/lib/feature/fit/users.js +1 -0
  87. package/lib/feature/gesture/gesture.d.ts +6 -0
  88. package/lib/feature/gesture/gesture.js +3 -0
  89. package/lib/feature/log/log.d.ts +5 -1
  90. package/lib/feature/log/log.js +53 -6
  91. package/lib/feature/media/camera.d.ts +18 -0
  92. package/lib/feature/media/camera.js +36 -0
  93. package/lib/feature/media/media.d.ts +10 -0
  94. package/lib/feature/media/media.js +31 -0
  95. package/lib/feature/misc/ble-control.js +2 -2
  96. package/lib/feature/misc/capability.d.ts +2 -0
  97. package/lib/feature/misc/capability.js +84 -11
  98. package/lib/feature/misc/connect-device.d.ts +1 -1
  99. package/lib/feature/misc/connect-device.js +7 -6
  100. package/lib/feature/misc/is-use-near-channel-for-runtime.js +8 -1
  101. package/lib/feature/notify/notify.d.ts +4 -0
  102. package/lib/feature/notify/notify.js +3 -0
  103. package/lib/feature/password/temporary/custom-dp.js +59 -54
  104. package/lib/feature/password/temporary/offline-create.d.ts +14 -0
  105. package/lib/feature/password/temporary/offline-create.js +77 -1
  106. package/lib/feature/service/goto-service.d.ts +3 -2
  107. package/lib/feature/service/goto-service.js +7 -1
  108. package/lib/feature/service/value-added.d.ts +4 -0
  109. package/lib/feature/service/value-added.js +4 -0
  110. package/lib/feature/state/clear.js +1 -0
  111. package/lib/feature/state/device-status.js +17 -6
  112. package/lib/feature/state/init-state.js +20 -12
  113. package/lib/feature/state/platform-routing.js +12 -3
  114. package/lib/feature/state/remote-permissions.js +17 -0
  115. package/lib/feature/state/sync/remote-serect-key.js +7 -0
  116. package/lib/feature/storage/index.d.ts +5 -0
  117. package/lib/feature/storage/index.js +32 -0
  118. package/lib/feature/storage/swr-cache.d.ts +7 -0
  119. package/lib/feature/storage/swr-cache.js +54 -0
  120. package/lib/feature/unlock/method/add-flow.js +2 -2
  121. package/lib/feature/unlock/method/add-password.js +2 -2
  122. package/lib/feature/unlock/sync/unlock-method.js +3 -0
  123. package/lib/feature/user/sync-user.js +4 -2
  124. package/lib/feature/utils/index.d.ts +1 -0
  125. package/lib/feature/utils/index.js +1 -0
  126. package/lib/feature/voip/voip.d.ts +3 -0
  127. package/lib/feature/voip/voip.js +3 -0
  128. package/lib/interface.d.ts +42 -1
  129. package/lib/platform/device.d.ts +4 -3
  130. package/lib/platform/index.d.ts +1 -0
  131. package/lib/platform/index.js +1 -0
  132. package/lib/platform/ipc.d.ts +3 -0
  133. package/lib/platform/ipc.js +13 -0
  134. package/lib/platform/storage.d.ts +3 -0
  135. package/lib/platform/storage.js +9 -0
  136. package/lib/runtime/LockDeviceRuntime.js +3 -0
  137. package/lib/runtime/lock-config.d.ts +5 -1
  138. package/lib/runtime/lock-config.js +6 -0
  139. package/lib/runtime/runtime-state-types.d.ts +6 -0
  140. package/lib/utils/constant.d.ts +1 -0
  141. package/lib/utils/constant.js +6 -0
  142. package/lib/utils/errors.js +3 -1
  143. package/lib/utils/index.d.ts +2 -1
  144. package/lib/utils/index.js +1 -0
  145. package/lib/utils/parse.js +1 -1
  146. package/package.json +1 -11
  147. package/lib/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  148. package/lib/bootstrap/bootstrap-lock-instance.js +0 -16
  149. package/lib/bootstrap/bootstrap.d.ts +0 -4
  150. package/lib/bootstrap/bootstrap.js +0 -53
  151. package/lib/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  152. package/lib/bootstrap/lock-instance-runtime-ref.js +0 -7
  153. package/lib/bootstrap/primary-instance.d.ts +0 -6
  154. package/lib/bootstrap/primary-instance.js +0 -24
  155. package/lib/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  156. package/lib/bootstrap/resolve-runtime-from-export-this.js +0 -29
  157. package/lib/bootstrap/top-level-runtime.d.ts +0 -2
  158. package/lib/bootstrap/top-level-runtime.js +0 -9
  159. package/lib/entries/ble/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  160. package/lib/entries/ble/bootstrap/bootstrap-lock-instance.js +0 -12
  161. package/lib/entries/ble/bootstrap/bootstrap.d.ts +0 -4
  162. package/lib/entries/ble/bootstrap/bootstrap.js +0 -53
  163. package/lib/entries/ble/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  164. package/lib/entries/ble/bootstrap/lock-instance-runtime-ref.js +0 -7
  165. package/lib/entries/ble/bootstrap/primary-instance.d.ts +0 -6
  166. package/lib/entries/ble/bootstrap/primary-instance.js +0 -24
  167. package/lib/entries/ble/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  168. package/lib/entries/ble/bootstrap/resolve-runtime-from-export-this.js +0 -29
  169. package/lib/entries/ble/bootstrap/top-level-runtime.d.ts +0 -2
  170. package/lib/entries/ble/bootstrap/top-level-runtime.js +0 -9
  171. package/lib/entries/ble/build-instance.d.ts +0 -9
  172. package/lib/entries/ble/build-instance.js +0 -50
  173. package/lib/entries/ble/exports/capability.d.ts +0 -6
  174. package/lib/entries/ble/exports/capability.js +0 -17
  175. package/lib/entries/ble/exports/config.d.ts +0 -3
  176. package/lib/entries/ble/exports/config.js +0 -5
  177. package/lib/entries/ble/exports/dp.d.ts +0 -9
  178. package/lib/entries/ble/exports/dp.js +0 -13
  179. package/lib/entries/ble/exports/index.d.ts +0 -16
  180. package/lib/entries/ble/exports/index.js +0 -16
  181. package/lib/entries/ble/exports/linkage.d.ts +0 -5
  182. package/lib/entries/ble/exports/linkage.js +0 -15
  183. package/lib/entries/ble/exports/log.d.ts +0 -9
  184. package/lib/entries/ble/exports/log.js +0 -21
  185. package/lib/entries/ble/exports/media.d.ts +0 -4
  186. package/lib/entries/ble/exports/media.js +0 -12
  187. package/lib/entries/ble/exports/misc.d.ts +0 -19
  188. package/lib/entries/ble/exports/misc.js +0 -30
  189. package/lib/entries/ble/exports/offline-dps.d.ts +0 -8
  190. package/lib/entries/ble/exports/offline-dps.js +0 -24
  191. package/lib/entries/ble/exports/open/do-open-close-action.d.ts +0 -2
  192. package/lib/entries/ble/exports/open/do-open-close-action.js +0 -36
  193. package/lib/entries/ble/exports/open/index.d.ts +0 -18
  194. package/lib/entries/ble/exports/open/index.js +0 -45
  195. package/lib/entries/ble/exports/signal.d.ts +0 -6
  196. package/lib/entries/ble/exports/signal.js +0 -14
  197. package/lib/entries/ble/exports/sleep.d.ts +0 -13
  198. package/lib/entries/ble/exports/sleep.js +0 -31
  199. package/lib/entries/ble/exports/state.d.ts +0 -6
  200. package/lib/entries/ble/exports/state.js +0 -19
  201. package/lib/entries/ble/exports/temporary.d.ts +0 -31
  202. package/lib/entries/ble/exports/temporary.js +0 -91
  203. package/lib/entries/ble/exports/unlock/sync.d.ts +0 -1
  204. package/lib/entries/ble/exports/unlock/sync.js +0 -5
  205. package/lib/entries/ble/exports/unlock-method.d.ts +0 -19
  206. package/lib/entries/ble/exports/unlock-method.js +0 -58
  207. package/lib/entries/ble/exports/user/index.d.ts +0 -23
  208. package/lib/entries/ble/exports/user/index.js +0 -22
  209. package/lib/entries/ble/exports/user/sync.d.ts +0 -1
  210. package/lib/entries/ble/exports/user/sync.js +0 -5
  211. package/lib/entries/ble/index.d.ts +0 -8
  212. package/lib/entries/ble/index.js +0 -39
  213. package/lib/entries/fit/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  214. package/lib/entries/fit/bootstrap/bootstrap-lock-instance.js +0 -12
  215. package/lib/entries/fit/bootstrap/bootstrap.d.ts +0 -4
  216. package/lib/entries/fit/bootstrap/bootstrap.js +0 -69
  217. package/lib/entries/fit/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  218. package/lib/entries/fit/bootstrap/lock-instance-runtime-ref.js +0 -7
  219. package/lib/entries/fit/bootstrap/primary-instance.d.ts +0 -6
  220. package/lib/entries/fit/bootstrap/primary-instance.js +0 -24
  221. package/lib/entries/fit/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  222. package/lib/entries/fit/bootstrap/resolve-runtime-from-export-this.js +0 -29
  223. package/lib/entries/fit/bootstrap/top-level-runtime.d.ts +0 -2
  224. package/lib/entries/fit/bootstrap/top-level-runtime.js +0 -9
  225. package/lib/entries/fit/build-instance.d.ts +0 -9
  226. package/lib/entries/fit/build-instance.js +0 -57
  227. package/lib/entries/fit/exports/binding.d.ts +0 -8
  228. package/lib/entries/fit/exports/temp.d.ts +0 -19
  229. package/lib/entries/fit/exports/temp.js +0 -18
  230. package/lib/entries/fit/index.d.ts +0 -8
  231. package/lib/entries/fit/index.js +0 -36
  232. package/lib/entries/main/exports/open.d.ts +0 -16
  233. package/lib/entries/main/exports/open.js +0 -44
  234. package/lib/entries/screen/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  235. package/lib/entries/screen/bootstrap/bootstrap-lock-instance.js +0 -12
  236. package/lib/entries/screen/bootstrap/bootstrap.d.ts +0 -4
  237. package/lib/entries/screen/bootstrap/bootstrap.js +0 -69
  238. package/lib/entries/screen/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  239. package/lib/entries/screen/bootstrap/lock-instance-runtime-ref.js +0 -7
  240. package/lib/entries/screen/bootstrap/primary-instance.d.ts +0 -6
  241. package/lib/entries/screen/bootstrap/primary-instance.js +0 -24
  242. package/lib/entries/screen/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  243. package/lib/entries/screen/bootstrap/resolve-runtime-from-export-this.js +0 -29
  244. package/lib/entries/screen/bootstrap/top-level-runtime.d.ts +0 -2
  245. package/lib/entries/screen/bootstrap/top-level-runtime.js +0 -9
  246. package/lib/entries/screen/build-instance.d.ts +0 -9
  247. package/lib/entries/screen/build-instance.js +0 -57
  248. package/lib/entries/screen/exports/bind-events.d.ts +0 -4
  249. package/lib/entries/screen/exports/bind-events.js +0 -8
  250. package/lib/entries/screen/exports/binding.d.ts +0 -6
  251. package/lib/entries/screen/exports/binding.js +0 -15
  252. package/lib/entries/screen/exports/device.d.ts +0 -16
  253. package/lib/entries/screen/exports/device.js +0 -41
  254. package/lib/entries/screen/exports/event.d.ts +0 -3
  255. package/lib/entries/screen/exports/event.js +0 -5
  256. package/lib/entries/screen/exports/index.d.ts +0 -5
  257. package/lib/entries/screen/exports/index.js +0 -5
  258. package/lib/entries/screen/exports/user.d.ts +0 -2
  259. package/lib/entries/screen/exports/user.js +0 -8
  260. package/lib/entries/screen/index.d.ts +0 -8
  261. package/lib/entries/screen/index.js +0 -36
  262. package/lib/feature/unlock/door/door-action.d.ts +0 -2
  263. package/lib/feature/unlock/door/door-action.js +0 -32
  264. package/lib/fit.d.ts +0 -4
  265. package/lib/fit.js +0 -3
  266. package/lib/runtime/device-status/compute-device-status.d.ts +0 -25
  267. package/lib/runtime/device-status/compute-device-status.js +0 -94
  268. package/lib/screen.d.ts +0 -4
  269. package/lib/screen.js +0 -3
package/lib/api/fit.d.ts CHANGED
@@ -48,7 +48,11 @@ export interface SyncFitToLockRiseResult {
48
48
  }
49
49
  export declare const syncFitToLockRise: (fittingId: string) => Promise<SyncFitToLockRiseResult>;
50
50
  export declare const syncFitReport: (fittingId: string, ins: string) => Promise<unknown>;
51
- export declare const syncOpenModeRise: (devId: string, dpIds: string) => Promise<unknown>;
51
+ export interface SyncOpenModeRiseResult {
52
+ ins: string;
53
+ distributed: boolean;
54
+ }
55
+ export declare const syncOpenModeRise: (devId: string, dpIds: string[]) => Promise<SyncOpenModeRiseResult>;
52
56
  export interface RawPasswordItem {
53
57
  unlockBindingId: number;
54
58
  effectiveTime: number;
@@ -73,6 +77,30 @@ export interface RawPasswordItem {
73
77
  gmtCreate: number;
74
78
  }
75
79
  export declare const getFitPasswordList: (fittingId: string) => Promise<RawPasswordItem[]>;
80
+ export interface RawOfflinePasswordItem {
81
+ unlockBindingId?: number | string;
82
+ pwdId: number;
83
+ sn: number;
84
+ gmtCreate: number;
85
+ opModeType: number;
86
+ opModeSubType: number;
87
+ pwdName: string;
88
+ gmtStart: number;
89
+ gmtExpired: number;
90
+ mayExpired: boolean;
91
+ devNameList: string[];
92
+ scheduleDetails: RawFitOpenModeScheduleItem[];
93
+ revokedPwdName: string;
94
+ revokedPwdEffectiveTime: number;
95
+ revokedPwdInvalidTime: number;
96
+ }
97
+ export interface FitOfflinePwdQuery {
98
+ limit?: number;
99
+ offset?: number;
100
+ }
101
+ export declare const getFitOfflinePasswordList: (fittingId: string, query?: FitOfflinePwdQuery) => Promise<RawOfflinePasswordItem[] | {
102
+ datas: RawOfflinePasswordItem[];
103
+ }>;
76
104
  export interface RawFitUserItem {
77
105
  userId: string;
78
106
  uid: string;
@@ -143,7 +171,19 @@ export interface RawFitOpenModeItem {
143
171
  gmtCreate: number;
144
172
  }
145
173
  export declare const getFitOpenModeList: (fittingId: string, dpId?: number) => Promise<RawFitOpenModeItem[]>;
146
- export declare const getFitBleKeyListApi: (fittingId: string) => Promise<unknown[]>;
174
+ export interface RawFitBleKeyItem {
175
+ id: string;
176
+ unlockBindingId: string;
177
+ name: string;
178
+ effectiveTime: number;
179
+ invalidTime: number;
180
+ scheduleDetails?: RawFitOpenModeScheduleItem[];
181
+ opModeSubType?: number;
182
+ sn?: number;
183
+ userName?: string;
184
+ devNameList?: string[];
185
+ }
186
+ export declare const getFitBleKeyListApi: (fittingId: string) => Promise<RawFitBleKeyItem[]>;
147
187
  export declare const addFitBleKeyApi: (fittingId: string, params: Record<string, unknown>) => Promise<unknown>;
148
188
  interface UpdateFitBleKeyParams {
149
189
  unlockBindingId: string;
@@ -200,4 +240,17 @@ export declare const addFitOnlineTempPwdCloud: (params: FetchFitOnlineTempPwdMes
200
240
  export declare const removeFitOnlineTempPwd: (fittingId: string, pwdId: number) => Promise<unknown>;
201
241
  export declare const updateFitOnlineTempPwd: (fittingId: string, params: Record<string, unknown>) => Promise<unknown>;
202
242
  export declare const renameFitOnlineTempPwd: (fittingId: string, pwdId: number, name: string) => Promise<true>;
243
+ export declare const resendFitOnlineTempPwd: (fittingId: string, pwdId: number) => Promise<boolean>;
244
+ export interface FitInvalidPwdQuery {
245
+ opMode?: number | string;
246
+ limit?: number;
247
+ offset?: number;
248
+ }
249
+ export interface FitInvalidPwdListResult {
250
+ datas: RawPasswordItem[];
251
+ totalCount: number;
252
+ }
253
+ export declare const getFitInvalidPwdListApi: (fittingId: string, query?: FitInvalidPwdQuery) => Promise<FitInvalidPwdListResult>;
254
+ export declare const clearFitInvalidPwdApi: (fittingId: string, opMode?: number | string) => Promise<boolean>;
255
+ export declare const getFitDeviceBVApi: (fittingId: string) => Promise<number>;
203
256
  export {};
package/lib/api/fit.js CHANGED
@@ -46,7 +46,7 @@ export const syncFitToLockRise = (fittingId) => requestApi({
46
46
  logName: "syncFitToLockRise",
47
47
  api: `${THING}.m.device.lock.fittings.sync.rise`,
48
48
  version: "1.0",
49
- data: { fittingId },
49
+ data: { devId: fittingId, fittingId },
50
50
  });
51
51
  export const syncFitReport = (fittingId, ins) => requestApi({
52
52
  logName: "syncFitReport",
@@ -66,6 +66,12 @@ export const getFitPasswordList = (fittingId) => requestApi({
66
66
  version: "1.0",
67
67
  data: { fittingId },
68
68
  });
69
+ export const getFitOfflinePasswordList = (fittingId, query = {}) => requestApi({
70
+ logName: "getFitOfflinePasswordList",
71
+ api: `${THING}.m.device.lock.offlinepwd.list.valid`,
72
+ version: "1.0",
73
+ data: { devId: fittingId, limit: 200, ...query },
74
+ });
69
75
  export const getFitUserListApi = (fittingId) => requestApi({
70
76
  logName: "getFitUserListApi",
71
77
  api: `${THING}.m.device.member.list`,
@@ -156,3 +162,39 @@ export const renameFitOnlineTempPwd = (fittingId, pwdId, name) => requestApi({
156
162
  version: "1.0",
157
163
  data: { fittingId, pwdId, name },
158
164
  });
165
+ export const resendFitOnlineTempPwd = (fittingId, pwdId) => requestApi({
166
+ logName: "resendFitOnlineTempPwd",
167
+ api: `${THING}.m.device.fittings.password.temp.resend`,
168
+ version: "1.0",
169
+ data: { fittingId, pwdId },
170
+ });
171
+ export const getFitInvalidPwdListApi = (fittingId, query = {}) => requestApi({
172
+ logName: "getFitInvalidPwdListApi",
173
+ api: `${THING}.m.device.fittings.unlock.bindings.list.garbage`,
174
+ version: "2.0",
175
+ data: { fittingId, ...query },
176
+ });
177
+ export const clearFitInvalidPwdApi = (fittingId, opMode) => requestApi({
178
+ logName: "clearFitInvalidPwdApi",
179
+ api: `${THING}.m.device.fittings.unlock.bindings.clear`,
180
+ version: "2.0",
181
+ data: { fittingId, opMode },
182
+ });
183
+ const FIT_BV_EXT_CONFIG_KEY = "5de69aaa812cd52c9a14dcfe";
184
+ export const getFitDeviceBVApi = (fittingId) => requestApi({
185
+ logName: "getFitDeviceBVApi",
186
+ api: `${THING}.app.buyer.high.power.get`,
187
+ version: "1.0",
188
+ data: { input: { deviceId: fittingId, code: "tyabi3trvg" } },
189
+ }).then((res) => {
190
+ if (res?.extConfig) {
191
+ try {
192
+ const extra = JSON.parse(res.extConfig);
193
+ return Number(extra[FIT_BV_EXT_CONFIG_KEY]) || 0;
194
+ }
195
+ catch {
196
+ return 0;
197
+ }
198
+ }
199
+ return 0;
200
+ });
@@ -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;
@@ -62,6 +74,35 @@ export interface LogsResult {
62
74
  totalCount: number;
63
75
  }
64
76
  export declare const getRecordList: (params: GetRecordListParams) => Promise<LogsResult>;
77
+ export interface FitRecordInfo {
78
+ id?: string | number;
79
+ historyId?: string | number;
80
+ time?: string | number;
81
+ gmtCreate?: number;
82
+ dpId: string | number;
83
+ dpValue: any;
84
+ userId: string;
85
+ userName?: string;
86
+ unlockName?: string;
87
+ memberBindableFlag?: 0 | 1;
88
+ avatarUrl?: string;
89
+ relateDevName?: string;
90
+ dps?: Record<number, any>[];
91
+ mediaInfoList?: MediaInfoRecord[];
92
+ unionUnlockInfo?: UnionUnlockInfo[];
93
+ localOperateRecordInfo?: LocalOperateRecordInfo;
94
+ matterRecordInfo?: {
95
+ matterSn: number;
96
+ matterSource: number;
97
+ matterType: number;
98
+ };
99
+ }
100
+ export interface FitRecordListResult {
101
+ datas: FitRecordInfo[];
102
+ hasNext: boolean;
103
+ totalCount: number;
104
+ }
105
+ export declare const getFitRecordListApi: (params: GetRecordListParams) => Promise<FitRecordListResult>;
65
106
  export interface LockLogListItem {
66
107
  logId: string;
67
108
  logCategory: LockLogCategory;
@@ -77,7 +118,7 @@ export interface LockLogListItem {
77
118
  relateDevName?: string;
78
119
  relateOpMode?: string;
79
120
  unionUnlockInfo?: UnionUnlockInfo[];
80
- mediaInfoList?: MediaInfo[];
121
+ mediaInfoList?: MediaInfoRecord[];
81
122
  localOperateRecordInfo?: LocalOperateRecordInfo;
82
123
  data?: boolean | number | string;
83
124
  dpId: number;
@@ -115,7 +156,7 @@ interface AlarmData {
115
156
  unlockName: string;
116
157
  userId: string;
117
158
  userName: string;
118
- mediaInfoList?: MediaInfo[];
159
+ mediaInfoList?: MediaInfoRecord[];
119
160
  }
120
161
  interface GetAlarmListResult {
121
162
  datas: AlarmData[];
@@ -123,6 +164,8 @@ interface GetAlarmListResult {
123
164
  totalCount: number;
124
165
  }
125
166
  export declare const getAlarmList: (params: GetRecordListParams) => Promise<GetAlarmListResult>;
167
+ export declare const getAlarmUnreadCountApi: (devId: string) => Promise<number>;
168
+ export declare const getActivePeriodApi: (devId: string) => Promise<number>;
126
169
  interface GetAlbumMessagesParams {
127
170
  devId: string;
128
171
  limit: number;
@@ -151,6 +194,11 @@ interface AlbumItem {
151
194
  fileUrl: string;
152
195
  mediaBucket: string;
153
196
  mediaKey: string;
197
+ width: number;
198
+ height: number;
199
+ angle: number;
200
+ position: number;
201
+ vr: 0 | 1;
154
202
  }
155
203
  export declare const getAlbumMessages: (params: GetAlbumMessagesParams) => Promise<{
156
204
  hasNext: boolean;
package/lib/api/log.js CHANGED
@@ -18,6 +18,12 @@ export const getRecordList = (params) => {
18
18
  data: params,
19
19
  });
20
20
  };
21
+ export const getFitRecordListApi = (params) => requestApi({
22
+ logName: "getFitRecordListApi",
23
+ api: `${THING}.m.device.lock.history.list`,
24
+ version: "2.0",
25
+ data: params,
26
+ });
21
27
  export const getLockLogList = (params) => {
22
28
  return requestApi({
23
29
  logName: "getLockLogList",
@@ -42,6 +48,22 @@ export const getAlarmList = (params) => {
42
48
  data: params,
43
49
  });
44
50
  };
51
+ export const getAlarmUnreadCountApi = (devId) => {
52
+ return requestApi({
53
+ logName: "getAlarmUnreadCountApi",
54
+ api: `${THING}.m.device.lock.alarm.unread`,
55
+ version: "1.0",
56
+ data: { devId },
57
+ });
58
+ };
59
+ export const getActivePeriodApi = (devId) => {
60
+ return requestApi({
61
+ logName: "getActivePeriodApi",
62
+ api: `${THING}.m.device.lock.active.period`,
63
+ version: "1.0",
64
+ data: { devId },
65
+ });
66
+ };
45
67
  export const getAlbumMessages = (params) => {
46
68
  return requestApi({
47
69
  logName: "getAlbumMessages",
@@ -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
+ };
package/lib/api/temp.d.ts CHANGED
@@ -129,6 +129,15 @@ interface CreateOfflineOnceParams {
129
129
  gmtExpired: string;
130
130
  }
131
131
  export declare const createOfflineOnceAPI: (params: CreateOfflineOnceParams) => Promise<OfflinePwdResult>;
132
+ interface GetOfflinePwdAvailableParams {
133
+ devId: string;
134
+ pwdType: string;
135
+ }
136
+ export interface OfflinePwdAvailableResult {
137
+ available: boolean;
138
+ nextAvailableTime?: number;
139
+ }
140
+ export declare const getOfflinePwdAvailable: (params: GetOfflinePwdAvailableParams) => Promise<OfflinePwdAvailableResult>;
132
141
  interface GetDynapwdParams {
133
142
  devId: string;
134
143
  adminPwd?: string;
@@ -142,6 +151,12 @@ interface RevokeOfflinePasswordParams {
142
151
  name?: string;
143
152
  }
144
153
  export declare const revokeOfflinePassword: (params: RevokeOfflinePasswordParams) => Promise<OfflinePwdResult>;
154
+ interface RevokeOfflinePasswordByPwdIdParams {
155
+ devId: string;
156
+ pwdId: number;
157
+ name?: string;
158
+ }
159
+ export declare const revokeOfflinePasswordByPwdId: (params: RevokeOfflinePasswordByPwdIdParams) => Promise<OfflinePwdResult>;
145
160
  interface EffectiveListParams {
146
161
  devId: string;
147
162
  authTypes: string[];
@@ -208,6 +223,12 @@ interface ReNameOfflineParams {
208
223
  unlockBindingId: string;
209
224
  }
210
225
  export declare const reNameOffline: (params: ReNameOfflineParams) => Promise<unknown>;
226
+ interface ReNameOfflineByPwdIdParams {
227
+ devId: string;
228
+ pwdName: string;
229
+ pwdId: number;
230
+ }
231
+ export declare const reNameOfflineByPwdId: (params: ReNameOfflineByPwdIdParams) => Promise<unknown>;
211
232
  export interface SyncTempPwdScheduleItem {
212
233
  allDay: boolean;
213
234
  effectiveTime: number;
package/lib/api/temp.js CHANGED
@@ -90,6 +90,14 @@ export const createOfflineOnceAPI = (params) => {
90
90
  data: params,
91
91
  });
92
92
  };
93
+ export const getOfflinePwdAvailable = (params) => {
94
+ return requestApi({
95
+ logName: "getOfflinePwdAvailable",
96
+ api: `${THING}.m.device.lock.offlinepwd.available`,
97
+ version: "1.0",
98
+ data: params,
99
+ });
100
+ };
93
101
  export const getDynamicPassword = (params) => {
94
102
  return requestApi({
95
103
  logName: "getDynamicPassword",
@@ -106,6 +114,14 @@ export const revokeOfflinePassword = (params) => {
106
114
  data: params,
107
115
  });
108
116
  };
117
+ export const revokeOfflinePasswordByPwdId = (params) => {
118
+ return requestApi({
119
+ logName: "revokeOfflinePasswordByPwdId",
120
+ api: `${THING}.m.device.lock.offlinepwd.revoke`,
121
+ version: "1.0",
122
+ data: params,
123
+ });
124
+ };
109
125
  export const fetchEffectiveList = (params) => {
110
126
  return requestApi({
111
127
  logName: "fetchEffectiveList",
@@ -146,6 +162,14 @@ export const reNameOffline = (params) => {
146
162
  data: params,
147
163
  });
148
164
  };
165
+ export const reNameOfflineByPwdId = (params) => {
166
+ return requestApi({
167
+ logName: "reNameOfflineByPwdId",
168
+ api: `${THING}.m.device.lock.offlinepwd.name.update`,
169
+ version: "1.0",
170
+ data: params,
171
+ });
172
+ };
149
173
  export const getSyncTempPasswords = (params) => {
150
174
  return requestApi({
151
175
  logName: "getSyncTempPasswords",
@@ -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";
@@ -99,5 +100,5 @@ declare const dpCodes: {
99
100
  readonly blePswUpdate: "ble_password_update";
100
101
  };
101
102
  export type DpCodeValue = (typeof dpCodes)[keyof typeof dpCodes];
102
- export declare const latLogDpCodes: ("unlock_password" | "unlock_fingerprint" | "unlock_finger_vein" | "unlock_hand" | "unlock_dynamic" | "unlock_key" | "unlock_card" | "unlock_face" | "unlock_temporary" | "unlock_offline_pd" | "unlock_offline_clear" | "unlock_offline_clear_single" | "unlock_phone_remote" | "unlock_voice_remote" | "lock_record" | "unlock_ble" | "unlock_eye" | "unlock_double_kit" | "unlock_double_kit_w" | "alarm_lock" | "doorbell" | "hijack" | "family_call")[];
103
+ export declare const latLogDpCodes: ("unlock_matter_kw" | "unlock_password" | "unlock_fingerprint" | "unlock_finger_vein" | "unlock_hand" | "unlock_dynamic" | "unlock_key" | "unlock_card" | "unlock_face" | "unlock_temporary" | "unlock_offline_pd" | "unlock_offline_clear" | "unlock_offline_clear_single" | "unlock_phone_remote" | "unlock_voice_remote" | "lock_record" | "unlock_ble" | "unlock_eye" | "unlock_double_kit" | "unlock_double_kit_w" | "alarm_lock" | "doorbell" | "hijack" | "family_call")[];
103
104
  export default dpCodes;
@@ -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",
@@ -122,5 +123,6 @@ export const latLogDpCodes = [
122
123
  dpCodes.unlockOfflineClear,
123
124
  dpCodes.unlockOfflineClearSingle,
124
125
  dpCodes.familyCall,
126
+ dpCodes.unlockMatterKw,
125
127
  ];
126
128
  export default dpCodes;
@@ -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,7 +1,8 @@
1
1
  import type { LockSDKOption } from "../../../interface";
2
2
  import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
3
3
  import { type LockSDKInstance } from "../build-instance";
4
- export declare function bootstrapRegisteredLockInstance(options?: LockSDKOption): Promise<{
4
+ import { type SDKKind } from "./bootstrap";
5
+ export declare function bootstrapRegisteredInstance(kind: SDKKind, options?: LockSDKOption): Promise<{
5
6
  runtime: LockDeviceRuntime;
6
7
  instance: LockSDKInstance;
7
8
  }>;