@ovok/native 1.5.6 → 1.6.1

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 (722) hide show
  1. package/README.md +35 -19
  2. package/android/src/main/AndroidManifest.xml +1 -20
  3. package/app.plugin.js +181 -0
  4. package/lib/commonjs/index.js +5 -104
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  7. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  8. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js +23 -0
  9. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  10. package/lib/commonjs/modules/auth/hooks/use-session.js +105 -0
  11. package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -0
  12. package/lib/commonjs/modules/auth/index.js +44 -0
  13. package/lib/commonjs/modules/auth/index.js.map +1 -1
  14. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js +5 -2
  15. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
  16. package/lib/commonjs/modules/auth/register/components/form/inputs.js +50 -1
  17. package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
  18. package/lib/commonjs/modules/auth/register/components/form/register-button.js +4 -0
  19. package/lib/commonjs/modules/auth/register/components/form/register-button.js.map +1 -1
  20. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +6 -0
  21. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  22. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js +12 -0
  23. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  24. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  25. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  26. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  27. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  28. package/lib/commonjs/modules/auth/session/components/session-list.js +82 -0
  29. package/lib/commonjs/modules/auth/session/components/session-list.js.map +1 -0
  30. package/lib/commonjs/modules/auth/session/events.js +19 -0
  31. package/lib/commonjs/modules/auth/session/events.js.map +1 -0
  32. package/lib/commonjs/modules/auth/session/index.js +13 -0
  33. package/lib/commonjs/modules/auth/session/index.js.map +1 -0
  34. package/lib/commonjs/modules/auth/session/types/session-list-props.js +6 -0
  35. package/lib/commonjs/modules/auth/session/types/session-list-props.js.map +1 -0
  36. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js +26 -0
  37. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  38. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  39. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  40. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js +58 -0
  41. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  42. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  43. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  44. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js +13 -5
  45. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  46. package/lib/commonjs/modules/auth/types/session.js +2 -0
  47. package/lib/commonjs/modules/auth/types/session.js.map +1 -0
  48. package/lib/commonjs/modules/auth/utils/rate-limit.js +37 -0
  49. package/lib/commonjs/modules/auth/utils/rate-limit.js.map +1 -0
  50. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  51. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  52. package/lib/commonjs/modules/background-sync/background-safe-storage.js +76 -0
  53. package/lib/commonjs/modules/background-sync/background-safe-storage.js.map +1 -0
  54. package/lib/commonjs/modules/background-sync/index.js +11 -0
  55. package/lib/commonjs/modules/background-sync/index.js.map +1 -1
  56. package/lib/commonjs/modules/bt-device/index.js +0 -22
  57. package/lib/commonjs/modules/bt-device/index.js.map +1 -1
  58. package/lib/commonjs/modules/bt-device-instructions/index.js +39 -0
  59. package/lib/commonjs/modules/bt-device-instructions/index.js.map +1 -0
  60. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +64 -0
  61. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
  62. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
  63. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  64. package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js +1 -0
  65. package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
  66. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +95 -0
  67. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -0
  68. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +51 -0
  69. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  70. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +51 -0
  71. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  72. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js +40 -0
  73. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  74. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js +82 -0
  75. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js.map +1 -0
  76. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +79 -0
  77. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -0
  78. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js +33 -0
  79. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  80. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js +58 -0
  81. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  82. package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js +21 -0
  83. package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js.map +1 -0
  84. package/lib/commonjs/modules/bt-management/index.js +154 -0
  85. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  86. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
  87. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  88. package/lib/commonjs/modules/bt-management/services/bt-manager.js +91 -22
  89. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  90. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
  91. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  92. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +107 -4
  93. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  94. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +9 -1
  95. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  96. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
  97. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  98. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  99. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  100. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  101. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  102. package/lib/commonjs/modules/bt-management/services/push-notification.js +39 -0
  103. package/lib/commonjs/modules/bt-management/services/push-notification.js.map +1 -0
  104. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +132 -0
  105. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  106. package/lib/commonjs/modules/bt-management/testing/index.js +28 -0
  107. package/lib/commonjs/modules/bt-management/testing/index.js.map +1 -0
  108. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js +23 -0
  109. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js.map +1 -0
  110. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +82 -0
  111. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -0
  112. package/lib/commonjs/modules/bt-management/types/device-connection-event.js +6 -0
  113. package/lib/commonjs/modules/bt-management/types/device-connection-event.js.map +1 -0
  114. package/lib/commonjs/modules/bt-management/types/result-policy.js +6 -0
  115. package/lib/commonjs/modules/bt-management/types/result-policy.js.map +1 -0
  116. package/lib/commonjs/modules/bt-management/utils/result-identity.js +63 -0
  117. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -0
  118. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
  119. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  120. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +29 -4
  121. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  122. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +2 -2
  123. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
  124. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  125. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  126. package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js +29 -21
  127. package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
  128. package/lib/commonjs/modules/data-sync/utils/retry-save.js +99 -0
  129. package/lib/commonjs/modules/data-sync/utils/retry-save.js.map +1 -0
  130. package/lib/commonjs/modules/helpers/form-items/form-field.js +2 -0
  131. package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
  132. package/lib/commonjs/modules/helpers/index.js +23 -4
  133. package/lib/commonjs/modules/helpers/index.js.map +1 -1
  134. package/lib/commonjs/modules/helpers/utils/s-log.js +4 -13
  135. package/lib/commonjs/modules/helpers/utils/s-log.js.map +1 -1
  136. package/lib/commonjs/modules/helpers/utils/sentry-logger.js +27 -17
  137. package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
  138. package/lib/commonjs/modules/helpers/utils/telemetry.js +230 -0
  139. package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
  140. package/lib/commonjs/modules/image/components/optimized-image.js +31 -6
  141. package/lib/commonjs/modules/image/components/optimized-image.js.map +1 -1
  142. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +18 -9
  143. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  144. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  145. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  146. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  147. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  148. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
  149. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  150. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  151. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  152. package/lib/commonjs/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  153. package/lib/commonjs/modules/tile/components/task-icon.js +2 -1
  154. package/lib/commonjs/modules/tile/components/task-icon.js.map +1 -1
  155. package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js +4 -1
  156. package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js.map +1 -1
  157. package/lib/commonjs/modules/ui/components/background-sync-setting.js +123 -0
  158. package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
  159. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +119 -0
  160. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  161. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +175 -0
  162. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  163. package/lib/commonjs/modules/ui/components/health-import-card.js +141 -0
  164. package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
  165. package/lib/commonjs/modules/ui/components/manual-entry-form.js +136 -0
  166. package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
  167. package/lib/commonjs/modules/ui/components/pairing-flow.js +247 -0
  168. package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
  169. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +107 -0
  170. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  171. package/lib/commonjs/modules/ui/components/urine-test-result.js +99 -0
  172. package/lib/commonjs/modules/ui/components/urine-test-result.js.map +1 -0
  173. package/lib/commonjs/modules/ui/index.js +116 -0
  174. package/lib/commonjs/modules/ui/index.js.map +1 -0
  175. package/lib/commonjs/modules/ui/types.js +6 -0
  176. package/lib/commonjs/modules/ui/types.js.map +1 -0
  177. package/lib/commonjs/modules/ui/use-ovok-ui.js +51 -0
  178. package/lib/commonjs/modules/ui/use-ovok-ui.js.map +1 -0
  179. package/lib/module/index.js +3 -9
  180. package/lib/module/index.js.map +1 -1
  181. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  182. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  183. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js +17 -0
  184. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  185. package/lib/module/modules/auth/hooks/use-session.js +99 -0
  186. package/lib/module/modules/auth/hooks/use-session.js.map +1 -0
  187. package/lib/module/modules/auth/index.js +4 -0
  188. package/lib/module/modules/auth/index.js.map +1 -1
  189. package/lib/module/modules/auth/logout-button/components/logout-button.js +5 -2
  190. package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
  191. package/lib/module/modules/auth/register/components/form/inputs.js +50 -1
  192. package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
  193. package/lib/module/modules/auth/register/components/form/register-button.js +4 -0
  194. package/lib/module/modules/auth/register/components/form/register-button.js.map +1 -1
  195. package/lib/module/modules/auth/register/components/form/register-form-provider.js +6 -0
  196. package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  197. package/lib/module/modules/auth/reset-password/components/form/inputs.js +12 -0
  198. package/lib/module/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  199. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  200. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  201. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  202. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  203. package/lib/module/modules/auth/session/components/session-list.js +76 -0
  204. package/lib/module/modules/auth/session/components/session-list.js.map +1 -0
  205. package/lib/module/modules/auth/session/events.js +13 -0
  206. package/lib/module/modules/auth/session/events.js.map +1 -0
  207. package/lib/module/modules/auth/session/index.js +4 -0
  208. package/lib/module/modules/auth/session/index.js.map +1 -0
  209. package/lib/module/modules/auth/session/types/session-list-props.js +4 -0
  210. package/lib/module/modules/auth/session/types/session-list-props.js.map +1 -0
  211. package/lib/module/modules/auth/sign-in/components/form/inputs.js +26 -0
  212. package/lib/module/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  213. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  214. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  215. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js +52 -0
  216. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  217. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  218. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  219. package/lib/module/modules/auth/sign-in/components/form/signin-button.js +13 -5
  220. package/lib/module/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  221. package/lib/module/modules/auth/types/session.js +2 -0
  222. package/lib/module/modules/auth/types/session.js.map +1 -0
  223. package/lib/module/modules/auth/utils/rate-limit.js +31 -0
  224. package/lib/module/modules/auth/utils/rate-limit.js.map +1 -0
  225. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  226. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  227. package/lib/module/modules/background-sync/background-safe-storage.js +71 -0
  228. package/lib/module/modules/background-sync/background-safe-storage.js.map +1 -0
  229. package/lib/module/modules/background-sync/index.js +1 -0
  230. package/lib/module/modules/background-sync/index.js.map +1 -1
  231. package/lib/module/modules/bt-device/index.js +0 -2
  232. package/lib/module/modules/bt-device/index.js.map +1 -1
  233. package/lib/module/modules/bt-device-instructions/index.js +6 -0
  234. package/lib/module/modules/bt-device-instructions/index.js.map +1 -0
  235. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +58 -0
  236. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
  237. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
  238. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  239. package/lib/module/modules/bt-management/constants/measurement-field-catalog.js +1 -0
  240. package/lib/module/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
  241. package/lib/module/modules/bt-management/hooks/runtime-context.js +86 -0
  242. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -0
  243. package/lib/module/modules/bt-management/hooks/use-background-sync.js +45 -0
  244. package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  245. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +45 -0
  246. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  247. package/lib/module/modules/bt-management/hooks/use-device-connection.js +34 -0
  248. package/lib/module/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  249. package/lib/module/modules/bt-management/hooks/use-health-import.js +76 -0
  250. package/lib/module/modules/bt-management/hooks/use-health-import.js.map +1 -0
  251. package/lib/module/modules/bt-management/hooks/use-measurements.js +73 -0
  252. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -0
  253. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js +27 -0
  254. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  255. package/lib/module/modules/bt-management/hooks/use-paired-devices.js +52 -0
  256. package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  257. package/lib/module/modules/bt-management/hooks/use-scan-control.js +16 -0
  258. package/lib/module/modules/bt-management/hooks/use-scan-control.js.map +1 -0
  259. package/lib/module/modules/bt-management/index.js +14 -0
  260. package/lib/module/modules/bt-management/index.js.map +1 -1
  261. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
  262. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  263. package/lib/module/modules/bt-management/services/bt-manager.js +91 -22
  264. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  265. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
  266. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  267. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +107 -4
  268. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  269. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +9 -1
  270. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  271. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
  272. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  273. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  274. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  275. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  276. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  277. package/lib/module/modules/bt-management/services/push-notification.js +34 -0
  278. package/lib/module/modules/bt-management/services/push-notification.js.map +1 -0
  279. package/lib/module/modules/bt-management/testing/fake-ble-manager.js +127 -0
  280. package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  281. package/lib/module/modules/bt-management/testing/index.js +5 -0
  282. package/lib/module/modules/bt-management/testing/index.js.map +1 -0
  283. package/lib/module/modules/bt-management/testing/recorded-frames.js +17 -0
  284. package/lib/module/modules/bt-management/testing/recorded-frames.js.map +1 -0
  285. package/lib/module/modules/bt-management/types/bluetooth-error.js +76 -0
  286. package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -0
  287. package/lib/module/modules/bt-management/types/device-connection-event.js +4 -0
  288. package/lib/module/modules/bt-management/types/device-connection-event.js.map +1 -0
  289. package/lib/module/modules/bt-management/types/result-policy.js +4 -0
  290. package/lib/module/modules/bt-management/types/result-policy.js.map +1 -0
  291. package/lib/module/modules/bt-management/utils/result-identity.js +57 -0
  292. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -0
  293. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
  294. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  295. package/lib/module/modules/data-sync/services/base-health-sync-service.js +29 -4
  296. package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  297. package/lib/module/modules/data-sync/services/managers/data-processor.js +2 -2
  298. package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
  299. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  300. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  301. package/lib/module/modules/data-sync/utils/generate-observation-entry.js +29 -21
  302. package/lib/module/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
  303. package/lib/module/modules/data-sync/utils/retry-save.js +92 -0
  304. package/lib/module/modules/data-sync/utils/retry-save.js.map +1 -0
  305. package/lib/module/modules/helpers/form-items/form-field.js +2 -0
  306. package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
  307. package/lib/module/modules/helpers/index.js +2 -1
  308. package/lib/module/modules/helpers/index.js.map +1 -1
  309. package/lib/module/modules/helpers/utils/s-log.js +4 -12
  310. package/lib/module/modules/helpers/utils/s-log.js.map +1 -1
  311. package/lib/module/modules/helpers/utils/sentry-logger.js +25 -14
  312. package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
  313. package/lib/module/modules/helpers/utils/telemetry.js +218 -0
  314. package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
  315. package/lib/module/modules/image/components/optimized-image.js +32 -7
  316. package/lib/module/modules/image/components/optimized-image.js.map +1 -1
  317. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +20 -11
  318. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  319. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  320. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  321. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  322. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  323. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
  324. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  325. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  326. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  327. package/lib/module/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  328. package/lib/module/modules/tile/components/task-icon.js +2 -1
  329. package/lib/module/modules/tile/components/task-icon.js.map +1 -1
  330. package/lib/module/modules/tile/constants/measurement-icon-svg.js +4 -1
  331. package/lib/module/modules/tile/constants/measurement-icon-svg.js.map +1 -1
  332. package/lib/module/modules/ui/components/background-sync-setting.js +117 -0
  333. package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
  334. package/lib/module/modules/ui/components/bluetooth-state-notice.js +113 -0
  335. package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  336. package/lib/module/modules/ui/components/ecg-strip-viewer.js +169 -0
  337. package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  338. package/lib/module/modules/ui/components/health-import-card.js +135 -0
  339. package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
  340. package/lib/module/modules/ui/components/manual-entry-form.js +130 -0
  341. package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
  342. package/lib/module/modules/ui/components/pairing-flow.js +241 -0
  343. package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
  344. package/lib/module/modules/ui/components/supported-devices-catalog-list.js +101 -0
  345. package/lib/module/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  346. package/lib/module/modules/ui/components/urine-test-result.js +94 -0
  347. package/lib/module/modules/ui/components/urine-test-result.js.map +1 -0
  348. package/lib/module/modules/ui/index.js +13 -0
  349. package/lib/module/modules/ui/index.js.map +1 -0
  350. package/lib/module/modules/ui/types.js +4 -0
  351. package/lib/module/modules/ui/types.js.map +1 -0
  352. package/lib/module/modules/ui/use-ovok-ui.js +45 -0
  353. package/lib/module/modules/ui/use-ovok-ui.js.map +1 -0
  354. package/lib/typescript/commonjs/src/index.d.ts +0 -9
  355. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  358. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +16 -0
  360. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/auth/index.d.ts +4 -0
  362. package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
  363. package/lib/typescript/commonjs/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  365. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  367. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  369. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  370. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts +4 -0
  371. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts +5 -0
  373. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts +3 -0
  375. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  377. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  379. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  380. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  381. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  382. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  383. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  384. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  385. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  386. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  387. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  388. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  389. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  390. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  391. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  392. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  393. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +10 -0
  394. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts +11 -0
  396. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  397. package/lib/typescript/commonjs/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  398. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts +31 -0
  399. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  400. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts +1 -0
  401. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts.map +1 -1
  402. package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts +0 -2
  403. package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts.map +1 -1
  404. package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts +4 -0
  405. package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts.map +1 -0
  406. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
  407. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
  408. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  409. package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
  410. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
  411. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  412. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  413. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  414. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  415. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  416. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  417. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  419. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  421. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  423. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  425. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
  427. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
  428. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +14 -0
  429. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  430. package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  431. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  432. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  433. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  434. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  435. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
  436. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  437. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
  439. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  440. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  441. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  442. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  443. package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts +8 -0
  444. package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
  445. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
  446. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  447. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts +3 -0
  448. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts.map +1 -0
  449. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  450. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  451. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +3 -1
  452. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  454. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  455. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  456. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
  458. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  459. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  460. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  461. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  462. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  463. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts +5 -2
  464. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  466. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  467. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
  468. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  469. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +8 -0
  470. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  471. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  472. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  473. package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  474. package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  475. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  476. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  477. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  478. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  479. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  480. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  481. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  482. package/lib/typescript/commonjs/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
  483. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts +6 -0
  484. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  485. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +4 -1
  486. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  487. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts +2 -1
  488. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts.map +1 -1
  489. package/lib/typescript/commonjs/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  490. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  491. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  492. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts +69 -0
  493. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  494. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts +1 -1
  495. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts.map +1 -1
  496. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts +4 -0
  497. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  498. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  499. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  500. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  501. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  502. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  503. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  504. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  505. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  506. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  507. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  508. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  509. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  510. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  511. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  512. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  513. package/lib/typescript/commonjs/src/modules/tile/components/task-icon.d.ts.map +1 -1
  514. package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
  515. package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
  516. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  517. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  518. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  519. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  520. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  521. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  522. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts +13 -0
  523. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  524. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts +21 -0
  525. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  526. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts +15 -0
  527. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  528. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  529. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  530. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts +10 -0
  531. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  532. package/lib/typescript/commonjs/src/modules/ui/index.d.ts +11 -0
  533. package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -0
  534. package/lib/typescript/commonjs/src/modules/ui/types.d.ts +24 -0
  535. package/lib/typescript/commonjs/src/modules/ui/types.d.ts.map +1 -0
  536. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts +7 -0
  537. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  538. package/lib/typescript/module/src/index.d.ts +0 -9
  539. package/lib/typescript/module/src/index.d.ts.map +1 -1
  540. package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  541. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  542. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  543. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +16 -0
  544. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  545. package/lib/typescript/module/src/modules/auth/index.d.ts +4 -0
  546. package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
  547. package/lib/typescript/module/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  548. package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  549. package/lib/typescript/module/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  550. package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  551. package/lib/typescript/module/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  552. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  553. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  554. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts +4 -0
  555. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  556. package/lib/typescript/module/src/modules/auth/session/events.d.ts +5 -0
  557. package/lib/typescript/module/src/modules/auth/session/events.d.ts.map +1 -0
  558. package/lib/typescript/module/src/modules/auth/session/index.d.ts +3 -0
  559. package/lib/typescript/module/src/modules/auth/session/index.d.ts.map +1 -0
  560. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  561. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  562. package/lib/typescript/module/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  563. package/lib/typescript/module/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  564. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  565. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  566. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  567. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  568. package/lib/typescript/module/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  569. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  570. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  571. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  572. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  573. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  574. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  575. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  576. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  577. package/lib/typescript/module/src/modules/auth/types/session.d.ts +10 -0
  578. package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -0
  579. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts +11 -0
  580. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  581. package/lib/typescript/module/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  582. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts +31 -0
  583. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  584. package/lib/typescript/module/src/modules/background-sync/index.d.ts +1 -0
  585. package/lib/typescript/module/src/modules/background-sync/index.d.ts.map +1 -1
  586. package/lib/typescript/module/src/modules/bt-device/index.d.ts +0 -2
  587. package/lib/typescript/module/src/modules/bt-device/index.d.ts.map +1 -1
  588. package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts +4 -0
  589. package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts.map +1 -0
  590. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
  591. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
  592. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  593. package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
  594. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
  595. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  596. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  597. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  598. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  599. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  600. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  601. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  602. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  603. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  604. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  605. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  606. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  607. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  608. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  609. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  610. package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
  611. package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
  612. package/lib/typescript/module/src/modules/bt-management/index.d.ts +14 -0
  613. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  614. package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  615. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  616. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  617. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  618. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  619. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
  620. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  621. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  622. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
  623. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  624. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  625. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  626. package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  627. package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts +8 -0
  628. package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
  629. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
  630. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  631. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts +3 -0
  632. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts.map +1 -0
  633. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  634. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  635. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +3 -1
  636. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  637. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  638. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  639. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  640. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  641. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
  642. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  643. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  644. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  645. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  646. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  647. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts +5 -2
  648. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  649. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  650. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  651. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
  652. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  653. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +8 -0
  654. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  655. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  656. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  657. package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  658. package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  659. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  660. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  661. package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  662. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  663. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  664. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  665. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  666. package/lib/typescript/module/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
  667. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts +6 -0
  668. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  669. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +4 -1
  670. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  671. package/lib/typescript/module/src/modules/helpers/index.d.ts +2 -1
  672. package/lib/typescript/module/src/modules/helpers/index.d.ts.map +1 -1
  673. package/lib/typescript/module/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  674. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  675. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  676. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts +69 -0
  677. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  678. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts +1 -1
  679. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts.map +1 -1
  680. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts +4 -0
  681. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  682. package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  683. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  684. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  685. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  686. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  687. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  688. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  689. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  690. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  691. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  692. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  693. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  694. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  695. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  696. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  697. package/lib/typescript/module/src/modules/tile/components/task-icon.d.ts.map +1 -1
  698. package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
  699. package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
  700. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  701. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  702. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  703. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  704. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  705. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  706. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts +13 -0
  707. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  708. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts +21 -0
  709. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  710. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts +15 -0
  711. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  712. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  713. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  714. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts +10 -0
  715. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  716. package/lib/typescript/module/src/modules/ui/index.d.ts +11 -0
  717. package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -0
  718. package/lib/typescript/module/src/modules/ui/types.d.ts +24 -0
  719. package/lib/typescript/module/src/modules/ui/types.d.ts.map +1 -0
  720. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts +7 -0
  721. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  722. package/package.json +146 -7
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useHealthImport","types","background","adapter","enabled","setEnabled","useState","statusByType","setStatusByType","error","setError","typesKey","useMemo","join","configRef","useRef","current","refresh","useCallback","currentAdapter","currentTypes","entries","Promise","allSettled","map","type","getStatus","rejected","find","entry","status","next","forEach","value","length","every","reason","Error","String","undefined","useEffect","setEnabledForTypes","currentBackground","request","cause","nextError","notShared","filter"],"sourceRoot":"../../../../../src","sources":["modules/b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C,CAAC;MACjB;MAEAZ,UAAU,CAAC0B,IAAI,CAAC;IAClB,CAAC,CAAC,OAAOa,KAAK,EAAE;MACd,MAAMC,SAAS,GAAGD,KAAK,YAAYP,KAAK,GAAGO,KAAK,GAAG,IAAIP,KAAK,CAACC,MAAM,CAACM,KAAK,CAAC,CAAC;MAE3ElC,QAAQ,CAACmC,SAAS,CAAC;MACnB,MAAMA,SAAS;IACjB;EACF,CAAC,EAAE,CAAC5B,OAAO,CAAC,CAAC;EAEb,MAAM6B,SAAS,GAAG7C,KAAK,CAAC8C,MAAM,CAAEtB,IAAI,IAAKlB,YAAY,CAACkB,IAAI,CAAC,KAAK,SAAS,CAAC;EAE1E,OAAO;IAAErB,OAAO;IAAEC,UAAU,EAAEoC,kBAAkB;IAAElC,YAAY,EAAEA,YAAqB;IAAEuC,SAAS;IAAErC;EAAM,CAAC;AAC3G,CAAC","ignoreList":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { useBluetoothRuntime } from "./runtime-context.js";
5
+ export const useMeasurements = (onResult, {
6
+ policy = "all",
7
+ maxResults = 100
8
+ } = {}) => {
9
+ const runtime = useBluetoothRuntime();
10
+ const [measurements, setMeasurements] = React.useState([]);
11
+ const seen = React.useRef(new Set());
12
+ const seenMeasurementKinds = React.useRef(new Set());
13
+ const seenDailyTotals = React.useRef(new Set());
14
+ const onResultRef = React.useRef(onResult);
15
+ onResultRef.current = onResult;
16
+ const acceptsResult = React.useCallback(result => {
17
+ const measurementTypeKey = String(result.data.measurementTypeKey);
18
+ if (policy === "first-reading-per-kind-per-connection") {
19
+ if (seenMeasurementKinds.current.has(measurementTypeKey)) {
20
+ return false;
21
+ }
22
+ seenMeasurementKinds.current.add(measurementTypeKey);
23
+ }
24
+ if (policy === "daily-totals-only") {
25
+ const temporal = result.data;
26
+ const end = temporal.end instanceof Date ? temporal.end : undefined;
27
+ if (end && end.getTime() > Date.now()) {
28
+ return false;
29
+ }
30
+ const day = temporal.end ?? temporal.start ?? temporal.recordedAt;
31
+ if (day instanceof Date) {
32
+ const key = `${measurementTypeKey}:${day.toISOString().slice(0, 10)}`;
33
+ if (seenDailyTotals.current.has(key)) {
34
+ return false;
35
+ }
36
+ seenDailyTotals.current.add(key);
37
+ }
38
+ }
39
+ return true;
40
+ }, [policy]);
41
+ React.useEffect(() => {
42
+ return runtime.subscribe("result", result => {
43
+ if (!acceptsResult(result)) {
44
+ return;
45
+ }
46
+ if (seen.current.has(result.id)) {
47
+ return;
48
+ }
49
+ seen.current.add(result.id);
50
+ setMeasurements(current => [...current, result].slice(-maxResults));
51
+ onResultRef.current?.(result);
52
+ });
53
+ }, [acceptsResult, maxResults, runtime]);
54
+ React.useEffect(() => {
55
+ const unsubscribe = runtime.subscribe("connection", event => {
56
+ if (event.kind === "bonded") {
57
+ seenMeasurementKinds.current.clear();
58
+ seenDailyTotals.current.clear();
59
+ }
60
+ });
61
+ return unsubscribe;
62
+ }, [runtime]);
63
+ return {
64
+ measurements,
65
+ clear: () => {
66
+ seen.current.clear();
67
+ seenMeasurementKinds.current.clear();
68
+ seenDailyTotals.current.clear();
69
+ setMeasurements([]);
70
+ }
71
+ };
72
+ };
73
+ //# sourceMappingURL=use-measurements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useBluetoothRuntime","useMeasurements","onResult","policy","maxResults","runtime","measurements","setMeasurements","useState","seen","useRef","Set","seenMeasurementKinds","seenDailyTotals","onResultRef","current","acceptsResult","useCallback","result","measurementTypeKey","String","data","has","add","temporal","end","Date","undefined","getTime","now","day","start","recordedAt","key","toISOString","slice","useEffect","subscribe","id","unsubscribe","event","kind","clear"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-measurements.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAGEC,mBAAmB,QACd,sBAAmB;AAO1B,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,QAA0C,EAC1C;EAAEC,MAAM,GA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C3B7B,oBAAoB,CAACG,OAAO,CAAC2B,KAAK,CAAC,CAAC;QACpC7B,eAAe,CAACE,OAAO,CAAC2B,KAAK,CAAC,CAAC;MACjC;IACF,CAAC,CAAC;IAEF,OAAOH,WAAW;EACpB,CAAC,EAAE,CAAClC,OAAO,CAAC,CAAC;EAEb,OAAO;IACLC,YAAY;IACZoC,KAAK,EAAEA,CAAA,KAAM;MACXjC,IAAI,CAACM,OAAO,CAAC2B,KAAK,CAAC,CAAC;MACpB9B,oBAAoB,CAACG,OAAO,CAAC2B,KAAK,CAAC,CAAC;MACpC7B,eAAe,CAACE,OAAO,CAAC2B,KAAK,CAAC,CAAC;MAC/BnC,eAAe,CAAC,EAAE,CAAC;IACrB;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { useBluetoothRuntime } from "./runtime-context.js";
5
+ export const useNearbyDevices = () => {
6
+ const runtime = useBluetoothRuntime();
7
+ const [, redraw] = React.useReducer(value => value + 1, 0);
8
+ React.useEffect(() => {
9
+ const unsubscribeFound = runtime.subscribe("deviceFound", redraw);
10
+ const unsubscribeStatus = runtime.subscribe("status", redraw);
11
+ return () => {
12
+ unsubscribeFound();
13
+ unsubscribeStatus();
14
+ };
15
+ }, [runtime]);
16
+ return {
17
+ devices: runtime.devices,
18
+ pair: async id => {
19
+ const device = runtime.devices.find(item => item.id === id);
20
+ if (device) {
21
+ await device.device.connect();
22
+ }
23
+ return device;
24
+ }
25
+ };
26
+ };
27
+ //# sourceMappingURL=use-nearby-devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useBluetoothRuntime","useNearbyDevices","runtime","redraw","useReducer","value","useEffect","unsubscribeFound","subscribe","unsubscribeStatus","devices","pair","id","device","find","item","connect"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-nearby-devices.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAAwBC,mBAAmB,QAAQ,sBAAmB;AAEtE,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAG3B;EACH,MAAMC,OAAO,GAAGF,mBAAmB,CAAC,CAAC;EACrC,MAAM,GAAGG,MAAM,CAAC,GAAGJ,KAAK,CAACK,UAAU,CAAEC,KAAK,IAAKA,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;EAE5DN,KAAK,CAACO,SAAS,CAAC,MAAM;IACpB,MAAMC,gBAAgB,GAAGL,OAAO,CAACM,SAAS,CAAC,aAAa,EAAEL,MAAM,CAAC;IACjE,MAAMM,iBAAiB,GAAGP,OAAO,CAACM,SAAS,CAAC,QAAQ,EAAEL,MAAM,CAAC;IAE7D,OAAO,MAAM;MACXI,gBAAgB,CAAC,CAAC;MAClBE,iBAAiB,CAAC,CAAC;IACrB,CAAC;EACH,CAAC,EAAE,CAACP,OAAO,CAAC,CAAC;EAEb,OAAO;IACLQ,OAAO,EAAER,OAAO,CAACQ,OAAO;IACxBC,IAAI,EAAE,MAAOC,EAAE,IAAK;MAClB,MAAMC,MAAM,GAAGX,OAAO,CAACQ,OAAO,CAACI,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACH,EAAE,KAAKA,EAAE,CAAC;MAE7D,IAAIC,MAAM,EAAE;QAAC,MAAMA,MAAM,CAACA,MAAM,CAACG,OAAO,CAAC,CAAC;MAAC;MAE3C,OAAOH,MAAM;IACf;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable import/group-exports */
4
+
5
+ import * as React from "react";
6
+ import { useBluetoothRuntime } from "./runtime-context.js";
7
+ export const usePairedDevices = ({
8
+ storage,
9
+ storageKey = "@ovok/native/paired-devices",
10
+ autoPair = false
11
+ }) => {
12
+ const runtime = useBluetoothRuntime();
13
+ const [paired, setPaired] = React.useState([]);
14
+ const pairedRef = React.useRef([]);
15
+ const [, redraw] = React.useReducer(value => value + 1, 0);
16
+ const save = React.useCallback(async next => {
17
+ pairedRef.current = next;
18
+ setPaired(next);
19
+ await storage.setItem(storageKey, JSON.stringify(next));
20
+ }, [storage, storageKey]);
21
+ React.useEffect(() => runtime.subscribe("deviceFound", redraw), [runtime]);
22
+ React.useEffect(() => {
23
+ void storage.getItem(storageKey).then(value => {
24
+ try {
25
+ const parsed = value ? JSON.parse(value) : [];
26
+ const next = Array.isArray(parsed) ? parsed.filter(id => typeof id === "string") : [];
27
+ pairedRef.current = next;
28
+ setPaired(next);
29
+ } catch {
30
+ setPaired([]);
31
+ }
32
+ });
33
+ }, [storage, storageKey]);
34
+ React.useEffect(() => {
35
+ if (!autoPair) {
36
+ return;
37
+ }
38
+ runtime.devices.filter(device => paired.includes(device.id)).forEach(device => void device.device.connect());
39
+ }, [autoPair, paired, runtime, runtime.devices]);
40
+ return {
41
+ paired,
42
+ pair: device => save([...new Set([...pairedRef.current, device.id])]),
43
+ forget: async id => {
44
+ if (!runtime.manager) {
45
+ throw new Error("Bluetooth manager is not ready; try forgetting the device again.");
46
+ }
47
+ await runtime.manager.forget(id);
48
+ await save(pairedRef.current.filter(candidate => candidate !== id));
49
+ }
50
+ };
51
+ };
52
+ //# sourceMappingURL=use-paired-devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useBluetoothRuntime","usePairedDevices","storage","storageKey","autoPair","runtime","paired","setPaired","useState","pairedRef","useRef","redraw","useReducer","value","save","useCallback","next","current","setItem","JSON","stringify","useEffect","subscribe","getItem","then","parsed","parse","Array","isArray","filter","id","devices","device","includes","forEach","connect","pair","Set","forget","manager","Error","candidate"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-paired-devices.ts"],"mappings":";;AAAA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAAwBC,mBAAmB,QAAQ,sBAAmB;AAatE,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,OAAO;EACPC,UAAU,GAAG,6BAA6B;EAC1CC,QAAQ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M;QACNT,SAAS,CAAC,EAAE,CAAC;MACf;IACF,CAAC,CAAC;EACJ,CAAC,EAAE,CAACL,OAAO,EAAEC,UAAU,CAAC,CAAC;EAEzBJ,KAAK,CAACsB,SAAS,CAAC,MAAM;IACpB,IAAI,CAACjB,QAAQ,EAAE;MAAC;IAAO;IACvBC,OAAO,CAAC0B,OAAO,CACZF,MAAM,CAAEG,MAAM,IAAK1B,MAAM,CAAC2B,QAAQ,CAACD,MAAM,CAACF,EAAE,CAAC,CAAC,CAC9CI,OAAO,CAAEF,MAAM,IAAK,KAAKA,MAAM,CAACA,MAAM,CAACG,OAAO,CAAC,CAAC,CAAC;EACtD,CAAC,EAAE,CAAC/B,QAAQ,EAAEE,MAAM,EAAED,OAAO,EAAEA,OAAO,CAAC0B,OAAO,CAAC,CAAC;EAEhD,OAAO;IACLzB,MAAM;IACN8B,IAAI,EAAGJ,MAAM,IAAKlB,IAAI,CAAC,CAAC,GAAG,IAAIuB,GAAG,CAAC,CAAC,GAAG5B,SAAS,CAACQ,OAAO,EAAEe,MAAM,CAACF,EAAE,CAAC,CAAC,CAAC,CAAC;IACvEQ,MAAM,EAAE,MAAOR,EAAE,IAAK;MACpB,IAAI,CAACzB,OAAO,CAACkC,OAAO,EAAE;QACpB,MAAM,IAAIC,KAAK,CAAC,kEAAkE,CAAC;MACrF;MAEA,MAAMnC,OAAO,CAACkC,OAAO,CAACD,MAAM,CAACR,EAAE,CAAC;MAChC,MAAMhB,IAAI,CAACL,SAAS,CAACQ,OAAO,CAACY,MAAM,CAAEY,SAAS,IAAKA,SAAS,KAAKX,EAAE,CAAC,CAAC;IACvE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { useBluetoothRuntime } from "./runtime-context.js";
5
+
6
+ /** Exposes scan pause/resume to apps using BTProvider. */
7
+ export const useScanControl = () => {
8
+ const runtime = useBluetoothRuntime();
9
+ React.useSyncExternalStore(runtime.subscribeState, () => runtime.manager, () => undefined);
10
+ return {
11
+ canControl: Boolean(runtime.manager),
12
+ pauseScan: () => runtime.manager?.pauseScan(),
13
+ resumeScan: () => runtime.manager?.resumeScan()
14
+ };
15
+ };
16
+ //# sourceMappingURL=use-scan-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useBluetoothRuntime","useScanControl","runtime","useSyncExternalStore","subscribeState","manager","undefined","canControl","Boolean","pauseScan","resumeScan"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-scan-control.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,mBAAmB,QAAQ,sBAAmB;;AAEvD;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAIzB;EACH,MAAMC,OAAO,GAAGF,mBAAmB,CAAC,CAAC;EAErCD,KAAK,CAACI,oBAAoB,CACxBD,OAAO,CAACE,cAAc,EACtB,MAAMF,OAAO,CAACG,OAAO,EACrB,MAAMC,SACR,CAAC;EAED,OAAO;IACLC,UAAU,EAAEC,OAAO,CAACN,OAAO,CAACG,OAAO,CAAC;IACpCI,SAAS,EAAEA,CAAA,KAAMP,OAAO,CAACG,OAAO,EAAEI,SAAS,CAAC,CAAC;IAC7CC,UAAU,EAAEA,CAAA,KAAMR,OAAO,CAACG,OAAO,EAAEK,UAAU,CAAC;EAChD,CAAC;AACH,CAAC","ignoreList":[]}
@@ -31,7 +31,10 @@ export * from "./types/btprovider-children-props.js";
31
31
  export * from "./types/background-sync.js";
32
32
  export * from "./types/result-callback.js";
33
33
  export * from "./types/error-callback.js";
34
+ export * from "./types/bluetooth-error.js";
34
35
  export * from "./types/device-status-change-callback.js";
36
+ export * from "./types/device-connection-event.js";
37
+ export * from "./types/result-policy.js";
35
38
  export * from "./services/devices/bt-managed-device.js";
36
39
  export * from "./services/devices/blood-glucose/blood-glucose.device.js";
37
40
  export * from "./services/devices/custom/custom.device.js";
@@ -39,6 +42,8 @@ export * from "./services/bt-manager.js";
39
42
  export * from "./services/background-sync/background-ble-manager.js";
40
43
  export * from "./services/background-sync/background-sync-coordinator.js";
41
44
  export * from "./services/background-sync/background-service-uuids.js";
45
+ export * from "./utils/result-identity.js";
46
+ export * from "./testing/index.js";
42
47
  export * from "./services/custom/define-custom-device.js";
43
48
  export * from "./services/devices/standard-gatt/standard-gatt.devices.js";
44
49
  export * from "./services/devices/boso/boso.medicus.js";
@@ -67,4 +72,13 @@ export * from "./components/bt-provider.js";
67
72
  export * from "./components/bluetooth-device-picker.js";
68
73
  export * from "./components/default-permission-fallback.js";
69
74
  export * from "./hooks/use-request-permissions.js";
75
+ export * from "./hooks/runtime-context.js";
76
+ export * from "./hooks/use-bluetooth-state.js";
77
+ export * from "./hooks/use-nearby-devices.js";
78
+ export * from "./hooks/use-paired-devices.js";
79
+ export * from "./hooks/use-device-connection.js";
80
+ export * from "./hooks/use-measurements.js";
81
+ export * from "./hooks/use-background-sync.js";
82
+ export * from "./hooks/use-health-import.js";
83
+ export * from "./hooks/use-scan-control.js";
70
84
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,0DAAuD;AACrE,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,sDAAmD;AACjE,cAAc,2DAAwD;AACtE,cAAc,wDAAqD;AACnE,cAAc,2CAAwC;AACtD,cAAc,2DAAwD;AACtE,cAAc,yCAAsC;AACpD,cAAc,oDAAiD;AAC/D,cAAc,mDAAgD;AAC9D,cAAc,0DAAuD;AACrE,cAAc,kDAA+C;AAC7D,cAAc,uDAAoD;AAClE,cAAc,0DAAuD;AACrE,cAAc,mDAAgD;AAC9D,cAAc,4CAAyC;AACvD,cAAc,4CAAyC;AACvD,cAAc,iDAA8C;AAC5D,cAAc,+CAA4C;AAC1D,cAAc,mDAAgD;AAC9D,cAAc,+CAA4C;AAC1D,cAAc,2CAAwC;AACtD,cAAc,8CAA2C;AACzD,cAAc,4CAAyC;AACvD,cAAc,0CAAuC;AACrD,cAAc,6CAA0C;AACxD,cAAc,+CAA4C;AAC1D,cAAc,+CAA4C;AAE1D,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,yCAAsC;AACpD,cAAc,6CAA0C;AACxD,cAAc,oCAAiC","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,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AACxD,cAAc,oCAAiC;AAC/C,cAAc,4BAAyB;AACvC,cAAc,gCAA6B;AAC3C,cAAc,+BAA4B;AAC1C,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,6BAA0B;AACxC,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B","ignoreList":[]}
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ import { recordOvokMetric } from "../../../helpers/utils/telemetry.js";
4
+ import { reviveResultDates } from "../../utils/result-identity.js";
3
5
  const DEFAULT_QUEUE_KEY = "@ovok/native/background-sync/results";
4
6
  const DEFAULT_MAX_RETRIES = 3;
5
7
  const DEFAULT_RETRY_BACKOFF_MS = 30_000;
@@ -8,6 +10,10 @@ const createResultId = () => {
8
10
  resultSequence += 1;
9
11
  return `${Date.now()}-${resultSequence}-${Math.random().toString(36).slice(2, 10)}`;
10
12
  };
13
+ const createQueueId = () => {
14
+ resultSequence += 1;
15
+ return `${Date.now()}-queue-${resultSequence}-${Math.random().toString(36).slice(2, 10)}`;
16
+ };
11
17
 
12
18
  /**
13
19
  * A small durable, at-least-once queue. The result is written before delivery and removed only
@@ -24,14 +30,19 @@ class BackgroundSyncCoordinator {
24
30
  }
25
31
  enqueue = result => this.runExclusive(async () => {
26
32
  const queue = await this.readQueue();
33
+ const stableId = result.id ?? createResultId();
27
34
  queue.push({
28
- id: createResultId(),
35
+ queueId: createQueueId(),
29
36
  queuedAt: new Date().toISOString(),
30
37
  attempt: 0,
31
38
  nextAttemptAt: 0,
32
- result
39
+ result: {
40
+ ...result,
41
+ id: stableId
42
+ }
33
43
  });
34
44
  await this.writeQueue(queue);
45
+ recordOvokMetric("ovok.queue.depth", queue.length);
35
46
  await this.flushQueue(queue);
36
47
  });
37
48
  flush = (options = {}) => this.runExclusive(async () => {
@@ -52,9 +63,19 @@ class BackgroundSyncCoordinator {
52
63
  if (!Array.isArray(parsed)) {
53
64
  throw new Error("Background sync queue is not an array");
54
65
  }
55
- return parsed;
66
+ return parsed.map(item => {
67
+ const typed = item;
68
+ const result = reviveResultDates(typed.result);
69
+ return {
70
+ ...typed,
71
+ queueId: typed.queueId ?? typed.id ?? createQueueId(),
72
+ result: {
73
+ ...result,
74
+ id: result.id ?? typed.id ?? createResultId()
75
+ }
76
+ };
77
+ });
56
78
  } catch (error) {
57
- await this.options.storage.setItem(this.storageKey, "[]");
58
79
  throw new Error(`Background sync queue could not be read: ${error instanceof Error ? error.message : String(error)}`);
59
80
  }
60
81
  };
@@ -78,21 +99,36 @@ class BackgroundSyncCoordinator {
78
99
  try {
79
100
  await this.options.onResult({
80
101
  ...item.result,
81
- id: item.id,
102
+ id: item.result.id,
103
+ queueId: item.queueId,
82
104
  queuedAt: item.queuedAt,
83
105
  attempt
84
106
  });
85
107
  queue.splice(queue.indexOf(item), 1);
108
+ recordOvokMetric("ovok.queue.delivered", 1, {
109
+ attempt,
110
+ measurementTypeKey: item.result.data.measurementTypeKey
111
+ });
86
112
  changed = true;
87
113
  } catch {
88
114
  item.attempt = attempt;
89
115
  item.exhausted = attempt >= this.maxRetries;
90
116
  item.nextAttemptAt = item.exhausted ? Number.MAX_SAFE_INTEGER : Date.now() + this.retryBackoffMs * 2 ** (attempt - 1);
117
+ recordOvokMetric("ovok.queue.retries", 1, {
118
+ attempt
119
+ });
120
+ if (item.exhausted) {
121
+ recordOvokMetric("ovok.queue.exhausted", 1, {
122
+ attempt,
123
+ exhausted: true
124
+ });
125
+ }
91
126
  changed = true;
92
127
  }
93
128
  }
94
129
  if (changed) {
95
130
  await this.writeQueue(queue);
131
+ recordOvokMetric("ovok.queue.depth", queue.length);
96
132
  }
97
133
  };
98
134
  }
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_QUEUE_KEY","DEFAULT_MAX_RETRIES","DEFAULT_RETRY_BACKOFF_MS","resultSequence","createResultId","Date","now","Math","random","toString","slice","BackgroundSyncCoordinator","operation","Promise","resolve","constructor","options","storageKey","maxRetries","max","retryBackoffMs","enqueue","result","runExclusive","queue","readQueue","push","id","queuedAt","toISOString","attempt","nextAttemptAt","writeQueue","flushQueue","flush","next","then","catch","undefined","serialized","storage","getItem","parsed","JSON","parse","Array","isArray","Error","error","setItem","message","String","stringify","changed","item","exhausted","resetExhausted","includeExhausted","onResult","splice","indexOf","Number","MAX_SAFE_INTEGER"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/background-sync/background-sync-coordinator.ts"],"mappings":";;AAkBA,MAAMA,iBAAiB,GAAG,sCAAsC;AAChE,MAAMC,mBAAmB,GAAG,CAAC;AAC7B,MAAMC,wBAAwB,GAAG,MAAM;AAEvC,IAAIC,cAAc,GAAG,CAAC;AAEtB,MAAMC,cAAc,GAAGA,CAAA,KAAc;EACnCD,cAAc,IAAI,CAAC;EAEnB,OAAO,GAAGE,IAAI,CAACC,GAAG,CAAC,CAAC,IAAIH,cAAc,IAAII,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;AACrF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,yBAAyB,CAAsB;EAI3CC,SAAS,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAE7CC,WAAWA,CAAkBC,OAAiC,EAAE;IAAA,KAAnCA,OAAiC,GAAjCA,OAAiC;IACnE,IAAI,CAACC,UAAU,GAAGD,OAAO,CAACC,UAAU,IAAIjB,iBAAiB;IACzD,IAAI,CAACkB,UAAU,GAAGX,IAAI,CAACY,GAAG,CAAC,CAAC,EAAEH,OAAO,CAACE,UAAU,IAAIjB,mBAAmB,CAAC;IACxE,IAAI,CAACmB,cAAc,GAAGb,IAAI,CAACY,GAAG,CAC5B,CAAC,EACDH,OAAO,CAACI,cAAc,IAAIlB,wBAC5B,CAAC;EACH;EAEOmB,OAAO,GAAIC,MAAyB,IACzC,IAAI,CAACC,YAAY,CAAC,YAAY;IAC5B,MAAM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AAE;UACXC,QAAQ,EAAE0B,IAAI,CAAC1B,QAAQ;UACvBE;QACF,CAA4B,CAAC;QAE7BN,KAAK,CAACmC,MAAM,CAACnC,KAAK,CAACoC,OAAO,CAACN,IAAI,CAAC,EAAE,CAAC,CAAC;QACpCD,OAAO,GAAG,IAAI;MAChB,CAAC,CAAC,MAAM;QACNC,IAAI,CAACxB,OAAO,GAAGA,OAAO;QACtBwB,IAAI,CAACC,SAAS,GAAGzB,OAAO,IAAI,IAAI,CAACZ,UAAU;QAC3CoC,IAAI,CAACvB,aAAa,GAAGuB,IAAI,CAACC,SAAS,GAC/BM,MAAM,CAACC,gBAAgB,GACvBzD,IAAI,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI,CAACc,cAAc,GAAG,CAAC,KAAKU,OAAO,GAAG,CAAC,CAAC;QACzDuB,OAAO,GAAG,IAAI;MAChB;IACF;IAEA,IAAIA,OAAO,EAAE;MACX,MAAM,IAAI,CAACrB,UAAU,CAACR,KAAK,CAAC;IAC9B;EACF,CAAC;AACH;AAEA,SAASb,yBAAyB,EAAEX,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["recordOvokMetric","reviveResultDates","DEFAULT_QUEUE_KEY","DEFAULT_MAX_RETRIES","DEFAULT_RETRY_BACKOFF_MS","resultSequence","createResultId","Date","now","Math","random","toString","slice","createQueueId","BackgroundSyncCoordinator","operation","Promise","resolve","constructor","options","storageKey","maxRetries","max","retryBackoffMs","enqueue","result","runExclusive","queue","readQueue","stableId","id","push","queueId","queuedAt","toISOString","attempt","nextAttemptAt","writeQueue","length","flushQueue","flush","next","then","catch","undefined","serialized","storage","getItem","parsed","JSON","parse","Array","isArray","Error","map","item","typed","error","message","String","setItem","stringify","changed","exhausted","resetExhausted","includeExhausted","onResult","splice","indexOf","measurementTypeKey","data","Number","MAX_SAFE_INTEGER"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/background-sync/background-sync-coordinator.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QA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G,CAAC,KAAKY,OAAO,GAAG,CAAC,CAAC;QACzDnC,gBAAgB,CAAC,oBAAoB,EAAE,CAAC,EAAE;UAAEmC;QAAQ,CAAC,CAAC;QACtD,IAAIoB,IAAI,CAACQ,SAAS,EAAE;UAClB/D,gBAAgB,CAAC,sBAAsB,EAAE,CAAC,EAAE;YAAEmC,OAAO;YAAE4B,SAAS,EAAE;UAAK,CAAC,CAAC;QAC3E;QACAD,OAAO,GAAG,IAAI;MAChB;IACF;IAEA,IAAIA,OAAO,EAAE;MACX,MAAM,IAAI,CAACzB,UAAU,CAACV,KAAK,CAAC;MAC5B3B,gBAAgB,CAAC,kBAAkB,EAAE2B,KAAK,CAACW,MAAM,CAAC;IACpD;EACF,CAAC;AACH;AAEA,SAASxB,yBAAyB,EAAEZ,iBAAiB","ignoreList":[]}
@@ -5,10 +5,21 @@ import { Linking, Platform } from "react-native";
5
5
  import { ScanMode, State } from "react-native-ble-plx";
6
6
  import { slog } from "../../helpers/index.js";
7
7
  import { sentryLogger } from "../../helpers/utils/sentry-logger.js";
8
+ import { addOvokSpanEvent, recordOvokMetric } from "../../helpers/utils/telemetry.js";
9
+ import { toBluetoothError } from "../types/bluetooth-error.js";
8
10
  import { DeviceCreator } from "./device-creator.js";
11
+ const bluetoothErrorCallback = error => {
12
+ const normalized = toBluetoothError(error);
13
+ const originalError = normalized.originalError;
14
+ return {
15
+ error: normalized.translationKey ?? (originalError instanceof Error || typeof originalError === "string" ? originalError : normalized),
16
+ code: normalized.code
17
+ };
18
+ };
9
19
  class BTManager {
10
20
  static MAX_DEVICES = 15; // Safety limit to prevent unbounded growth
11
21
  devices = new Map();
22
+ forgottenDeviceIds = new Set();
12
23
  eventSubscriptions = [];
13
24
  scanGeneration = 0;
14
25
  scanActive = false;
@@ -36,10 +47,12 @@ class BTManager {
36
47
  this.onDeviceFoundCallback = undefined;
37
48
  this.onResultCallback = undefined;
38
49
  this.onDeviceStatusChangedCallback = undefined;
50
+ this.onConnectionEventCallback = undefined;
39
51
  this.devices.forEach(device => {
40
52
  device.destroy();
41
53
  });
42
54
  this.devices.clear();
55
+ this.forgottenDeviceIds.clear();
43
56
  this.deviceCreator.destroy();
44
57
  };
45
58
  startScan = () => {
@@ -76,9 +89,7 @@ class BTManager {
76
89
  try {
77
90
  subscription = this.bleManager.onStateChange(onStateChange, true);
78
91
  } catch (error) {
79
- this.onErrorCallback?.({
80
- error: error instanceof Error ? error : String(error)
81
- });
92
+ this.onErrorCallback?.(bluetoothErrorCallback(error));
82
93
  return;
83
94
  }
84
95
  if (poweredOnBeforeSubscription) {
@@ -116,11 +127,44 @@ class BTManager {
116
127
  this.onDeviceFoundCallback = undefined;
117
128
  this.onResultCallback = undefined;
118
129
  this.onDeviceStatusChangedCallback = undefined;
130
+ this.onConnectionEventCallback = undefined;
119
131
  this.devices.forEach(device => {
120
132
  device.destroy();
121
133
  });
122
134
  this.devices.clear();
123
135
  };
136
+
137
+ /**
138
+ * Pauses discovery without tearing down devices or their callbacks.
139
+ *
140
+ * Use this when an app temporarily stops scanning, for example while it is in the
141
+ * background but an already-connected device may still deliver a measurement.
142
+ */
143
+ pauseScan = () => {
144
+ if (this.destroyed) {
145
+ return;
146
+ }
147
+ sentryLogger("info", "BT_MANAGER: Pausing scan");
148
+ this.scanGeneration += 1;
149
+ this.scanActive = false;
150
+ this.scanStarting = false;
151
+ this.removeStateChangeListener();
152
+ this.bleManager.stopDeviceScan();
153
+ };
154
+
155
+ /**
156
+ * Resumes discovery without clearing devices or callbacks.
157
+ *
158
+ * Restarting unconditionally also recovers when an app stopped the underlying BLE scan
159
+ * directly while BTManager still believed it was active.
160
+ */
161
+ resumeScan = () => {
162
+ if (this.destroyed) {
163
+ return;
164
+ }
165
+ sentryLogger("info", "BT_MANAGER: Resuming scan");
166
+ this.restartScan();
167
+ };
124
168
  restartScan = () => {
125
169
  if (this.destroyed) {
126
170
  return;
@@ -151,9 +195,7 @@ class BTManager {
151
195
  }
152
196
  const serviceUUIDs = this.options.serviceUUIDs ?? [];
153
197
  if (Platform.OS === "ios" && this.backgroundScanEnabled && !serviceUUIDs.length) {
154
- this.onErrorCallback?.({
155
- error: "Background Bluetooth sync on iOS requires at least one service UUID. Add serviceUUIDs for custom devices."
156
- });
198
+ this.onErrorCallback?.(bluetoothErrorCallback("Background Bluetooth sync on iOS requires at least one service UUID. Add serviceUUIDs for custom devices."));
157
199
  return;
158
200
  }
159
201
  this.scanStarting = true;
@@ -171,16 +213,33 @@ class BTManager {
171
213
  });
172
214
  this.scanActive = true;
173
215
  sentryLogger("info", "BT_MANAGER: Scan started (continuous mode)");
174
- } catch (error) {
175
- this.onErrorCallback?.({
176
- error: error instanceof Error ? error : String(error)
216
+ addOvokSpanEvent("bluetooth.scan.started", {
217
+ platform: Platform.OS,
218
+ background: this.backgroundScanEnabled
177
219
  });
220
+ } catch (error) {
221
+ this.onErrorCallback?.(bluetoothErrorCallback(error));
178
222
  } finally {
179
223
  this.scanStarting = false;
180
224
  }
181
225
  };
182
226
  restoreDevices = devices => {
183
- devices.forEach(device => this.onScanResult(null, device));
227
+ devices.forEach(device => {
228
+ this.forgottenDeviceIds.delete(device.id);
229
+ this.onScanResult(null, device);
230
+ });
231
+ };
232
+
233
+ /** Disconnects one device and prevents it from being re-created by later advertisements. */
234
+ forget = async deviceId => {
235
+ this.forgottenDeviceIds.add(deviceId);
236
+ this.autoConnectCandidates.delete(deviceId);
237
+ const device = this.devices.get(deviceId);
238
+ if (!device) {
239
+ return;
240
+ }
241
+ this.devices.delete(deviceId);
242
+ await device.disconnect();
184
243
  };
185
244
  onDeviceFound = callback => {
186
245
  sentryLogger("info", "BT_MANAGER: Setting onDeviceFound callback");
@@ -194,6 +253,10 @@ class BTManager {
194
253
  sentryLogger("info", "BT_MANAGER: Setting onDeviceStatusChanged callback");
195
254
  this.onDeviceStatusChangedCallback = callback;
196
255
  };
256
+ onConnectionEvent = callback => {
257
+ sentryLogger("info", "BT_MANAGER: Setting onConnectionEvent callback");
258
+ this.onConnectionEventCallback = callback;
259
+ };
197
260
  onResult = callback => {
198
261
  sentryLogger("info", "BT_MANAGER: Setting onResult callback");
199
262
  this.onResultCallback = callback;
@@ -204,12 +267,7 @@ class BTManager {
204
267
  onScanResult = (error, device) => {
205
268
  try {
206
269
  if (error) {
207
- this.onErrorCallback?.({
208
- error: error
209
- });
210
- sentryLogger("error", "BT_MANAGER: Scan result error", {
211
- error: error instanceof Error ? error.message : error
212
- });
270
+ this.onErrorCallback?.(bluetoothErrorCallback(error));
213
271
  slog(error, "BT_MANAGER: Scan result error", {
214
272
  error
215
273
  });
@@ -226,6 +284,9 @@ class BTManager {
226
284
  if (!device) {
227
285
  return;
228
286
  }
287
+ if (this.forgottenDeviceIds.has(device.id)) {
288
+ return;
289
+ }
229
290
  if (this.devices.has(device.id)) {
230
291
  return;
231
292
  }
@@ -248,22 +309,24 @@ class BTManager {
248
309
  deviceName,
249
310
  onError: this.onErrorCallback?.bind(this),
250
311
  onDeviceStatusChanged: this.onDeviceStatusChangedCallback?.bind(this),
312
+ onConnectionEvent: this.onConnectionEventCallback?.bind(this),
251
313
  onResult: this.onResultCallback?.bind(this),
252
314
  oneReadingPerConnection: this.options.oneReadingPerConnection,
253
315
  deliveredEcgFileNames: this.options.deliveredEcgFileNames,
316
+ resultPolicy: this.options.resultPolicies?.[deviceName],
254
317
  onDeviceDisconnected: () => {
255
318
  this.removeDeviceFromFoundedDevices?.bind(this)(device.id);
256
319
  }
257
320
  });
258
321
  this.devices.set(device.id, deviceClass);
322
+ recordOvokMetric("ovok.devices.found", 1, {
323
+ deviceId: device.id,
324
+ model: deviceName,
325
+ platform: Platform.OS
326
+ });
259
327
  this.onDeviceFoundCallback?.(deviceClass, this);
260
328
  this.queueAutoConnect(deviceClass);
261
329
  } catch (error) {
262
- sentryLogger("error", "BT_MANAGER: Error creating device", {
263
- error: error instanceof Error ? error.message : error,
264
- deviceId: device?.id,
265
- deviceName: device?.name
266
- });
267
330
  slog(error, "BT_MANAGER: Error creating device", {
268
331
  error,
269
332
  deviceId: device?.id,
@@ -284,13 +347,19 @@ class BTManager {
284
347
  const devices = [...this.autoConnectCandidates.values()];
285
348
  this.autoConnectCandidates.clear();
286
349
  if (devices.length === 1) {
287
- void devices[0]?.connect();
350
+ const candidate = devices[0];
351
+ if (candidate && !this.forgottenDeviceIds.has(candidate.id) && this.devices.get(candidate.id) === candidate) {
352
+ void candidate.connect();
353
+ }
288
354
  return;
289
355
  }
290
356
  if (devices.length > 1) {
291
357
  this.options.onDeviceSelectionRequired?.({
292
358
  devices: devices,
293
359
  select: async selected => {
360
+ if (this.forgottenDeviceIds.has(selected.id) || this.devices.get(selected.id) !== selected) {
361
+ throw new Error("The selected Bluetooth device was forgotten.");
362
+ }
294
363
  await selected.connect();
295
364
  }
296
365
  });