@ovok/native 1.5.5 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (656) hide show
  1. package/README.md +27 -17
  2. package/app.plugin.js +104 -0
  3. package/lib/commonjs/index.js +11 -0
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  6. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  7. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js +23 -0
  8. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  9. package/lib/commonjs/modules/auth/hooks/use-session.js +91 -0
  10. package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -0
  11. package/lib/commonjs/modules/auth/index.js +44 -0
  12. package/lib/commonjs/modules/auth/index.js.map +1 -1
  13. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js +3 -1
  14. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
  15. package/lib/commonjs/modules/auth/register/components/form/inputs.js +48 -1
  16. package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
  17. package/lib/commonjs/modules/auth/register/components/form/register-button.js +4 -0
  18. package/lib/commonjs/modules/auth/register/components/form/register-button.js.map +1 -1
  19. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +6 -0
  20. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  21. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js +12 -0
  22. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  23. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  24. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  25. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  26. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  27. package/lib/commonjs/modules/auth/session/components/session-list.js +82 -0
  28. package/lib/commonjs/modules/auth/session/components/session-list.js.map +1 -0
  29. package/lib/commonjs/modules/auth/session/events.js +19 -0
  30. package/lib/commonjs/modules/auth/session/events.js.map +1 -0
  31. package/lib/commonjs/modules/auth/session/index.js +13 -0
  32. package/lib/commonjs/modules/auth/session/index.js.map +1 -0
  33. package/lib/commonjs/modules/auth/session/types/session-list-props.js +6 -0
  34. package/lib/commonjs/modules/auth/session/types/session-list-props.js.map +1 -0
  35. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js +25 -0
  36. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  37. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  38. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  39. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js +58 -0
  40. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  41. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  42. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  43. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js +13 -5
  44. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  45. package/lib/commonjs/modules/auth/types/session.js +2 -0
  46. package/lib/commonjs/modules/auth/types/session.js.map +1 -0
  47. package/lib/commonjs/modules/auth/utils/rate-limit.js +37 -0
  48. package/lib/commonjs/modules/auth/utils/rate-limit.js.map +1 -0
  49. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  50. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  51. package/lib/commonjs/modules/background-sync/background-safe-storage.js +79 -0
  52. package/lib/commonjs/modules/background-sync/background-safe-storage.js.map +1 -0
  53. package/lib/commonjs/modules/background-sync/index.js +11 -0
  54. package/lib/commonjs/modules/background-sync/index.js.map +1 -1
  55. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +123 -21
  56. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  57. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +91 -0
  58. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -0
  59. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +47 -0
  60. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  61. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +51 -0
  62. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  63. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js +36 -0
  64. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  65. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js +46 -0
  66. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js.map +1 -0
  67. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +57 -0
  68. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -0
  69. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js +26 -0
  70. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  71. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js +49 -0
  72. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  73. package/lib/commonjs/modules/bt-management/index.js +143 -0
  74. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  75. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -4
  76. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  77. package/lib/commonjs/modules/bt-management/services/bt-manager.js +75 -4
  78. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  79. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +57 -0
  80. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  81. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +111 -3
  82. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  83. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  84. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  85. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  86. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  87. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.js +9 -3
  88. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.js.map +1 -1
  89. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +52 -0
  90. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  91. package/lib/commonjs/modules/bt-management/testing/index.js +28 -0
  92. package/lib/commonjs/modules/bt-management/testing/index.js.map +1 -0
  93. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js +23 -0
  94. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js.map +1 -0
  95. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +80 -0
  96. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -0
  97. package/lib/commonjs/modules/bt-management/types/device-connection-event.js +6 -0
  98. package/lib/commonjs/modules/bt-management/types/device-connection-event.js.map +1 -0
  99. package/lib/commonjs/modules/bt-management/types/result-policy.js +6 -0
  100. package/lib/commonjs/modules/bt-management/types/result-policy.js.map +1 -0
  101. package/lib/commonjs/modules/bt-management/utils/result-identity.js +63 -0
  102. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -0
  103. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js +8 -2
  104. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  105. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +23 -4
  106. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  107. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +2 -2
  108. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
  109. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  110. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  111. package/lib/commonjs/modules/data-sync/utils/retry-save.js +65 -0
  112. package/lib/commonjs/modules/data-sync/utils/retry-save.js.map +1 -0
  113. package/lib/commonjs/modules/helpers/form-items/form-field.js +2 -0
  114. package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
  115. package/lib/commonjs/modules/helpers/index.js +12 -0
  116. package/lib/commonjs/modules/helpers/index.js.map +1 -1
  117. package/lib/commonjs/modules/helpers/utils/s-log.js +4 -13
  118. package/lib/commonjs/modules/helpers/utils/s-log.js.map +1 -1
  119. package/lib/commonjs/modules/helpers/utils/sentry-logger.js +28 -17
  120. package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
  121. package/lib/commonjs/modules/helpers/utils/telemetry.js +143 -0
  122. package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
  123. package/lib/commonjs/modules/image/components/optimized-image.js +24 -2
  124. package/lib/commonjs/modules/image/components/optimized-image.js.map +1 -1
  125. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +18 -9
  126. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  127. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  128. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  129. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  130. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  131. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +42 -17
  132. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  133. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  134. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  135. package/lib/commonjs/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  136. package/lib/commonjs/modules/tile/components/task-icon.js +2 -1
  137. package/lib/commonjs/modules/tile/components/task-icon.js.map +1 -1
  138. package/lib/commonjs/modules/ui/components/background-sync-setting.js +113 -0
  139. package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
  140. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +105 -0
  141. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  142. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +165 -0
  143. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  144. package/lib/commonjs/modules/ui/components/health-import-card.js +130 -0
  145. package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
  146. package/lib/commonjs/modules/ui/components/manual-entry-form.js +123 -0
  147. package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
  148. package/lib/commonjs/modules/ui/components/pairing-flow.js +222 -0
  149. package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
  150. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +99 -0
  151. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  152. package/lib/commonjs/modules/ui/components/urine-test-result.js +94 -0
  153. package/lib/commonjs/modules/ui/components/urine-test-result.js.map +1 -0
  154. package/lib/commonjs/modules/ui/index.js +116 -0
  155. package/lib/commonjs/modules/ui/index.js.map +1 -0
  156. package/lib/commonjs/modules/ui/types.js +6 -0
  157. package/lib/commonjs/modules/ui/types.js.map +1 -0
  158. package/lib/commonjs/modules/ui/use-ovok-ui.js +51 -0
  159. package/lib/commonjs/modules/ui/use-ovok-ui.js.map +1 -0
  160. package/lib/module/index.js +1 -0
  161. package/lib/module/index.js.map +1 -1
  162. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  163. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  164. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js +17 -0
  165. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  166. package/lib/module/modules/auth/hooks/use-session.js +85 -0
  167. package/lib/module/modules/auth/hooks/use-session.js.map +1 -0
  168. package/lib/module/modules/auth/index.js +4 -0
  169. package/lib/module/modules/auth/index.js.map +1 -1
  170. package/lib/module/modules/auth/logout-button/components/logout-button.js +3 -1
  171. package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
  172. package/lib/module/modules/auth/register/components/form/inputs.js +48 -1
  173. package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
  174. package/lib/module/modules/auth/register/components/form/register-button.js +4 -0
  175. package/lib/module/modules/auth/register/components/form/register-button.js.map +1 -1
  176. package/lib/module/modules/auth/register/components/form/register-form-provider.js +6 -0
  177. package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  178. package/lib/module/modules/auth/reset-password/components/form/inputs.js +12 -0
  179. package/lib/module/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  180. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  181. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  182. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  183. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  184. package/lib/module/modules/auth/session/components/session-list.js +76 -0
  185. package/lib/module/modules/auth/session/components/session-list.js.map +1 -0
  186. package/lib/module/modules/auth/session/events.js +13 -0
  187. package/lib/module/modules/auth/session/events.js.map +1 -0
  188. package/lib/module/modules/auth/session/index.js +4 -0
  189. package/lib/module/modules/auth/session/index.js.map +1 -0
  190. package/lib/module/modules/auth/session/types/session-list-props.js +4 -0
  191. package/lib/module/modules/auth/session/types/session-list-props.js.map +1 -0
  192. package/lib/module/modules/auth/sign-in/components/form/inputs.js +25 -0
  193. package/lib/module/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  194. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  195. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  196. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js +52 -0
  197. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  198. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  199. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  200. package/lib/module/modules/auth/sign-in/components/form/signin-button.js +13 -5
  201. package/lib/module/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  202. package/lib/module/modules/auth/types/session.js +2 -0
  203. package/lib/module/modules/auth/types/session.js.map +1 -0
  204. package/lib/module/modules/auth/utils/rate-limit.js +31 -0
  205. package/lib/module/modules/auth/utils/rate-limit.js.map +1 -0
  206. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  207. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  208. package/lib/module/modules/background-sync/background-safe-storage.js +74 -0
  209. package/lib/module/modules/background-sync/background-safe-storage.js.map +1 -0
  210. package/lib/module/modules/background-sync/index.js +1 -0
  211. package/lib/module/modules/background-sync/index.js.map +1 -1
  212. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +123 -21
  213. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  214. package/lib/module/modules/bt-management/hooks/runtime-context.js +82 -0
  215. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -0
  216. package/lib/module/modules/bt-management/hooks/use-background-sync.js +41 -0
  217. package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  218. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +45 -0
  219. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  220. package/lib/module/modules/bt-management/hooks/use-device-connection.js +30 -0
  221. package/lib/module/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  222. package/lib/module/modules/bt-management/hooks/use-health-import.js +40 -0
  223. package/lib/module/modules/bt-management/hooks/use-health-import.js.map +1 -0
  224. package/lib/module/modules/bt-management/hooks/use-measurements.js +51 -0
  225. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -0
  226. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js +20 -0
  227. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  228. package/lib/module/modules/bt-management/hooks/use-paired-devices.js +43 -0
  229. package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  230. package/lib/module/modules/bt-management/index.js +13 -0
  231. package/lib/module/modules/bt-management/index.js.map +1 -1
  232. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -4
  233. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  234. package/lib/module/modules/bt-management/services/bt-manager.js +75 -4
  235. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  236. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +57 -0
  237. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  238. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +111 -3
  239. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  240. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  241. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  242. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  243. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  244. package/lib/module/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.js +9 -3
  245. package/lib/module/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.js.map +1 -1
  246. package/lib/module/modules/bt-management/testing/fake-ble-manager.js +48 -0
  247. package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  248. package/lib/module/modules/bt-management/testing/index.js +5 -0
  249. package/lib/module/modules/bt-management/testing/index.js.map +1 -0
  250. package/lib/module/modules/bt-management/testing/recorded-frames.js +17 -0
  251. package/lib/module/modules/bt-management/testing/recorded-frames.js.map +1 -0
  252. package/lib/module/modules/bt-management/types/bluetooth-error.js +74 -0
  253. package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -0
  254. package/lib/module/modules/bt-management/types/device-connection-event.js +4 -0
  255. package/lib/module/modules/bt-management/types/device-connection-event.js.map +1 -0
  256. package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
  257. package/lib/module/modules/bt-management/types/result-policy.js +4 -0
  258. package/lib/module/modules/bt-management/types/result-policy.js.map +1 -0
  259. package/lib/module/modules/bt-management/utils/result-identity.js +57 -0
  260. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -0
  261. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +8 -2
  262. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  263. package/lib/module/modules/data-sync/services/base-health-sync-service.js +23 -4
  264. package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  265. package/lib/module/modules/data-sync/services/managers/data-processor.js +2 -2
  266. package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
  267. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  268. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  269. package/lib/module/modules/data-sync/utils/retry-save.js +60 -0
  270. package/lib/module/modules/data-sync/utils/retry-save.js.map +1 -0
  271. package/lib/module/modules/helpers/form-items/form-field.js +2 -0
  272. package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
  273. package/lib/module/modules/helpers/index.js +1 -0
  274. package/lib/module/modules/helpers/index.js.map +1 -1
  275. package/lib/module/modules/helpers/utils/s-log.js +4 -12
  276. package/lib/module/modules/helpers/utils/s-log.js.map +1 -1
  277. package/lib/module/modules/helpers/utils/sentry-logger.js +26 -14
  278. package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
  279. package/lib/module/modules/helpers/utils/telemetry.js +131 -0
  280. package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
  281. package/lib/module/modules/image/components/optimized-image.js +25 -3
  282. package/lib/module/modules/image/components/optimized-image.js.map +1 -1
  283. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +20 -11
  284. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  285. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  286. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  287. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  288. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  289. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +42 -17
  290. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  291. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  292. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  293. package/lib/module/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  294. package/lib/module/modules/tile/components/task-icon.js +2 -1
  295. package/lib/module/modules/tile/components/task-icon.js.map +1 -1
  296. package/lib/module/modules/ui/components/background-sync-setting.js +107 -0
  297. package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
  298. package/lib/module/modules/ui/components/bluetooth-state-notice.js +99 -0
  299. package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  300. package/lib/module/modules/ui/components/ecg-strip-viewer.js +159 -0
  301. package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  302. package/lib/module/modules/ui/components/health-import-card.js +124 -0
  303. package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
  304. package/lib/module/modules/ui/components/manual-entry-form.js +117 -0
  305. package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
  306. package/lib/module/modules/ui/components/pairing-flow.js +216 -0
  307. package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
  308. package/lib/module/modules/ui/components/supported-devices-catalog-list.js +93 -0
  309. package/lib/module/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  310. package/lib/module/modules/ui/components/urine-test-result.js +89 -0
  311. package/lib/module/modules/ui/components/urine-test-result.js.map +1 -0
  312. package/lib/module/modules/ui/index.js +13 -0
  313. package/lib/module/modules/ui/index.js.map +1 -0
  314. package/lib/module/modules/ui/types.js +4 -0
  315. package/lib/module/modules/ui/types.js.map +1 -0
  316. package/lib/module/modules/ui/use-ovok-ui.js +45 -0
  317. package/lib/module/modules/ui/use-ovok-ui.js.map +1 -0
  318. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  319. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  320. package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  322. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  323. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +16 -0
  324. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  325. package/lib/typescript/commonjs/src/modules/auth/index.d.ts +4 -0
  326. package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  328. package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  329. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  331. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  333. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  334. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts +4 -0
  335. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  336. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts +5 -0
  337. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts.map +1 -0
  338. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts +3 -0
  339. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts.map +1 -0
  340. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  341. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  342. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  345. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  346. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  347. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  348. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  350. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  352. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  353. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  354. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  356. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +13 -0
  358. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts +11 -0
  360. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  362. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts +29 -0
  363. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  364. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts +1 -0
  365. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  367. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +46 -0
  368. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  369. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  370. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  371. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  372. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  373. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  374. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  375. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  376. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  377. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  378. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  379. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  380. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  381. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  382. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  383. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +13 -0
  384. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  385. package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  386. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  387. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  388. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  389. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  390. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +9 -1
  391. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  392. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  393. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  394. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  395. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.d.ts +2 -0
  396. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.d.ts.map +1 -1
  397. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts +16 -0
  398. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  399. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts +3 -0
  400. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts.map +1 -0
  401. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  402. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +3 -1
  404. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  405. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  406. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  407. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  408. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  409. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  410. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  411. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  412. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  413. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  414. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  415. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts +5 -2
  416. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  417. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  418. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  419. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
  420. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  421. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +8 -0
  422. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  423. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  424. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  425. package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  426. package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  427. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  428. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  429. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  430. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  431. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  432. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  433. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  434. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts +5 -0
  435. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  436. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +4 -1
  437. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts +1 -0
  439. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts.map +1 -1
  440. package/lib/typescript/commonjs/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  441. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  442. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  443. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts +68 -0
  444. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  445. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts +1 -1
  446. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts.map +1 -1
  447. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts +4 -0
  448. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  449. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  450. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  451. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  452. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  454. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  455. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  456. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  457. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  458. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  459. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  460. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  461. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  462. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  463. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  464. package/lib/typescript/commonjs/src/modules/tile/components/task-icon.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  466. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  467. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  468. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  469. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  470. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  471. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts +13 -0
  472. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  473. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts +20 -0
  474. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  475. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts +15 -0
  476. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  477. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  478. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  479. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts +10 -0
  480. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  481. package/lib/typescript/commonjs/src/modules/ui/index.d.ts +11 -0
  482. package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -0
  483. package/lib/typescript/commonjs/src/modules/ui/types.d.ts +24 -0
  484. package/lib/typescript/commonjs/src/modules/ui/types.d.ts.map +1 -0
  485. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts +7 -0
  486. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  487. package/lib/typescript/module/src/index.d.ts +1 -0
  488. package/lib/typescript/module/src/index.d.ts.map +1 -1
  489. package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  490. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  491. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  492. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +16 -0
  493. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  494. package/lib/typescript/module/src/modules/auth/index.d.ts +4 -0
  495. package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
  496. package/lib/typescript/module/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  497. package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  498. package/lib/typescript/module/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  499. package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  500. package/lib/typescript/module/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  501. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  502. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  503. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts +4 -0
  504. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  505. package/lib/typescript/module/src/modules/auth/session/events.d.ts +5 -0
  506. package/lib/typescript/module/src/modules/auth/session/events.d.ts.map +1 -0
  507. package/lib/typescript/module/src/modules/auth/session/index.d.ts +3 -0
  508. package/lib/typescript/module/src/modules/auth/session/index.d.ts.map +1 -0
  509. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  510. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  511. package/lib/typescript/module/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  512. package/lib/typescript/module/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  513. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  514. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  515. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  516. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  517. package/lib/typescript/module/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  518. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  519. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  520. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  521. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  522. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  523. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  524. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  525. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  526. package/lib/typescript/module/src/modules/auth/types/session.d.ts +13 -0
  527. package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -0
  528. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts +11 -0
  529. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  530. package/lib/typescript/module/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  531. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts +29 -0
  532. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  533. package/lib/typescript/module/src/modules/background-sync/index.d.ts +1 -0
  534. package/lib/typescript/module/src/modules/background-sync/index.d.ts.map +1 -1
  535. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  536. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +46 -0
  537. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  538. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  539. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  540. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  541. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  542. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  543. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  544. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  545. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  546. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  547. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  548. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  549. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  550. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  551. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  552. package/lib/typescript/module/src/modules/bt-management/index.d.ts +13 -0
  553. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  554. package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  555. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  556. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  557. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  558. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  559. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +9 -1
  560. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  561. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  562. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  563. package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  564. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.d.ts +2 -0
  565. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.d.ts.map +1 -1
  566. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts +16 -0
  567. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  568. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts +3 -0
  569. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts.map +1 -0
  570. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  571. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  572. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +3 -1
  573. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  574. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  575. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  576. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  577. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  578. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  579. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  580. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  581. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  582. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  583. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  584. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts +5 -2
  585. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  586. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  587. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  588. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
  589. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  590. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +8 -0
  591. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  592. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  593. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  594. package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  595. package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  596. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  597. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  598. package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  599. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  600. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  601. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  602. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  603. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts +5 -0
  604. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  605. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +4 -1
  606. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  607. package/lib/typescript/module/src/modules/helpers/index.d.ts +1 -0
  608. package/lib/typescript/module/src/modules/helpers/index.d.ts.map +1 -1
  609. package/lib/typescript/module/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  610. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  611. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  612. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts +68 -0
  613. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  614. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts +1 -1
  615. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts.map +1 -1
  616. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts +4 -0
  617. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  618. package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  619. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  620. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  621. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  622. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  623. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  624. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  625. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  626. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  627. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  628. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  629. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  630. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  631. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  632. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  633. package/lib/typescript/module/src/modules/tile/components/task-icon.d.ts.map +1 -1
  634. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  635. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  636. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  637. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  638. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  639. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  640. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts +13 -0
  641. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  642. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts +20 -0
  643. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  644. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts +15 -0
  645. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  646. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  647. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  648. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts +10 -0
  649. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  650. package/lib/typescript/module/src/modules/ui/index.d.ts +11 -0
  651. package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -0
  652. package/lib/typescript/module/src/modules/ui/types.d.ts +24 -0
  653. package/lib/typescript/module/src/modules/ui/types.d.ts.map +1 -0
  654. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts +7 -0
  655. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  656. package/package.json +145 -6
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable import/group-exports */
4
+
5
+ const canonicalize = value => {
6
+ if (value instanceof Date) {
7
+ return value.toISOString();
8
+ }
9
+ if (Array.isArray(value)) {
10
+ return value.map(canonicalize);
11
+ }
12
+ if (value && typeof value === "object") {
13
+ return Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, canonicalize(nested)]));
14
+ }
15
+ return value;
16
+ };
17
+ const hash = value => {
18
+ let first = 0x811c9dc5;
19
+ let second = 0x01000193;
20
+ for (let index = 0; index < value.length; index += 1) {
21
+ const code = value.charCodeAt(index);
22
+ first = Math.imul(first ^ code, 0x01000193);
23
+ second = Math.imul(second ^ code + index, 0x811c9dc5);
24
+ }
25
+ return `${(first >>> 0).toString(16).padStart(8, "0")}${(second >>> 0).toString(16).padStart(8, "0")}`;
26
+ };
27
+
28
+ /**
29
+ * Creates an identity that is stable when a device sends its stored history again.
30
+ * Recording IDs, timestamps and indexes are retained in the canonical payload; transient
31
+ * delivery metadata is deliberately not part of the key.
32
+ */
33
+ export const createStableResultId = (deviceData, data) => {
34
+ const deviceIdentity = deviceData.sn || deviceData.id || deviceData.name;
35
+ return `ovok:${hash(JSON.stringify(canonicalize({
36
+ device: deviceIdentity,
37
+ name: deviceData.name,
38
+ data
39
+ })))}`;
40
+ };
41
+ export const reviveResultDates = value => {
42
+ const revive = (current, key) => {
43
+ if (typeof current === "string" && ["recordedAt", "start", "end"].includes(key ?? "")) {
44
+ const date = new Date(current);
45
+ return Number.isNaN(date.getTime()) ? current : date;
46
+ }
47
+ if (Array.isArray(current)) {
48
+ return current.map(item => revive(item));
49
+ }
50
+ if (current && typeof current === "object") {
51
+ return Object.fromEntries(Object.entries(current).map(([childKey, childValue]) => [childKey, revive(childValue, childKey)]));
52
+ }
53
+ return current;
54
+ };
55
+ return revive(value);
56
+ };
57
+ //# sourceMappingURL=result-identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["canonicalize","value","Date","toISOString","Array","isArray","map","Object","fromEntries","entries","sort","left","right","localeCompare","key","nested","hash","first","second","index","length","code","charCodeAt","Math","imul","toString","padStart","createStableResultId","deviceData","data","deviceIdentity","sn","id","name","JSON","stringify","device","reviveResultDates","revive","current","includes","date","Number","isNaN","getTime","item","childKey","childValue"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/result-identity.ts"],"mappings":";;AAAA;;AAMA,MAAMA,YAAY,GAAIC,KAAc,IAAc;EAChD,IAAIA,KAAK,YAAYC,IAAI,EAAE;IACzB,OAAOD,KAAK,CAACE,WAAW,CAAC,CAAC;EAC5B;EAEA,IAAIC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK,CAACK,GAAG,CAACN,YAAY,CAAC;EAChC;EAEA,IAAIC,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACtC,OAAOM,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACR,KAAK,CAAC,CAClBS,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,EAAE,CAACC,KAAK,CAAC,KAAKD,IAAI,CAACE,aAAa,CAACD,KAAK,CAAC,CAAC,CACpDN,GAAG,CAAC,CAAC,CAACQ,GAAG,EAAEC,MAAM,CAAC,KAAK,CAACD,GAAG,EAAEd,YAAY,CAACe,MAAM,CAAC,CAAC,CACvD,CAAC;EACH;EAEA,OAAOd,KAAK;AACd,CAAC;AAED,MAAMe,IAAI,GAAIf,KAAa,IAAa;EACtC,IAAIgB,KAAK,GAAG,UAAU;EACtB,IAAIC,MAAM,GAAG,UAAU;EAEvB,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGlB,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E9B,OAAOG,MAAM,CAACC,KAAK,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,GAAGL,OAAO,GAAGE,IAAI;IACtD;IAEA,IAAIrC,KAAK,CAACC,OAAO,CAACkC,OAAO,CAAC,EAAE;MAC1B,OAAOA,OAAO,CAACjC,GAAG,CAAEuC,IAAI,IAAKP,MAAM,CAACO,IAAI,CAAC,CAAC;IAC5C;IAEA,IAAIN,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC1C,OAAOhC,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAAC8B,OAAO,CAAC,CAACjC,GAAG,CAAC,CAAC,CAACwC,QAAQ,EAAEC,UAAU,CAAC,KAAK,CACtDD,QAAQ,EACRR,MAAM,CAACS,UAAU,EAAED,QAAQ,CAAC,CAC7B,CACH,CAAC;IACH;IAEA,OAAOP,OAAO;EAChB,CAAC;EAED,OAAOD,MAAM,CAACrC,KAAK,CAAC;AACtB,CAAC","ignoreList":[]}
@@ -50,9 +50,15 @@ const useHealthConnectAuthorization = (readIdentifiers, writeIdentifiers, backgr
50
50
  return;
51
51
  }
52
52
  const grantedPermissions = await getGrantedPermissions();
53
- const allGranted = permissionsRef.current.every(permission => grantedPermissions.some(granted => granted.accessType === permission.accessType && granted.recordType === permission.recordType));
53
+ const backgroundPermission = permissionsRef.current.find(permission => permission.recordType === "BackgroundAccessPermission");
54
+ const requiredPermissions = permissionsRef.current.filter(permission => permission !== backgroundPermission);
55
+ const allGranted = requiredPermissions.every(permission => grantedPermissions.some(granted => granted.accessType === permission.accessType && granted.recordType === permission.recordType));
56
+ const backgroundGranted = backgroundPermission ? grantedPermissions.some(granted => granted.accessType === backgroundPermission.accessType && granted.recordType === backgroundPermission.recordType) : undefined;
54
57
  updateStatus({
55
- state: allGranted ? "authorized" : hasRequestedRef.current ? "refused" : "shouldRequest"
58
+ state: allGranted ? "authorized" : hasRequestedRef.current ? "refused" : "shouldRequest",
59
+ ...(backgroundPermission ? {
60
+ backgroundAccess: backgroundGranted ? "authorized" : hasRequestedRef.current ? "refused" : "shouldRequest"
61
+ } : {})
56
62
  });
57
63
  } catch (error) {
58
64
  updateStatus({
@@ -1 +1 @@
1
- {"version":3,"names":["React","AppState","getGrantedPermissions","initialize","requestPermission","Fragment","_Fragment","jsx","_jsx","toError","error","Error","String","useHealthConnectAuthorization","readIdentifiers","writeIdentifiers","backgroundAccess","onStatusChange","status","setStatus","useState","state","hasRequestedRef","useRef","identifiersRef","permissionsRef","current","readPermissions","map","recordType","accessType","writePermissions","backgroundPermissions","updateStatus","useCallback","nextStatus","checkAuthorization","isInitialized","grantedPermissions","allGranted","every","permission","some","granted","requestAuthorization","useEffect","subscription","addEventListener","remove","AndroidHealthConnectAuthorizationProvider","memo","fallback","children","skipRequest","renderManualRequestUI","onAuthorizationStatusChange","authorizationStatus","shouldRenderManualRequestUI","includes","shouldRenderFallback"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/android/android-health-connect-authorization-provider.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,cAAc;AACvC,SACEC,qBAAqB,EACrBC,UAAU,EACVC,iBAAiB,QACZ,6BAA6B;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAWrC,MAAMC,OAAO,GAAIC,KAAc,IAC7BA,KAAK,YAAYC,KAAK,GAAGD,KAAK,GAAG,IAAIC,KAAK,CAACC,MAAM,CAACF,KAAK,CAAC,CAAC;AAE3D,MAAMG,6BAA6B,GAAGA,CACpCC,eAA6B,EAC7BC,gBAA+B,EAC/BC,gBAAgB,GAAG,KAAK,EACxBC,cAA0E,KACP;EACnE,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GACvBnB,KAAK,CAACoB,QAAQ,CAA0C;IACtDC,KAAK,EAAE;EACT,CAAC,CAAC;EAEJ,MAAMC,eAAe,GAAGtB,KAAK,CAACuB,M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ES,qBAAqB,IACrBD,WAAW,IACXG,mBAAmB,CAACnC,KAAK,KAAK,eAAe,EAC7C;MACA;IACF;IAEA,KAAKuB,oBAAoB,CAAC,CAAC;EAC7B,CAAC,EAAE,CACDY,mBAAmB,CAACnC,KAAK,EACzBiC,qBAAqB,EACrBV,oBAAoB,EACpBS,WAAW,CACZ,CAAC;EAEF,IAAIA,WAAW,IAAIG,mBAAmB,CAACnC,KAAK,KAAK,YAAY,EAAE;IAC7D,oBAAOb,IAAA,CAAAF,SAAA;MAAA8C,QAAA,EAAGA;IAAQ,CAAG,CAAC;EACxB;EAEA,IAAIK,2BAA2B,EAAE;IAC/B,OAAOH,qBAAqB,GAAGV,oBAAoB,CAAC;EACtD;EAEA,IAAIe,oBAAoB,EAAE;IACxB,oBAAOnD,IAAA,CAAAF,SAAA;MAAA8C,QAAA,EAAGD,QAAQ,IAAI;IAAI,CAAG,CAAC;EAChC;EAEA,IAAIK,mBAAmB,CAACnC,KAAK,KAAK,SAAS,EAAE;IAC3C,OAAO,IAAI;EACb;EAEA,OAAO,IAAI;AACb,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","AppState","getGrantedPermissions","initialize","requestPermission","Fragment","_Fragment","jsx","_jsx","toError","error","Error","String","useHealthConnectAuthorization","readIdentifiers","writeIdentifiers","backgroundAccess","onStatusChange","status","setStatus","useState","state","hasRequestedRef","useRef","identifiersRef","permissionsRef","current","readPermissions","map","recordType","accessType","writePermissions","backgroundPermissions","updateStatus","useCallback","nextStatus","checkAuthorization","isInitialized","grantedPermissions","backgroundPermission","find","permission","requiredPermissions","filter","allGranted","every","some","granted","backgroundGranted","undefined","requestAuthorization","useEffect","subscription","addEventListener","remove","AndroidHealthConnectAuthorizationProvider","memo","fallback","children","skipRequest","renderManualRequestUI","onAuthorizationStatusChange","authorizationStatus","shouldRenderManualRequestUI","includes","shouldRenderFallback"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/android/android-health-connect-authorization-provider.tsx"],"mappings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e,EAC7C;MACA;IACF;IAEA,KAAK6B,oBAAoB,CAAC,CAAC;EAC7B,CAAC,EAAE,CACDY,mBAAmB,CAACzC,KAAK,EACzBuC,qBAAqB,EACrBV,oBAAoB,EACpBS,WAAW,CACZ,CAAC;EAEF,IAAIA,WAAW,IAAIG,mBAAmB,CAACzC,KAAK,KAAK,YAAY,EAAE;IAC7D,oBAAOb,IAAA,CAAAF,SAAA;MAAAoD,QAAA,EAAGA;IAAQ,CAAG,CAAC;EACxB;EAEA,IAAIK,2BAA2B,EAAE;IAC/B,OAAOH,qBAAqB,GAAGV,oBAAoB,CAAC;EACtD;EAEA,IAAIe,oBAAoB,EAAE;IACxB,oBAAOzD,IAAA,CAAAF,SAAA;MAAAoD,QAAA,EAAGD,QAAQ,IAAI;IAAI,CAAG,CAAC;EAChC;EAEA,IAAIK,mBAAmB,CAACzC,KAAK,KAAK,SAAS,EAAE;IAC3C,OAAO,IAAI;EACb;EAEA,OAAO,IAAI;AACb,CACF,CAAC","ignoreList":[]}
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
 
3
+ /* eslint-disable max-lines */
4
+
5
+ import { recordOvokDuration, recordOvokMetric, withOvokSpan } from "../../helpers/utils/telemetry.js";
6
+ import { withSyncRetries } from "../utils/retry-save.js";
3
7
  import { DataProcessor } from "./managers/data-processor.js";
4
8
  import { StorageManager } from "./managers/storage-manager.js";
5
9
  import { SyncProgressManager } from "./managers/sync-progress-manager.js";
@@ -17,7 +21,9 @@ export class BaseHealthSyncService {
17
21
  }
18
22
  /** One run at a time; see `SyncStateManager.once` for why that matters. */
19
23
  async startSync() {
20
- return this.stateManager.once(() => this.runSync());
24
+ return this.stateManager.once(() => withOvokSpan("health.import", {
25
+ provider: this.getProviderName()
26
+ }, () => this.runSync()));
21
27
  }
22
28
  async runSync() {
23
29
  try {
@@ -88,22 +94,35 @@ export class BaseHealthSyncService {
88
94
  while (hasAnchor && !this.stateManager.shouldStopSync) {
89
95
  const {
90
96
  observationBodies,
91
- hasAnchor: currentHasAnchor
97
+ hasAnchor: currentHasAnchor,
98
+ anchors
92
99
  } = await this.dataProcessor.getObservationBodiesForType(measurementTypeKey, data, latestValidStartDate);
93
100
  hasAnchor = currentHasAnchor;
94
101
  if (this.stateManager.shouldStopSync) {
95
102
  break;
96
103
  }
97
104
  const entries = this.dataProcessor.generateObservationEntries(observationBodies);
98
- this.progressManager.incrementSyncedObservations(measurementTypeKey, entries.length);
99
105
  if (entries.length !== 0 && !this.stateManager.shouldStopSync) {
100
106
  try {
101
- const result = await this.storageManager.saveObservations(entries);
107
+ const startedAt = Date.now();
108
+ const result = await withSyncRetries(() => this.storageManager.saveObservations(entries));
109
+ recordOvokMetric("ovok.health.samples.imported", entries.length, {
110
+ provider: this.getProviderName(),
111
+ measurementTypeKey
112
+ });
113
+ recordOvokDuration("ovok.measurement.save.duration", Date.now() - startedAt, {
114
+ provider: this.getProviderName()
115
+ });
102
116
  this.stateManager.addResult(result);
117
+ this.progressManager.incrementSyncedObservations(measurementTypeKey, entries.length);
118
+ this.storageManager.saveAnchors(anchors);
103
119
  } catch (error) {
120
+ this.progressManager.setStatus(measurementTypeKey, "failed");
104
121
  this.onSyncError(error);
105
122
  return;
106
123
  }
124
+ } else {
125
+ this.storageManager.saveAnchors(anchors);
107
126
  }
108
127
  }
109
128
  this.progressManager.setStatus(measurementTypeKey, this.stateManager.shouldStopSync ? "idle" : "completed");
@@ -1 +1 @@
1
- {"version":3,"names":["DataProcessor","StorageManager","SyncProgressManager","SyncStateManager","BaseHealthSyncService","constructor","props","client","patientId","dataToSync","onSyncError","progressManager","updateProgress","stateManager","storageManager","getProviderName","dataProcessor","chunkSize","getTotalCountsFunction","getDataFromProviderFunction","getConverterFunction","startSync","once","runSync","isInitialized","Error","resume","setNotStartedStatuses","initialDataFetched","initializeSync","processAllDataTypes","setPauseStatuses","pauseReason","error","stopSync","resetAll","reset","shouldStopSync","pauseSync","reason","pause","latestObservationDates","getLatestObservationDates","calculateTotalCounts","key","Object","keys","measurementTypeKey","data","getDataForMeasurementType","latestValidStartDate","getLatestValidStartDate","totalCount","getTotalRecordsCountForType","setTotalObservations","setStatus","syncDataByType","hasAnchor","observationBodies","currentHasAnchor","getObservationBodiesForType","entries","generateObservationEntries","incrementSyncedObservations","length","result","saveObservations","addResult"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/services/base-health-sync-service.ts"],"mappings":";;AAmBA,SAASA,aAAa,QAAQ,8BAA2B;AACzD,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,qCAAkC;AACtE,SAASC,gBAAgB,QAAQ,kCAA+B;AAEhE,OAAO,MAAeC,qBAAqB,CAUzC;EAeAC,WAAWA,CAACC,KAAoC,EAAE;IAChD,IAAI,CAACC,MAAM,GAAGD,KAAK,CAACC,MAAM;IAC1B,IAAI,CAACC,SAAS,GAAGF,KAAK,CAACE,SAAS;IAChC,IAAI,CAACC,UAAU,GAAGH,KAAK,CAACG,UAAU;IAClC,IAAI,CAACC,WAAW,GAAGJ,KAAK,CAACI,WAAW;IAEpC,IAAI,CAACC,eAAe,GAAG,IAAIT,mBAAmB,CAC5CI,KAAK,CAACM,cAAc,EACpBN,KAAK,CAACG,UACR,CAAC;IACD,IAAI,CAACI,YAAY,GAAG,IAAIV,gBAAgB,CAAC,CAAC;IAC1C,IAAI,CAACW,cAAc,GAAG,IAAIb,cAAc,CACtCK,KAAK,CAACC,MAAM,EACZ,IAAI,CAACQ,eAAe,CAAC,CACvB,CAAC;IACD,IAAI,CAACC,aAAa,GAAG,IAAIhB,aAAa,CACpCM,KAAK,CAACC,MAAM,EACZD,KAAK,CAACE,SAAS,EACf,IAAI,CAACO,eAAe,CAAC,CAAC,EACtBT,KAAK,CAACW,SAAS,IAAI,IAAI,EACvB,IAAI,CAACH,cAAc,EACnB,IAAI,CAACI,sBAAsB,CAAC,CAAC,EAC7B,IAAI,CAACC,2BAA2B,CAAC,CAAC,EAClC,IAAI,CAACC,oBAAoB,CAAC,CAC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AAc,CAAC;UAEhC;QACF;MACF;IACF;IAEA,IAAI,CAACtB,eAAe,CAAC4C,SAAS,CAC5BR,kBAAkB,EAClB,IAAI,CAAClC,YAAY,CAACwB,cAAc,GAAG,MAAM,GAAG,WAC9C,CAAC;EACH;EAEQY,yBAAyBA,CAACF,kBAAkC,EAAE;IACpE,OAAO,IAAI,CAACtC,UAAU,CAACsC,kBAAkB,CAAC;EAC5C;AACF","ignoreList":[]}
1
+ {"version":3,"names":["recordOvokDuration","recordOvokMetric","withOvokSpan","withSyncRetries","DataProcessor","StorageManager","SyncProgressManager","SyncStateManager","BaseHealthSyncService","constructor","props","client","patientId","dataToSync","onSyncError","progressManager","updateProgress","stateManager","storageManager","getProviderName","dataProcessor","chunkSize","getTotalCountsFunction","getDataFromProviderFunction","getConverterFunction","startSync","once","provider","runSync","isInitialized","Error","resume","setNotStartedStatuses","initialDataFetched","initializeSync","processAllDataTypes","setPauseStatuses","pauseReason","error","stopSync","resetAll","reset","shouldStopSync","pauseSync","reason","pause","latestObservationDates","getLatestObservationDates","calculateTotalCounts","key","Object","keys","measurementTypeKey","data","getDataForMeasurementType","latestValidStartDate","getLatestValidStartDate","totalCount","getTotalRecordsCountForType","setTotalObservations","setStatus","syncDataByType","hasAnchor","observationBodies","currentHasAnchor","anchors","getObservationBodiesForType","entries","generateObservationEntries","length","startedAt","Date","now","result","saveObservations","addResult","incrementSyncedObservations","saveAnchors"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/services/base-health-sync-service.ts"],"mappings":";;AAAA;;AAUA,SACEA,kBAAkB,EAClBC,gBAAgB,EAChBC,YAAY,QACP,kCAA+B;AAWtC,SAASC,eAAe,QAAQ,wBAAqB;AAErD,SAASC,aAAa,QAAQ,8BAA2B;AACzD,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,qCAAkC;AACtE,SAASC,gBAAgB,QAAQ,kCAA+B;AAEhE,OAAO,MAAeC,qBAAqB,CAUzC;EAeAC,WA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AI,CAACnD,cAAc,CAAC2D,WAAW,CAACZ,OAAO,CAAC;QAC1C,CAAC,CAAC,OAAO3B,KAAK,EAAE;UACd,IAAI,CAACvB,eAAe,CAAC6C,SAAS,CAACR,kBAAkB,EAAE,QAAQ,CAAC;UAC5D,IAAI,CAACtC,WAAW,CAACwB,KAAc,CAAC;UAEhC;QACF;MACF,CAAC,MAAM;QACL,IAAI,CAACpB,cAAc,CAAC2D,WAAW,CAACZ,OAAO,CAAC;MAC1C;IACF;IAEA,IAAI,CAAClD,eAAe,CAAC6C,SAAS,CAC5BR,kBAAkB,EAClB,IAAI,CAACnC,YAAY,CAACyB,cAAc,GAAG,MAAM,GAAG,WAC9C,CAAC;EACH;EAEQY,yBAAyBA,CAACF,kBAAkC,EAAE;IACpE,OAAO,IAAI,CAACvC,UAAU,CAACuC,kBAAkB,CAAC;EAC5C;AACF","ignoreList":[]}
@@ -53,7 +53,6 @@ export class DataProcessor {
53
53
  });
54
54
  }));
55
55
  const newAnchors = results.map(result => result.anchor).flat().filter(Boolean);
56
- this.storageManager.saveAnchors(newAnchors);
57
56
  const allData = results.flatMap(result => result.data);
58
57
  const dataGroups = this.provider === "apple-health" && measurementTypeKey === MeasurementTypeKey.bloodPressure ? Array.from(allData.reduce((groups, sample) => {
59
58
  const value = sample;
@@ -70,7 +69,8 @@ export class DataProcessor {
70
69
  })));
71
70
  return {
72
71
  observationBodies,
73
- hasAnchor: newAnchors.length > 0
72
+ hasAnchor: newAnchors.length > 0,
73
+ anchors: newAnchors
74
74
  };
75
75
  }
76
76
  generateObservationEntries(observationBodies) {
@@ -1 +1 @@
1
- {"version":3,"names":["MeasurementTypeKey","generateObservationEntry","getLatestObservationDatesByCode","getLatestValidStartDate","DataProcessor","constructor","client","patientId","provider","chunkSize","storageManager","getTotalCountsFunction","getDataFromProviderFunction","getConverterFunction","extractCodes","dataToSync","Object","values","flatMap","data","typeIdentifiers","map","identifier","code","getLatestObservationDates","codes","getTotalRecordsCountForType","latestValidStartDate","totalCounts","Promise","all","typeIdentifier","anchor","getAnchor","startDate","toISOString","reduce","acc","count","getObservationBodiesForType","measurementTypeKey","results","newAnchors","result","flat","filter","Boolean","saveAnchors","allData","dataGroups","bloodPressure","Array","from","groups","sample","value","key","Date","getTime","endDate","group","get","push","set","Map","observationBodies","hasAnchor","length","generateObservationEntries","groupedObservationBodies","latestObservationDates"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/services/managers/data-processor.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAqC,YAAY;AAW5E,SAASC,wBAAwB,QAAQ,2CAAwC;AACjF,SAASC,+BAA+B,QAAQ,qDAAkD;AAClG,SAASC,uBAAuB,QAAQ,4CAAyC;AAIjF,OAAO,MAAMC,aAAa,CAMxB;EACAC,WAAWA,CACDC,MAAkB,EAClBC,SAAiB,EACjBC,QAAwB,EACxBC,SAAiB,EACjBC,cAA8B,EAC9BC,sBAEY,EACZC,2BAEgE,EAChEC,oBAEmB,EAC3B;IAAA,KAdQP,MAAkB,GAAlBA,MAAkB;IAAA,KAClBC,SAAiB,GAAjBA,SAAiB;IAAA,KACjBC,QAAwB,GAAxBA,QAAwB;IAAA,KACxBC,SAAiB,GAAjBA,SAAiB;IAAA,KACjBC,cAA8B,GAA9BA,cAA8B;IAAA,KAC9BC,sBAEY,GAFZA,sBAEY;IAAA,KACZC,2BAEgE,GAFhEA,2BAEgE;IAAA,KAChEC,oBAEmB,GAFnBA,oBAEmB;EAC1B;EAEHC,YAAYA,CAACC,UAAuB,EAAqB;IACvD,OAAOC,MAAM,CAACC,MAAM,CAACF,UAAU,CAAC,CAACG,OAAO,CACrCC,IAA8C,IAC7CA,IAAI,EAAEC,eAAe,CAACC,GAAG,CAAEC,UAAU,IAAKA,UAAU,CAACC,IAAI,CAAC,IAAI,EAClE,CAAC;EACH;EAEA,MAAMC,yBAAyBA,CAACT,UAAuB,EAKrD;IACA,MAAMU,KAAK,GAAG,IAAI,CAACX,YAAY,CAACC,UAAU,CAAC;IAE3C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C;MACxBM,IAAI,EAAEyC,KAAK;MACXtD,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBkC;IACF,CAAC,CACH,CACF,CAAC;IAED,OAAO;MAAEyB,iBAAiB;MAAEC,SAAS,EAAExB,UAAU,CAACyB,MAAM,GAAG;IAAE,CAAC;EAChE;EAEAC,0BAA0BA,CAACH,iBAAkC,EAAE;IAC7D,OAAOhE,wBAAwB,CAAC;MAC9BoE,wBAAwB,EAAEJ,iBAAiB;MAC3CzD,QAAQ,EAAE,IAAI,CAACA;IACjB,CAAC,CAAC;EACJ;EAEAL,uBAAuBA,CACrBmE,sBAGE,EACFnD,IAA8C,EAC5B;IAClB,OAAOhB,uBAAuB,CAAC;MAC7BmE,sBAAsB;MACtBnD,IAAI,EAAEA;IACR,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"names":["MeasurementTypeKey","generateObservationEntry","getLatestObservationDatesByCode","getLatestValidStartDate","DataProcessor","constructor","client","patientId","provider","chunkSize","storageManager","getTotalCountsFunction","getDataFromProviderFunction","getConverterFunction","extractCodes","dataToSync","Object","values","flatMap","data","typeIdentifiers","map","identifier","code","getLatestObservationDates","codes","getTotalRecordsCountForType","latestValidStartDate","totalCounts","Promise","all","typeIdentifier","anchor","getAnchor","startDate","toISOString","reduce","acc","count","getObservationBodiesForType","measurementTypeKey","results","newAnchors","result","flat","filter","Boolean","allData","dataGroups","bloodPressure","Array","from","groups","sample","value","key","Date","getTime","endDate","group","get","push","set","Map","observationBodies","hasAnchor","length","anchors","generateObservationEntries","groupedObservationBodies","latestObservationDates"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/services/managers/data-processor.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAqC,YAAY;AAW5E,SAASC,wBAAwB,QAAQ,2CAAwC;AACjF,SAASC,+BAA+B,QAAQ,qDAAkD;AAClG,SAASC,uBAAuB,QAAQ,4CAAyC;AAIjF,OAAO,MAAMC,aAAa,CAMxB;EACAC,WAAWA,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}
@@ -20,7 +20,7 @@ export class SyncProgressManager {
20
20
  for (const key of Object.keys(this.syncData)) {
21
21
  const measurementTypeKey = key;
22
22
  const currentStatus = this.getStatus(measurementTypeKey);
23
- if (currentStatus !== "completed") {
23
+ if (currentStatus !== "completed" && currentStatus !== "failed") {
24
24
  this.setStatus(measurementTypeKey, "paused", reason);
25
25
  }
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"names":["defaultSyncData","syncedObservations","totalObservations","status","SyncProgressManager","syncData","constructor","updateProgress","dataToSync","key","Object","keys","measurementTypeKey","setPauseStatuses","reason","currentStatus","getStatus","setStatus","setNotStartedStatuses","getProgress","done","total","setTotalObservations","notifyProgress","incrementSyncedObservations","count","undefined","resetAll","forEach","progress"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/services/managers/sync-progress-manager.ts"],"mappings":";;AAeA,MAAMA,eAAyB,GAAG;EAChCC,kBAAkB,EAAE,IAAI;EACxBC,iBAAiB,EAAE,IAAI;EACvBC,MAAM,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,mBAAmB,CAI9B;EACQC,QAAQ,GAA8C,CAAC,CAAC;EAEhEC,WAAWA,CACDC,cAAgD,EACxDC,UAAuB,EACvB;IAAA,KAFQD,cAAgD,GAAhDA,cAAgD;IAGxD,KAAK,MAAME,GAAG,IAAIC,MAAM,CAACC,IAAI,CAACH,UAAU,CAAC,EAAE;MACzC,MAAMI,kBAAkB,GAAGH,GAAqB;MAEhD,IAAI,CAACJ,QAAQ,CAACO,kBAAkB,CAAC,GAAG;QAAE,GAAGZ;MAAgB,CAAC;IAC5D;EACF;EAEAa,gBAAgBA,CAACC,MAAwB,EAAE;IACzC,KAAK,MAAML,GAAG,IAAIC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACN,QAAQ,CAAC,EAAE;MAC5C,MAAMO,kBAAkB,GAAGH,GAAqB;MAChD,MAAMM,aAAa,GAAG,IAAI,CAACC,SAAS,CAACJ,kBAAkB,CAAC;MAExD,IAAIG,aA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B,CAAC,CAAET,MAAM,GAAGA,MAAM;IAClD,IAAI,CAACE,QAAQ,CAACO,kBAAkB,CAAC,CAAEE,MAAM,GACvCX,MAAM,KAAK,QAAQ,GAAGW,MAAM,GAAGY,SAAS;IAC1C,IAAI,CAACH,cAAc,CAACX,kBAAkB,EAAET,MAAM,EAAEW,MAAM,CAAC;EACzD;EAEAE,SAASA,CAACJ,kBAAkC,EAAE;IAC5C,OAAO,IAAI,CAACP,QAAQ,CAACO,kBAAkB,CAAC,CAAET,MAAM;EAClD;EAEAwB,QAAQA,CAAA,EAAG;IACTjB,MAAM,CAACC,IAAI,CAAC,IAAI,CAACN,QAAQ,CAAC,CAACuB,OAAO,CAAEnB,GAAG,IAAK;MAC1C,MAAMG,kBAAkB,GAAGH,GAAqB;MAEhD,IAAI,CAACJ,QAAQ,CAACO,kBAAkB,CAAC,GAAG;QAAE,GAAGZ;MAAgB,CAAC;MAC1D,IAAI,CAACuB,cAAc,CAACX,kBAAkB,EAAE,MAAM,CAAC;IACjD,CAAC,CAAC;EACJ;EAEQW,cAAcA,CACpBX,kBAAkC,EAClCT,MAA8B,EAC9BW,MAAwB,EACxB;IACA,IAAI,CAACP,cAAc,CAAC;MAClBK,kBAAkB;MAClBT,MAAM;MACN,IAAIA,MAAM,KAAK,QAAQ,IAAIW,MAAM,GAAG;QAAEA;MAAO,CAAC,GAAG,CAAC,CAAC,CAAC;MACpDe,QAAQ,EAAE,IAAI,CAACV,WAAW,CAACP,kBAAkB;IAC/C,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"names":["defaultSyncData","syncedObservations","totalObservations","status","SyncProgressManager","syncData","constructor","updateProgress","dataToSync","key","Object","keys","measurementTypeKey","setPauseStatuses","reason","currentStatus","getStatus","setStatus","setNotStartedStatuses","getProgress","done","total","setTotalObservations","notifyProgress","incrementSyncedObservations","count","undefined","resetAll","forEach","progress"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/services/managers/sync-progress-manager.ts"],"m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,IAAI,CAACJ,QAAQ,CAACO,kBAAkB,CAAC,GAAG;QAAE,GAAGZ;MAAgB,CAAC;MAC1D,IAAI,CAACuB,cAAc,CAACX,kBAAkB,EAAE,MAAM,CAAC;IACjD,CAAC,CAAC;EACJ;EAEQW,cAAcA,CACpBX,kBAAkC,EAClCT,MAA8B,EAC9BW,MAAwB,EACxB;IACA,IAAI,CAACP,cAAc,CAAC;MAClBK,kBAAkB;MAClBT,MAAM;MACN,IAAIA,MAAM,KAAK,QAAQ,IAAIW,MAAM,GAAG;QAAEA;MAAO,CAAC,GAAG,CAAC,CAAC,CAAC;MACpDe,QAAQ,EAAE,IAAI,CAACV,WAAW,CAACP,kBAAkB;IAC/C,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ const RETRY_DELAYS_MS = [1000, 4000, 16000];
4
+ function asRecord(value) {
5
+ return typeof value === "object" && value !== null ? value : undefined;
6
+ }
7
+ function getStatus(error) {
8
+ const record = asRecord(error);
9
+ const response = asRecord(record?.response);
10
+ const statuses = [record?.status, record?.statusCode, response?.status, ...(Array.isArray(record?.entry) ? record.entry.map(entry => asRecord(entry)?.response).map(asRecord) : [])];
11
+ for (const status of statuses) {
12
+ const numberStatus = Number(status);
13
+ if (Number.isInteger(numberStatus) && numberStatus > 0) {
14
+ return numberStatus;
15
+ }
16
+ }
17
+ return undefined;
18
+ }
19
+ function getRetryAfterMs(error) {
20
+ const record = asRecord(error);
21
+ const response = asRecord(record?.response);
22
+ const retryAfter = record?.retryAfterMs ?? response?.retryAfterMs;
23
+ if (typeof retryAfter === "number" && retryAfter >= 0) {
24
+ return retryAfter;
25
+ }
26
+ const headers = asRecord(response?.headers);
27
+ const header = headers?.["retry-after"] ?? headers?.["Retry-After"];
28
+ if (typeof header !== "string") {
29
+ return undefined;
30
+ }
31
+ const seconds = Number(header);
32
+ return Number.isFinite(seconds) && seconds >= 0 ? seconds * 1000 : undefined;
33
+ }
34
+ function isRetryableSyncError(error) {
35
+ const status = getStatus(error);
36
+ if (status !== undefined) {
37
+ return status === 429 || status >= 500;
38
+ }
39
+ const message = error instanceof Error ? error.message : String(error);
40
+ return error instanceof TypeError || /network|fetch|timeout|connection|offline|unreachable/i.test(message);
41
+ }
42
+ function getSyncRetryDelayMs(error, retryIndex) {
43
+ return Math.max(RETRY_DELAYS_MS[retryIndex] ?? RETRY_DELAYS_MS.at(-1), getRetryAfterMs(error) ?? 0);
44
+ }
45
+ async function withSyncRetries(operation) {
46
+ for (let retryIndex = 0;; retryIndex += 1) {
47
+ try {
48
+ return await operation();
49
+ } catch (error) {
50
+ if (!isRetryableSyncError(error) || retryIndex >= RETRY_DELAYS_MS.length) {
51
+ throw error;
52
+ }
53
+ await new Promise(resolve => {
54
+ setTimeout(resolve, getSyncRetryDelayMs(error, retryIndex));
55
+ });
56
+ }
57
+ }
58
+ }
59
+ export { getSyncRetryDelayMs, isRetryableSyncError, withSyncRetries };
60
+ //# sourceMappingURL=retry-save.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RETRY_DELAYS_MS","asRecord","value","undefined","getStatus","error","record","response","statuses","status","statusCode","Array","isArray","entry","map","numberStatus","Number","isInteger","getRetryAfterMs","retryAfter","retryAfterMs","headers","header","seconds","isFinite","isRetryableSyncError","message","Error","String","TypeError","test","getSyncRetryDelayMs","retryIndex","Math","max","at","withSyncRetries","operation","length","Promise","resolve","setTimeout"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/retry-save.ts"],"mappings":";;AAAA,MAAMA,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU;AAIpD,SAASC,QAAQA,CAACC,KAAc,EAA2B;EACzD,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,GAC7CA,KAAK,GACNC,SAAS;AACf;AAEA,SAASC,SAASA,CAACC,KAAc,EAAsB;EACrD,MAAMC,MAAM,GAAGL,QAAQ,CAACI,KAAK,C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A,SAASD,mBAAmB,EAAEN,oBAAoB,EAAEW,eAAe","ignoreList":[]}
@@ -11,6 +11,7 @@ export const FormField = /*#__PURE__*/React.memo(({
11
11
  name,
12
12
  context,
13
13
  containerStyle,
14
+ inputRef,
14
15
  testID,
15
16
  ...props
16
17
  }) => {
@@ -38,6 +39,7 @@ export const FormField = /*#__PURE__*/React.memo(({
38
39
  testID: testID,
39
40
  children: [/*#__PURE__*/_jsx(TextInput, {
40
41
  ...props,
42
+ ref: inputRef,
41
43
  mode: "outlined",
42
44
  autoCapitalize: "none",
43
45
  value: value,
@@ -1 +1 @@
1
- {"version":3,"names":["getIn","React","useTranslation","View","HelperText","TextInput","useAppTheme","jsx","_jsx","jsxs","_jsxs","FormField","memo","name","context","containerStyle","testID","props","t","theme","values","errors","touched","handleChange","handleBlur","useContext","value","useMemo","error","onBlur","e","style","gap","spacing","children","mode","autoCapitalize","roundness","borderRadius","onChangeText","onFocus","undefined","type"],"sourceRoot":"../../../../../src","sources":["modules/helpers/form-items/form-field.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAAmB,QAAQ;AACzC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAGEC,IAAI,QAEC,cAAc;AACrB,SAASC,UAAU,EAAEC,SAAS,QAA6B,oBAAoB;AAE/E,SAASC,WAAW,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAa1C,OAAO,MAAMC,SAAS,gBAAGV,KAAK,CAACW,IAAI,CACjC,CAAC;EAAEC,IAAI;EAAEC,OAAO;EAAEC,cAAc;EAAEC,MAAM;EAAE,GAAGC;AAAsB,CAAC,KAAK;EACvE,MAAM;IAAEC;EAAE,CAAC,GAAGhB,cAAc,CAAC,CAAC;EAC9B,MAAMiB,KAAK,GAAGb,WAAW,CAAC,CAAC;EAE3B,MAAM;IAAEc,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAA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BACJpB,IAAA,CAACJ,UAAU;MACTsC,IAAI,EAAC,OAAO;MACZ1B,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,QAAQ,GAAGyB,SAAU;MAAAP,QAAA,EAE9ChB,CAAC,CAACU,KAAK;IAAC,CACC,CAAC,GACX,IAAI;EAAA,CACJ,CAAC;AAEX,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getIn","React","useTranslation","View","HelperText","TextInput","useAppTheme","jsx","_jsx","jsxs","_jsxs","FormField","memo","name","context","containerStyle","inputRef","testID","props","t","theme","values","errors","touched","handleChange","handleBlur","useContext","value","useMemo","error","onBlur","e","style","gap","spacing","children","ref","mode","autoCapitalize","roundness","borderRadius","onChangeText","onFocus","undefined","type"],"sourceRoot":"../../../../../src","sources":["modules/helpers/form-items/form-field.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAAmB,QAAQ;AACzC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAGEC,IAAI,QAEC,cAAc;AACrB,SAASC,UAAU,EAAEC,SAAS,QAA6B,oBAAoB;AAE/E,SAASC,WAAW,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAc1C,OAAO,MAAMC,SAAS,gBAAGV,KAAK,CAACW,IAAI,CACjC,CAAC;EACCC,IAAI;EACJC,OAAO;EACPC,cAAc;EACdC,QAAQ;EACRC,MAAM;EACN,GAAGC;AACW,CAAC,KAAK;EACpB,MAAM;IAAEC;EAAE,CAAC,GAAGjB,cAAc,CAAC,CAAC;EAC9B,MAAMkB,KAAK,GAAGd,WAAW,CAAC,CAAC;EAE3B,MAAM;IAAEe,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC,YAAY;IAAEC;EAAW,CAAC,GACzDxB,KAAK,CAACyB,UAAU,CAACZ,OAAO,CAAiC;EAE3D,MAAMa,KAAK,GAAG1B,KAAK,CAAC2B,O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AGA,MAAM,QAAQ,GAAG0B,SAAU;MAAAR,QAAA,EAE9ChB,CAAC,CAACU,KAAK;IAAC,CACC,CAAC,GACX,IAAI;EAAA,CACJ,CAAC;AAEX,CACF,CAAC","ignoreList":[]}
@@ -5,6 +5,7 @@ export * from "./form-items/form-field.js";
5
5
  export * from "./form-items/form-select.js";
6
6
  export * from "./form-items/form-date-field.js";
7
7
  export * from "./utils/s-log.js";
8
+ export * from "./utils/telemetry.js";
8
9
  export * from "./utils/with-animated.js";
9
10
  export { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BottomSheetModalProvider"],"sourceRoot":"../../../../src","sources":["modules/helpers/index.tsx"],"mappings":";;AAAA,cAAc,kBAAe;AAE7B,cAAc,4BAAyB;AAEvC,cAAc,6BAA0B;AAExC,cAAc,iCAA8B;AAE5C,cAAc,kBAAe;AAE7B,cAAc,0BAAuB;AACrC,SAASA,wBAAwB,QAAQ,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["BottomSheetModalProvider"],"sourceRoot":"../../../../src","sources":["modules/helpers/index.tsx"],"mappings":";;AAAA,cAAc,kBAAe;AAE7B,cAAc,4BAAyB;AAEvC,cAAc,6BAA0B;AAExC,cAAc,iCAA8B;AAE5C,cAAc,kBAAe;AAE7B,cAAc,sBAAmB;AAEjC,cAAc,0BAAuB;AACrC,SAASA,wBAAwB,QAAQ,sBAAsB","ignoreList":[]}
@@ -1,20 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import * as Sentry from "@sentry/react-native";
3
+ import { sentryLogger } from "./sentry-logger.js";
4
4
  export const slog = (error, scope,
5
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
6
  additionalData = {}, level = "error") => {
7
- if (__DEV__) {
8
- // eslint-disable-next-line no-console
9
- console.log(error, scope, JSON.stringify(additionalData, null, 2), level);
10
- return;
11
- }
12
- Sentry.captureException(error, {
13
- extra: {
14
- scope,
15
- additionalData
16
- },
17
- level
7
+ sentryLogger(level, scope, {
8
+ error,
9
+ additionalData
18
10
  });
19
11
  };
20
12
  //# sourceMappingURL=s-log.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Sentry","slog","error","scope","additionalData","level","__DEV__","console","log","JSON","stringify","captureException","extra"],"sourceRoot":"../../../../../src","sources":["modules/helpers/utils/s-log.ts"],"mappings":";;AAAA,OAAO,KAAKA,MAAM,MAAM,sBAAsB;AAE9C,OAAO,MAAMC,IAAI,GAAGA,CAElBC,KAAU,EACVC,KAAa;AACb;AACAC,cAAmC,GAAG,CAAC,CAAC,EACxCC,KAA6C,GAAG,OAAO,KACpD;EACH,IAAIC,OAAO,EAAE;IACX;IACAC,OAAO,CAACC,GAAG,CAACN,KAAK,EAAEC,KAAK,EAAEM,IAAI,CAACC,SAAS,CAACN,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,EAAEC,KAAK,CAAC;IAEzE;EACF;EAEAL,MAAM,CAACW,gBAAgB,CAACT,KAAK,EAAE;IAC7BU,KAAK,EAAE;MACLT,KAAK;MACLC;IACF,CAAC;IACDC;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["sentryLogger","slog","error","scope","additionalData","level"],"sourceRoot":"../../../../../src","sources":["modules/helpers/utils/s-log.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,oBAAiB;AAE9C,OAAO,MAAMC,IAAI,GAAGA,CAElBC,KAAU,EACVC,KAAa;AACb;AACAC,cAAmC,GAAG,CAAC,CAAC,EACxCC,KAA6C,GAAG,OAAO,KACpD;EACHL,YAAY,CAACK,KAAK,EAAEF,KAAK,EAAE;IAAED,KAAK;IAAEE;EAAe,CAAC,CAAC;AACvD,CAAC","ignoreList":[]}
@@ -1,20 +1,32 @@
1
1
  "use strict";
2
2
 
3
3
  /* eslint-disable no-console */
4
- import * as Sentry from "@sentry/react-native";
5
- export const sentryLogger = (type, message, extra = {}) => {
6
- if (__DEV__) {
7
- console.log("Sentry logger:", message, JSON.stringify(extra, null, 2));
8
- return;
4
+ /* eslint-disable import/group-exports */
5
+
6
+ import { emitOvokLog, recordOvokMetric, sanitizeOvokTelemetryAttributes } from "./telemetry.js";
7
+ const consoleLogger = (level, message, extra = {}) => {
8
+ const method = level === "warning" ? "warn" : level === "trace" ? "debug" : level;
9
+ const log = method === "fatal" ? console.error : console[method] ?? console.log;
10
+ log(`[Ovok] ${message}`, extra);
11
+ };
12
+ let configuredLogger;
13
+
14
+ /** Configure the SDK logger. The default is the console and OpenTelemetry when present. */
15
+ export const configureOvokLogger = logger => {
16
+ configuredLogger = logger;
17
+ };
18
+ export const ovokLogger = (type, message, extra = {}) => {
19
+ const safeExtra = sanitizeOvokTelemetryAttributes(extra);
20
+ emitOvokLog(type, message, safeExtra);
21
+ if (type === "error" || type === "fatal") {
22
+ recordOvokMetric("ovok.errors", 1, {
23
+ errorCode: typeof extra.errorCode === "string" ? extra.errorCode : "unknown"
24
+ });
9
25
  }
10
- const functionMap = {
11
- error: Sentry.logger.error,
12
- warning: Sentry.logger.warn,
13
- info: Sentry.logger.info,
14
- debug: Sentry.logger.debug,
15
- fatal: Sentry.logger.fatal,
16
- trace: Sentry.logger.trace
17
- };
18
- functionMap[type](message, extra);
26
+ const logger = configuredLogger ?? consoleLogger;
27
+ logger(type, message, safeExtra);
19
28
  };
29
+
30
+ /** @deprecated Use ovokLogger. Kept as a source-compatible alias for existing apps. */
31
+ export const sentryLogger = ovokLogger;
20
32
  //# sourceMappingURL=sentry-logger.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Sentry","sentryLogger","type","message","extra","__DEV__","console","log","JSON","stringify","functionMap","error","logger","warning","warn","info","debug","fatal","trace"],"sourceRoot":"../../../../../src","sources":["modules/helpers/utils/sentry-logger.ts"],"mappings":";;AAAA;AACA,OAAO,KAAKA,MAAM,MAAM,sBAAsB;AAE9C,OAAO,MAAMC,YAAY,GAAGA,CAC1BC,IAAgE,EAChEC,OAAe,EACfC,KAA8B,GAAG,CAAC,CAAC,KAChC;EACH,IAAIC,OAAO,EAAE;IACXC,OAAO,CAACC,GAAG,CAAC,gBAAgB,EAAEJ,OAAO,EAAEK,IAAI,CAACC,SAAS,CAACL,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEtE;EACF;EACA,MAAMM,WAAW,GAAG;IAClBC,KAAK,EAAEX,MAAM,CAACY,MAAM,CAACD,KAAK;IAC1BE,OAAO,EAAEb,MAAM,CAACY,MAAM,CAACE,IAAI;IAC3BC,IAAI,EAAEf,MAAM,CAACY,MAAM,CAACG,IAAI;IACxBC,KAAK,EAAEhB,MAAM,CAACY,MAAM,CAACI,KAAK;IAC1BC,KAAK,EAAEjB,MAAM,CAACY,MAAM,CAACK,KAAK;IAC1BC,KAAK,EAAElB,MAAM,CAACY,MAAM,CAACM;EACvB,CAAC;EAEDR,WAAW,CAACR,IAAI,CAAC,CAACC,OAAO,EAAEC,KAAK,CAAC;AACnC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["emitOvokLog","recordOvokMetric","sanitizeOvokTelemetryAttributes","consoleLogger","level","message","extra","method","log","console","error","configuredLogger","configureOvokLogger","logger","ovokLogger","type","safeExtra","errorCode","sentryLogger"],"sourceRoot":"../../../../../src","sources":["modules/helpers/utils/sentry-logger.ts"],"mappings":";;AAAA;AACA;;AAEA,SAASA,WAAW,EAAEC,gBAAgB,EAAEC,+BAA+B,QAAQ,gBAAa;AAgB5F,MAAMC,aAAyB,GAAGA,CAACC,KAAK,EAAEC,OAAO,EAAEC,KAAK,GAAG,CAAC,CAAC,KAAK;EAChE,MAAMC,MAAM,GAAGH,KAAK,KAAK,SAAS,GAAG,MAAM,GAAGA,KAAK,KAAK,OAAO,GAAG,OAAO,GAAGA,KAAK;EAEjF,MAAMI,GAAG,GACPD,MAAM,KAAK,OAAO,GACdE,OAAO,CAACC,KAAK,GACbD,OAAO,CAACF,MAAM,CAAwC,IAAIE,OAAO,CAACD,GAAG;EAE3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