@ray-js/lock-sdk 1.2.0-beta.8 → 1.2.0

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 (239) 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/temp.d.ts +21 -0
  8. package/lib/api/temp.js +24 -0
  9. package/lib/api/video.d.ts +4 -0
  10. package/lib/api/video.js +10 -0
  11. package/lib/config/dp-code/index.d.ts +1 -1
  12. package/lib/config/dp-code/index.js +1 -0
  13. package/lib/entries/main/bootstrap/bootstrap-lock-instance.d.ts +2 -1
  14. package/lib/entries/main/bootstrap/bootstrap-lock-instance.js +23 -8
  15. package/lib/entries/main/bootstrap/bootstrap.d.ts +3 -2
  16. package/lib/entries/main/bootstrap/bootstrap.js +10 -6
  17. package/lib/entries/main/bootstrap/primary-instance.d.ts +1 -2
  18. package/lib/entries/main/bootstrap/primary-instance.js +1 -1
  19. package/lib/entries/main/bootstrap/resolve-runtime-from-export-this.js +1 -1
  20. package/lib/entries/main/build-instance.d.ts +6 -3
  21. package/lib/entries/main/build-instance.js +13 -1
  22. package/lib/entries/main/exports/capability.d.ts +2 -0
  23. package/lib/entries/main/exports/capability.js +7 -1
  24. package/lib/entries/main/exports/fit-sdk/binding.d.ts +10 -0
  25. package/lib/entries/{fit/exports → main/exports/fit-sdk}/binding.js +6 -3
  26. package/lib/entries/{fit/exports → main/exports/fit-sdk}/device.d.ts +11 -10
  27. package/lib/entries/{fit/exports → main/exports/fit-sdk}/device.js +20 -20
  28. package/lib/entries/{fit/exports → main/exports/fit-sdk}/index.d.ts +1 -0
  29. package/lib/entries/{fit/exports → main/exports/fit-sdk}/index.js +1 -0
  30. package/lib/entries/main/exports/fit-sdk/log.d.ts +3 -0
  31. package/lib/entries/main/exports/fit-sdk/log.js +5 -0
  32. package/lib/entries/main/exports/fit-sdk/temp.d.ts +40 -0
  33. package/lib/entries/main/exports/fit-sdk/temp.js +59 -0
  34. package/lib/entries/main/exports/gesture.d.ts +6 -0
  35. package/lib/entries/main/exports/gesture.js +8 -0
  36. package/lib/entries/main/exports/index.d.ts +5 -0
  37. package/lib/entries/main/exports/index.js +5 -0
  38. package/lib/entries/main/exports/log.d.ts +2 -0
  39. package/lib/entries/main/exports/log.js +7 -1
  40. package/lib/entries/main/exports/media.d.ts +3 -1
  41. package/lib/entries/main/exports/media.js +8 -2
  42. package/lib/entries/main/exports/misc.d.ts +4 -2
  43. package/lib/entries/main/exports/misc.js +2 -2
  44. package/lib/entries/main/index.d.ts +3 -3
  45. package/lib/entries/main/index.js +11 -5
  46. package/lib/feature/fit/bind-lock-to-fit.d.ts +1 -0
  47. package/lib/feature/fit/bind-lock-to-fit.js +53 -0
  48. package/lib/feature/fit/ble-key.d.ts +10 -4
  49. package/lib/feature/fit/ble-key.js +145 -4
  50. package/lib/feature/fit/device-bv.d.ts +2 -0
  51. package/lib/feature/fit/device-bv.js +15 -0
  52. package/lib/feature/fit/invalid-password.d.ts +10 -0
  53. package/lib/feature/fit/invalid-password.js +43 -0
  54. package/lib/feature/fit/list.d.ts +12 -2
  55. package/lib/feature/fit/list.js +54 -5
  56. package/lib/feature/fit/log.d.ts +7 -0
  57. package/lib/feature/fit/log.js +123 -0
  58. package/lib/feature/fit/method/add-flow.js +2 -2
  59. package/lib/feature/fit/method/add-password.js +2 -2
  60. package/lib/feature/fit/method/update-remove.js +40 -14
  61. package/lib/feature/fit/password-list.d.ts +37 -0
  62. package/lib/feature/fit/password-list.js +44 -1
  63. package/lib/feature/fit/security-channel.d.ts +3 -0
  64. package/lib/feature/fit/security-channel.js +43 -0
  65. package/lib/feature/fit/shared.d.ts +8 -0
  66. package/lib/feature/fit/shared.js +40 -1
  67. package/lib/feature/fit/sync.d.ts +4 -2
  68. package/lib/feature/fit/sync.js +63 -22
  69. package/lib/feature/fit/temp-password.d.ts +23 -0
  70. package/lib/feature/fit/temp-password.js +95 -3
  71. package/lib/feature/fit/users.d.ts +1 -0
  72. package/lib/feature/fit/users.js +1 -0
  73. package/lib/feature/gesture/gesture.d.ts +6 -0
  74. package/lib/feature/gesture/gesture.js +3 -0
  75. package/lib/feature/log/log.d.ts +5 -1
  76. package/lib/feature/log/log.js +53 -6
  77. package/lib/feature/media/camera.d.ts +12 -2
  78. package/lib/feature/media/camera.js +3 -0
  79. package/lib/feature/media/media.d.ts +2 -1
  80. package/lib/feature/media/media.js +4 -1
  81. package/lib/feature/misc/ble-control.js +2 -2
  82. package/lib/feature/misc/capability.d.ts +2 -0
  83. package/lib/feature/misc/capability.js +33 -31
  84. package/lib/feature/misc/connect-device.d.ts +1 -1
  85. package/lib/feature/misc/connect-device.js +7 -6
  86. package/lib/feature/misc/is-use-near-channel-for-runtime.js +8 -1
  87. package/lib/feature/password/temporary/offline-create.d.ts +14 -0
  88. package/lib/feature/password/temporary/offline-create.js +77 -1
  89. package/lib/feature/service/goto-service.d.ts +1 -1
  90. package/lib/feature/state/clear.js +1 -0
  91. package/lib/feature/state/device-status.js +17 -6
  92. package/lib/feature/state/init-state.js +18 -10
  93. package/lib/feature/state/platform-routing.js +12 -3
  94. package/lib/feature/state/remote-permissions.js +17 -0
  95. package/lib/feature/state/sync/remote-serect-key.js +7 -0
  96. package/lib/feature/storage/swr-cache.d.ts +7 -0
  97. package/lib/feature/storage/swr-cache.js +54 -0
  98. package/lib/feature/unlock/method/add-flow.js +2 -2
  99. package/lib/feature/unlock/method/add-password.js +2 -2
  100. package/lib/feature/user/sync-user.js +4 -2
  101. package/lib/feature/utils/index.d.ts +1 -0
  102. package/lib/feature/utils/index.js +1 -0
  103. package/lib/interface.d.ts +29 -0
  104. package/lib/platform/device.d.ts +4 -3
  105. package/lib/platform/ipc.d.ts +3 -0
  106. package/lib/platform/ipc.js +13 -0
  107. package/lib/platform/storage.d.ts +1 -1
  108. package/lib/runtime/LockDeviceRuntime.js +3 -0
  109. package/lib/runtime/lock-config.d.ts +5 -1
  110. package/lib/runtime/lock-config.js +6 -0
  111. package/lib/runtime/runtime-state-types.d.ts +6 -0
  112. package/lib/utils/constant.d.ts +1 -0
  113. package/lib/utils/constant.js +6 -0
  114. package/lib/utils/index.d.ts +2 -1
  115. package/lib/utils/index.js +1 -0
  116. package/package.json +1 -11
  117. package/lib/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  118. package/lib/bootstrap/bootstrap-lock-instance.js +0 -16
  119. package/lib/bootstrap/bootstrap.d.ts +0 -4
  120. package/lib/bootstrap/bootstrap.js +0 -53
  121. package/lib/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  122. package/lib/bootstrap/lock-instance-runtime-ref.js +0 -7
  123. package/lib/bootstrap/primary-instance.d.ts +0 -6
  124. package/lib/bootstrap/primary-instance.js +0 -24
  125. package/lib/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  126. package/lib/bootstrap/resolve-runtime-from-export-this.js +0 -29
  127. package/lib/bootstrap/top-level-runtime.d.ts +0 -2
  128. package/lib/bootstrap/top-level-runtime.js +0 -9
  129. package/lib/entries/ble/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  130. package/lib/entries/ble/bootstrap/bootstrap-lock-instance.js +0 -12
  131. package/lib/entries/ble/bootstrap/bootstrap.d.ts +0 -4
  132. package/lib/entries/ble/bootstrap/bootstrap.js +0 -53
  133. package/lib/entries/ble/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  134. package/lib/entries/ble/bootstrap/lock-instance-runtime-ref.js +0 -7
  135. package/lib/entries/ble/bootstrap/primary-instance.d.ts +0 -6
  136. package/lib/entries/ble/bootstrap/primary-instance.js +0 -24
  137. package/lib/entries/ble/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  138. package/lib/entries/ble/bootstrap/resolve-runtime-from-export-this.js +0 -29
  139. package/lib/entries/ble/bootstrap/top-level-runtime.d.ts +0 -2
  140. package/lib/entries/ble/bootstrap/top-level-runtime.js +0 -9
  141. package/lib/entries/ble/build-instance.d.ts +0 -9
  142. package/lib/entries/ble/build-instance.js +0 -50
  143. package/lib/entries/ble/exports/capability.d.ts +0 -6
  144. package/lib/entries/ble/exports/capability.js +0 -17
  145. package/lib/entries/ble/exports/config.d.ts +0 -3
  146. package/lib/entries/ble/exports/config.js +0 -5
  147. package/lib/entries/ble/exports/dp.d.ts +0 -9
  148. package/lib/entries/ble/exports/dp.js +0 -13
  149. package/lib/entries/ble/exports/index.d.ts +0 -16
  150. package/lib/entries/ble/exports/index.js +0 -16
  151. package/lib/entries/ble/exports/linkage.d.ts +0 -5
  152. package/lib/entries/ble/exports/linkage.js +0 -15
  153. package/lib/entries/ble/exports/log.d.ts +0 -9
  154. package/lib/entries/ble/exports/log.js +0 -21
  155. package/lib/entries/ble/exports/media.d.ts +0 -4
  156. package/lib/entries/ble/exports/media.js +0 -12
  157. package/lib/entries/ble/exports/misc.d.ts +0 -19
  158. package/lib/entries/ble/exports/misc.js +0 -30
  159. package/lib/entries/ble/exports/offline-dps.d.ts +0 -8
  160. package/lib/entries/ble/exports/offline-dps.js +0 -24
  161. package/lib/entries/ble/exports/open/do-open-close-action.d.ts +0 -2
  162. package/lib/entries/ble/exports/open/do-open-close-action.js +0 -36
  163. package/lib/entries/ble/exports/open/index.d.ts +0 -18
  164. package/lib/entries/ble/exports/open/index.js +0 -45
  165. package/lib/entries/ble/exports/signal.d.ts +0 -6
  166. package/lib/entries/ble/exports/signal.js +0 -14
  167. package/lib/entries/ble/exports/sleep.d.ts +0 -13
  168. package/lib/entries/ble/exports/sleep.js +0 -31
  169. package/lib/entries/ble/exports/state.d.ts +0 -6
  170. package/lib/entries/ble/exports/state.js +0 -19
  171. package/lib/entries/ble/exports/temporary.d.ts +0 -31
  172. package/lib/entries/ble/exports/temporary.js +0 -91
  173. package/lib/entries/ble/exports/unlock/sync.d.ts +0 -1
  174. package/lib/entries/ble/exports/unlock/sync.js +0 -5
  175. package/lib/entries/ble/exports/unlock-method.d.ts +0 -19
  176. package/lib/entries/ble/exports/unlock-method.js +0 -58
  177. package/lib/entries/ble/exports/user/index.d.ts +0 -23
  178. package/lib/entries/ble/exports/user/index.js +0 -22
  179. package/lib/entries/ble/exports/user/sync.d.ts +0 -1
  180. package/lib/entries/ble/exports/user/sync.js +0 -5
  181. package/lib/entries/ble/index.d.ts +0 -8
  182. package/lib/entries/ble/index.js +0 -39
  183. package/lib/entries/fit/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  184. package/lib/entries/fit/bootstrap/bootstrap-lock-instance.js +0 -12
  185. package/lib/entries/fit/bootstrap/bootstrap.d.ts +0 -4
  186. package/lib/entries/fit/bootstrap/bootstrap.js +0 -69
  187. package/lib/entries/fit/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  188. package/lib/entries/fit/bootstrap/lock-instance-runtime-ref.js +0 -7
  189. package/lib/entries/fit/bootstrap/primary-instance.d.ts +0 -6
  190. package/lib/entries/fit/bootstrap/primary-instance.js +0 -24
  191. package/lib/entries/fit/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  192. package/lib/entries/fit/bootstrap/resolve-runtime-from-export-this.js +0 -29
  193. package/lib/entries/fit/bootstrap/top-level-runtime.d.ts +0 -2
  194. package/lib/entries/fit/bootstrap/top-level-runtime.js +0 -9
  195. package/lib/entries/fit/build-instance.d.ts +0 -9
  196. package/lib/entries/fit/build-instance.js +0 -57
  197. package/lib/entries/fit/exports/binding.d.ts +0 -8
  198. package/lib/entries/fit/exports/temp.d.ts +0 -19
  199. package/lib/entries/fit/exports/temp.js +0 -18
  200. package/lib/entries/fit/index.d.ts +0 -8
  201. package/lib/entries/fit/index.js +0 -36
  202. package/lib/entries/main/exports/open.d.ts +0 -16
  203. package/lib/entries/main/exports/open.js +0 -44
  204. package/lib/entries/screen/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  205. package/lib/entries/screen/bootstrap/bootstrap-lock-instance.js +0 -12
  206. package/lib/entries/screen/bootstrap/bootstrap.d.ts +0 -4
  207. package/lib/entries/screen/bootstrap/bootstrap.js +0 -69
  208. package/lib/entries/screen/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  209. package/lib/entries/screen/bootstrap/lock-instance-runtime-ref.js +0 -7
  210. package/lib/entries/screen/bootstrap/primary-instance.d.ts +0 -6
  211. package/lib/entries/screen/bootstrap/primary-instance.js +0 -24
  212. package/lib/entries/screen/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  213. package/lib/entries/screen/bootstrap/resolve-runtime-from-export-this.js +0 -29
  214. package/lib/entries/screen/bootstrap/top-level-runtime.d.ts +0 -2
  215. package/lib/entries/screen/bootstrap/top-level-runtime.js +0 -9
  216. package/lib/entries/screen/build-instance.d.ts +0 -9
  217. package/lib/entries/screen/build-instance.js +0 -57
  218. package/lib/entries/screen/exports/bind-events.d.ts +0 -4
  219. package/lib/entries/screen/exports/bind-events.js +0 -8
  220. package/lib/entries/screen/exports/binding.d.ts +0 -6
  221. package/lib/entries/screen/exports/binding.js +0 -15
  222. package/lib/entries/screen/exports/device.d.ts +0 -16
  223. package/lib/entries/screen/exports/device.js +0 -41
  224. package/lib/entries/screen/exports/event.d.ts +0 -3
  225. package/lib/entries/screen/exports/event.js +0 -5
  226. package/lib/entries/screen/exports/index.d.ts +0 -5
  227. package/lib/entries/screen/exports/index.js +0 -5
  228. package/lib/entries/screen/exports/user.d.ts +0 -2
  229. package/lib/entries/screen/exports/user.js +0 -8
  230. package/lib/entries/screen/index.d.ts +0 -8
  231. package/lib/entries/screen/index.js +0 -36
  232. package/lib/feature/unlock/door/door-action.d.ts +0 -2
  233. package/lib/feature/unlock/door/door-action.js +0 -32
  234. package/lib/fit.d.ts +0 -4
  235. package/lib/fit.js +0 -3
  236. package/lib/runtime/device-status/compute-device-status.d.ts +0 -25
  237. package/lib/runtime/device-status/compute-device-status.js +0 -94
  238. package/lib/screen.d.ts +0 -4
  239. package/lib/screen.js +0 -3
@@ -0,0 +1,10 @@
1
+ import { type BoundLockListItem, type FitLockUnbindableReason, type UnbindLockListItem } from "../../../../feature/fit/list";
2
+ import { BoundFitLockItem, UnbindLockItem } from "../../../../api/fit";
3
+ export type { BoundFitLockItem, BoundLockListItem, UnbindLockItem, UnbindLockListItem, FitLockUnbindableReason, };
4
+ export declare function getBoundLockList(): Promise<BoundLockListItem[]>;
5
+ export declare function getUnbindLockList(): Promise<UnbindLockListItem[]>;
6
+ export declare function bindLockToFit(lock: UnbindLockItem): Promise<unknown>;
7
+ export declare function unbindLockToFit(lock: BoundFitLockItem & {
8
+ bindingId: string;
9
+ }): Promise<unknown>;
10
+ export declare function activateLockToFit(lock: BoundFitLockItem): Promise<void>;
@@ -1,6 +1,6 @@
1
- import { getBoundLockListForRuntime, getUnbindLockListForRuntime, } from "../../../feature/fit/list";
2
- import { bindLockToFitForRuntime, unbindLockToFitForRuntime, } from "../../../feature/fit/bind-lock-to-fit";
3
- import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
1
+ import { getBoundLockListForRuntime, getUnbindLockListForRuntime, } from "../../../../feature/fit/list";
2
+ import { activateLockToFitForRuntime, bindLockToFitForRuntime, unbindLockToFitForRuntime, } from "../../../../feature/fit/bind-lock-to-fit";
3
+ import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
4
4
  export function getBoundLockList() {
5
5
  return getBoundLockListForRuntime(resolveRuntimeFromExportThis(this));
6
6
  }
@@ -13,3 +13,6 @@ export function bindLockToFit(lock) {
13
13
  export function unbindLockToFit(lock) {
14
14
  return unbindLockToFitForRuntime(resolveRuntimeFromExportThis(this), lock);
15
15
  }
16
+ export function activateLockToFit(lock) {
17
+ return activateLockToFitForRuntime(resolveRuntimeFromExportThis(this), lock);
18
+ }
@@ -1,8 +1,9 @@
1
- import { type FitStartAddUnlockMethodResult } from "../../../feature/fit/method/add-flow";
2
- import type { FitAddPasswordParams, FitAddUnlockMethodEvent, FitAddUnlockMethodListener, FitCancelAddUnlockMethodParams, FitStartAddUnlockMethodParams, FitUnlockMethodDevice, FitUnlockMethodItem, FitUpdateUnlockMethodParams, GetFitUnlockMethodListParams } from "../../../feature/fit/method/types";
3
- import { UpdateFitBleKeyParams, RenameFitBleKeyParams } from "../../../feature/fit/ble-key";
4
- import { type FitUserItem } from "../../../feature/fit/users";
5
- export type { FitAddPasswordParams, FitStartAddUnlockMethodParams, FitCancelAddUnlockMethodParams, FitUpdateUnlockMethodParams, FitAddUnlockMethodEvent, FitAddUnlockMethodListener, FitStartAddUnlockMethodResult, FitUserItem, FitUnlockMethodDevice, FitUnlockMethodItem, GetFitUnlockMethodListParams, };
1
+ import { type FitStartAddUnlockMethodResult } from "../../../../feature/fit/method/add-flow";
2
+ import type { FitAddPasswordParams, FitAddUnlockMethodEvent, FitAddUnlockMethodListener, FitCancelAddUnlockMethodParams, FitStartAddUnlockMethodParams, FitUnlockMethodDevice, FitUnlockMethodItem, FitUpdateUnlockMethodParams, GetFitUnlockMethodListParams } from "../../../../feature/fit/method/types";
3
+ import { CreateTemporaryBleKeyParams, UpdateTemporaryBleKeyParams, RenameFitBleKeyParams } from "../../../../feature/fit/ble-key";
4
+ import { type FitUserItem } from "../../../../feature/fit/users";
5
+ import type { FitBleKeyItem } from "../../../../interface";
6
+ export type { FitAddPasswordParams, FitStartAddUnlockMethodParams, FitCancelAddUnlockMethodParams, FitUpdateUnlockMethodParams, FitAddUnlockMethodEvent, FitAddUnlockMethodListener, FitStartAddUnlockMethodResult, FitUserItem, FitUnlockMethodDevice, FitUnlockMethodItem, GetFitUnlockMethodListParams, FitBleKeyItem, CreateTemporaryBleKeyParams, };
6
7
  export declare function fitAddPassword(params: FitAddPasswordParams): Promise<void>;
7
8
  export declare function fitStartAddUnlockMethod(params: FitStartAddUnlockMethodParams): Promise<FitStartAddUnlockMethodResult>;
8
9
  export declare function fitCancelAddUnlockMethod(params: FitCancelAddUnlockMethodParams): Promise<void>;
@@ -11,12 +12,12 @@ export declare function offFitAddUnlockMethod(listener: FitAddUnlockMethodListen
11
12
  export declare function fitUpdateUnlockMethod(params: FitUpdateUnlockMethodParams): Promise<void>;
12
13
  export declare function fitDeleteUnlockMethod(id: number, lockDevId?: string): Promise<void>;
13
14
  export declare function getFitUnlockMethodList(params: GetFitUnlockMethodListParams): Promise<FitUnlockMethodItem[]>;
14
- export declare function syncFitBindings(): Promise<void>;
15
- export declare function syncFitReport(ins: string): Promise<unknown>;
16
- export declare function syncOpenModeRise(dpIds: string): Promise<unknown>;
17
- export declare function getFitBleKeyList(): Promise<unknown[]>;
15
+ export declare function syncOpenModeRise(dpCodes?: string[]): Promise<import("../../../../api/fit").SyncOpenModeRiseResult>;
16
+ export declare function getFitBleKeyList(): Promise<FitBleKeyItem[]>;
18
17
  export declare function addFitBleKey(params: Record<string, unknown>): Promise<unknown>;
19
- export declare function updateFitBleKey(params: UpdateFitBleKeyParams): Promise<unknown>;
18
+ export declare function createFitPermanentBleKey(userId: string): Promise<unknown>;
19
+ export declare function createFitTemporaryBleKey(params: CreateTemporaryBleKeyParams): Promise<unknown>;
20
+ export declare function updateFitTemporaryBleKey(params: UpdateTemporaryBleKeyParams): Promise<unknown>;
20
21
  interface RemoveFitBleKeyParams {
21
22
  id: string;
22
23
  }
@@ -1,13 +1,13 @@
1
- import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
- import { fitAddPasswordForRuntime } from "../../../feature/fit/method/add-password";
3
- import { fitCancelAddUnlockMethodForRuntime, fitStartAddUnlockMethodForRuntime, } from "../../../feature/fit/method/add-flow";
4
- import { fitDeleteUnlockMethodForRuntime, fitUpdateUnlockMethodForRuntime, } from "../../../feature/fit/method/update-remove";
5
- import { offFitAddUnlockMethodForRuntime, onFitAddUnlockMethodForRuntime, } from "../../../feature/fit/method/add-method-events";
6
- import { getFitUnlockMethodListForRuntime } from "../../../feature/fit/method/list";
7
- import { syncFitBindingsForRuntime, syncFitReportForRuntime, syncOpenModeRiseForRuntime, } from "../../../feature/fit/sync";
8
- import { getFitBleKeyListForRuntime, addFitBleKeyForRuntime, updateFitBleKeyForRuntime, removeFitBleKeyForRuntime, renameFitBleKeyForRuntime, } from "../../../feature/fit/ble-key";
9
- import { setFitSettingForRuntime } from "../../../feature/fit/setting";
10
- import { getFitUsersForRuntime, } from "../../../feature/fit/users";
1
+ import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
2
+ import { fitAddPasswordForRuntime } from "../../../../feature/fit/method/add-password";
3
+ import { fitCancelAddUnlockMethodForRuntime, fitStartAddUnlockMethodForRuntime, } from "../../../../feature/fit/method/add-flow";
4
+ import { fitDeleteUnlockMethodForRuntime, fitUpdateUnlockMethodForRuntime, } from "../../../../feature/fit/method/update-remove";
5
+ import { offFitAddUnlockMethodForRuntime, onFitAddUnlockMethodForRuntime, } from "../../../../feature/fit/method/add-method-events";
6
+ import { getFitUnlockMethodListForRuntime } from "../../../../feature/fit/method/list";
7
+ import { syncOpenModeRiseForRuntime } from "../../../../feature/fit/sync";
8
+ import { getFitBleKeyListForRuntime, addFitBleKeyForRuntime, createFitPermanentBleKeyForRuntime, createFitTemporaryBleKeyForRuntime, updateFitTemporaryBleKeyForRuntime, removeFitBleKeyForRuntime, renameFitBleKeyForRuntime, } from "../../../../feature/fit/ble-key";
9
+ import { setFitSettingForRuntime } from "../../../../feature/fit/setting";
10
+ import { getFitUsersForRuntime, } from "../../../../feature/fit/users";
11
11
  export function fitAddPassword(params) {
12
12
  return fitAddPasswordForRuntime(resolveRuntimeFromExportThis(this), params);
13
13
  }
@@ -32,14 +32,8 @@ export function fitDeleteUnlockMethod(id, lockDevId) {
32
32
  export function getFitUnlockMethodList(params) {
33
33
  return getFitUnlockMethodListForRuntime(resolveRuntimeFromExportThis(this), params);
34
34
  }
35
- export function syncFitBindings() {
36
- return syncFitBindingsForRuntime(resolveRuntimeFromExportThis(this));
37
- }
38
- export function syncFitReport(ins) {
39
- return syncFitReportForRuntime(resolveRuntimeFromExportThis(this), ins);
40
- }
41
- export function syncOpenModeRise(dpIds) {
42
- return syncOpenModeRiseForRuntime(resolveRuntimeFromExportThis(this), dpIds);
35
+ export function syncOpenModeRise(dpCodes) {
36
+ return syncOpenModeRiseForRuntime(resolveRuntimeFromExportThis(this), dpCodes);
43
37
  }
44
38
  export function getFitBleKeyList() {
45
39
  return getFitBleKeyListForRuntime(resolveRuntimeFromExportThis(this));
@@ -47,8 +41,14 @@ export function getFitBleKeyList() {
47
41
  export function addFitBleKey(params) {
48
42
  return addFitBleKeyForRuntime(resolveRuntimeFromExportThis(this), params);
49
43
  }
50
- export function updateFitBleKey(params) {
51
- return updateFitBleKeyForRuntime(resolveRuntimeFromExportThis(this), params);
44
+ export function createFitPermanentBleKey(userId) {
45
+ return createFitPermanentBleKeyForRuntime(resolveRuntimeFromExportThis(this), userId);
46
+ }
47
+ export function createFitTemporaryBleKey(params) {
48
+ return createFitTemporaryBleKeyForRuntime(resolveRuntimeFromExportThis(this), params);
49
+ }
50
+ export function updateFitTemporaryBleKey(params) {
51
+ return updateFitTemporaryBleKeyForRuntime(resolveRuntimeFromExportThis(this), params);
52
52
  }
53
53
  export function removeFitBleKey(params) {
54
54
  return removeFitBleKeyForRuntime(resolveRuntimeFromExportThis(this), params.id);
@@ -1,3 +1,4 @@
1
1
  export * from "./binding";
2
2
  export * from "./device";
3
+ export * from "./log";
3
4
  export * from "./temp";
@@ -1,3 +1,4 @@
1
1
  export * from "./binding";
2
2
  export * from "./device";
3
+ export * from "./log";
3
4
  export * from "./temp";
@@ -0,0 +1,3 @@
1
+ import { type GetFitLogsParams } from "../../../../feature/fit/log";
2
+ export type { GetFitLogsParams };
3
+ export declare function getFitLogs(params?: GetFitLogsParams): Promise<import("../../../../feature/log/log").GetLogsResult>;
@@ -0,0 +1,5 @@
1
+ import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
2
+ import { getFitLogsForRuntime, } from "../../../../feature/fit/log";
3
+ export async function getFitLogs(params) {
4
+ return getFitLogsForRuntime(resolveRuntimeFromExportThis(this), params);
5
+ }
@@ -0,0 +1,40 @@
1
+ import { type FitOnlinePasswordItem, type FitOfflinePasswordItem } from "../../../../feature/fit/password-list";
2
+ import { type AddFitTempPwdParams, type RemoveFitTempPwdParams, type RenameFitTempPwdParams, type RenameFitOfflineTempPwdParams, type RevokeFitOfflineTempPwdParams, type FitOfflineClearCodeResult, type ResendFitTempPwdParams, type UpdateFitTempPwdParams } from "../../../../feature/fit/temp-password";
3
+ import { type ClearFitInvalidPwdParams, type GetFitInvalidPwdListParams } from "../../../../feature/fit/invalid-password";
4
+ import { type FitOfflineOnceResult } from "../../../../feature/password/temporary/offline-create";
5
+ import type { LimitOfflinePwdItem, OfflinePwdAvailableResult } from "../../../../api/temp";
6
+ import type { TempPasswordResult } from "../../../../interface";
7
+ export declare function getFitPasswordList(): Promise<{
8
+ id: number;
9
+ unlockId: string;
10
+ unlockName: string;
11
+ photoUnlock: boolean;
12
+ userName: string;
13
+ lockUserId: number;
14
+ userType: number;
15
+ devLockId: string;
16
+ effective: import("../../../../interface").EffectiveConfig;
17
+ }[]>;
18
+ export declare function getFitOnlinePasswordList(): Promise<FitOnlinePasswordItem[]>;
19
+ export declare function getFitOfflinePasswordList(): Promise<FitOfflinePasswordItem[]>;
20
+ export declare function addFitTempPwd(params: AddFitTempPwdParams): Promise<{
21
+ pwdId: number;
22
+ }>;
23
+ export declare function removeFitTempPwd(params: RemoveFitTempPwdParams): Promise<void>;
24
+ export declare function updateFitTempPwd(params: UpdateFitTempPwdParams): Promise<void>;
25
+ export declare function renameFitTempPwd(params: RenameFitTempPwdParams): Promise<void>;
26
+ export declare function renameFitOfflineTempPwd(params: RenameFitOfflineTempPwdParams): Promise<void>;
27
+ export declare function revokeFitOfflineTempPwd(params: RevokeFitOfflineTempPwdParams): Promise<FitOfflineClearCodeResult>;
28
+ export declare function resendFitTempPwd(params: ResendFitTempPwdParams): Promise<boolean>;
29
+ export declare function getFitInvalidPwdList(params?: GetFitInvalidPwdListParams): Promise<import("../../../../api/fit").FitInvalidPwdListResult>;
30
+ export declare function clearFitInvalidPwd(params?: ClearFitInvalidPwdParams): Promise<boolean>;
31
+ export declare function getFitDynamicPassword(): Promise<TempPasswordResult>;
32
+ export declare function getFitOfflineOncePassword(): Promise<FitOfflineOnceResult>;
33
+ export declare function getFitOfflineLimitPassword(params: {
34
+ effectiveTime: number;
35
+ invalidTime: number;
36
+ }): Promise<FitOfflineOnceResult>;
37
+ export declare function getFitOfflineClearAllCode(): Promise<FitOfflineOnceResult>;
38
+ export declare function getFitOfflineRevocableList(): Promise<LimitOfflinePwdItem[]>;
39
+ export declare function getFitOfflinePwdAvailable(pwdType: string): Promise<OfflinePwdAvailableResult>;
40
+ export type { AddFitTempPwdParams, RemoveFitTempPwdParams, UpdateFitTempPwdParams, RenameFitTempPwdParams, RenameFitOfflineTempPwdParams, RevokeFitOfflineTempPwdParams, FitOfflineClearCodeResult, ResendFitTempPwdParams, GetFitInvalidPwdListParams, ClearFitInvalidPwdParams, FitOnlinePasswordItem, FitOfflinePasswordItem, FitOfflineOnceResult, OfflinePwdAvailableResult, LimitOfflinePwdItem, };
@@ -0,0 +1,59 @@
1
+ import { getFitPasswordListForRuntime, getFitOnlinePasswordListForRuntime, getFitOfflinePasswordListForRuntime, } from "../../../../feature/fit/password-list";
2
+ import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
3
+ import { fitAddTempPwdForRuntime, fitRemoveTempPwdForRuntime, fitRenameTempPwdForRuntime, fitRenameOfflineTempPwdForRuntime, fitRevokeOfflineTempPwdForRuntime, fitResendTempPwdForRuntime, fitUpdateTempPwdForRuntime, } from "../../../../feature/fit/temp-password";
4
+ import { clearFitInvalidPwdForRuntime, getFitInvalidPwdListForRuntime, } from "../../../../feature/fit/invalid-password";
5
+ import { createTempDynamicForRuntime, createFitOfflineOnceForRuntime, createFitOfflineLimitForRuntime, createFitOfflineClearAllForRuntime, getFitOfflineRevocableListForRuntime, getFitOfflinePwdAvailableForRuntime, } from "../../../../feature/password/temporary/offline-create";
6
+ export function getFitPasswordList() {
7
+ return getFitPasswordListForRuntime(resolveRuntimeFromExportThis(this));
8
+ }
9
+ export function getFitOnlinePasswordList() {
10
+ return getFitOnlinePasswordListForRuntime(resolveRuntimeFromExportThis(this));
11
+ }
12
+ export function getFitOfflinePasswordList() {
13
+ return getFitOfflinePasswordListForRuntime(resolveRuntimeFromExportThis(this));
14
+ }
15
+ export function addFitTempPwd(params) {
16
+ return fitAddTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
17
+ }
18
+ export function removeFitTempPwd(params) {
19
+ return fitRemoveTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
20
+ }
21
+ export function updateFitTempPwd(params) {
22
+ return fitUpdateTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
23
+ }
24
+ export function renameFitTempPwd(params) {
25
+ return fitRenameTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
26
+ }
27
+ export function renameFitOfflineTempPwd(params) {
28
+ return fitRenameOfflineTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
29
+ }
30
+ export function revokeFitOfflineTempPwd(params) {
31
+ return fitRevokeOfflineTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
32
+ }
33
+ export function resendFitTempPwd(params) {
34
+ return fitResendTempPwdForRuntime(resolveRuntimeFromExportThis(this), params);
35
+ }
36
+ export function getFitInvalidPwdList(params) {
37
+ return getFitInvalidPwdListForRuntime(resolveRuntimeFromExportThis(this), params ?? {});
38
+ }
39
+ export function clearFitInvalidPwd(params) {
40
+ return clearFitInvalidPwdForRuntime(resolveRuntimeFromExportThis(this), params ?? {});
41
+ }
42
+ export function getFitDynamicPassword() {
43
+ return createTempDynamicForRuntime(resolveRuntimeFromExportThis(this));
44
+ }
45
+ export function getFitOfflineOncePassword() {
46
+ return createFitOfflineOnceForRuntime(resolveRuntimeFromExportThis(this));
47
+ }
48
+ export function getFitOfflineLimitPassword(params) {
49
+ return createFitOfflineLimitForRuntime(resolveRuntimeFromExportThis(this), params);
50
+ }
51
+ export function getFitOfflineClearAllCode() {
52
+ return createFitOfflineClearAllForRuntime(resolveRuntimeFromExportThis(this));
53
+ }
54
+ export function getFitOfflineRevocableList() {
55
+ return getFitOfflineRevocableListForRuntime(resolveRuntimeFromExportThis(this));
56
+ }
57
+ export function getFitOfflinePwdAvailable(pwdType) {
58
+ return getFitOfflinePwdAvailableForRuntime(resolveRuntimeFromExportThis(this), pwdType);
59
+ }
@@ -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";
@@ -22,3 +23,7 @@ export * from "./ai";
22
23
  export * from "./accessory-binding";
23
24
  export * from "./screen/list";
24
25
  export * from "./screen/bind";
26
+ export * from "./fit-sdk/binding";
27
+ export * from "./fit-sdk/device";
28
+ export * from "./fit-sdk/log";
29
+ export * from "./fit-sdk/temp";
@@ -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";
@@ -22,3 +23,7 @@ export * from "./ai";
22
23
  export * from "./accessory-binding";
23
24
  export * from "./screen/list";
24
25
  export * from "./screen/bind";
26
+ export * from "./fit-sdk/binding";
27
+ export * from "./fit-sdk/device";
28
+ export * from "./fit-sdk/log";
29
+ export * from "./fit-sdk/temp";
@@ -8,3 +8,5 @@ export declare function getLogs(params?: GetLogsParams): Promise<import("../../.
8
8
  export declare function getAlarms(params?: GetAlarmsParams): Promise<import("../../../feature/log/log").GetAlarmsResult>;
9
9
  export declare function getAlbums(params?: GetAlbumsParams): Promise<import("../../../feature/log/log").GetAlbumsResult>;
10
10
  export declare function getLockLogList(params: GetLockLogListParams): Promise<import("../../../feature/log/log").GetLockLogListResult>;
11
+ export declare function getAlarmUnreadCount(): Promise<number>;
12
+ export declare function getActivePeriod(): Promise<number>;
@@ -1,5 +1,5 @@
1
1
  import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
- import { getLatestLogsForRuntime, getLogsForRuntime, getAlarmsForRuntime, getAlbumsForRuntime, onLogsRefreshForRuntime, offLogsRefreshForRuntime, getLockLogListForRuntime, } from "../../../feature/log/log";
2
+ import { getLatestLogsForRuntime, getLogsForRuntime, getAlarmsForRuntime, getAlbumsForRuntime, onLogsRefreshForRuntime, offLogsRefreshForRuntime, getLockLogListForRuntime, getAlarmUnreadCountForRuntime, getActivePeriodForRuntime, } from "../../../feature/log/log";
3
3
  export function onLogsRefresh(cb) {
4
4
  onLogsRefreshForRuntime(resolveRuntimeFromExportThis(this), cb);
5
5
  }
@@ -22,3 +22,9 @@ export async function getAlbums(params) {
22
22
  export async function getLockLogList(params) {
23
23
  return getLockLogListForRuntime(resolveRuntimeFromExportThis(this), params);
24
24
  }
25
+ export async function getAlarmUnreadCount() {
26
+ return getAlarmUnreadCountForRuntime(resolveRuntimeFromExportThis(this));
27
+ }
28
+ export async function getActivePeriod() {
29
+ return getActivePeriodForRuntime(resolveRuntimeFromExportThis(this));
30
+ }
@@ -6,8 +6,10 @@ export declare function getMediaInfo(): import("../../../feature/media/media").M
6
6
  export declare function openLocalAlbum(params?: OpenLocalAlbumParams): Promise<void>;
7
7
  export declare function gotoPlayback(params?: GotoPlaybackParams): Promise<void>;
8
8
  export declare function isSupportMultiCamera(): boolean;
9
- export declare function getCameraInfo(): import("../../../feature/media/camera").CameraInfo | undefined;
9
+ export declare function getCameraInfo(): import("../../../feature/media/camera").CameraDpInfo | undefined;
10
10
  export declare function queryCameraInfo(): Promise<import("../../../feature/media/camera").CameraInfo | undefined>;
11
11
  export declare function switchCamera(index: number): Promise<true>;
12
12
  export declare function getMediaViewTimes(): Promise<import("../../../api/video").MediaViewTimesResult>;
13
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,7 +1,7 @@
1
1
  import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
- import { getMediaUrlForRuntime, isSupportMediaForRuntime, openLocalAlbumForRuntime, gotoPlaybackForRuntime, getMediaInfoForRuntime, getMediaViewTimesForRuntime, setMediaViewTimesForRuntime, } 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, } from "../../../feature/media/camera";
4
+ import { isSupportMultiCameraForRuntime, getCameraInfoForRuntime, queryCameraInfoForRuntime, switchCameraForRuntime, getCameraConfigForRuntime, } from "../../../feature/media/camera";
5
5
  export async function getMediaUrl(params) {
6
6
  return getMediaUrlForRuntime(resolveRuntimeFromExportThis(this), params);
7
7
  }
@@ -38,3 +38,9 @@ export async function getMediaViewTimes() {
38
38
  export async function addMediaViewTimes() {
39
39
  return setMediaViewTimesForRuntime(resolveRuntimeFromExportThis(this));
40
40
  }
41
+ export async function getAlbumDateList() {
42
+ return getAlbumDateListForRuntime(resolveRuntimeFromExportThis(this));
43
+ }
44
+ export function getCameraConfig() {
45
+ return getCameraConfigForRuntime(resolveRuntimeFromExportThis(this));
46
+ }
@@ -13,6 +13,8 @@ export interface UpdateDpPeriodTimeOption {
13
13
  offlineDp?: boolean;
14
14
  }
15
15
  export declare function updateDpPeriodTime(dpCode: string, data: UpdateDpPeriodTimeParams, option?: UpdateDpPeriodTimeOption): Promise<void>;
16
- export declare function connectDevice(): Promise<true>;
17
- export declare function gotoService(params?: GotoServiceParams): Promise<unknown>;
16
+ export declare function connectDevice(options?: {
17
+ timeout?: number;
18
+ }): Promise<true>;
19
+ export declare function gotoService(params?: GotoServiceParams): Promise<void>;
18
20
  export declare function validatePwdComplexity(password: string): Promise<boolean>;
@@ -19,8 +19,8 @@ export function getDpPeriodTime(dpCode) {
19
19
  export function updateDpPeriodTime(dpCode, data, option) {
20
20
  return updateDpPeriodTimeForRuntime(resolveRuntimeFromExportThis(this), dpCode, data, option);
21
21
  }
22
- export async function connectDevice() {
23
- return connectDeviceForRuntime(resolveRuntimeFromExportThis(this));
22
+ export async function connectDevice(options) {
23
+ return connectDeviceForRuntime(resolveRuntimeFromExportThis(this), options?.timeout);
24
24
  }
25
25
  export async function gotoService(params) {
26
26
  return gotoServiceForRuntime(resolveRuntimeFromExportThis(this), params);
@@ -1,8 +1,8 @@
1
1
  import type { LockSDKOption } from "../../interface";
2
- import type { LockSDKInstance } from "./build-instance";
2
+ import type { LockSDKInstance, FitSDKInstance } from "./build-instance";
3
3
  export * from "./exports";
4
- export type { LockSDKInstance };
4
+ export type { LockSDKInstance, FitSDKInstance };
5
5
  export type { LockSdkBoundExportThis } from "./bootstrap/resolve-runtime-from-export-this";
6
- export declare const createLockSDK: (options?: Omit<LockSDKOption, "preFetch">) => Promise<LockSDKInstance>;
6
+ export declare const createSDK: (options?: Omit<LockSDKOption, "preFetch">) => Promise<LockSDKInstance>;
7
7
  export declare const init: (options?: LockSDKOption) => Promise<void>;
8
8
  export declare const destroy: () => void;
@@ -1,34 +1,40 @@
1
1
  import { clearStateForRuntime } from "../../feature/state/clear";
2
2
  import { removeEvents } from "../../feature/state/platform-routing";
3
- import { bootstrapRegisteredLockInstance } from "./bootstrap/bootstrap-lock-instance";
3
+ import { bootstrapRegisteredInstance } from "./bootstrap/bootstrap-lock-instance";
4
4
  import { clearPrimaryLockSDKInstance, setPrimaryLockSDKInstance, } from "./bootstrap/primary-instance";
5
5
  import { clearAllRuntimes, listRegisteredRuntimes, } from "../../runtime/registry";
6
6
  import { getLaunchOptionsSync } from "../../platform/device";
7
+ import { stopFitSyncReportForRuntime } from "../../feature/fit/sync";
7
8
  import { getError } from "../../utils/errors";
8
9
  export * from "./exports";
9
- export const createLockSDK = async (options) => {
10
- const { instance } = await bootstrapRegisteredLockInstance({
10
+ export const createSDK = async (options) => {
11
+ const kind = options?.kind ?? "lock";
12
+ const { instance } = await bootstrapRegisteredInstance(kind, {
11
13
  ...options,
12
14
  preFetch: false,
13
15
  });
14
16
  return instance;
15
17
  };
16
18
  export const init = async (options) => {
19
+ const kind = options?.kind ?? "lock";
17
20
  const opts = { ...options };
18
21
  const { devInfo, deviceId } = opts;
19
22
  if (!devInfo && !deviceId) {
20
23
  const { query } = getLaunchOptionsSync();
21
- opts.deviceId = query.deviceId;
24
+ opts.deviceId = query['deviceId'];
22
25
  if (!opts.deviceId) {
23
26
  throw getError(1000);
24
27
  }
25
28
  }
26
- const { instance } = await bootstrapRegisteredLockInstance(opts);
29
+ const { instance } = await bootstrapRegisteredInstance(kind, opts);
27
30
  setPrimaryLockSDKInstance(instance);
28
31
  };
29
32
  export const destroy = () => {
30
33
  removeEvents();
31
34
  for (const rt of listRegisteredRuntimes()) {
35
+ if (rt.config.isFitting) {
36
+ stopFitSyncReportForRuntime(rt);
37
+ }
32
38
  clearStateForRuntime(rt);
33
39
  }
34
40
  clearAllRuntimes();
@@ -2,3 +2,4 @@ import { BoundFitLockItem, LockFitItemBase } from "../../api/fit";
2
2
  import type { LockDeviceRuntime } from "../../runtime/LockDeviceRuntime";
3
3
  export declare function bindLockToFitForRuntime(runtime: LockDeviceRuntime, lock: LockFitItemBase): Promise<unknown>;
4
4
  export declare function unbindLockToFitForRuntime(runtime: LockDeviceRuntime, lock: BoundFitLockItem): Promise<unknown>;
5
+ export declare function activateLockToFitForRuntime(runtime: LockDeviceRuntime, lock: LockFitItemBase): Promise<void>;
@@ -1,9 +1,36 @@
1
1
  import { bindLockAndFit, unbindFitFromLockCloud, unbindLockFromFitCloud, } from "../../api/fit";
2
+ import { setDeviceProperties } from "../../api/setting";
2
3
  import { getUsersSyncLockData } from "../../api/user";
3
4
  import { offDpDataChange, onDpDataChange, publishDeviceDps, } from "../../platform/device";
4
5
  import { getError } from "../../utils/errors";
5
6
  import { sdkLog } from "../../utils/sdk-log";
7
+ import { getSecurityUpdatedLockIds, isFitSecurityChannelEnabledForRuntime, } from "./security-channel";
6
8
  import { FIT_BIND_TIMEOUT_MS, FIT_OPERATION_CODE, normalizeHex, buildLockCheckCodeTemplate, publishFitTransparentFlow, } from "./shared";
9
+ const markSecurityUpdated = async (runtime, lock) => {
10
+ if (!lock.isSupportScy || !isFitSecurityChannelEnabledForRuntime(runtime)) {
11
+ return;
12
+ }
13
+ const fittingId = runtime.devId;
14
+ try {
15
+ const list = await getSecurityUpdatedLockIds(fittingId);
16
+ if (list.includes(lock.devId)) {
17
+ return;
18
+ }
19
+ await setDeviceProperties(fittingId, {
20
+ SECURITY_UPDATED: JSON.stringify({
21
+ key: fittingId,
22
+ value: [...list, lock.devId],
23
+ }),
24
+ });
25
+ }
26
+ catch (e) {
27
+ sdkLog("warn", "fit", "markSecurityUpdatedError", {
28
+ devId: fittingId,
29
+ data: { lockDevId: lock.devId },
30
+ error: e,
31
+ });
32
+ }
33
+ };
7
34
  const CHECK_CODE_SET_DP_ID = "70";
8
35
  const delay = (ms) => new Promise((resolve) => {
9
36
  setTimeout(resolve, ms);
@@ -104,6 +131,7 @@ export async function bindLockToFitForRuntime(runtime, lock) {
104
131
  devId: runtime.devId,
105
132
  data: { lockDevId: lock.devId },
106
133
  });
134
+ await markSecurityUpdated(runtime, lock);
107
135
  await publishToLock(runtime, "bind", lock);
108
136
  const result = await bindLockAndFit({
109
137
  devId: lock.devId,
@@ -165,3 +193,28 @@ export async function unbindLockToFitForRuntime(runtime, lock) {
165
193
  throw error;
166
194
  }
167
195
  }
196
+ export async function activateLockToFitForRuntime(runtime, lock) {
197
+ const startedAt = Date.now();
198
+ sdkLog("info", "fit", "activateLockToFitStart", {
199
+ devId: runtime.devId,
200
+ data: { lockDevId: lock.devId },
201
+ });
202
+ try {
203
+ await publishToFitting(runtime, "bind", lock);
204
+ await markSecurityUpdated(runtime, lock);
205
+ sdkLog("info", "fit", "activateLockToFitSuccess", {
206
+ devId: runtime.devId,
207
+ duration: Date.now() - startedAt,
208
+ data: { lockDevId: lock.devId },
209
+ });
210
+ }
211
+ catch (error) {
212
+ sdkLog("error", "fit", "activateLockToFitFail", {
213
+ devId: runtime.devId,
214
+ duration: Date.now() - startedAt,
215
+ data: { lockDevId: lock.devId },
216
+ error,
217
+ });
218
+ throw error;
219
+ }
220
+ }
@@ -1,13 +1,19 @@
1
1
  import type { LockDeviceRuntime } from "../../runtime/LockDeviceRuntime";
2
- import { EffectiveConfig } from "../../interface";
3
- export declare function getFitBleKeyListForRuntime(runtime: LockDeviceRuntime): Promise<unknown[]>;
2
+ import { EffectiveConfig, FitBleKeyItem } from "../../interface";
3
+ export declare function getFitBleKeyListForRuntime(runtime: LockDeviceRuntime): Promise<FitBleKeyItem[]>;
4
+ export interface CreateTemporaryBleKeyParams {
5
+ name?: string;
6
+ effective: EffectiveConfig;
7
+ }
8
+ export declare function createFitPermanentBleKeyForRuntime(runtime: LockDeviceRuntime, userId: string): Promise<unknown>;
9
+ export declare function createFitTemporaryBleKeyForRuntime(runtime: LockDeviceRuntime, params: CreateTemporaryBleKeyParams): Promise<unknown>;
4
10
  export declare function addFitBleKeyForRuntime(runtime: LockDeviceRuntime, params: Record<string, unknown>): Promise<unknown>;
5
- export interface UpdateFitBleKeyParams {
11
+ export interface UpdateTemporaryBleKeyParams {
6
12
  id: string;
7
13
  name: string;
8
14
  effective: EffectiveConfig;
9
15
  }
10
- export declare function updateFitBleKeyForRuntime(runtime: LockDeviceRuntime, params: UpdateFitBleKeyParams): Promise<unknown>;
16
+ export declare function updateFitTemporaryBleKeyForRuntime(runtime: LockDeviceRuntime, params: UpdateTemporaryBleKeyParams): Promise<unknown>;
11
17
  export declare function removeFitBleKeyForRuntime(runtime: LockDeviceRuntime, unlockBindingId: string): Promise<unknown>;
12
18
  export interface RenameFitBleKeyParams {
13
19
  id: string;