@ovok/native 1.5.6 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -19
- package/android/src/main/AndroidManifest.xml +1 -20
- package/app.plugin.js +181 -0
- package/lib/commonjs/index.js +5 -104
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
- package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js +23 -0
- package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js +105 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -0
- package/lib/commonjs/modules/auth/index.js +44 -0
- package/lib/commonjs/modules/auth/index.js.map +1 -1
- package/lib/commonjs/modules/auth/logout-button/components/logout-button.js +5 -2
- package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/inputs.js +50 -1
- package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-button.js +4 -0
- package/lib/commonjs/modules/auth/register/components/form/register-button.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +6 -0
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js +12 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/components/session-list.js +82 -0
- package/lib/commonjs/modules/auth/session/components/session-list.js.map +1 -0
- package/lib/commonjs/modules/auth/session/events.js +19 -0
- package/lib/commonjs/modules/auth/session/events.js.map +1 -0
- package/lib/commonjs/modules/auth/session/index.js +13 -0
- package/lib/commonjs/modules/auth/session/index.js.map +1 -0
- package/lib/commonjs/modules/auth/session/types/session-list-props.js +6 -0
- package/lib/commonjs/modules/auth/session/types/session-list-props.js.map +1 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js +26 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js +58 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js +13 -5
- package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
- package/lib/commonjs/modules/auth/types/session.js +2 -0
- package/lib/commonjs/modules/auth/types/session.js.map +1 -0
- package/lib/commonjs/modules/auth/utils/rate-limit.js +37 -0
- package/lib/commonjs/modules/auth/utils/rate-limit.js.map +1 -0
- package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
- package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/background-sync/background-safe-storage.js +76 -0
- package/lib/commonjs/modules/background-sync/background-safe-storage.js.map +1 -0
- package/lib/commonjs/modules/background-sync/index.js +11 -0
- package/lib/commonjs/modules/background-sync/index.js.map +1 -1
- package/lib/commonjs/modules/bt-device/index.js +0 -22
- package/lib/commonjs/modules/bt-device/index.js.map +1 -1
- package/lib/commonjs/modules/bt-device-instructions/index.js +39 -0
- package/lib/commonjs/modules/bt-device-instructions/index.js.map +1 -0
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +64 -0
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js +1 -0
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +95 -0
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +51 -0
- package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +51 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js +40 -0
- package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-health-import.js +82 -0
- package/lib/commonjs/modules/bt-management/hooks/use-health-import.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +79 -0
- package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js +33 -0
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js +58 -0
- package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js +21 -0
- package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js.map +1 -0
- package/lib/commonjs/modules/bt-management/index.js +154 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +91 -22
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +107 -4
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +9 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
- package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
- package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/push-notification.js +39 -0
- package/lib/commonjs/modules/bt-management/services/push-notification.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +132 -0
- package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/index.js +28 -0
- package/lib/commonjs/modules/bt-management/testing/index.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/recorded-frames.js +23 -0
- package/lib/commonjs/modules/bt-management/testing/recorded-frames.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +82 -0
- package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-connection-event.js +6 -0
- package/lib/commonjs/modules/bt-management/types/device-connection-event.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/result-policy.js +6 -0
- package/lib/commonjs/modules/bt-management/types/result-policy.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/result-identity.js +63 -0
- package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -0
- package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
- package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +29 -4
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +2 -2
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js +29 -21
- package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/retry-save.js +99 -0
- package/lib/commonjs/modules/data-sync/utils/retry-save.js.map +1 -0
- package/lib/commonjs/modules/helpers/form-items/form-field.js +2 -0
- package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/commonjs/modules/helpers/index.js +23 -4
- package/lib/commonjs/modules/helpers/index.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/s-log.js +4 -13
- package/lib/commonjs/modules/helpers/utils/s-log.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/sentry-logger.js +27 -17
- package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/telemetry.js +230 -0
- package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
- package/lib/commonjs/modules/image/components/optimized-image.js +31 -6
- package/lib/commonjs/modules/image/components/optimized-image.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +18 -9
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
- package/lib/commonjs/modules/tile/components/task-icon.js +2 -1
- package/lib/commonjs/modules/tile/components/task-icon.js.map +1 -1
- package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js +4 -1
- package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js.map +1 -1
- package/lib/commonjs/modules/ui/components/background-sync-setting.js +123 -0
- package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +119 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
- package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +175 -0
- package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
- package/lib/commonjs/modules/ui/components/health-import-card.js +141 -0
- package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
- package/lib/commonjs/modules/ui/components/manual-entry-form.js +136 -0
- package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
- package/lib/commonjs/modules/ui/components/pairing-flow.js +247 -0
- package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
- package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +107 -0
- package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
- package/lib/commonjs/modules/ui/components/urine-test-result.js +99 -0
- package/lib/commonjs/modules/ui/components/urine-test-result.js.map +1 -0
- package/lib/commonjs/modules/ui/index.js +116 -0
- package/lib/commonjs/modules/ui/index.js.map +1 -0
- package/lib/commonjs/modules/ui/types.js +6 -0
- package/lib/commonjs/modules/ui/types.js.map +1 -0
- package/lib/commonjs/modules/ui/use-ovok-ui.js +51 -0
- package/lib/commonjs/modules/ui/use-ovok-ui.js.map +1 -0
- package/lib/module/index.js +3 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
- package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js +17 -0
- package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
- package/lib/module/modules/auth/hooks/use-session.js +99 -0
- package/lib/module/modules/auth/hooks/use-session.js.map +1 -0
- package/lib/module/modules/auth/index.js +4 -0
- package/lib/module/modules/auth/index.js.map +1 -1
- package/lib/module/modules/auth/logout-button/components/logout-button.js +5 -2
- package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/inputs.js +50 -1
- package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-button.js +4 -0
- package/lib/module/modules/auth/register/components/form/register-button.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-form-provider.js +6 -0
- package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/inputs.js +12 -0
- package/lib/module/modules/auth/reset-password/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
- package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/components/session-list.js +76 -0
- package/lib/module/modules/auth/session/components/session-list.js.map +1 -0
- package/lib/module/modules/auth/session/events.js +13 -0
- package/lib/module/modules/auth/session/events.js.map +1 -0
- package/lib/module/modules/auth/session/index.js +4 -0
- package/lib/module/modules/auth/session/index.js.map +1 -0
- package/lib/module/modules/auth/session/types/session-list-props.js +4 -0
- package/lib/module/modules/auth/session/types/session-list-props.js.map +1 -0
- package/lib/module/modules/auth/sign-in/components/form/inputs.js +26 -0
- package/lib/module/modules/auth/sign-in/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
- package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js +52 -0
- package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
- package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
- package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/signin-button.js +13 -5
- package/lib/module/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
- package/lib/module/modules/auth/types/session.js +2 -0
- package/lib/module/modules/auth/types/session.js.map +1 -0
- package/lib/module/modules/auth/utils/rate-limit.js +31 -0
- package/lib/module/modules/auth/utils/rate-limit.js.map +1 -0
- package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
- package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/module/modules/background-sync/background-safe-storage.js +71 -0
- package/lib/module/modules/background-sync/background-safe-storage.js.map +1 -0
- package/lib/module/modules/background-sync/index.js +1 -0
- package/lib/module/modules/background-sync/index.js.map +1 -1
- package/lib/module/modules/bt-device/index.js +0 -2
- package/lib/module/modules/bt-device/index.js.map +1 -1
- package/lib/module/modules/bt-device-instructions/index.js +6 -0
- package/lib/module/modules/bt-device-instructions/index.js.map +1 -0
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +58 -0
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js +1 -0
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/runtime-context.js +86 -0
- package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-background-sync.js +45 -0
- package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +45 -0
- package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-device-connection.js +34 -0
- package/lib/module/modules/bt-management/hooks/use-device-connection.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-health-import.js +76 -0
- package/lib/module/modules/bt-management/hooks/use-health-import.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-measurements.js +73 -0
- package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-nearby-devices.js +27 -0
- package/lib/module/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-paired-devices.js +52 -0
- package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-scan-control.js +16 -0
- package/lib/module/modules/bt-management/hooks/use-scan-control.js.map +1 -0
- package/lib/module/modules/bt-management/index.js +14 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +91 -22
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +107 -4
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +9 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
- package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
- package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
- package/lib/module/modules/bt-management/services/push-notification.js +34 -0
- package/lib/module/modules/bt-management/services/push-notification.js.map +1 -0
- package/lib/module/modules/bt-management/testing/fake-ble-manager.js +127 -0
- package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
- package/lib/module/modules/bt-management/testing/index.js +5 -0
- package/lib/module/modules/bt-management/testing/index.js.map +1 -0
- package/lib/module/modules/bt-management/testing/recorded-frames.js +17 -0
- package/lib/module/modules/bt-management/testing/recorded-frames.js.map +1 -0
- package/lib/module/modules/bt-management/types/bluetooth-error.js +76 -0
- package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-connection-event.js +4 -0
- package/lib/module/modules/bt-management/types/device-connection-event.js.map +1 -0
- package/lib/module/modules/bt-management/types/result-policy.js +4 -0
- package/lib/module/modules/bt-management/types/result-policy.js.map +1 -0
- package/lib/module/modules/bt-management/utils/result-identity.js +57 -0
- package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -0
- package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
- package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
- package/lib/module/modules/data-sync/services/base-health-sync-service.js +29 -4
- package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/data-processor.js +2 -2
- package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
- package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
- package/lib/module/modules/data-sync/utils/generate-observation-entry.js +29 -21
- package/lib/module/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
- package/lib/module/modules/data-sync/utils/retry-save.js +92 -0
- package/lib/module/modules/data-sync/utils/retry-save.js.map +1 -0
- package/lib/module/modules/helpers/form-items/form-field.js +2 -0
- package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/module/modules/helpers/index.js +2 -1
- package/lib/module/modules/helpers/index.js.map +1 -1
- package/lib/module/modules/helpers/utils/s-log.js +4 -12
- package/lib/module/modules/helpers/utils/s-log.js.map +1 -1
- package/lib/module/modules/helpers/utils/sentry-logger.js +25 -14
- package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
- package/lib/module/modules/helpers/utils/telemetry.js +218 -0
- package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
- package/lib/module/modules/image/components/optimized-image.js +32 -7
- package/lib/module/modules/image/components/optimized-image.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +20 -11
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
- package/lib/module/modules/tile/components/task-icon.js +2 -1
- package/lib/module/modules/tile/components/task-icon.js.map +1 -1
- package/lib/module/modules/tile/constants/measurement-icon-svg.js +4 -1
- package/lib/module/modules/tile/constants/measurement-icon-svg.js.map +1 -1
- package/lib/module/modules/ui/components/background-sync-setting.js +117 -0
- package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js +113 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
- package/lib/module/modules/ui/components/ecg-strip-viewer.js +169 -0
- package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
- package/lib/module/modules/ui/components/health-import-card.js +135 -0
- package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
- package/lib/module/modules/ui/components/manual-entry-form.js +130 -0
- package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
- package/lib/module/modules/ui/components/pairing-flow.js +241 -0
- package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
- package/lib/module/modules/ui/components/supported-devices-catalog-list.js +101 -0
- package/lib/module/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
- package/lib/module/modules/ui/components/urine-test-result.js +94 -0
- package/lib/module/modules/ui/components/urine-test-result.js.map +1 -0
- package/lib/module/modules/ui/index.js +13 -0
- package/lib/module/modules/ui/index.js.map +1 -0
- package/lib/module/modules/ui/types.js +4 -0
- package/lib/module/modules/ui/types.js.map +1 -0
- package/lib/module/modules/ui/use-ovok-ui.js +45 -0
- package/lib/module/modules/ui/use-ovok-ui.js.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +0 -9
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
- package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
- package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts +31 -0
- package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts +0 -2
- package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts +5 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/helpers/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/s-log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts +69 -0
- package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/tile/components/task-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/types.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/ui/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +0 -9
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +16 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/index.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/events.d.ts +5 -0
- package/lib/typescript/module/src/modules/auth/session/events.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/index.d.ts +3 -0
- package/lib/typescript/module/src/modules/auth/session/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts +5 -0
- package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
- package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
- package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
- package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/types/session.d.ts +10 -0
- package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts +11 -0
- package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts +31 -0
- package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/background-sync/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/background-sync/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/index.d.ts +0 -2
- package/lib/typescript/module/src/modules/bt-device/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
- package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts +5 -2
- package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
- package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts +6 -0
- package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +4 -1
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/index.d.ts +2 -1
- package/lib/typescript/module/src/modules/helpers/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/s-log.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
- package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts +69 -0
- package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts +1 -1
- package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts +4 -0
- package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/tile/components/task-icon.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
- package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts +9 -0
- package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
- package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts +13 -0
- package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts +21 -0
- package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts +15 -0
- package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
- package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts +10 -0
- package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts +11 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/types.d.ts +24 -0
- package/lib/typescript/module/src/modules/ui/types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts +7 -0
- package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
- package/package.json +146 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useHealthImport","types","background","adapter","enabled","setEnabled","useState","statusByType","setStatusByType","error","setError","typesKey","useMemo","join","configRef","useRef","current","refresh","useCallback","currentAdapter","currentTypes","entries","Promise","allSettled","map","type","getStatus","rejected","find","entry","status","next","forEach","value","length","every","reason","Error","String","undefined","useEffect","setEnabledForTypes","currentBackground","request","cause","nextError","notShared","filter"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-health-import.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAO9B,OAAO,MAAMC,eAAe,GAAGA,CAAuB;EACpDC,KAAK;EACLC,UAAU,GAAG,KAAK;EAClBC;AAKF,CAAC,KAMI;EACH,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAAC,KAAK,CAAC;EACnD,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGT,KAAK,CAACO,QAAQ,CAAyB,CAAC,CAAC,CAAC;EAClF,MAAM,CAACG,KAAK,EAAEC,QAAQ,CAAC,GAAGX,KAAK,CAACO,QAAQ,CAAQ,CAAC;EACjD,MAAMK,QAAQ,GAAGZ,KAAK,CAACa,OAAO,CAAC,MAAMX,KAAK,CAAC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AEuC,SAAS;IAAErC;EAAM,CAAC;AAC3G,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useBluetoothRuntime } from "./runtime-context.js";
|
|
5
|
+
export const useMeasurements = (onResult, {
|
|
6
|
+
policy = "all",
|
|
7
|
+
maxResults = 100
|
|
8
|
+
} = {}) => {
|
|
9
|
+
const runtime = useBluetoothRuntime();
|
|
10
|
+
const [measurements, setMeasurements] = React.useState([]);
|
|
11
|
+
const seen = React.useRef(new Set());
|
|
12
|
+
const seenMeasurementKinds = React.useRef(new Set());
|
|
13
|
+
const seenDailyTotals = React.useRef(new Set());
|
|
14
|
+
const onResultRef = React.useRef(onResult);
|
|
15
|
+
onResultRef.current = onResult;
|
|
16
|
+
const acceptsResult = React.useCallback(result => {
|
|
17
|
+
const measurementTypeKey = String(result.data.measurementTypeKey);
|
|
18
|
+
if (policy === "first-reading-per-kind-per-connection") {
|
|
19
|
+
if (seenMeasurementKinds.current.has(measurementTypeKey)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
seenMeasurementKinds.current.add(measurementTypeKey);
|
|
23
|
+
}
|
|
24
|
+
if (policy === "daily-totals-only") {
|
|
25
|
+
const temporal = result.data;
|
|
26
|
+
const end = temporal.end instanceof Date ? temporal.end : undefined;
|
|
27
|
+
if (end && end.getTime() > Date.now()) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
const day = temporal.end ?? temporal.start ?? temporal.recordedAt;
|
|
31
|
+
if (day instanceof Date) {
|
|
32
|
+
const key = `${measurementTypeKey}:${day.toISOString().slice(0, 10)}`;
|
|
33
|
+
if (seenDailyTotals.current.has(key)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
seenDailyTotals.current.add(key);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}, [policy]);
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
return runtime.subscribe("result", result => {
|
|
43
|
+
if (!acceptsResult(result)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (seen.current.has(result.id)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
seen.current.add(result.id);
|
|
50
|
+
setMeasurements(current => [...current, result].slice(-maxResults));
|
|
51
|
+
onResultRef.current?.(result);
|
|
52
|
+
});
|
|
53
|
+
}, [acceptsResult, maxResults, runtime]);
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
const unsubscribe = runtime.subscribe("connection", event => {
|
|
56
|
+
if (event.kind === "bonded") {
|
|
57
|
+
seenMeasurementKinds.current.clear();
|
|
58
|
+
seenDailyTotals.current.clear();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return unsubscribe;
|
|
62
|
+
}, [runtime]);
|
|
63
|
+
return {
|
|
64
|
+
measurements,
|
|
65
|
+
clear: () => {
|
|
66
|
+
seen.current.clear();
|
|
67
|
+
seenMeasurementKinds.current.clear();
|
|
68
|
+
seenDailyTotals.current.clear();
|
|
69
|
+
setMeasurements([]);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=use-measurements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useBluetoothRuntime","useMeasurements","onResult","policy","maxResults","runtime","measurements","setMeasurements","useState","seen","useRef","Set","seenMeasurementKinds","seenDailyTotals","onResultRef","current","acceptsResult","useCallback","result","measurementTypeKey","String","data","has","add","temporal","end","Date","undefined","getTime","now","day","start","recordedAt","key","toISOString","slice","useEffect","subscribe","id","unsubscribe","event","kind","clear"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-measurements.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAGEC,mBAAmB,QACd,sBAAmB;AAO1B,OAAO,MAAMC,eAAe,GAA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A,KAAK,CAACC,IAAI,KAAK,QAAQ,EAAE;QAC3B7B,oBAAoB,CAACG,OAAO,CAAC2B,KAAK,CAAC,CAAC;QACpC7B,eAAe,CAACE,OAAO,CAAC2B,KAAK,CAAC,CAAC;MACjC;IACF,CAAC,CAAC;IAEF,OAAOH,WAAW;EACpB,CAAC,EAAE,CAAClC,OAAO,CAAC,CAAC;EAEb,OAAO;IACLC,YAAY;IACZoC,KAAK,EAAEA,CAAA,KAAM;MACXjC,IAAI,CAACM,OAAO,CAAC2B,KAAK,CAAC,CAAC;MACpB9B,oBAAoB,CAACG,OAAO,CAAC2B,KAAK,CAAC,CAAC;MACpC7B,eAAe,CAACE,OAAO,CAAC2B,KAAK,CAAC,CAAC;MAC/BnC,eAAe,CAAC,EAAE,CAAC;IACrB;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useBluetoothRuntime } from "./runtime-context.js";
|
|
5
|
+
export const useNearbyDevices = () => {
|
|
6
|
+
const runtime = useBluetoothRuntime();
|
|
7
|
+
const [, redraw] = React.useReducer(value => value + 1, 0);
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
const unsubscribeFound = runtime.subscribe("deviceFound", redraw);
|
|
10
|
+
const unsubscribeStatus = runtime.subscribe("status", redraw);
|
|
11
|
+
return () => {
|
|
12
|
+
unsubscribeFound();
|
|
13
|
+
unsubscribeStatus();
|
|
14
|
+
};
|
|
15
|
+
}, [runtime]);
|
|
16
|
+
return {
|
|
17
|
+
devices: runtime.devices,
|
|
18
|
+
pair: async id => {
|
|
19
|
+
const device = runtime.devices.find(item => item.id === id);
|
|
20
|
+
if (device) {
|
|
21
|
+
await device.device.connect();
|
|
22
|
+
}
|
|
23
|
+
return device;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=use-nearby-devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useBluetoothRuntime","useNearbyDevices","runtime","redraw","useReducer","value","useEffect","unsubscribeFound","subscribe","unsubscribeStatus","devices","pair","id","device","find","item","connect"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-nearby-devices.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAAwBC,mBAAmB,QAAQ,sBAAmB;AAEtE,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAG3B;EACH,MAAMC,OAAO,GAAGF,mBAAmB,CAAC,CAAC;EACrC,MAAM,GAAGG,MAAM,CAAC,GAAGJ,KAAK,CAACK,UAAU,CAAEC,KAAK,IAAKA,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;EAE5DN,KAAK,CAACO,SAAS,CAAC,MAAM;IACpB,MAAMC,gBAAgB,GAAGL,OAAO,CAACM,SAAS,CAAC,aAAa,EAAEL,MAAM,CAAC;IACjE,MAAMM,iBAAiB,GAAGP,OAAO,CAACM,SAAS,CAAC,QAAQ,EAAEL,MAAM,CAAC;IAE7D,OAAO,MAAM;MACXI,gBAAgB,CAAC,CAAC;MAClBE,iBAAiB,CAAC,CAAC;IACrB,CAAC;EACH,CAAC,EAAE,CAACP,OAAO,CAAC,CAAC;EAEb,OAAO;IACLQ,OAAO,EAAER,OAAO,CAACQ,OAAO;IACxBC,IAAI,EAAE,MAAOC,EAAE,IAAK;MAClB,MAAMC,MAAM,GAAGX,OAAO,CAACQ,OAAO,CAACI,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACH,EAAE,KAAKA,EAAE,CAAC;MAE7D,IAAIC,MAAM,EAAE;QAAC,MAAMA,MAAM,CAACA,MAAM,CAACG,OAAO,CAAC,CAAC;MAAC;MAE3C,OAAOH,MAAM;IACf;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/group-exports */
|
|
4
|
+
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { useBluetoothRuntime } from "./runtime-context.js";
|
|
7
|
+
export const usePairedDevices = ({
|
|
8
|
+
storage,
|
|
9
|
+
storageKey = "@ovok/native/paired-devices",
|
|
10
|
+
autoPair = false
|
|
11
|
+
}) => {
|
|
12
|
+
const runtime = useBluetoothRuntime();
|
|
13
|
+
const [paired, setPaired] = React.useState([]);
|
|
14
|
+
const pairedRef = React.useRef([]);
|
|
15
|
+
const [, redraw] = React.useReducer(value => value + 1, 0);
|
|
16
|
+
const save = React.useCallback(async next => {
|
|
17
|
+
pairedRef.current = next;
|
|
18
|
+
setPaired(next);
|
|
19
|
+
await storage.setItem(storageKey, JSON.stringify(next));
|
|
20
|
+
}, [storage, storageKey]);
|
|
21
|
+
React.useEffect(() => runtime.subscribe("deviceFound", redraw), [runtime]);
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
void storage.getItem(storageKey).then(value => {
|
|
24
|
+
try {
|
|
25
|
+
const parsed = value ? JSON.parse(value) : [];
|
|
26
|
+
const next = Array.isArray(parsed) ? parsed.filter(id => typeof id === "string") : [];
|
|
27
|
+
pairedRef.current = next;
|
|
28
|
+
setPaired(next);
|
|
29
|
+
} catch {
|
|
30
|
+
setPaired([]);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}, [storage, storageKey]);
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
if (!autoPair) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
runtime.devices.filter(device => paired.includes(device.id)).forEach(device => void device.device.connect());
|
|
39
|
+
}, [autoPair, paired, runtime, runtime.devices]);
|
|
40
|
+
return {
|
|
41
|
+
paired,
|
|
42
|
+
pair: device => save([...new Set([...pairedRef.current, device.id])]),
|
|
43
|
+
forget: async id => {
|
|
44
|
+
if (!runtime.manager) {
|
|
45
|
+
throw new Error("Bluetooth manager is not ready; try forgetting the device again.");
|
|
46
|
+
}
|
|
47
|
+
await runtime.manager.forget(id);
|
|
48
|
+
await save(pairedRef.current.filter(candidate => candidate !== id));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=use-paired-devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useBluetoothRuntime","usePairedDevices","storage","storageKey","autoPair","runtime","paired","setPaired","useState","pairedRef","useRef","redraw","useReducer","value","save","useCallback","next","current","setItem","JSON","stringify","useEffect","subscribe","getItem","then","parsed","parse","Array","isArray","filter","id","devices","device","includes","forEach","connect","pair","Set","forget","manager","Error","candidate"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-paired-devices.ts"],"mappings":";;AAAA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAAwBC,mBAAmB,QAAQ,sBAAmB;AAatE,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,OAAO;EACPC,UAAU,GAAG,6BAA6B;EAC1CC,QAAQ,GAAG;AACY,CAAC,KAIrB;EACH,MAAMC,OAAO,GAAGL,mBAAmB,CAAC,CAAC;EACrC,MAAM,CAACM,MAAM,EAAEC,SAAS,CAAC,GAAGR,KAAK,CAACS,QAAQ,CAAoB,EAAE,CAAC;EACjE,MAAMC,SAAS,GAAGV,KAAK,CAACW,MAAM,CAAoB,EAAE,CAAC;EACrD,MAAM,GAAGC,MAAM,CAAC,GAAGZ,KAAK,CAACa,UAAU,CAAEC,KAAK,IAAKA,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;EAE5D,MAAMC,IAAI,GAAGf,KAAK,CAACgB,WAAW,CAAC,MAAOC,IAAuB,IAAK;IAChEP,SAAS,CAACQ,OAAO,GAAGD,IAAI;IACxBT,SAAS,CAACS,IAAI,CAAC;IACf,MAAMd,OAAO,CAACgB,OAAO,CAACf,UAAU,EAAEgB,IAAI,CAACC,SAAS,CAACJ,IAAI,CAAC,CAA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CAAC,GAAG,IAAIuB,GAAG,CAAC,CAAC,GAAG5B,SAAS,CAACQ,OAAO,EAAEe,MAAM,CAACF,EAAE,CAAC,CAAC,CAAC,CAAC;IACvEQ,MAAM,EAAE,MAAOR,EAAE,IAAK;MACpB,IAAI,CAACzB,OAAO,CAACkC,OAAO,EAAE;QACpB,MAAM,IAAIC,KAAK,CAAC,kEAAkE,CAAC;MACrF;MAEA,MAAMnC,OAAO,CAACkC,OAAO,CAACD,MAAM,CAACR,EAAE,CAAC;MAChC,MAAMhB,IAAI,CAACL,SAAS,CAACQ,OAAO,CAACY,MAAM,CAAEY,SAAS,IAAKA,SAAS,KAAKX,EAAE,CAAC,CAAC;IACvE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useBluetoothRuntime } from "./runtime-context.js";
|
|
5
|
+
|
|
6
|
+
/** Exposes scan pause/resume to apps using BTProvider. */
|
|
7
|
+
export const useScanControl = () => {
|
|
8
|
+
const runtime = useBluetoothRuntime();
|
|
9
|
+
React.useSyncExternalStore(runtime.subscribeState, () => runtime.manager, () => undefined);
|
|
10
|
+
return {
|
|
11
|
+
canControl: Boolean(runtime.manager),
|
|
12
|
+
pauseScan: () => runtime.manager?.pauseScan(),
|
|
13
|
+
resumeScan: () => runtime.manager?.resumeScan()
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=use-scan-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useBluetoothRuntime","useScanControl","runtime","useSyncExternalStore","subscribeState","manager","undefined","canControl","Boolean","pauseScan","resumeScan"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-scan-control.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,mBAAmB,QAAQ,sBAAmB;;AAEvD;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAIzB;EACH,MAAMC,OAAO,GAAGF,mBAAmB,CAAC,CAAC;EAErCD,KAAK,CAACI,oBAAoB,CACxBD,OAAO,CAACE,cAAc,EACtB,MAAMF,OAAO,CAACG,OAAO,EACrB,MAAMC,SACR,CAAC;EAED,OAAO;IACLC,UAAU,EAAEC,OAAO,CAACN,OAAO,CAACG,OAAO,CAAC;IACpCI,SAAS,EAAEA,CAAA,KAAMP,OAAO,CAACG,OAAO,EAAEI,SAAS,CAAC,CAAC;IAC7CC,UAAU,EAAEA,CAAA,KAAMR,OAAO,CAACG,OAAO,EAAEK,UAAU,CAAC;EAChD,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -31,7 +31,10 @@ export * from "./types/btprovider-children-props.js";
|
|
|
31
31
|
export * from "./types/background-sync.js";
|
|
32
32
|
export * from "./types/result-callback.js";
|
|
33
33
|
export * from "./types/error-callback.js";
|
|
34
|
+
export * from "./types/bluetooth-error.js";
|
|
34
35
|
export * from "./types/device-status-change-callback.js";
|
|
36
|
+
export * from "./types/device-connection-event.js";
|
|
37
|
+
export * from "./types/result-policy.js";
|
|
35
38
|
export * from "./services/devices/bt-managed-device.js";
|
|
36
39
|
export * from "./services/devices/blood-glucose/blood-glucose.device.js";
|
|
37
40
|
export * from "./services/devices/custom/custom.device.js";
|
|
@@ -39,6 +42,8 @@ export * from "./services/bt-manager.js";
|
|
|
39
42
|
export * from "./services/background-sync/background-ble-manager.js";
|
|
40
43
|
export * from "./services/background-sync/background-sync-coordinator.js";
|
|
41
44
|
export * from "./services/background-sync/background-service-uuids.js";
|
|
45
|
+
export * from "./utils/result-identity.js";
|
|
46
|
+
export * from "./testing/index.js";
|
|
42
47
|
export * from "./services/custom/define-custom-device.js";
|
|
43
48
|
export * from "./services/devices/standard-gatt/standard-gatt.devices.js";
|
|
44
49
|
export * from "./services/devices/boso/boso.medicus.js";
|
|
@@ -67,4 +72,13 @@ export * from "./components/bt-provider.js";
|
|
|
67
72
|
export * from "./components/bluetooth-device-picker.js";
|
|
68
73
|
export * from "./components/default-permission-fallback.js";
|
|
69
74
|
export * from "./hooks/use-request-permissions.js";
|
|
75
|
+
export * from "./hooks/runtime-context.js";
|
|
76
|
+
export * from "./hooks/use-bluetooth-state.js";
|
|
77
|
+
export * from "./hooks/use-nearby-devices.js";
|
|
78
|
+
export * from "./hooks/use-paired-devices.js";
|
|
79
|
+
export * from "./hooks/use-device-connection.js";
|
|
80
|
+
export * from "./hooks/use-measurements.js";
|
|
81
|
+
export * from "./hooks/use-background-sync.js";
|
|
82
|
+
export * from "./hooks/use-health-import.js";
|
|
83
|
+
export * from "./hooks/use-scan-control.js";
|
|
70
84
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,4BAAyB;AACvC,cAAc,0CAAuC;AACrD,cAAc,oCAAiC;AAC/C,cAAc,0BAAuB;AAErC,cAAc,yCAAsC;AACpD,cAAc,0DAAuD;AACrE,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,sDAAmD;AACjE,cAAc,2DAAwD;AACtE,cAAc,wDAAqD;AACnE,cAAc,4BAAyB;AACvC,cAAc,oBAAW;AACzB,cAAc,2CAAwC;AACtD,cAAc,2DAAwD;AACtE,cAAc,yCAAsC;AACpD,cAAc,oDAAiD;AAC/D,cAAc,mDAAgD;AAC9D,cAAc,0DAAuD;AACrE,cAAc,kDAA+C;AAC7D,cAAc,uDAAoD;AAClE,cAAc,0DAAuD;AACrE,cAAc,mDAAgD;AAC9D,cAAc,4CAAyC;AACvD,cAAc,4CAAyC;AACvD,cAAc,iDAA8C;AAC5D,cAAc,+CAA4C;AAC1D,cAAc,mDAAgD;AAC9D,cAAc,+CAA4C;AAC1D,cAAc,2CAAwC;AACtD,cAAc,8CAA2C;AACzD,cAAc,4CAAyC;AACvD,cAAc,0CAAuC;AACrD,cAAc,6CAA0C;AACxD,cAAc,+CAA4C;AAC1D,cAAc,+CAA4C;AAE1D,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,yCAAsC;AACpD,cAAc,6CAA0C;AACxD,cAAc,oCAAiC;AAC/C,cAAc,4BAAyB;AACvC,cAAc,gCAA6B;AAC3C,cAAc,+BAA4B;AAC1C,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,6BAA0B;AACxC,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { recordOvokMetric } from "../../../helpers/utils/telemetry.js";
|
|
4
|
+
import { reviveResultDates } from "../../utils/result-identity.js";
|
|
3
5
|
const DEFAULT_QUEUE_KEY = "@ovok/native/background-sync/results";
|
|
4
6
|
const DEFAULT_MAX_RETRIES = 3;
|
|
5
7
|
const DEFAULT_RETRY_BACKOFF_MS = 30_000;
|
|
@@ -8,6 +10,10 @@ const createResultId = () => {
|
|
|
8
10
|
resultSequence += 1;
|
|
9
11
|
return `${Date.now()}-${resultSequence}-${Math.random().toString(36).slice(2, 10)}`;
|
|
10
12
|
};
|
|
13
|
+
const createQueueId = () => {
|
|
14
|
+
resultSequence += 1;
|
|
15
|
+
return `${Date.now()}-queue-${resultSequence}-${Math.random().toString(36).slice(2, 10)}`;
|
|
16
|
+
};
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
19
|
* A small durable, at-least-once queue. The result is written before delivery and removed only
|
|
@@ -24,14 +30,19 @@ class BackgroundSyncCoordinator {
|
|
|
24
30
|
}
|
|
25
31
|
enqueue = result => this.runExclusive(async () => {
|
|
26
32
|
const queue = await this.readQueue();
|
|
33
|
+
const stableId = result.id ?? createResultId();
|
|
27
34
|
queue.push({
|
|
28
|
-
|
|
35
|
+
queueId: createQueueId(),
|
|
29
36
|
queuedAt: new Date().toISOString(),
|
|
30
37
|
attempt: 0,
|
|
31
38
|
nextAttemptAt: 0,
|
|
32
|
-
result
|
|
39
|
+
result: {
|
|
40
|
+
...result,
|
|
41
|
+
id: stableId
|
|
42
|
+
}
|
|
33
43
|
});
|
|
34
44
|
await this.writeQueue(queue);
|
|
45
|
+
recordOvokMetric("ovok.queue.depth", queue.length);
|
|
35
46
|
await this.flushQueue(queue);
|
|
36
47
|
});
|
|
37
48
|
flush = (options = {}) => this.runExclusive(async () => {
|
|
@@ -52,9 +63,19 @@ class BackgroundSyncCoordinator {
|
|
|
52
63
|
if (!Array.isArray(parsed)) {
|
|
53
64
|
throw new Error("Background sync queue is not an array");
|
|
54
65
|
}
|
|
55
|
-
return parsed
|
|
66
|
+
return parsed.map(item => {
|
|
67
|
+
const typed = item;
|
|
68
|
+
const result = reviveResultDates(typed.result);
|
|
69
|
+
return {
|
|
70
|
+
...typed,
|
|
71
|
+
queueId: typed.queueId ?? typed.id ?? createQueueId(),
|
|
72
|
+
result: {
|
|
73
|
+
...result,
|
|
74
|
+
id: result.id ?? typed.id ?? createResultId()
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
});
|
|
56
78
|
} catch (error) {
|
|
57
|
-
await this.options.storage.setItem(this.storageKey, "[]");
|
|
58
79
|
throw new Error(`Background sync queue could not be read: ${error instanceof Error ? error.message : String(error)}`);
|
|
59
80
|
}
|
|
60
81
|
};
|
|
@@ -78,21 +99,36 @@ class BackgroundSyncCoordinator {
|
|
|
78
99
|
try {
|
|
79
100
|
await this.options.onResult({
|
|
80
101
|
...item.result,
|
|
81
|
-
id: item.id,
|
|
102
|
+
id: item.result.id,
|
|
103
|
+
queueId: item.queueId,
|
|
82
104
|
queuedAt: item.queuedAt,
|
|
83
105
|
attempt
|
|
84
106
|
});
|
|
85
107
|
queue.splice(queue.indexOf(item), 1);
|
|
108
|
+
recordOvokMetric("ovok.queue.delivered", 1, {
|
|
109
|
+
attempt,
|
|
110
|
+
measurementTypeKey: item.result.data.measurementTypeKey
|
|
111
|
+
});
|
|
86
112
|
changed = true;
|
|
87
113
|
} catch {
|
|
88
114
|
item.attempt = attempt;
|
|
89
115
|
item.exhausted = attempt >= this.maxRetries;
|
|
90
116
|
item.nextAttemptAt = item.exhausted ? Number.MAX_SAFE_INTEGER : Date.now() + this.retryBackoffMs * 2 ** (attempt - 1);
|
|
117
|
+
recordOvokMetric("ovok.queue.retries", 1, {
|
|
118
|
+
attempt
|
|
119
|
+
});
|
|
120
|
+
if (item.exhausted) {
|
|
121
|
+
recordOvokMetric("ovok.queue.exhausted", 1, {
|
|
122
|
+
attempt,
|
|
123
|
+
exhausted: true
|
|
124
|
+
});
|
|
125
|
+
}
|
|
91
126
|
changed = true;
|
|
92
127
|
}
|
|
93
128
|
}
|
|
94
129
|
if (changed) {
|
|
95
130
|
await this.writeQueue(queue);
|
|
131
|
+
recordOvokMetric("ovok.queue.depth", queue.length);
|
|
96
132
|
}
|
|
97
133
|
};
|
|
98
134
|
}
|
package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_QUEUE_KEY","DEFAULT_MAX_RETRIES","DEFAULT_RETRY_BACKOFF_MS","resultSequence","createResultId","Date","now","Math","random","toString","slice","BackgroundSyncCoordinator","operation","Promise","resolve","constructor","options","storageKey","maxRetries","max","retryBackoffMs","enqueue","result","runExclusive","queue","readQueue","
|
|
1
|
+
{"version":3,"names":["recordOvokMetric","reviveResultDates","DEFAULT_QUEUE_KEY","DEFAULT_MAX_RETRIES","DEFAULT_RETRY_BACKOFF_MS","resultSequence","createResultId","Date","now","Math","random","toString","slice","createQueueId","BackgroundSyncCoordinator","operation","Promise","resolve","constructor","options","storageKey","maxRetries","max","retryBackoffMs","enqueue","result","runExclusive","queue","readQueue","stableId","id","push","queueId","queuedAt","toISOString","attempt","nextAttemptAt","writeQueue","length","flushQueue","flush","next","then","catch","undefined","serialized","storage","getItem","parsed","JSON","parse","Array","isArray","Error","map","item","typed","error","message","String","setItem","stringify","changed","exhausted","resetExhausted","includeExhausted","onResult","splice","indexOf","measurementTypeKey","data","Number","MAX_SAFE_INTEGER"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/background-sync/background-sync-coordinator.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,qCAAkC;AAInE,SAASC,iBAAiB,QAAQ,gCAA6B;AAiB/D,MAAMC,iBAAiB,GAAG,sCAAsC;AAChE,MAAMC,mBAAmB,GAAG,CAAC;AAC7B,MAAMC,wBAAwB,GAAG,MAAM;AAEvC,IAAIC,cAAc,GAAG,CAAC;AAEtB,MAAMC,cAAc,GAAGA,CAAA,KAAc;EACnCD,cAAc,IAAI,CAAC;EAEnB,OAAO,GAAGE,IAAI,CAACC,GAAG,CAAC,CAAC,IAAIH,cAAc,IAAII,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;AACrF,CAAC;AAED,MAAMC,aAAa,GAAGA,CAAA,KAAc;EAClCR,cAAc,IAAI,CAAC;EAEnB,OAAO,GAAGE,IAAI,CAACC,GAAG,CAAC,CAAC,UAAUH,cAAc,IAAII,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;AAC3F,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAME,yBAAyB,CAAsB;EAI3CC,SAAS,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAE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B,EAAE,CAAC,EAAE;UAC1CmC,OAAO;UACPkC,kBAAkB,EAAEd,IAAI,CAAC9B,MAAM,CAAC6C,IAAI,CAACD;QACvC,CAAC,CAAC;QACFP,OAAO,GAAG,IAAI;MAChB,CAAC,CAAC,MAAM;QACNP,IAAI,CAACpB,OAAO,GAAGA,OAAO;QACtBoB,IAAI,CAACQ,SAAS,GAAG5B,OAAO,IAAI,IAAI,CAACd,UAAU;QAC3CkC,IAAI,CAACnB,aAAa,GAAGmB,IAAI,CAACQ,SAAS,GAC/BQ,MAAM,CAACC,gBAAgB,GACvBjE,IAAI,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI,CAACe,cAAc,GAAG,CAAC,KAAKY,OAAO,GAAG,CAAC,CAAC;QACzDnC,gBAAgB,CAAC,oBAAoB,EAAE,CAAC,EAAE;UAAEmC;QAAQ,CAAC,CAAC;QACtD,IAAIoB,IAAI,CAACQ,SAAS,EAAE;UAClB/D,gBAAgB,CAAC,sBAAsB,EAAE,CAAC,EAAE;YAAEmC,OAAO;YAAE4B,SAAS,EAAE;UAAK,CAAC,CAAC;QAC3E;QACAD,OAAO,GAAG,IAAI;MAChB;IACF;IAEA,IAAIA,OAAO,EAAE;MACX,MAAM,IAAI,CAACzB,UAAU,CAACV,KAAK,CAAC;MAC5B3B,gBAAgB,CAAC,kBAAkB,EAAE2B,KAAK,CAACW,MAAM,CAAC;IACpD;EACF,CAAC;AACH;AAEA,SAASxB,yBAAyB,EAAEZ,iBAAiB","ignoreList":[]}
|
|
@@ -5,10 +5,21 @@ import { Linking, Platform } from "react-native";
|
|
|
5
5
|
import { ScanMode, State } from "react-native-ble-plx";
|
|
6
6
|
import { slog } from "../../helpers/index.js";
|
|
7
7
|
import { sentryLogger } from "../../helpers/utils/sentry-logger.js";
|
|
8
|
+
import { addOvokSpanEvent, recordOvokMetric } from "../../helpers/utils/telemetry.js";
|
|
9
|
+
import { toBluetoothError } from "../types/bluetooth-error.js";
|
|
8
10
|
import { DeviceCreator } from "./device-creator.js";
|
|
11
|
+
const bluetoothErrorCallback = error => {
|
|
12
|
+
const normalized = toBluetoothError(error);
|
|
13
|
+
const originalError = normalized.originalError;
|
|
14
|
+
return {
|
|
15
|
+
error: normalized.translationKey ?? (originalError instanceof Error || typeof originalError === "string" ? originalError : normalized),
|
|
16
|
+
code: normalized.code
|
|
17
|
+
};
|
|
18
|
+
};
|
|
9
19
|
class BTManager {
|
|
10
20
|
static MAX_DEVICES = 15; // Safety limit to prevent unbounded growth
|
|
11
21
|
devices = new Map();
|
|
22
|
+
forgottenDeviceIds = new Set();
|
|
12
23
|
eventSubscriptions = [];
|
|
13
24
|
scanGeneration = 0;
|
|
14
25
|
scanActive = false;
|
|
@@ -36,10 +47,12 @@ class BTManager {
|
|
|
36
47
|
this.onDeviceFoundCallback = undefined;
|
|
37
48
|
this.onResultCallback = undefined;
|
|
38
49
|
this.onDeviceStatusChangedCallback = undefined;
|
|
50
|
+
this.onConnectionEventCallback = undefined;
|
|
39
51
|
this.devices.forEach(device => {
|
|
40
52
|
device.destroy();
|
|
41
53
|
});
|
|
42
54
|
this.devices.clear();
|
|
55
|
+
this.forgottenDeviceIds.clear();
|
|
43
56
|
this.deviceCreator.destroy();
|
|
44
57
|
};
|
|
45
58
|
startScan = () => {
|
|
@@ -76,9 +89,7 @@ class BTManager {
|
|
|
76
89
|
try {
|
|
77
90
|
subscription = this.bleManager.onStateChange(onStateChange, true);
|
|
78
91
|
} catch (error) {
|
|
79
|
-
this.onErrorCallback?.(
|
|
80
|
-
error: error instanceof Error ? error : String(error)
|
|
81
|
-
});
|
|
92
|
+
this.onErrorCallback?.(bluetoothErrorCallback(error));
|
|
82
93
|
return;
|
|
83
94
|
}
|
|
84
95
|
if (poweredOnBeforeSubscription) {
|
|
@@ -116,11 +127,44 @@ class BTManager {
|
|
|
116
127
|
this.onDeviceFoundCallback = undefined;
|
|
117
128
|
this.onResultCallback = undefined;
|
|
118
129
|
this.onDeviceStatusChangedCallback = undefined;
|
|
130
|
+
this.onConnectionEventCallback = undefined;
|
|
119
131
|
this.devices.forEach(device => {
|
|
120
132
|
device.destroy();
|
|
121
133
|
});
|
|
122
134
|
this.devices.clear();
|
|
123
135
|
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Pauses discovery without tearing down devices or their callbacks.
|
|
139
|
+
*
|
|
140
|
+
* Use this when an app temporarily stops scanning, for example while it is in the
|
|
141
|
+
* background but an already-connected device may still deliver a measurement.
|
|
142
|
+
*/
|
|
143
|
+
pauseScan = () => {
|
|
144
|
+
if (this.destroyed) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
sentryLogger("info", "BT_MANAGER: Pausing scan");
|
|
148
|
+
this.scanGeneration += 1;
|
|
149
|
+
this.scanActive = false;
|
|
150
|
+
this.scanStarting = false;
|
|
151
|
+
this.removeStateChangeListener();
|
|
152
|
+
this.bleManager.stopDeviceScan();
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Resumes discovery without clearing devices or callbacks.
|
|
157
|
+
*
|
|
158
|
+
* Restarting unconditionally also recovers when an app stopped the underlying BLE scan
|
|
159
|
+
* directly while BTManager still believed it was active.
|
|
160
|
+
*/
|
|
161
|
+
resumeScan = () => {
|
|
162
|
+
if (this.destroyed) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
sentryLogger("info", "BT_MANAGER: Resuming scan");
|
|
166
|
+
this.restartScan();
|
|
167
|
+
};
|
|
124
168
|
restartScan = () => {
|
|
125
169
|
if (this.destroyed) {
|
|
126
170
|
return;
|
|
@@ -151,9 +195,7 @@ class BTManager {
|
|
|
151
195
|
}
|
|
152
196
|
const serviceUUIDs = this.options.serviceUUIDs ?? [];
|
|
153
197
|
if (Platform.OS === "ios" && this.backgroundScanEnabled && !serviceUUIDs.length) {
|
|
154
|
-
this.onErrorCallback?.(
|
|
155
|
-
error: "Background Bluetooth sync on iOS requires at least one service UUID. Add serviceUUIDs for custom devices."
|
|
156
|
-
});
|
|
198
|
+
this.onErrorCallback?.(bluetoothErrorCallback("Background Bluetooth sync on iOS requires at least one service UUID. Add serviceUUIDs for custom devices."));
|
|
157
199
|
return;
|
|
158
200
|
}
|
|
159
201
|
this.scanStarting = true;
|
|
@@ -171,16 +213,33 @@ class BTManager {
|
|
|
171
213
|
});
|
|
172
214
|
this.scanActive = true;
|
|
173
215
|
sentryLogger("info", "BT_MANAGER: Scan started (continuous mode)");
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
216
|
+
addOvokSpanEvent("bluetooth.scan.started", {
|
|
217
|
+
platform: Platform.OS,
|
|
218
|
+
background: this.backgroundScanEnabled
|
|
177
219
|
});
|
|
220
|
+
} catch (error) {
|
|
221
|
+
this.onErrorCallback?.(bluetoothErrorCallback(error));
|
|
178
222
|
} finally {
|
|
179
223
|
this.scanStarting = false;
|
|
180
224
|
}
|
|
181
225
|
};
|
|
182
226
|
restoreDevices = devices => {
|
|
183
|
-
devices.forEach(device =>
|
|
227
|
+
devices.forEach(device => {
|
|
228
|
+
this.forgottenDeviceIds.delete(device.id);
|
|
229
|
+
this.onScanResult(null, device);
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/** Disconnects one device and prevents it from being re-created by later advertisements. */
|
|
234
|
+
forget = async deviceId => {
|
|
235
|
+
this.forgottenDeviceIds.add(deviceId);
|
|
236
|
+
this.autoConnectCandidates.delete(deviceId);
|
|
237
|
+
const device = this.devices.get(deviceId);
|
|
238
|
+
if (!device) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
this.devices.delete(deviceId);
|
|
242
|
+
await device.disconnect();
|
|
184
243
|
};
|
|
185
244
|
onDeviceFound = callback => {
|
|
186
245
|
sentryLogger("info", "BT_MANAGER: Setting onDeviceFound callback");
|
|
@@ -194,6 +253,10 @@ class BTManager {
|
|
|
194
253
|
sentryLogger("info", "BT_MANAGER: Setting onDeviceStatusChanged callback");
|
|
195
254
|
this.onDeviceStatusChangedCallback = callback;
|
|
196
255
|
};
|
|
256
|
+
onConnectionEvent = callback => {
|
|
257
|
+
sentryLogger("info", "BT_MANAGER: Setting onConnectionEvent callback");
|
|
258
|
+
this.onConnectionEventCallback = callback;
|
|
259
|
+
};
|
|
197
260
|
onResult = callback => {
|
|
198
261
|
sentryLogger("info", "BT_MANAGER: Setting onResult callback");
|
|
199
262
|
this.onResultCallback = callback;
|
|
@@ -204,12 +267,7 @@ class BTManager {
|
|
|
204
267
|
onScanResult = (error, device) => {
|
|
205
268
|
try {
|
|
206
269
|
if (error) {
|
|
207
|
-
this.onErrorCallback?.(
|
|
208
|
-
error: error
|
|
209
|
-
});
|
|
210
|
-
sentryLogger("error", "BT_MANAGER: Scan result error", {
|
|
211
|
-
error: error instanceof Error ? error.message : error
|
|
212
|
-
});
|
|
270
|
+
this.onErrorCallback?.(bluetoothErrorCallback(error));
|
|
213
271
|
slog(error, "BT_MANAGER: Scan result error", {
|
|
214
272
|
error
|
|
215
273
|
});
|
|
@@ -226,6 +284,9 @@ class BTManager {
|
|
|
226
284
|
if (!device) {
|
|
227
285
|
return;
|
|
228
286
|
}
|
|
287
|
+
if (this.forgottenDeviceIds.has(device.id)) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
229
290
|
if (this.devices.has(device.id)) {
|
|
230
291
|
return;
|
|
231
292
|
}
|
|
@@ -248,22 +309,24 @@ class BTManager {
|
|
|
248
309
|
deviceName,
|
|
249
310
|
onError: this.onErrorCallback?.bind(this),
|
|
250
311
|
onDeviceStatusChanged: this.onDeviceStatusChangedCallback?.bind(this),
|
|
312
|
+
onConnectionEvent: this.onConnectionEventCallback?.bind(this),
|
|
251
313
|
onResult: this.onResultCallback?.bind(this),
|
|
252
314
|
oneReadingPerConnection: this.options.oneReadingPerConnection,
|
|
253
315
|
deliveredEcgFileNames: this.options.deliveredEcgFileNames,
|
|
316
|
+
resultPolicy: this.options.resultPolicies?.[deviceName],
|
|
254
317
|
onDeviceDisconnected: () => {
|
|
255
318
|
this.removeDeviceFromFoundedDevices?.bind(this)(device.id);
|
|
256
319
|
}
|
|
257
320
|
});
|
|
258
321
|
this.devices.set(device.id, deviceClass);
|
|
322
|
+
recordOvokMetric("ovok.devices.found", 1, {
|
|
323
|
+
deviceId: device.id,
|
|
324
|
+
model: deviceName,
|
|
325
|
+
platform: Platform.OS
|
|
326
|
+
});
|
|
259
327
|
this.onDeviceFoundCallback?.(deviceClass, this);
|
|
260
328
|
this.queueAutoConnect(deviceClass);
|
|
261
329
|
} catch (error) {
|
|
262
|
-
sentryLogger("error", "BT_MANAGER: Error creating device", {
|
|
263
|
-
error: error instanceof Error ? error.message : error,
|
|
264
|
-
deviceId: device?.id,
|
|
265
|
-
deviceName: device?.name
|
|
266
|
-
});
|
|
267
330
|
slog(error, "BT_MANAGER: Error creating device", {
|
|
268
331
|
error,
|
|
269
332
|
deviceId: device?.id,
|
|
@@ -284,13 +347,19 @@ class BTManager {
|
|
|
284
347
|
const devices = [...this.autoConnectCandidates.values()];
|
|
285
348
|
this.autoConnectCandidates.clear();
|
|
286
349
|
if (devices.length === 1) {
|
|
287
|
-
|
|
350
|
+
const candidate = devices[0];
|
|
351
|
+
if (candidate && !this.forgottenDeviceIds.has(candidate.id) && this.devices.get(candidate.id) === candidate) {
|
|
352
|
+
void candidate.connect();
|
|
353
|
+
}
|
|
288
354
|
return;
|
|
289
355
|
}
|
|
290
356
|
if (devices.length > 1) {
|
|
291
357
|
this.options.onDeviceSelectionRequired?.({
|
|
292
358
|
devices: devices,
|
|
293
359
|
select: async selected => {
|
|
360
|
+
if (this.forgottenDeviceIds.has(selected.id) || this.devices.get(selected.id) !== selected) {
|
|
361
|
+
throw new Error("The selected Bluetooth device was forgotten.");
|
|
362
|
+
}
|
|
294
363
|
await selected.connect();
|
|
295
364
|
}
|
|
296
365
|
});
|