@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
@@ -1,31 +0,0 @@
1
- import dpCodes from "../../../config/dp-code";
2
- import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
3
- import { getDpPeriodTimeForRuntime, updateDpPeriodTimeForRuntime, } from "../../../feature/misc/dp-period";
4
- import { isSleepForRuntime, hasSleepAbilityForRuntime, getSwitchStatusForRuntime, setSleepStatusForRuntime, onSleepStatusChangeForRuntime, offSleepStatusChangeForRuntime, } from "../../../feature/misc/sleep";
5
- export function isSleep() {
6
- return isSleepForRuntime(resolveRuntimeFromExportThis(this));
7
- }
8
- export function hasSleepAbility() {
9
- return hasSleepAbilityForRuntime(resolveRuntimeFromExportThis(this));
10
- }
11
- export function isEnabledSleep() {
12
- return getSwitchStatusForRuntime(resolveRuntimeFromExportThis(this));
13
- }
14
- export async function enableSleep() {
15
- return setSleepStatusForRuntime(resolveRuntimeFromExportThis(this), true);
16
- }
17
- export async function disableSleep() {
18
- return setSleepStatusForRuntime(resolveRuntimeFromExportThis(this), false);
19
- }
20
- export function getSleepPeriod() {
21
- return getDpPeriodTimeForRuntime(resolveRuntimeFromExportThis(this), dpCodes.dormantTimeSet);
22
- }
23
- export function updateSleepPeriod(params) {
24
- return updateDpPeriodTimeForRuntime(resolveRuntimeFromExportThis(this), dpCodes.dormantTimeSet, params, { offlineDp: true });
25
- }
26
- export function onSleepStatusChange(callback) {
27
- onSleepStatusChangeForRuntime(resolveRuntimeFromExportThis(this), callback);
28
- }
29
- export function offSleepStatusChange(callback) {
30
- offSleepStatusChangeForRuntime(resolveRuntimeFromExportThis(this), callback);
31
- }
@@ -1,6 +0,0 @@
1
- import { type DeviceStatus } from "../../../interface";
2
- export declare function getCurrentUser(isForce?: boolean): Promise<import("../../../interface").CurrentUser>;
3
- export declare function getCurrentUserSync(): import("../../../interface").CurrentUser | null;
4
- export declare function getDeviceStatus(): DeviceStatus;
5
- export declare function onDeviceStatusChange(callback: (status: DeviceStatus) => void): void;
6
- export declare function offDeviceStatusChange(callback: (status: DeviceStatus) => void): void;
@@ -1,19 +0,0 @@
1
- import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
- import { getCurrentUserForRuntime } from "../../../feature/user/current-user";
3
- import { getDeviceStatusForRuntime } from "../../../feature/state/device-status";
4
- import { onDeviceStatusChangeForRuntime, offDeviceStatusChangeForRuntime, } from "../../../feature/state/device-status-events";
5
- export async function getCurrentUser(isForce) {
6
- return getCurrentUserForRuntime(resolveRuntimeFromExportThis(this), isForce);
7
- }
8
- export function getCurrentUserSync() {
9
- return resolveRuntimeFromExportThis(this).cache.currentUser;
10
- }
11
- export function getDeviceStatus() {
12
- return getDeviceStatusForRuntime(resolveRuntimeFromExportThis(this));
13
- }
14
- export function onDeviceStatusChange(callback) {
15
- onDeviceStatusChangeForRuntime(resolveRuntimeFromExportThis(this), callback);
16
- }
17
- export function offDeviceStatusChange(callback) {
18
- offDeviceStatusChangeForRuntime(resolveRuntimeFromExportThis(this), callback);
19
- }
@@ -1,31 +0,0 @@
1
- import type { CreateClearParams, CreateCustomParams, CreateLimitParams, CreateOfflineParams, CreateOnceParams, CreateOnlineUnlimitedParams, FreezeParams, GetInvalidListParams, OfflinePasswordType, RemoveCustomProps, RenameParams, UpdateTempPasswordParams } from "../../../feature/password/temporary/types";
2
- import type { TempPasswordResult } from "../../../interface";
3
- export type { EffectivePasswrodItem, InvalidPasswordItem, OfflinePasswordItem, OfflinePasswordType, OfflineTempResult, OfflineTempType, OnlinePasswordItem, } from "../../../feature/password/temporary/types";
4
- export declare function createTempCustom(params: CreateCustomParams): Promise<TempPasswordResult>;
5
- export declare function removeTempCustom(params: RemoveCustomProps): Promise<boolean>;
6
- export declare function updateTempCustom(params: UpdateTempPasswordParams): Promise<boolean>;
7
- export declare function getTempEffectiveList(): Promise<import("../../../feature/password/temporary/types").EffectivePasswrodItem[]>;
8
- export declare function getTempInvalidList(params?: GetInvalidListParams): Promise<{
9
- list: import("../../../feature/password/temporary/types").InvalidPasswordItem[];
10
- hasMore: boolean;
11
- total: number;
12
- }>;
13
- export declare function clearTempInvalidList(): Promise<boolean>;
14
- export declare function freezeTemp(params: FreezeParams): Promise<unknown>;
15
- export declare function unfreezeTemp(params: FreezeParams): Promise<unknown>;
16
- export declare function renameTemp(params: RenameParams): Promise<void>;
17
- export declare function saveTempOnlineUnlimited(params: CreateOnlineUnlimitedParams): Promise<{
18
- type: "custom";
19
- name: string;
20
- pwdId: string;
21
- effectiveConfig: import("../../../interface").EffectiveConfig;
22
- }>;
23
- export declare function removeTempOnlineUnlimited(id: string): Promise<void>;
24
- export declare function getTempOnlineUnlimitedList(): Promise<import("../../../feature/password/temporary/wifi-online").OnlinePasswordItem[]>;
25
- export declare function createTempOffline(params: CreateOfflineParams): Promise<import("../../../feature/password/temporary/types").OfflineTempResult>;
26
- export declare function getTempOfflineEffectiveList(pwdTypeCode: OfflinePasswordType): Promise<import("../../../api/temp").EffectivePasswrodItem[]>;
27
- export declare function getTempOfflineInvalidList(pwdTypeCode: OfflinePasswordType): Promise<import("../../../api/temp").EffectivePasswrodItem[]>;
28
- export declare function createTempLimit(params: CreateLimitParams): Promise<TempPasswordResult>;
29
- export declare function createTempOnce(params: CreateOnceParams): Promise<TempPasswordResult>;
30
- export declare function createTempDynamic(): Promise<TempPasswordResult>;
31
- export declare function createTempClear(params: CreateClearParams): Promise<TempPasswordResult>;
@@ -1,91 +0,0 @@
1
- import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
- import { createTempCustomForRuntime, removeTempCustomForRuntime, updateTempCustomForRuntime, } from "../../../feature/password/temporary/custom-dp";
3
- import { createTempCustomForRuntime as createTempCustomForRuntimeBle, updateTempCustomForRuntime as updateTempCustomForRuntimeBle, removeTempCustomForRuntime as removeTempCustomForRuntimeBle, freezeTempForRuntime as freezeTempForRuntimeBle, unfreezeTempForRuntime as unfreezeTempForRuntimeBle, } from "../../../feature/password/temporary/custom-dp-ble";
4
- import { createTempClearForRuntime, createTempDynamicForRuntime, createTempLimitForRuntime, createTempOnceForRuntime, } from "../../../feature/password/temporary/offline-create";
5
- import { clearTempInvalidListForRuntime, getTempEffectiveListForRuntime, getTempInvalidListForRuntime, } from "../../../feature/password/temporary/lists";
6
- import { freezeTempForRuntime, renameTempForRuntime, unfreezeTempForRuntime, } from "../../../feature/password/temporary/freeze-rename";
7
- import { getTempOnlineUnlimitedListForRuntime, removeTempOnlineUnlimitedForRuntime, saveTempOnlineUnlimitedForRuntime, } from "../../../feature/password/temporary/wifi-online";
8
- import { createTempOfflineForRuntime, getTempOfflineEffectiveListForRuntime, getTempOfflineInvalidListForRuntime, } from "../../../feature/password/temporary/wifi-offline";
9
- import { isBlePureDeviceForRuntime } from "../../../feature/misc/capability";
10
- export function createTempCustom(params) {
11
- const rt = resolveRuntimeFromExportThis(this);
12
- const isBlePureDevice = isBlePureDeviceForRuntime(rt);
13
- if (isBlePureDevice) {
14
- return createTempCustomForRuntimeBle(rt, params);
15
- }
16
- return createTempCustomForRuntime(rt, params);
17
- }
18
- export function removeTempCustom(params) {
19
- const rt = resolveRuntimeFromExportThis(this);
20
- const isBlePureDevice = isBlePureDeviceForRuntime(rt);
21
- if (isBlePureDevice) {
22
- return removeTempCustomForRuntimeBle(rt, params);
23
- }
24
- return removeTempCustomForRuntime(rt, params);
25
- }
26
- export function updateTempCustom(params) {
27
- const rt = resolveRuntimeFromExportThis(this);
28
- const isBlePureDevice = isBlePureDeviceForRuntime(rt);
29
- if (isBlePureDevice) {
30
- return updateTempCustomForRuntimeBle(rt, params);
31
- }
32
- return updateTempCustomForRuntime(rt, params);
33
- }
34
- export function getTempEffectiveList() {
35
- return getTempEffectiveListForRuntime(resolveRuntimeFromExportThis(this));
36
- }
37
- export function getTempInvalidList(params) {
38
- return getTempInvalidListForRuntime(resolveRuntimeFromExportThis(this), params);
39
- }
40
- export function clearTempInvalidList() {
41
- return clearTempInvalidListForRuntime(resolveRuntimeFromExportThis(this));
42
- }
43
- export function freezeTemp(params) {
44
- const rt = resolveRuntimeFromExportThis(this);
45
- const isBlePureDevice = isBlePureDeviceForRuntime(rt);
46
- if (isBlePureDevice) {
47
- return freezeTempForRuntimeBle(rt, params);
48
- }
49
- return freezeTempForRuntime(rt, params);
50
- }
51
- export function unfreezeTemp(params) {
52
- const rt = resolveRuntimeFromExportThis(this);
53
- const isBlePureDevice = isBlePureDeviceForRuntime(rt);
54
- if (isBlePureDevice) {
55
- return unfreezeTempForRuntimeBle(rt, params);
56
- }
57
- return unfreezeTempForRuntime(rt, params);
58
- }
59
- export function renameTemp(params) {
60
- return renameTempForRuntime(resolveRuntimeFromExportThis(this), params);
61
- }
62
- export function saveTempOnlineUnlimited(params) {
63
- return saveTempOnlineUnlimitedForRuntime(resolveRuntimeFromExportThis(this), params);
64
- }
65
- export function removeTempOnlineUnlimited(id) {
66
- return removeTempOnlineUnlimitedForRuntime(resolveRuntimeFromExportThis(this), id);
67
- }
68
- export function getTempOnlineUnlimitedList() {
69
- return getTempOnlineUnlimitedListForRuntime(resolveRuntimeFromExportThis(this));
70
- }
71
- export function createTempOffline(params) {
72
- return createTempOfflineForRuntime(resolveRuntimeFromExportThis(this), params);
73
- }
74
- export function getTempOfflineEffectiveList(pwdTypeCode) {
75
- return getTempOfflineEffectiveListForRuntime(resolveRuntimeFromExportThis(this), pwdTypeCode);
76
- }
77
- export function getTempOfflineInvalidList(pwdTypeCode) {
78
- return getTempOfflineInvalidListForRuntime(resolveRuntimeFromExportThis(this), pwdTypeCode);
79
- }
80
- export function createTempLimit(params) {
81
- return createTempLimitForRuntime(resolveRuntimeFromExportThis(this), params);
82
- }
83
- export function createTempOnce(params) {
84
- return createTempOnceForRuntime(resolveRuntimeFromExportThis(this), params);
85
- }
86
- export function createTempDynamic() {
87
- return createTempDynamicForRuntime(resolveRuntimeFromExportThis(this));
88
- }
89
- export function createTempClear(params) {
90
- return createTempClearForRuntime(resolveRuntimeFromExportThis(this), params);
91
- }
@@ -1 +0,0 @@
1
- export declare function syncUnlockMethod(): Promise<void>;
@@ -1,5 +0,0 @@
1
- import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
2
- import { syncUnlockMethodWithRuntime } from "../../../../feature/unlock/sync/unlock-method";
3
- export async function syncUnlockMethod() {
4
- return syncUnlockMethodWithRuntime(resolveRuntimeFromExportThis(this));
5
- }
@@ -1,19 +0,0 @@
1
- import type { AddPasswordParams, AddUnlockMethodBaseParams, AddUnlockMethodEvent, AddUnlockMethodListener, BindUnlockMethodFromLogParams, BindUnlockMethodParams, CancelAddUnlockMethodParams, SendVerifyCodeParams, SpecialUnlockMethodInfo, StartAddUnlockMethodParams, updateUnlockMethodParams } from "../../../feature/unlock/method/types";
2
- import type { UnlockMethodType } from "../../../interface";
3
- export type { AddPasswordParams, AddUnlockMethodBaseParams, AddUnlockMethodEvent, AddUnlockMethodListener, SpecialUnlockMethodInfo, updateUnlockMethodParams, };
4
- export declare function getUnlockMethodDetail(id: number): Promise<import("../../../interface").UnlockMethodDetail>;
5
- export declare function checkSpecialSupportPhone(): boolean;
6
- export declare function addPassword(params: AddPasswordParams): Promise<import("../../../api/lock").CreateUnlockMethodResult>;
7
- export declare function startAddUnlockMethod(params: StartAddUnlockMethodParams): Promise<import("../../../feature/unlock/method/add-flow").StartAddUnlockMethodResult>;
8
- export declare function cancelAddUnlockMethod(params: CancelAddUnlockMethodParams): Promise<void>;
9
- export declare function updateUnlockMethod(params: updateUnlockMethodParams): Promise<void>;
10
- export declare function deleteUnlockMethod(id: number): Promise<void>;
11
- export declare function checkUnBindUnlockMethods(): Promise<boolean>;
12
- export declare function getUnbindUnlockMethods(): Promise<import("../../../interface").UnBindUnlockMethodGroup[]>;
13
- export declare function bindUnlockMethod(params: BindUnlockMethodParams): Promise<boolean>;
14
- export declare function unbindUnlockMethod(id: number): Promise<void>;
15
- export declare function bindUnlockMethodFromLog(params: BindUnlockMethodFromLogParams): Promise<boolean>;
16
- export declare function sendVerifyCode(params: SendVerifyCodeParams): Promise<void>;
17
- export declare function onAddUnlockMethod(listener: AddUnlockMethodListener): void;
18
- export declare function offAddUnlockMethod(listener: AddUnlockMethodListener): void;
19
- export declare function getUnlockGuide(type: UnlockMethodType): Promise<import("../../../interface").UnlockGuide | null>;
@@ -1,58 +0,0 @@
1
- import { resolveRuntimeFromExportThis } from "../bootstrap/resolve-runtime-from-export-this";
2
- import { addPasswordForRuntime } from "../../../feature/unlock/method/add-password";
3
- import { cancelAddUnlockMethodForRuntime, startAddUnlockMethodForRuntime, } from "../../../feature/unlock/method/add-flow";
4
- import { deleteUnlockMethodForRuntime, updateUnlockMethodForRuntime, } from "../../../feature/unlock/method/update-remove";
5
- import { bindUnlockMethodForRuntime, bindUnlockMethodFromLogForRuntime, checkUnBindUnlockMethodsForRuntime, getUnbindUnlockMethodsForRuntime, unbindUnlockMethodForRuntime, } from "../../../feature/unlock/method/bind-unbind";
6
- import { getUnlockMethodDetailForRuntime } from "../../../feature/unlock/method/detail";
7
- import { getUnlockGuideForRuntime } from "../../../feature/unlock/method/guide";
8
- import { checkSpecialSupportPhoneForRuntime } from "../../../feature/unlock/method/internal/special-check";
9
- import { sendVerifyCodeForRuntime } from "../../../feature/unlock/method/verify-code";
10
- import { onAddUnlockMethodForRuntime, offAddUnlockMethodForRuntime, } from "../../../feature/unlock/method/add-method-events";
11
- export function getUnlockMethodDetail(id) {
12
- return getUnlockMethodDetailForRuntime(resolveRuntimeFromExportThis(this), id);
13
- }
14
- export function checkSpecialSupportPhone() {
15
- return checkSpecialSupportPhoneForRuntime(resolveRuntimeFromExportThis(this));
16
- }
17
- export function addPassword(params) {
18
- return addPasswordForRuntime(resolveRuntimeFromExportThis(this), params);
19
- }
20
- export function startAddUnlockMethod(params) {
21
- return startAddUnlockMethodForRuntime(resolveRuntimeFromExportThis(this), params);
22
- }
23
- export function cancelAddUnlockMethod(params) {
24
- return cancelAddUnlockMethodForRuntime(resolveRuntimeFromExportThis(this), params);
25
- }
26
- export function updateUnlockMethod(params) {
27
- return updateUnlockMethodForRuntime(resolveRuntimeFromExportThis(this), params);
28
- }
29
- export function deleteUnlockMethod(id) {
30
- return deleteUnlockMethodForRuntime(resolveRuntimeFromExportThis(this), id);
31
- }
32
- export function checkUnBindUnlockMethods() {
33
- return checkUnBindUnlockMethodsForRuntime(resolveRuntimeFromExportThis(this));
34
- }
35
- export function getUnbindUnlockMethods() {
36
- return getUnbindUnlockMethodsForRuntime(resolveRuntimeFromExportThis(this));
37
- }
38
- export function bindUnlockMethod(params) {
39
- return bindUnlockMethodForRuntime(resolveRuntimeFromExportThis(this), params);
40
- }
41
- export function unbindUnlockMethod(id) {
42
- return unbindUnlockMethodForRuntime(resolveRuntimeFromExportThis(this), id);
43
- }
44
- export function bindUnlockMethodFromLog(params) {
45
- return bindUnlockMethodFromLogForRuntime(resolveRuntimeFromExportThis(this), params);
46
- }
47
- export function sendVerifyCode(params) {
48
- return sendVerifyCodeForRuntime(resolveRuntimeFromExportThis(this), params);
49
- }
50
- export function onAddUnlockMethod(listener) {
51
- onAddUnlockMethodForRuntime(resolveRuntimeFromExportThis(this), listener);
52
- }
53
- export function offAddUnlockMethod(listener) {
54
- offAddUnlockMethodForRuntime(resolveRuntimeFromExportThis(this), listener);
55
- }
56
- export function getUnlockGuide(type) {
57
- return getUnlockGuideForRuntime(resolveRuntimeFromExportThis(this), type);
58
- }
@@ -1,23 +0,0 @@
1
- import type { EffectiveConfig } from "../../../../interface";
2
- export { openAddFamilyUser } from "../../../../feature/user/user";
3
- export declare function getUsers(params?: {
4
- page?: number;
5
- pageSize?: number;
6
- keyword?: string;
7
- }): Promise<import("../../../../feature/user/user").getUsersResult>;
8
- export declare function getUserInfo(params: {
9
- userId: string;
10
- }): Promise<import("../../../../interface").UserInfo>;
11
- export declare function updateUserLimitTime(params: {
12
- userId: string;
13
- lockUserId: number;
14
- permanent: boolean;
15
- effective?: EffectiveConfig;
16
- offlineUnlock?: boolean;
17
- }): Promise<void>;
18
- export declare function openFamilyUserDetail(userId: string): Promise<void>;
19
- export declare function addUser(params: {
20
- name: string;
21
- }): Promise<void>;
22
- export declare function removeUser(userId: string): Promise<void>;
23
- export * from "./sync";
@@ -1,22 +0,0 @@
1
- import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
2
- import { getUsersForRuntime, getUserInfoForRuntime, updateUserLimitTimeForRuntime, openFamilyUserDetailForRuntime, addUserForRuntime, removeUserForRuntime, } from "../../../../feature/user/user";
3
- export { openAddFamilyUser } from "../../../../feature/user/user";
4
- export async function getUsers(params) {
5
- return getUsersForRuntime(resolveRuntimeFromExportThis(this), params);
6
- }
7
- export async function getUserInfo(params) {
8
- return getUserInfoForRuntime(resolveRuntimeFromExportThis(this), params);
9
- }
10
- export async function updateUserLimitTime(params) {
11
- return updateUserLimitTimeForRuntime(resolveRuntimeFromExportThis(this), params);
12
- }
13
- export async function openFamilyUserDetail(userId) {
14
- return openFamilyUserDetailForRuntime(resolveRuntimeFromExportThis(this), userId);
15
- }
16
- export async function addUser(params) {
17
- return addUserForRuntime(resolveRuntimeFromExportThis(this), params);
18
- }
19
- export async function removeUser(userId) {
20
- return removeUserForRuntime(resolveRuntimeFromExportThis(this), userId);
21
- }
22
- export * from "./sync";
@@ -1 +0,0 @@
1
- export declare function syncDeleteUsers(): Promise<void>;
@@ -1,5 +0,0 @@
1
- import { resolveRuntimeFromExportThis } from "../../bootstrap/resolve-runtime-from-export-this";
2
- import { syncDeleteUsersWithRuntime } from "../../../../feature/user/sync-user";
3
- export async function syncDeleteUsers() {
4
- return syncDeleteUsersWithRuntime(resolveRuntimeFromExportThis(this));
5
- }
@@ -1,8 +0,0 @@
1
- import type { LockSDKOption } from "../../interface";
2
- import type { LockSDKInstance } from "./build-instance";
3
- export * from "./exports";
4
- export type { LockSDKInstance };
5
- export type { LockSdkBoundExportThis } from "./bootstrap/resolve-runtime-from-export-this";
6
- export declare const createLockSDK: (options?: Omit<LockSDKOption, "preFetch">) => Promise<LockSDKInstance>;
7
- export declare const init: (options?: LockSDKOption) => Promise<void>;
8
- export declare const destroy: () => void;
@@ -1,39 +0,0 @@
1
- import { clearStateForRuntime } from "../../feature/state/clear";
2
- import { removeEvents } from "../../feature/state/platform-routing";
3
- import { bootstrapRegisteredLockInstance } from "./bootstrap/bootstrap-lock-instance";
4
- import { clearPrimaryLockSDKInstance, setPrimaryLockSDKInstance, } from "./bootstrap/primary-instance";
5
- import { clearAllRuntimes, getRegisteredRuntimeCount, listRegisteredRuntimes, } from "../../runtime/registry";
6
- import { getLaunchOptionsSync } from "../../platform/device";
7
- import { getError } from "../../utils/errors";
8
- export * from "./exports";
9
- export const createLockSDK = async (options) => {
10
- const { instance } = await bootstrapRegisteredLockInstance({
11
- ...options,
12
- preFetch: false,
13
- });
14
- return instance;
15
- };
16
- export const init = async (options) => {
17
- if (getRegisteredRuntimeCount() >= 1) {
18
- destroy();
19
- }
20
- const opts = { ...options };
21
- const { devInfo, deviceId } = opts;
22
- if (!devInfo && !deviceId) {
23
- const { query } = getLaunchOptionsSync();
24
- opts.deviceId = query.deviceId;
25
- if (!opts.deviceId) {
26
- throw getError(1000);
27
- }
28
- }
29
- const { instance } = await bootstrapRegisteredLockInstance(opts);
30
- setPrimaryLockSDKInstance(instance);
31
- };
32
- export const destroy = () => {
33
- removeEvents();
34
- for (const rt of listRegisteredRuntimes()) {
35
- clearStateForRuntime(rt);
36
- }
37
- clearAllRuntimes();
38
- clearPrimaryLockSDKInstance();
39
- };
@@ -1,7 +0,0 @@
1
- import type { LockSDKOption } from "../../../interface";
2
- import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
3
- import { type FitSDKInstance } from "../build-instance";
4
- export declare function bootstrapRegisteredFitInstance(options?: LockSDKOption): Promise<{
5
- runtime: LockDeviceRuntime;
6
- instance: FitSDKInstance;
7
- }>;
@@ -1,12 +0,0 @@
1
- import { addEvents } from "../../../feature/state/platform-routing";
2
- import { initState } from "../../../feature/state/init-state";
3
- import { registerRuntime } from "../../../runtime/registry";
4
- import { buildFitSDKInstance } from "../build-instance";
5
- import { createBootstrappedRuntime } from "./bootstrap";
6
- export async function bootstrapRegisteredFitInstance(options) {
7
- const runtime = await createBootstrappedRuntime(options);
8
- registerRuntime(runtime);
9
- addEvents(runtime);
10
- await initState(runtime);
11
- return { runtime, instance: buildFitSDKInstance(runtime) };
12
- }
@@ -1,4 +0,0 @@
1
- import type { LockSDKOption } from "../../../interface";
2
- import { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
3
- export declare function applyFitOptionsToRuntime(runtime: LockDeviceRuntime, options?: LockSDKOption): Promise<void>;
4
- export declare function createBootstrappedRuntime(options?: LockSDKOption): Promise<LockDeviceRuntime>;
@@ -1,69 +0,0 @@
1
- import dpCodes from "../../../config/dp-code";
2
- import { getCapabilities } from "../../../utils";
3
- import { getDeviceInfo, trackEvent } from "../../../platform/device";
4
- import { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
5
- import { sdkLog, setSDKLogConfig } from "../../../utils/sdk-log";
6
- export async function applyFitOptionsToRuntime(runtime, options) {
7
- setSDKLogConfig({
8
- level: options?.logLevel ?? "warn",
9
- sink: options?.logger,
10
- console: options?.logToConsole ?? false,
11
- });
12
- const { config } = runtime;
13
- let { devInfo, deviceId } = options || {};
14
- if (!devInfo && !deviceId) {
15
- throw new Error("deviceId is required in fit sdk");
16
- }
17
- if (deviceId && (!devInfo || devInfo.devId !== deviceId)) {
18
- devInfo = await getDeviceInfo(deviceId);
19
- }
20
- let dpSchema = {};
21
- const codesById = {};
22
- const idsByCode = {};
23
- if (devInfo.schema) {
24
- dpSchema = devInfo.schema.reduce((acc, cur) => {
25
- acc[cur.code] = cur;
26
- codesById[cur.id] = cur.code;
27
- idsByCode[cur.code] = cur.id;
28
- return acc;
29
- }, {});
30
- }
31
- else if (devInfo.dpSchema) {
32
- dpSchema = devInfo.dpSchema;
33
- Object.keys(dpSchema).forEach((key) => {
34
- const item = dpSchema[key];
35
- codesById[item.id] = item.code;
36
- idsByCode[item.code] = item.id;
37
- });
38
- }
39
- config.strictMode = options?.strictMode ?? true;
40
- config.passwordDigitalBase = options?.passwordDigitalBase ?? 10;
41
- config.passwordSupportZero = options?.passwordSupportZero ?? true;
42
- config.supportMultipleFace = options?.supportMultipleFace ?? false;
43
- config.supportOfflineDps = options?.supportOfflineDps ?? false;
44
- config.devInfo = devInfo;
45
- config.dpSchema = dpSchema;
46
- config.codesById = codesById;
47
- config.idsByCode = idsByCode;
48
- config.supportBigData = !!dpSchema[dpCodes.synchMethodW];
49
- config.preFetch = options?.preFetch ?? false;
50
- config.communication = getCapabilities(devInfo.capability).map((item) => item.id);
51
- sdkLog("info", "fit-bootstrap", "applyOptions", {
52
- devId: config.devInfo.devId,
53
- data: {
54
- productId: config.devInfo.productId,
55
- strictMode: config.strictMode,
56
- supportOfflineDps: config.supportOfflineDps,
57
- supportBigData: config.supportBigData,
58
- communication: config.communication,
59
- },
60
- });
61
- trackEvent("t$y_UztB3Lj9Qns375R0r7dA0L5Kr2VytH3J".replace("$", ""), {
62
- pid: devInfo.productId,
63
- });
64
- }
65
- export async function createBootstrappedRuntime(options) {
66
- const runtime = new LockDeviceRuntime();
67
- await applyFitOptionsToRuntime(runtime, options);
68
- return runtime;
69
- }
@@ -1,3 +0,0 @@
1
- import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
2
- export declare function registerFitSDKInstanceRuntime(instance: object, runtime: LockDeviceRuntime): void;
3
- export declare function getRuntimeForFitSDKInstance(instance: object): LockDeviceRuntime | undefined;
@@ -1,7 +0,0 @@
1
- const runtimeByInstance = new WeakMap();
2
- export function registerFitSDKInstanceRuntime(instance, runtime) {
3
- runtimeByInstance.set(instance, runtime);
4
- }
5
- export function getRuntimeForFitSDKInstance(instance) {
6
- return runtimeByInstance.get(instance);
7
- }
@@ -1,6 +0,0 @@
1
- import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
2
- import type { FitSDKInstance } from "../build-instance";
3
- export declare function setPrimaryFitSDKInstance(instance: FitSDKInstance): void;
4
- export declare function getPrimaryFitSDKRuntime(): LockDeviceRuntime | null;
5
- export declare function clearPrimaryFitSDKInstance(): void;
6
- export declare function clearPrimaryFitSDKInstanceIfDevId(devId: string): void;
@@ -1,24 +0,0 @@
1
- import { getRuntimeForFitSDKInstance } from "./lock-instance-runtime-ref";
2
- let primaryDevId = null;
3
- let primaryRuntime = null;
4
- export function setPrimaryFitSDKInstance(instance) {
5
- const runtime = getRuntimeForFitSDKInstance(instance);
6
- if (!runtime) {
7
- throw new Error("setPrimaryFitSDKInstance: instance must be returned by createFitSDK or init");
8
- }
9
- primaryDevId = runtime.devId;
10
- primaryRuntime = runtime;
11
- }
12
- export function getPrimaryFitSDKRuntime() {
13
- return primaryRuntime;
14
- }
15
- export function clearPrimaryFitSDKInstance() {
16
- primaryDevId = null;
17
- primaryRuntime = null;
18
- }
19
- export function clearPrimaryFitSDKInstanceIfDevId(devId) {
20
- if (primaryDevId === devId) {
21
- primaryDevId = null;
22
- primaryRuntime = null;
23
- }
24
- }
@@ -1,5 +0,0 @@
1
- import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
2
- export type FitSdkBoundExportThis = {
3
- devId: string;
4
- };
5
- export declare function resolveRuntimeFromExportThis(thisArg: unknown): LockDeviceRuntime;
@@ -1,29 +0,0 @@
1
- import { getRuntimeByDevId } from "../../../runtime/registry";
2
- import { getRuntimeForFitSDKInstance } from "./lock-instance-runtime-ref";
3
- import { resolveTopLevelTargetRuntime } from "./top-level-runtime";
4
- export function resolveRuntimeFromExportThis(thisArg) {
5
- if (thisArg !== null &&
6
- thisArg !== undefined &&
7
- typeof thisArg === "object") {
8
- const rtFromInstance = getRuntimeForFitSDKInstance(thisArg);
9
- if (rtFromInstance) {
10
- return rtFromInstance;
11
- }
12
- }
13
- if (thisArg !== null &&
14
- thisArg !== undefined &&
15
- typeof thisArg === "object" &&
16
- "devId" in thisArg &&
17
- typeof thisArg.devId === "string") {
18
- const devId = thisArg.devId;
19
- if (devId.length === 0) {
20
- throw new Error("Fit SDK: bound context devId must be non-empty");
21
- }
22
- const rt = getRuntimeByDevId(devId);
23
- if (!rt) {
24
- throw new Error(`Fit SDK: no registered runtime for devId "${devId}"; use createFitSDK or init first`);
25
- }
26
- return rt;
27
- }
28
- return resolveTopLevelTargetRuntime();
29
- }
@@ -1,2 +0,0 @@
1
- import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
2
- export declare function resolveTopLevelTargetRuntime(): LockDeviceRuntime;
@@ -1,9 +0,0 @@
1
- import { getError } from "../../../utils/errors";
2
- import { getPrimaryFitSDKRuntime } from "./primary-instance";
3
- export function resolveTopLevelTargetRuntime() {
4
- const primary = getPrimaryFitSDKRuntime();
5
- if (!primary) {
6
- throw getError(1071);
7
- }
8
- return primary;
9
- }
@@ -1,9 +0,0 @@
1
- import type { LockDeviceRuntime } from "../../runtime/LockDeviceRuntime";
2
- import { type UpdateConfigParams } from "../../feature/misc/update-config";
3
- import * as FitExports from "./exports";
4
- export type FitSDKInstance = {
5
- destroy(): void;
6
- updateConfig(options: UpdateConfigParams): void;
7
- } & Omit<typeof FitExports, "updateConfig">;
8
- export declare function getFlatFitInstanceMethodKeysForTests(): string[];
9
- export declare function buildFitSDKInstance(runtime: LockDeviceRuntime): FitSDKInstance;