@ovok/native 1.5.6 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -17
- package/app.plugin.js +104 -0
- package/lib/commonjs/index.js +11 -0
- 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 +91 -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 +3 -1
- package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/inputs.js +48 -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 +25 -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 +79 -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-management/components/bt-provider-child-wrapper.js +123 -21
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +91 -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 +47 -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 +36 -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 +46 -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 +57 -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 +26 -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 +49 -0
- package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/index.js +143 -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 -4
- 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 +75 -4
- 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 +57 -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 +111 -3
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.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/testing/fake-ble-manager.js +52 -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 +80 -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 +8 -2
- 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 +23 -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/retry-save.js +65 -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 +12 -0
- 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 +28 -17
- package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/telemetry.js +143 -0
- package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
- package/lib/commonjs/modules/image/components/optimized-image.js +24 -2
- 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 +42 -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/ui/components/background-sync-setting.js +113 -0
- package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +105 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
- package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +165 -0
- package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
- package/lib/commonjs/modules/ui/components/health-import-card.js +130 -0
- package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
- package/lib/commonjs/modules/ui/components/manual-entry-form.js +123 -0
- package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
- package/lib/commonjs/modules/ui/components/pairing-flow.js +222 -0
- package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
- package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +99 -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 +94 -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 +1 -0
- 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 +85 -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 +3 -1
- package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/inputs.js +48 -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 +25 -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 +74 -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-management/components/bt-provider-child-wrapper.js +123 -21
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/runtime-context.js +82 -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 +41 -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 +30 -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 +40 -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 +51 -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 +20 -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 +43 -0
- package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
- package/lib/module/modules/bt-management/index.js +13 -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 -4
- 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 +75 -4
- 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 +57 -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 +111 -3
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.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/testing/fake-ble-manager.js +48 -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 +74 -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 +8 -2
- 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 +23 -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/retry-save.js +60 -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 +1 -0
- 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 +26 -14
- package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
- package/lib/module/modules/helpers/utils/telemetry.js +131 -0
- package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
- package/lib/module/modules/image/components/optimized-image.js +25 -3
- 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 +42 -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/ui/components/background-sync-setting.js +107 -0
- package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js +99 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
- package/lib/module/modules/ui/components/ecg-strip-viewer.js +159 -0
- package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
- package/lib/module/modules/ui/components/health-import-card.js +124 -0
- package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
- package/lib/module/modules/ui/components/manual-entry-form.js +117 -0
- package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
- package/lib/module/modules/ui/components/pairing-flow.js +216 -0
- package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
- package/lib/module/modules/ui/components/supported-devices-catalog-list.js +93 -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 +89 -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 +1 -0
- 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 +13 -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 +29 -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-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +46 -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/index.d.ts +13 -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 +9 -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/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/testing/fake-ble-manager.d.ts +16 -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/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/retry-save.d.ts +5 -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 +1 -0
- 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 +68 -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/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 +20 -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 +1 -0
- 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 +13 -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 +29 -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-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +46 -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/index.d.ts +13 -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 +9 -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/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/testing/fake-ble-manager.d.ts +16 -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/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/retry-save.d.ts +5 -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 +1 -0
- 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 +68 -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/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 +20 -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 +145 -6
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/group-exports */
|
|
4
|
+
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const RuntimeContext = /*#__PURE__*/React.createContext(null);
|
|
8
|
+
export const createBluetoothRuntime = bleManager => {
|
|
9
|
+
const listeners = new Map();
|
|
10
|
+
let currentManager;
|
|
11
|
+
let currentDevices = [];
|
|
12
|
+
const subscribers = new Set();
|
|
13
|
+
return {
|
|
14
|
+
bleManager,
|
|
15
|
+
get manager() {
|
|
16
|
+
return currentManager;
|
|
17
|
+
},
|
|
18
|
+
get devices() {
|
|
19
|
+
return currentDevices;
|
|
20
|
+
},
|
|
21
|
+
subscribe: (event, callback) => {
|
|
22
|
+
const eventListeners = listeners.get(event) ?? new Set();
|
|
23
|
+
eventListeners.add(callback);
|
|
24
|
+
listeners.set(event, eventListeners);
|
|
25
|
+
return () => eventListeners.delete(callback);
|
|
26
|
+
},
|
|
27
|
+
hasListeners: event => (listeners.get(event)?.size ?? 0) > 0,
|
|
28
|
+
emit: (event, value) => {
|
|
29
|
+
listeners.get(event)?.forEach(callback => callback(value));
|
|
30
|
+
subscribers.forEach(notify => notify());
|
|
31
|
+
},
|
|
32
|
+
setManager: manager => {
|
|
33
|
+
currentManager = manager;
|
|
34
|
+
subscribers.forEach(notify => notify());
|
|
35
|
+
},
|
|
36
|
+
upsertDevice: device => {
|
|
37
|
+
const existing = currentDevices.findIndex(item => item.id === device.id);
|
|
38
|
+
const next = {
|
|
39
|
+
id: device.id,
|
|
40
|
+
deviceData: device.deviceData,
|
|
41
|
+
device,
|
|
42
|
+
status: existing === -1 ? undefined : currentDevices[existing]?.status
|
|
43
|
+
};
|
|
44
|
+
currentDevices = existing === -1 ? [...currentDevices, next] : currentDevices.map((item, index) => index === existing ? next : item);
|
|
45
|
+
subscribers.forEach(notify => notify());
|
|
46
|
+
},
|
|
47
|
+
setDeviceStatus: ({
|
|
48
|
+
deviceData,
|
|
49
|
+
status
|
|
50
|
+
}) => {
|
|
51
|
+
currentDevices = currentDevices.map(item => item.id === deviceData.id ? {
|
|
52
|
+
...item,
|
|
53
|
+
deviceData,
|
|
54
|
+
status
|
|
55
|
+
} : item);
|
|
56
|
+
subscribers.forEach(notify => notify());
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export const BluetoothRuntimeProvider = ({
|
|
61
|
+
runtime,
|
|
62
|
+
children
|
|
63
|
+
}) => /*#__PURE__*/_jsx(RuntimeContext.Provider, {
|
|
64
|
+
value: runtime,
|
|
65
|
+
children: children
|
|
66
|
+
});
|
|
67
|
+
export const useBluetoothRuntime = () => {
|
|
68
|
+
const runtime = React.useContext(RuntimeContext);
|
|
69
|
+
if (!runtime) {
|
|
70
|
+
throw new Error("Bluetooth hooks must be rendered inside BTProvider");
|
|
71
|
+
}
|
|
72
|
+
return runtime;
|
|
73
|
+
};
|
|
74
|
+
export const useRuntimeEvent = (event, callback) => {
|
|
75
|
+
const runtime = useBluetoothRuntime();
|
|
76
|
+
const callbackRef = React.useRef(callback);
|
|
77
|
+
callbackRef.current = callback;
|
|
78
|
+
React.useEffect(() => runtime.subscribe(event, value => callbackRef.current(value)), [event, runtime]);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** Typed union exposed when a host listens to every accepted device. */
|
|
82
|
+
//# sourceMappingURL=runtime-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","jsx","_jsx","RuntimeContext","createContext","createBluetoothRuntime","bleManager","listeners","Map","currentManager","currentDevices","subscribers","Set","manager","devices","subscribe","event","callback","eventListeners","get","add","set","delete","hasListeners","size","emit","value","forEach","notify","setManager","upsertDevice","device","existing","findIndex","item","id","next","deviceData","status","undefined","map","index","setDeviceStatus","BluetoothRuntimeProvider","runtime","children","Provider","useBluetoothRuntime","useContext","Error","useRuntimeEvent","callbackRef","useRef","current","useEffect"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/runtime-context.tsx"],"mappings":";;AAAA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkD/B,MAAMC,cAAc,gBAAGH,KAAK,CAACI,aAAa,CAA0B,IAAI,CAAC;AAEzE,OAAO,MAAMC,sBAAsB,GACjCC,UAAuB,IACF;EACrB,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAA8C,CAAC;EACxE,IAAIC,cAES;EACb,IAAIC,cAA+B,GAAG,EAAE;EACxC,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAa,CAAC;EAEzC,OAAO;IACLN,UAAU;IACV,IAAIO,OAAOA,CAAA,EAAG;MACZ,OAAOJ,cAAc;IACvB,CAAC;IACD,IAAIK,OAAOA,CAAA,EAAG;MACZ,OAAOJ,cAAc;IACvB,CAAC;IACDK,SAAS,EAAEA,CAAKC,KAAmB,EAAEC,QAA4B,KAAK;MACpE,MAAMC,cAAc,GAAGX,SAAS,CAACY,GAAG,CAACH,KAAK,CAAC,IAAI,IAAIJ,GAAG,CAAC,CAAC;MAExDM,cAAc,CAACE,GAAG,CAACH,QAAoC,CAAC;MACxDV,SAAS,CAACc,GAAG,CAACL,KAAK,EAAEE,cAAc,CAAC;MAEpC,OAAO,MAAMA,cAAc,CAACI,MAAM,CAACL,QAAoC,CAAC;IAC1E,CAAC;IACDM,YAAY,EAAGP,KAAK,IAAK,CAACT,SAAS,CAACY,GAAG,CAACH,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
import { useBluetoothRuntime } from "./runtime-context.js";
|
|
7
|
+
export const useBackgroundSync = ({
|
|
8
|
+
enabled: initialEnabled = false,
|
|
9
|
+
canEnable,
|
|
10
|
+
onEnabledChange
|
|
11
|
+
} = {}) => {
|
|
12
|
+
const runtime = useBluetoothRuntime();
|
|
13
|
+
const [enabled, setEnabledState] = React.useState(initialEnabled);
|
|
14
|
+
const [error, setError] = React.useState();
|
|
15
|
+
const [status, setStatus] = React.useState(initialEnabled ? "on" : "off");
|
|
16
|
+
const setEnabled = React.useCallback(async next => {
|
|
17
|
+
setError(undefined);
|
|
18
|
+
if (next && canEnable && !(await canEnable())) {
|
|
19
|
+
setStatus("restricted");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
runtime.manager?.setBackgroundScanEnabled(next);
|
|
24
|
+
await onEnabledChange?.(next);
|
|
25
|
+
setEnabledState(next);
|
|
26
|
+
setStatus(next ? "on" : "off");
|
|
27
|
+
} catch (cause) {
|
|
28
|
+
const nextError = cause instanceof Error ? cause : new Error(String(cause));
|
|
29
|
+
setError(nextError);
|
|
30
|
+
setStatus("blocked");
|
|
31
|
+
}
|
|
32
|
+
}, [canEnable, onEnabledChange, runtime]);
|
|
33
|
+
return {
|
|
34
|
+
enabled,
|
|
35
|
+
setEnabled,
|
|
36
|
+
status,
|
|
37
|
+
error,
|
|
38
|
+
reason: status === "restricted" ? "background access is restricted" : undefined
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=use-background-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useBluetoothRuntime","useBackgroundSync","enabled","initialEnabled","canEnable","onEnabledChange","runtime","setEnabledState","useState","error","setError","status","setStatus","setEnabled","useCallback","next","undefined","manager","setBackgroundScanEnabled","cause","nextError","Error","String","reason"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-background-sync.ts"],"mappings":";;AAAA;;AAEA,OAAO,KA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O,CAAC,CAAC;EAEzC,OAAO;IAAEJ,OAAO;IAAEW,UAAU;IAAEF,MAAM;IAAEF,KAAK;IAAEc,MAAM,EAAEZ,MAAM,KAAK,YAAY,GAAG,iCAAiC,GAAGK;EAAU,CAAC;AAChI,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/group-exports */
|
|
4
|
+
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { Platform } from "react-native";
|
|
7
|
+
import { State } from "react-native-ble-plx";
|
|
8
|
+
import { PERMISSIONS, requestMultiple } from "react-native-permissions";
|
|
9
|
+
const requestBluetoothPermission = async () => {
|
|
10
|
+
const permissions = Platform.select({
|
|
11
|
+
android: [PERMISSIONS.ANDROID.BLUETOOTH_SCAN, PERMISSIONS.ANDROID.BLUETOOTH_CONNECT],
|
|
12
|
+
ios: [PERMISSIONS.IOS.BLUETOOTH],
|
|
13
|
+
default: []
|
|
14
|
+
});
|
|
15
|
+
const result = await requestMultiple(permissions);
|
|
16
|
+
return Object.values(result).every(value => value === "granted");
|
|
17
|
+
};
|
|
18
|
+
export const useBluetoothState = ({
|
|
19
|
+
bleManager,
|
|
20
|
+
requestPermission = requestBluetoothPermission
|
|
21
|
+
} = {}) => {
|
|
22
|
+
const [state, setState] = React.useState(bleManager ? "off" : "unsupported");
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
if (!bleManager) {
|
|
25
|
+
setState("unsupported");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const subscription = bleManager.onStateChange(nextState => {
|
|
29
|
+
setState(nextState === State.PoweredOn ? "on" : nextState === State.Unsupported ? "unsupported" : nextState === State.Unauthorized ? "unauthorized" : "off");
|
|
30
|
+
}, true);
|
|
31
|
+
return () => subscription.remove();
|
|
32
|
+
}, [bleManager]);
|
|
33
|
+
const request = React.useCallback(async () => {
|
|
34
|
+
const granted = await requestPermission();
|
|
35
|
+
if (!granted) {
|
|
36
|
+
setState("unauthorized");
|
|
37
|
+
}
|
|
38
|
+
return granted;
|
|
39
|
+
}, [requestPermission]);
|
|
40
|
+
return {
|
|
41
|
+
state,
|
|
42
|
+
requestPermission: request
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=use-bluetooth-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Platform","State","PERMISSIONS","requestMultiple","requestBluetoothPermission","permissions","select","android","ANDROID","BLUETOOTH_SCAN","BLUETOOTH_CONNECT","ios","IOS","BLUETOOTH","default","result","Object","values","every","value","useBluetoothState","bleManager","requestPermission","state","setState","useState","useEffect","subscription","onStateChange","nextState","PoweredOn","Unsupported","Unauthorized","remove","request","useCallback","granted"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-bluetooth-state.ts"],"mappings":";;AAAA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAAqBC,KAAK,QAAQ,sBAAsB;AACxD,SAASC,WAAW,EAAEC,eAAe,QAAQ,0BAA0B;AASvE,MAAMC,0BAA0B,GAAG,MAAAA,CAAA,KAA8B;EAC/D,MAAMC,WAAW,GAAGL,QAAQ,CAACM,MAAM,CAAC;IAClCC,OAAO,EAAE,CACPL,WAAW,CAACM,OAAO,CAACC,cAAc,EAClCP,WAAW,CAACM,OAAO,CAACE,iBAAiB,CACtC;IACDC,GAAG,EAAE,CAACT,WAAW,CAACU,GAAG,CAACC,SAAS,CAAC;IAChCC,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,MAAMC,MAAM,GAAG,MAAMZ,eAAe,CAACE,WAAW,CAAC;EAEjD,OAAOW,MAAM,CAACC,MAAM,CAACF,MAAM,CAAC,CAACG,KAAK,CAAEC,KAAK,IAAKA,KAAK,KAAK,SAAS,CAAC;AACpE,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGA,CAAC;EAChCC,UAAU;EACVC,iBAAiB,GAAGlB;AACI,CAAC,GAAG,CAAC,CAAC,KAG3B;EACH,MAAM,CAACmB,KAAK,EAAEC,QAAQ,CAAC,GAAGzB,KAAK,CAAC0B,QAAQ,CACtCJ,UAAU,GAAG,KAAK,GAAG,aACvB,CAAC;EAEDtB,KAAK,CAAC2B,SAAS,CAAC,MAAM;IACpB,IAAI,CAACL,UAAU,EAAE;MACfG,QAAQ,CAAC,aAAa,CAAC;MAEvB;IACF;IAEA,MAAMG,YAAY,GAAGN,UAAU,CAACO,aAAa,CAAEC,SAAS,IAAK;MAC3DL,QAAQ,CACNK,SAAS,KAAK5B,KAAK,CAAC6B,SAAS,GACzB,IAAI,GACJD,SAAS,KAAK5B,KAAK,CAAC8B,WAAW,GAC7B,aAAa,GACbF,SAAS,KAAK5B,KAAK,CAAC+B,YAAY,GAC9B,cAAc,GACd,KACV,CAAC;IACH,CAAC,EAAE,IAAI,CAAC;IAER,OAAO,MAAML,YAAY,CAACM,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,CAACZ,UAAU,CAAC,CAAC;EAEhB,MAAMa,OAAO,GAAGnC,KAAK,CAACoC,WAAW,CAAC,YAAY;IAC5C,MAAMC,OAAO,GAAG,MAAMd,iBAAiB,CAAC,CAAC;IAEzC,IAAI,CAACc,OAAO,EAAE;MAACZ,QAAQ,CAAC,cAAc,CAAC;IAAC;IAExC,OAAOY,OAAO;EAChB,CAAC,EAAE,CAACd,iBAAiB,CAAC,CAAC;EAEvB,OAAO;IAAEC,KAAK;IAAED,iBAAiB,EAAEY;EAAQ,CAAC;AAC9C,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useBluetoothRuntime } from "./runtime-context.js";
|
|
5
|
+
export const useDeviceConnection = id => {
|
|
6
|
+
const runtime = useBluetoothRuntime();
|
|
7
|
+
const [status, setStatus] = React.useState(() => runtime.devices.find(device => device.id === id)?.status);
|
|
8
|
+
const [events, setEvents] = React.useState([]);
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
const unsubStatus = runtime.subscribe("status", value => {
|
|
11
|
+
if (value.deviceData.id === id) {
|
|
12
|
+
setStatus(value.status);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const unsubEvent = runtime.subscribe("connection", event => {
|
|
16
|
+
if (event.deviceData.id === id) {
|
|
17
|
+
setEvents(current => [...current, event]);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return () => {
|
|
21
|
+
unsubStatus();
|
|
22
|
+
unsubEvent();
|
|
23
|
+
};
|
|
24
|
+
}, [id, runtime]);
|
|
25
|
+
return {
|
|
26
|
+
status,
|
|
27
|
+
events
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=use-device-connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useBluetoothRuntime","useDeviceConnection","id","runtime","status","setStatus","useState","devices","find","device","events","setEvents","useEffect","unsubStatus","subscribe","value","deviceData","unsubEvent","event","current"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-device-connection.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAK9B,SAASC,mBAAmB,QAAQ,sBAAmB;AAEvD,OAAO,MAAMC,mBAAmB,GAC9BC,EAAW,IAC6D;EACxE,MAAMC,OAAO,GAAGH,mBAAmB,CAAC,CAAC;EAErC,MAAM,CAACI,MAAM,EAAEC,SAAS,CAAC,GAAGN,KAAK,CAACO,QAAQ,CACxC,MAAMH,OAAO,CAACI,OAAO,CAACC,IAAI,CAAEC,MAAM,IAAKA,MAAM,CAACP,EAAE,KAAKA,EAAE,CAAC,EAAEE,MAC5D,CAAC;EAED,MAAM,CAACM,MAAM,EAAEC,SAAS,CAAC,GAAGZ,KAAK,CAACO,QAAQ,CAAmC,EAAE,CAAC;EAEhFP,KAAK,CAACa,SAAS,CAAC,MAAM;IACpB,MAAMC,WAAW,GAAGV,OAAO,CAACW,SAAS,CACnC,QAAQ,EACPC,KAAK,IAAK;MACT,IAAIA,KAAK,CAACC,UAAU,CAACd,EAAE,KAAKA,EAAE,EAAE;QAACG,SAAS,CAACU,KAAK,CAACX,MAAM,CAAC;MAAC;IAC3D,CACF,CAAC;IAED,MAAMa,UAAU,GAAGd,OAAO,CAACW,SAAS,CAAwB,YAAY,EAAGI,KAAK,IAAK;MACnF,IAAIA,KAAK,CAACF,UAAU,CAACd,EAAE,KAAKA,EAAE,EAAE;QAACS,SAAS,CAAEQ,OAAO,IAAK,CAAC,GAAGA,OAAO,EAAED,KAAK,CAAC,CAAC;MAAC;IAC/E,CAAC,CAAC;IAEF,OAAO,MAAM;MACXL,WAAW,CAAC,CAAC;MACbI,UAAU,CAAC,CAAC;IACd,CAAC;EACH,CAAC,EAAE,CAACf,EAAE,EAAEC,OAAO,CAAC,CAAC;EAEjB,OAAO;IAAEC,MAAM;IAAEM;EAAO,CAAC;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export const useHealthImport = ({
|
|
5
|
+
types,
|
|
6
|
+
background = false,
|
|
7
|
+
adapter
|
|
8
|
+
}) => {
|
|
9
|
+
const [enabled, setEnabled] = React.useState(false);
|
|
10
|
+
const [statusByType, setStatusByType] = React.useState({});
|
|
11
|
+
const [error, setError] = React.useState();
|
|
12
|
+
const refresh = React.useCallback(async () => {
|
|
13
|
+
try {
|
|
14
|
+
const entries = await Promise.all(types.map(async type => [type, await adapter.getStatus(type)]));
|
|
15
|
+
setStatusByType(Object.fromEntries(entries));
|
|
16
|
+
} catch (cause) {
|
|
17
|
+
setError(cause instanceof Error ? cause : new Error(String(cause)));
|
|
18
|
+
}
|
|
19
|
+
}, [adapter, types]);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
void refresh();
|
|
22
|
+
}, [refresh]);
|
|
23
|
+
const setEnabledForTypes = React.useCallback(async next => {
|
|
24
|
+
setError(undefined);
|
|
25
|
+
if (next) {
|
|
26
|
+
await adapter.request(types, background);
|
|
27
|
+
await refresh();
|
|
28
|
+
}
|
|
29
|
+
setEnabled(next);
|
|
30
|
+
}, [adapter, background, refresh, types]);
|
|
31
|
+
const notShared = types.filter(type => statusByType[type] === "refused");
|
|
32
|
+
return {
|
|
33
|
+
enabled,
|
|
34
|
+
setEnabled: setEnabledForTypes,
|
|
35
|
+
statusByType: statusByType,
|
|
36
|
+
notShared,
|
|
37
|
+
error
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=use-health-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useHealthImport","types","background","adapter","enabled","setEnabled","useState","statusByType","setStatusByType","error","setError","refresh","useCallback","entries","Promise","all","map","type","getStatus","Object","fromEntries","cause","Error","String","useEffect","setEnabledForTypes","next","undefined","request","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;EAEjD,MAAMK,OAAO,GAAGZ,KAAK,CAACa,WAAW,CAAC,YAAY;IAC5C,IAAI;MACF,MAAMC,OAAO,GAAG,MAAMC,OAAO,CAAC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oothRuntime } 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 onResultRef = React.useRef(onResult);
|
|
13
|
+
onResultRef.current = onResult;
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
return runtime.subscribe("result", result => {
|
|
16
|
+
if (seen.current.has(result.id)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
seen.current.add(result.id);
|
|
20
|
+
setMeasurements(current => [...current, result].slice(-maxResults));
|
|
21
|
+
onResultRef.current?.(result);
|
|
22
|
+
});
|
|
23
|
+
}, [maxResults, runtime]);
|
|
24
|
+
|
|
25
|
+
// The manager applies device policies at source; this is a host-side guard for
|
|
26
|
+
// consumers that want a single stream policy without changing the scan config.
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
if (policy === "all") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setMeasurements(current => {
|
|
32
|
+
const byKind = new Set();
|
|
33
|
+
return current.filter(result => {
|
|
34
|
+
const key = String(result.data.measurementTypeKey);
|
|
35
|
+
if (policy === "first-reading-per-kind-per-connection" && byKind.has(key)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
byKind.add(key);
|
|
39
|
+
return true;
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}, [policy]);
|
|
43
|
+
return {
|
|
44
|
+
measurements,
|
|
45
|
+
clear: () => {
|
|
46
|
+
seen.current.clear();
|
|
47
|
+
setMeasurements([]);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
//# 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","onResultRef","current","useEffect","subscribe","result","has","id","add","slice","byKind","filter","key","String","data","measurementTypeKey","clear"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-measurements.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAAwBC,mBAAmB,QAAQ,sBAAmB;AAOtE,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,QAA0C,EAC1C;EAAEC,MAAM,GAAG,KAAK;EAAEC,UAAU,GAAG;AAA4B,CAAC,GAAG,CAAC,CAAC,KACC;EAClE,MAAMC,OAAO,GAAGL,mBAAmB,CAAC,CAAC;EACrC,MAAM,CAACM,YAAY,EAAEC,eAAe,CAAC,GAAGR,KAAK,CAACS,QAAQ,CAA2B,EAAE,CAAC;EACpF,MAAMC,IAAI,GAAGV,KAAK,CAACW,MAAM,CAAC,IAAIC,GAAG,CAAS,CAAC,CAAC;EAC5C,MAAMC,WAAW,GAAGb,KAAK,CAACW,MAAM,CAACR,QAAQ,CAAC;EAE1CU,WAAW,CAACC,OAAO,GAAGX,QAAQ;EAE9BH,KAAK,CAACe,SAAS,CAAC,MAAM;IACpB,OAAOT,OAAO,CAACU,SAAS,CAAgB,QAAQ,EAAGC,MAAM,IAAK;MAC5D,IAAIP,IAAI,CAACI,OAAO,CAACI,GAAG,CAACD,MAAM,CAACE,EAAE,CAAC,EAAE;QAAC;MAAO;MACzCT,IAAI,CAACI,OAAO,CAACM,GAAG,CAACH,MAAM,CAACE,EAAE,CAAC;MAC3BX,eAAe,CAAEM,OAAO,IAAK,CAAC,GAAGA,OAAO,EAAEG,MAAM,CAAC,CAACI,KAAK,CAAC,CAAChB,UAAU,CAAC,CAAC;MACrEQ,WAAW,CAACC,OAAO,GAAGG,MAAM,CAAC;IAC/B,CAAC,CAAC;EACJ,CAAC,EAAE,CAACZ,UAAU,EAAEC,OAAO,CAAC,CAAC;;EAEzB;EACA;EACAN,KAAK,CAACe,SAAS,CAAC,MAAM;IACpB,IAAIX,MAAM,KAAK,KAAK,EAAE;MAAC;IAAO;IAC9BI,eAAe,CAAEM,OAAO,IAAK;MAC3B,MAAMQ,MAAM,GAAG,IAAIV,GAAG,CAAS,CAAC;MAEhC,OAAOE,OAAO,CAACS,MAAM,CAAEN,MAAM,IAAK;QAChC,MAAMO,GAAG,GAAGC,MAAM,CAACR,MAAM,CAACS,IAAI,CAACC,kBAAkB,CAAC;QAElD,IAAIvB,MAAM,KAAK,uCAAuC,IAAIkB,MAAM,CAACJ,GAAG,CAACM,GAAG,CAAC,EAAE;UAAC,OAAO,KAAK;QAAC;QACzFF,MAAM,CAACF,GAAG,CAACI,GAAG,CAAC;QAEf,OAAO,IAAI;MACb,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,EAAE,CAACpB,MAAM,CAAC,CAAC;EAEZ,OAAO;IAAEG,YAAY;IAAEqB,KAAK,EAAEA,CAAA,KAAM;MAAElB,IAAI,CAACI,OAAO,CAACc,KAAK,CAAC,CAAC;MAAEpB,eAAe,CAAC,EAAE,CAAC;IAAE;EAAE,CAAC;AACtF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
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(() => runtime.subscribe("deviceFound", redraw), [runtime]);
|
|
9
|
+
return {
|
|
10
|
+
devices: runtime.devices,
|
|
11
|
+
pair: async id => {
|
|
12
|
+
const device = runtime.devices.find(item => item.id === id);
|
|
13
|
+
if (device) {
|
|
14
|
+
await device.device.connect();
|
|
15
|
+
}
|
|
16
|
+
return device;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=use-nearby-devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useBluetoothRuntime","useNearbyDevices","runtime","redraw","useReducer","value","useEffect","subscribe","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,MAAMJ,OAAO,CAACK,SAAS,CAAC,aAAa,EAAEJ,MAAM,CAAC,EAAE,CAACD,OAAO,CAAC,CAAC;EAE1E,OAAO;IACLM,OAAO,EAAEN,OAAO,CAACM,OAAO;IACxBC,IAAI,EAAE,MAAOC,EAAE,IAAK;MAClB,MAAMC,MAAM,GAAGT,OAAO,CAACM,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,43 @@
|
|
|
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 save = React.useCallback(async next => {
|
|
15
|
+
setPaired(next);
|
|
16
|
+
await storage.setItem(storageKey, JSON.stringify(next));
|
|
17
|
+
}, [storage, storageKey]);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
void storage.getItem(storageKey).then(value => {
|
|
20
|
+
try {
|
|
21
|
+
const parsed = value ? JSON.parse(value) : [];
|
|
22
|
+
setPaired(Array.isArray(parsed) ? parsed.filter(id => typeof id === "string") : []);
|
|
23
|
+
} catch {
|
|
24
|
+
setPaired([]);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}, [storage, storageKey]);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
if (!autoPair) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
runtime.devices.filter(device => paired.includes(device.id)).forEach(device => void device.device.connect());
|
|
33
|
+
}, [autoPair, paired, runtime, runtime.devices]);
|
|
34
|
+
return {
|
|
35
|
+
paired,
|
|
36
|
+
pair: device => save([...new Set([...paired, device.id])]),
|
|
37
|
+
forget: async id => {
|
|
38
|
+
await runtime.manager?.forget(id);
|
|
39
|
+
await save(paired.filter(candidate => candidate !== id));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=use-paired-devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useBluetoothRuntime","usePairedDevices","storage","storageKey","autoPair","runtime","paired","setPaired","useState","save","useCallback","next","setItem","JSON","stringify","useEffect","getItem","then","value","parsed","parse","Array","isArray","filter","id","devices","device","includes","forEach","connect","pair","Set","forget","manager","candidate"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-paired-devices.ts"],"mappings":";;AAAA;;AAEA,OAAO,KAAKA,KAAK,MAAM,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M,CAACF,EAAE,CAAC,CAAC,CAC9CI,OAAO,CAAEF,MAAM,IAAK,KAAKA,MAAM,CAACA,MAAM,CAACG,OAAO,CAAC,CAAC,CAAC;EACtD,CAAC,EAAE,CAACzB,QAAQ,EAAEE,MAAM,EAAED,OAAO,EAAEA,OAAO,CAACoB,OAAO,CAAC,CAAC;EAEhD,OAAO;IACLnB,MAAM;IACNwB,IAAI,EAAGJ,MAAM,IAAKjB,IAAI,CAAC,CAAC,GAAG,IAAIsB,GAAG,CAAC,CAAC,GAAGzB,MAAM,EAAEoB,MAAM,CAACF,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5DQ,MAAM,EAAE,MAAOR,EAAE,IAAK;MACpB,MAAMnB,OAAO,CAAC4B,OAAO,EAAED,MAAM,CAACR,EAAE,CAAC;MACjC,MAAMf,IAAI,CAACH,MAAM,CAACiB,MAAM,CAAEW,SAAS,IAAKA,SAAS,KAAKV,EAAE,CAAC,CAAC;IAC5D;EACF,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,12 @@ 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";
|
|
70
83
|
//# 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","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,7 +63,18 @@ 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
79
|
await this.options.storage.setItem(this.storageKey, "[]");
|
|
58
80
|
throw new Error(`Background sync queue could not be read: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -78,21 +100,36 @@ class BackgroundSyncCoordinator {
|
|
|
78
100
|
try {
|
|
79
101
|
await this.options.onResult({
|
|
80
102
|
...item.result,
|
|
81
|
-
id: item.id,
|
|
103
|
+
id: item.result.id,
|
|
104
|
+
queueId: item.queueId,
|
|
82
105
|
queuedAt: item.queuedAt,
|
|
83
106
|
attempt
|
|
84
107
|
});
|
|
85
108
|
queue.splice(queue.indexOf(item), 1);
|
|
109
|
+
recordOvokMetric("ovok.queue.delivered", 1, {
|
|
110
|
+
attempt,
|
|
111
|
+
measurementTypeKey: item.result.data.measurementTypeKey
|
|
112
|
+
});
|
|
86
113
|
changed = true;
|
|
87
114
|
} catch {
|
|
88
115
|
item.attempt = attempt;
|
|
89
116
|
item.exhausted = attempt >= this.maxRetries;
|
|
90
117
|
item.nextAttemptAt = item.exhausted ? Number.MAX_SAFE_INTEGER : Date.now() + this.retryBackoffMs * 2 ** (attempt - 1);
|
|
118
|
+
recordOvokMetric("ovok.queue.retries", 1, {
|
|
119
|
+
attempt
|
|
120
|
+
});
|
|
121
|
+
if (item.exhausted) {
|
|
122
|
+
recordOvokMetric("ovok.queue.exhausted", 1, {
|
|
123
|
+
attempt,
|
|
124
|
+
exhausted: true
|
|
125
|
+
});
|
|
126
|
+
}
|
|
91
127
|
changed = true;
|
|
92
128
|
}
|
|
93
129
|
}
|
|
94
130
|
if (changed) {
|
|
95
131
|
await this.writeQueue(queue);
|
|
132
|
+
recordOvokMetric("ovok.queue.depth", queue.length);
|
|
96
133
|
}
|
|
97
134
|
};
|
|
98
135
|
}
|
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","setItem","message","String","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;;AA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