@ovok/native 1.5.6 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -19
- package/android/src/main/AndroidManifest.xml +1 -20
- package/app.plugin.js +181 -0
- package/lib/commonjs/index.js +5 -104
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
- package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js +23 -0
- package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js +105 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -0
- package/lib/commonjs/modules/auth/index.js +44 -0
- package/lib/commonjs/modules/auth/index.js.map +1 -1
- package/lib/commonjs/modules/auth/logout-button/components/logout-button.js +5 -2
- package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/inputs.js +50 -1
- package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-button.js +4 -0
- package/lib/commonjs/modules/auth/register/components/form/register-button.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +6 -0
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js +12 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/components/session-list.js +82 -0
- package/lib/commonjs/modules/auth/session/components/session-list.js.map +1 -0
- package/lib/commonjs/modules/auth/session/events.js +19 -0
- package/lib/commonjs/modules/auth/session/events.js.map +1 -0
- package/lib/commonjs/modules/auth/session/index.js +13 -0
- package/lib/commonjs/modules/auth/session/index.js.map +1 -0
- package/lib/commonjs/modules/auth/session/types/session-list-props.js +6 -0
- package/lib/commonjs/modules/auth/session/types/session-list-props.js.map +1 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js +26 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js +58 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js +13 -5
- package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
- package/lib/commonjs/modules/auth/types/session.js +2 -0
- package/lib/commonjs/modules/auth/types/session.js.map +1 -0
- package/lib/commonjs/modules/auth/utils/rate-limit.js +37 -0
- package/lib/commonjs/modules/auth/utils/rate-limit.js.map +1 -0
- package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
- package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/background-sync/background-safe-storage.js +76 -0
- package/lib/commonjs/modules/background-sync/background-safe-storage.js.map +1 -0
- package/lib/commonjs/modules/background-sync/index.js +11 -0
- package/lib/commonjs/modules/background-sync/index.js.map +1 -1
- package/lib/commonjs/modules/bt-device/index.js +0 -22
- package/lib/commonjs/modules/bt-device/index.js.map +1 -1
- package/lib/commonjs/modules/bt-device-instructions/index.js +39 -0
- package/lib/commonjs/modules/bt-device-instructions/index.js.map +1 -0
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +64 -0
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js +1 -0
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +95 -0
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +51 -0
- package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +51 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js +40 -0
- package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-health-import.js +82 -0
- package/lib/commonjs/modules/bt-management/hooks/use-health-import.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +79 -0
- package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js +33 -0
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js +58 -0
- package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js +21 -0
- package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js.map +1 -0
- package/lib/commonjs/modules/bt-management/index.js +154 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +91 -22
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +107 -4
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +9 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
- package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
- package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/push-notification.js +39 -0
- package/lib/commonjs/modules/bt-management/services/push-notification.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +132 -0
- package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/index.js +28 -0
- package/lib/commonjs/modules/bt-management/testing/index.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/recorded-frames.js +23 -0
- package/lib/commonjs/modules/bt-management/testing/recorded-frames.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +82 -0
- package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-connection-event.js +6 -0
- package/lib/commonjs/modules/bt-management/types/device-connection-event.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/result-policy.js +6 -0
- package/lib/commonjs/modules/bt-management/types/result-policy.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/result-identity.js +63 -0
- package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -0
- package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
- package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +29 -4
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +2 -2
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js +29 -21
- package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/retry-save.js +99 -0
- package/lib/commonjs/modules/data-sync/utils/retry-save.js.map +1 -0
- package/lib/commonjs/modules/helpers/form-items/form-field.js +2 -0
- package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/commonjs/modules/helpers/index.js +23 -4
- package/lib/commonjs/modules/helpers/index.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/s-log.js +4 -13
- package/lib/commonjs/modules/helpers/utils/s-log.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/sentry-logger.js +27 -17
- package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/telemetry.js +230 -0
- package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
- package/lib/commonjs/modules/image/components/optimized-image.js +31 -6
- package/lib/commonjs/modules/image/components/optimized-image.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +18 -9
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
- package/lib/commonjs/modules/tile/components/task-icon.js +2 -1
- package/lib/commonjs/modules/tile/components/task-icon.js.map +1 -1
- package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js +4 -1
- package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js.map +1 -1
- package/lib/commonjs/modules/ui/components/background-sync-setting.js +123 -0
- package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +119 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
- package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +175 -0
- package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
- package/lib/commonjs/modules/ui/components/health-import-card.js +141 -0
- package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
- package/lib/commonjs/modules/ui/components/manual-entry-form.js +136 -0
- package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
- package/lib/commonjs/modules/ui/components/pairing-flow.js +247 -0
- package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
- package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +107 -0
- package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
- package/lib/commonjs/modules/ui/components/urine-test-result.js +99 -0
- package/lib/commonjs/modules/ui/components/urine-test-result.js.map +1 -0
- package/lib/commonjs/modules/ui/index.js +116 -0
- package/lib/commonjs/modules/ui/index.js.map +1 -0
- package/lib/commonjs/modules/ui/types.js +6 -0
- package/lib/commonjs/modules/ui/types.js.map +1 -0
- package/lib/commonjs/modules/ui/use-ovok-ui.js +51 -0
- package/lib/commonjs/modules/ui/use-ovok-ui.js.map +1 -0
- package/lib/module/index.js +3 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
- package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js +17 -0
- package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
- package/lib/module/modules/auth/hooks/use-session.js +99 -0
- package/lib/module/modules/auth/hooks/use-session.js.map +1 -0
- package/lib/module/modules/auth/index.js +4 -0
- package/lib/module/modules/auth/index.js.map +1 -1
- package/lib/module/modules/auth/logout-button/components/logout-button.js +5 -2
- package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/inputs.js +50 -1
- package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-button.js +4 -0
- package/lib/module/modules/auth/register/components/form/register-button.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-form-provider.js +6 -0
- package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/inputs.js +12 -0
- package/lib/module/modules/auth/reset-password/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
- package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/components/session-list.js +76 -0
- package/lib/module/modules/auth/session/components/session-list.js.map +1 -0
- package/lib/module/modules/auth/session/events.js +13 -0
- package/lib/module/modules/auth/session/events.js.map +1 -0
- package/lib/module/modules/auth/session/index.js +4 -0
- package/lib/module/modules/auth/session/index.js.map +1 -0
- package/lib/module/modules/auth/session/types/session-list-props.js +4 -0
- package/lib/module/modules/auth/session/types/session-list-props.js.map +1 -0
- package/lib/module/modules/auth/sign-in/components/form/inputs.js +26 -0
- package/lib/module/modules/auth/sign-in/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
- package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js +52 -0
- package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
- package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
- package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/signin-button.js +13 -5
- package/lib/module/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
- package/lib/module/modules/auth/types/session.js +2 -0
- package/lib/module/modules/auth/types/session.js.map +1 -0
- package/lib/module/modules/auth/utils/rate-limit.js +31 -0
- package/lib/module/modules/auth/utils/rate-limit.js.map +1 -0
- package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
- package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/module/modules/background-sync/background-safe-storage.js +71 -0
- package/lib/module/modules/background-sync/background-safe-storage.js.map +1 -0
- package/lib/module/modules/background-sync/index.js +1 -0
- package/lib/module/modules/background-sync/index.js.map +1 -1
- package/lib/module/modules/bt-device/index.js +0 -2
- package/lib/module/modules/bt-device/index.js.map +1 -1
- package/lib/module/modules/bt-device-instructions/index.js +6 -0
- package/lib/module/modules/bt-device-instructions/index.js.map +1 -0
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +58 -0
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js +1 -0
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/runtime-context.js +86 -0
- package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-background-sync.js +45 -0
- package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +45 -0
- package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-device-connection.js +34 -0
- package/lib/module/modules/bt-management/hooks/use-device-connection.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-health-import.js +76 -0
- package/lib/module/modules/bt-management/hooks/use-health-import.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-measurements.js +73 -0
- package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-nearby-devices.js +27 -0
- package/lib/module/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-paired-devices.js +52 -0
- package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-scan-control.js +16 -0
- package/lib/module/modules/bt-management/hooks/use-scan-control.js.map +1 -0
- package/lib/module/modules/bt-management/index.js +14 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +91 -22
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +107 -4
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +9 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
- package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
- package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
- package/lib/module/modules/bt-management/services/push-notification.js +34 -0
- package/lib/module/modules/bt-management/services/push-notification.js.map +1 -0
- package/lib/module/modules/bt-management/testing/fake-ble-manager.js +127 -0
- package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
- package/lib/module/modules/bt-management/testing/index.js +5 -0
- package/lib/module/modules/bt-management/testing/index.js.map +1 -0
- package/lib/module/modules/bt-management/testing/recorded-frames.js +17 -0
- package/lib/module/modules/bt-management/testing/recorded-frames.js.map +1 -0
- package/lib/module/modules/bt-management/types/bluetooth-error.js +76 -0
- package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-connection-event.js +4 -0
- package/lib/module/modules/bt-management/types/device-connection-event.js.map +1 -0
- package/lib/module/modules/bt-management/types/result-policy.js +4 -0
- package/lib/module/modules/bt-management/types/result-policy.js.map +1 -0
- package/lib/module/modules/bt-management/utils/result-identity.js +57 -0
- package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -0
- package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
- package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
- package/lib/module/modules/data-sync/services/base-health-sync-service.js +29 -4
- package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/data-processor.js +2 -2
- package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
- package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
- package/lib/module/modules/data-sync/utils/generate-observation-entry.js +29 -21
- package/lib/module/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
- package/lib/module/modules/data-sync/utils/retry-save.js +92 -0
- package/lib/module/modules/data-sync/utils/retry-save.js.map +1 -0
- package/lib/module/modules/helpers/form-items/form-field.js +2 -0
- package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/module/modules/helpers/index.js +2 -1
- package/lib/module/modules/helpers/index.js.map +1 -1
- package/lib/module/modules/helpers/utils/s-log.js +4 -12
- package/lib/module/modules/helpers/utils/s-log.js.map +1 -1
- package/lib/module/modules/helpers/utils/sentry-logger.js +25 -14
- package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
- package/lib/module/modules/helpers/utils/telemetry.js +218 -0
- package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
- package/lib/module/modules/image/components/optimized-image.js +32 -7
- package/lib/module/modules/image/components/optimized-image.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +20 -11
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
- package/lib/module/modules/tile/components/task-icon.js +2 -1
- package/lib/module/modules/tile/components/task-icon.js.map +1 -1
- package/lib/module/modules/tile/constants/measurement-icon-svg.js +4 -1
- package/lib/module/modules/tile/constants/measurement-icon-svg.js.map +1 -1
- package/lib/module/modules/ui/components/background-sync-setting.js +117 -0
- package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js +113 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
- package/lib/module/modules/ui/components/ecg-strip-viewer.js +169 -0
- package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
- package/lib/module/modules/ui/components/health-import-card.js +135 -0
- package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
- package/lib/module/modules/ui/components/manual-entry-form.js +130 -0
- package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
- package/lib/module/modules/ui/components/pairing-flow.js +241 -0
- package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
- package/lib/module/modules/ui/components/supported-devices-catalog-list.js +101 -0
- package/lib/module/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
- package/lib/module/modules/ui/components/urine-test-result.js +94 -0
- package/lib/module/modules/ui/components/urine-test-result.js.map +1 -0
- package/lib/module/modules/ui/index.js +13 -0
- package/lib/module/modules/ui/index.js.map +1 -0
- package/lib/module/modules/ui/types.js +4 -0
- package/lib/module/modules/ui/types.js.map +1 -0
- package/lib/module/modules/ui/use-ovok-ui.js +45 -0
- package/lib/module/modules/ui/use-ovok-ui.js.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +0 -9
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
- package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
- package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts +31 -0
- package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts +0 -2
- package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts +5 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/helpers/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/s-log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts +69 -0
- package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/tile/components/task-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/types.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/ui/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +0 -9
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +16 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/index.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/events.d.ts +5 -0
- package/lib/typescript/module/src/modules/auth/session/events.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/index.d.ts +3 -0
- package/lib/typescript/module/src/modules/auth/session/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts +5 -0
- package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
- package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
- package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
- package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/types/session.d.ts +10 -0
- package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts +11 -0
- package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts +31 -0
- package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/background-sync/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/background-sync/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/index.d.ts +0 -2
- package/lib/typescript/module/src/modules/bt-device/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
- package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts +5 -2
- package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
- package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts +6 -0
- package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +4 -1
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/index.d.ts +2 -1
- package/lib/typescript/module/src/modules/helpers/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/s-log.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
- package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts +69 -0
- package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts +1 -1
- package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts +4 -0
- package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/tile/components/task-icon.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
- package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts +9 -0
- package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
- package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts +13 -0
- package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts +21 -0
- package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts +15 -0
- package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
- package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts +10 -0
- package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts +11 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/types.d.ts +24 -0
- package/lib/typescript/module/src/modules/ui/types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts +7 -0
- package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
- package/package.json +146 -7
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
/* eslint-disable max-lines */
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { AppState } from "react-native";
|
|
6
|
-
import { AndroidBluetoothForegroundService, showPushNotification } from "../../background-sync/index.js";
|
|
7
6
|
import { useDeviceList } from "../../bt-device/components/hooks/use-device-list.js";
|
|
8
7
|
import { sentryLogger } from "../../helpers/utils/sentry-logger.js";
|
|
8
|
+
import { BluetoothRuntimeProvider, createBluetoothRuntime } from "../hooks/runtime-context.js";
|
|
9
9
|
import { getRestoredBleState } from "../services/background-sync/background-ble-manager.js";
|
|
10
10
|
import { getBackgroundServiceUUIDs } from "../services/background-sync/background-service-uuids.js";
|
|
11
11
|
import { BackgroundSyncCoordinator } from "../services/background-sync/background-sync-coordinator.js";
|
|
12
12
|
import { BTManager } from "../services/bt-manager.js";
|
|
13
|
+
import { showBackgroundPushNotification } from "../services/push-notification.js";
|
|
14
|
+
import { toBluetoothError } from "../types/bluetooth-error.js";
|
|
15
|
+
import { AndroidBluetoothForegroundService } from "./android-bluetooth-foreground-service.js";
|
|
13
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
17
|
export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
15
18
|
bleManager,
|
|
@@ -20,10 +23,13 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
20
23
|
onDeviceFound,
|
|
21
24
|
onError,
|
|
22
25
|
onDeviceStatusChanged,
|
|
26
|
+
onConnectionEvent,
|
|
23
27
|
onResult,
|
|
28
|
+
resultPolicies,
|
|
24
29
|
backgroundSync
|
|
25
30
|
}) => {
|
|
26
31
|
const btManagerRef = React.useRef(null);
|
|
32
|
+
const runtimeRef = React.useRef(createBluetoothRuntime(bleManager));
|
|
27
33
|
const backgroundSyncRef = React.useRef(backgroundSync);
|
|
28
34
|
const backgroundSyncCoordinatorRef = React.useRef(null);
|
|
29
35
|
const {
|
|
@@ -34,6 +40,7 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
34
40
|
if (!acceptedDevices.length) {
|
|
35
41
|
return;
|
|
36
42
|
}
|
|
43
|
+
const runtime = runtimeRef.current;
|
|
37
44
|
sentryLogger("info", "Creating BTManager");
|
|
38
45
|
const currentBackgroundSync = backgroundSyncRef.current;
|
|
39
46
|
const isBackgroundEnabled = currentBackgroundSync?.enabled === true;
|
|
@@ -48,6 +55,9 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
48
55
|
}),
|
|
49
56
|
...(deliveredEcgFileNames === undefined ? {} : {
|
|
50
57
|
deliveredEcgFileNames
|
|
58
|
+
}),
|
|
59
|
+
...(resultPolicies === undefined ? {} : {
|
|
60
|
+
resultPolicies
|
|
51
61
|
})
|
|
52
62
|
};
|
|
53
63
|
const btManager = Object.keys(managerOptions).length ? new BTManager(bleManager, acceptedDevices, managerOptions) : new BTManager(bleManager, acceptedDevices);
|
|
@@ -66,7 +76,7 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
66
76
|
const body = latest.notifications.body;
|
|
67
77
|
const data = latest.notifications.data;
|
|
68
78
|
try {
|
|
69
|
-
await
|
|
79
|
+
await showBackgroundPushNotification({
|
|
70
80
|
title: latest.notifications.title ?? "New health measurement",
|
|
71
81
|
body: body === undefined ? `${result.deviceData.name} reported a measurement` : typeof body === "function" ? body(result) : body,
|
|
72
82
|
...(data === undefined ? {} : {
|
|
@@ -75,12 +85,13 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
75
85
|
});
|
|
76
86
|
} catch (error) {
|
|
77
87
|
onError?.({
|
|
78
|
-
error:
|
|
88
|
+
error: toBluetoothError(error)
|
|
79
89
|
});
|
|
80
90
|
}
|
|
81
91
|
}
|
|
82
92
|
}) : null;
|
|
83
93
|
btManagerRef.current = btManager;
|
|
94
|
+
runtime.setManager(btManager);
|
|
84
95
|
backgroundSyncCoordinatorRef.current = coordinator;
|
|
85
96
|
btManager.setBackgroundScanEnabled(isBackgroundEnabled && AppState.currentState !== "active");
|
|
86
97
|
btManager.startScan();
|
|
@@ -88,59 +99,96 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
88
99
|
sentryLogger("info", "Destroying scan service");
|
|
89
100
|
backgroundSyncCoordinatorRef.current = null;
|
|
90
101
|
btManagerRef.current = null;
|
|
102
|
+
runtime.setManager(undefined);
|
|
91
103
|
btManager.destroy();
|
|
92
104
|
};
|
|
93
|
-
}, [acceptedDevices, backgroundSync?.enabled, backgroundSync?.maxRetries, backgroundSync?.retryBackoffMs, backgroundSync?.serviceUUIDs, backgroundSync?.storage, backgroundSync?.storageKey, backgroundSync?.notifications?.enabled, backgroundSync?.notifications?.title, backgroundSync?.notifications?.body, backgroundSync?.notifications?.data, bleManager, deliveredEcgFileNames, onError, oneReadingPerConnection]);
|
|
105
|
+
}, [acceptedDevices, backgroundSync?.enabled, backgroundSync?.maxRetries, backgroundSync?.retryBackoffMs, backgroundSync?.serviceUUIDs, backgroundSync?.storage, backgroundSync?.storageKey, backgroundSync?.notifications?.enabled, backgroundSync?.notifications?.title, backgroundSync?.notifications?.body, backgroundSync?.notifications?.data, bleManager, deliveredEcgFileNames, resultPolicies, onError, oneReadingPerConnection]);
|
|
94
106
|
React.useEffect(() => {
|
|
95
|
-
if (!
|
|
107
|
+
if (!acceptedDevices.length) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const runtime = runtimeRef.current;
|
|
111
|
+
const manager = btManagerRef.current;
|
|
112
|
+
if (!manager) {
|
|
96
113
|
return;
|
|
97
114
|
}
|
|
98
|
-
|
|
115
|
+
manager.onDeviceFound((device, deviceManager) => {
|
|
116
|
+
runtime.upsertDevice(device);
|
|
117
|
+
runtime.emit("deviceFound", device);
|
|
118
|
+
return onDeviceFound?.(device, deviceManager) ?? Promise.resolve();
|
|
119
|
+
});
|
|
99
120
|
return () => {
|
|
100
|
-
|
|
121
|
+
manager.onDeviceFound(undefined);
|
|
101
122
|
};
|
|
102
123
|
}, [onDeviceFound, acceptedDevices]);
|
|
103
124
|
React.useEffect(() => {
|
|
104
|
-
if (!
|
|
125
|
+
if (!acceptedDevices.length) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const runtime = runtimeRef.current;
|
|
129
|
+
const manager = btManagerRef.current;
|
|
130
|
+
if (!manager) {
|
|
105
131
|
return;
|
|
106
132
|
}
|
|
107
|
-
|
|
133
|
+
manager.onError(data => {
|
|
134
|
+
runtime.emit("error", data);
|
|
135
|
+
onError?.(data);
|
|
136
|
+
});
|
|
108
137
|
return () => {
|
|
109
|
-
|
|
138
|
+
manager.onError(undefined);
|
|
110
139
|
};
|
|
111
140
|
}, [onError, acceptedDevices]);
|
|
112
141
|
React.useEffect(() => {
|
|
113
142
|
if (!acceptedDevices.length) {
|
|
114
143
|
return;
|
|
115
144
|
}
|
|
145
|
+
const runtime = runtimeRef.current;
|
|
146
|
+
const manager = btManagerRef.current;
|
|
147
|
+
if (!manager) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
116
150
|
const callback = backgroundSync?.enabled === true ? data => {
|
|
117
151
|
onResult?.(data);
|
|
118
152
|
const coordinator = backgroundSyncCoordinatorRef.current;
|
|
119
153
|
if (coordinator) {
|
|
120
154
|
void coordinator.enqueue(data).catch(error => {
|
|
121
155
|
onError?.({
|
|
122
|
-
error:
|
|
156
|
+
error: toBluetoothError(error)
|
|
123
157
|
});
|
|
124
158
|
});
|
|
125
159
|
}
|
|
126
160
|
} : onResult;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
161
|
+
manager.onResult(data => {
|
|
162
|
+
runtime.emit("result", data);
|
|
163
|
+
callback?.(data);
|
|
164
|
+
});
|
|
131
165
|
return () => {
|
|
132
|
-
|
|
166
|
+
manager.onResult(undefined);
|
|
133
167
|
};
|
|
134
168
|
}, [backgroundSync?.enabled, onError, onResult, acceptedDevices]);
|
|
135
169
|
React.useEffect(() => {
|
|
136
|
-
if (!
|
|
170
|
+
if (!acceptedDevices.length) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const runtime = runtimeRef.current;
|
|
174
|
+
const manager = btManagerRef.current;
|
|
175
|
+
if (!manager) {
|
|
137
176
|
return;
|
|
138
177
|
}
|
|
139
|
-
|
|
178
|
+
manager.onDeviceStatusChanged(({
|
|
140
179
|
status,
|
|
141
180
|
deviceData,
|
|
142
181
|
measurementTypeKey
|
|
143
182
|
}) => {
|
|
183
|
+
runtime.setDeviceStatus({
|
|
184
|
+
deviceData,
|
|
185
|
+
status
|
|
186
|
+
});
|
|
187
|
+
runtime.emit("status", {
|
|
188
|
+
status,
|
|
189
|
+
deviceData,
|
|
190
|
+
measurementTypeKey
|
|
191
|
+
});
|
|
144
192
|
setDeviceListItems(prev => {
|
|
145
193
|
const newList = [...prev];
|
|
146
194
|
const index = newList.findIndex(item => item.deviceType === deviceData.name);
|
|
@@ -153,7 +201,7 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
153
201
|
};
|
|
154
202
|
return newList;
|
|
155
203
|
});
|
|
156
|
-
onDeviceStatusChanged({
|
|
204
|
+
onDeviceStatusChanged?.({
|
|
157
205
|
status,
|
|
158
206
|
deviceData,
|
|
159
207
|
measurementTypeKey
|
|
@@ -163,6 +211,23 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
163
211
|
btManagerRef.current?.onDeviceStatusChanged(undefined);
|
|
164
212
|
};
|
|
165
213
|
}, [onDeviceStatusChanged, acceptedDevices, setDeviceListItems]);
|
|
214
|
+
React.useEffect(() => {
|
|
215
|
+
if (!acceptedDevices.length) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const runtime = runtimeRef.current;
|
|
219
|
+
const manager = btManagerRef.current;
|
|
220
|
+
if (!manager || typeof manager.onConnectionEvent !== "function") {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
manager.onConnectionEvent(event => {
|
|
224
|
+
runtime.emit("connection", event);
|
|
225
|
+
onConnectionEvent?.(event);
|
|
226
|
+
});
|
|
227
|
+
return () => {
|
|
228
|
+
manager.onConnectionEvent(undefined);
|
|
229
|
+
};
|
|
230
|
+
}, [onConnectionEvent, acceptedDevices]);
|
|
166
231
|
React.useEffect(() => {
|
|
167
232
|
if (!acceptedDevices.length || backgroundSync?.enabled !== true) {
|
|
168
233
|
return;
|
|
@@ -176,7 +241,7 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
176
241
|
resetExhausted: true
|
|
177
242
|
}).catch(error => {
|
|
178
243
|
onError?.({
|
|
179
|
-
error:
|
|
244
|
+
error: toBluetoothError(error)
|
|
180
245
|
});
|
|
181
246
|
});
|
|
182
247
|
}, [acceptedDevices, backgroundSync?.enabled, backgroundSync?.restoreStateIdentifier, onError]);
|
|
@@ -189,7 +254,7 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
189
254
|
resetExhausted: true
|
|
190
255
|
}).catch(error => {
|
|
191
256
|
onError?.({
|
|
192
|
-
error:
|
|
257
|
+
error: toBluetoothError(error)
|
|
193
258
|
});
|
|
194
259
|
});
|
|
195
260
|
}
|
|
@@ -198,11 +263,14 @@ export const BTProviderChildWrapper = /*#__PURE__*/React.memo(({
|
|
|
198
263
|
listener.remove();
|
|
199
264
|
};
|
|
200
265
|
}, [onError]);
|
|
201
|
-
return /*#__PURE__*/_jsx(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
266
|
+
return /*#__PURE__*/_jsx(BluetoothRuntimeProvider, {
|
|
267
|
+
runtime: runtimeRef.current,
|
|
268
|
+
children: /*#__PURE__*/_jsx(AndroidBluetoothForegroundService, {
|
|
269
|
+
enabled: backgroundSync?.enabled === true,
|
|
270
|
+
options: backgroundSync?.android?.foregroundService,
|
|
271
|
+
onError: onError,
|
|
272
|
+
children: children
|
|
273
|
+
})
|
|
206
274
|
});
|
|
207
275
|
});
|
|
208
276
|
//# sourceMappingURL=bt-provider-child-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","AppState","AndroidBluetoothForegroundService","showPushNotification","useDeviceList","sentryLogger","getRestoredBleState","getBackgroundServiceUUIDs","BackgroundSyncCoordinator","BTManager","jsx","_jsx","BTProviderChildWrapper","memo","bleManager","acceptedDevices","children","oneReadingPerConnection","deliveredEcgFileNames","onDeviceFound","onError","onDeviceStatusChanged","onResult","backgroundSync","btManagerRef","useRef","backgroundSyncRef","backgroundSyncCoordinatorRef","setDeviceListItems","current","useEffect","length","currentBackgroundSync","isBackgroundEnabled","enabled","backgroundOptions","backgroundEnabled","serviceUUIDs","undefined","managerOptions","btManager","Object","keys","coordinator","result","latest","notifications","body","data","title","deviceData","name","error","Error","String","setBackgroundScanEnabled","currentState","startScan","destroy","maxRetries","retryBackoffMs","storage","storageKey","callback","enqueue","catch","status","measurementTypeKey","prev","newList","index","findIndex","item","deviceType","restoredState","restoreStateIdentifier","connectedPeripherals","restoreDevices","flush","includeExhausted","resetExhausted","listener","addEventListener","state","remove","options","android","foregroundService"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/bt-provider-child-wrapper.tsx"],"mappings":";;AAAA;AACA,OAAO,KAAKA,KAAK,M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AAC,CAAC;QACJ,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACX6B,QAAQ,CAACG,MAAM,CAAC,CAAC;IACnB,CAAC;EACH,CAAC,EAAE,CAAChE,OAAO,CAAC,CAAC;EAEb,oBACET,IAAA,CAACT,iCAAiC;IAChCgC,OAAO,EAAEX,cAAc,EAAEW,OAAO,KAAK,IAAK;IAC1CmD,OAAO,EAAE9D,cAAc,EAAE+D,OAAO,EAAEC,iBAAkB;IACpDnE,OAAO,EAAEA,OAAQ;IAAAJ,QAAA,EAEhBA;EAAQ,CACwB,CAAC;AAExC,CACF,CAEsB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","AppState","useDeviceList","sentryLogger","BluetoothRuntimeProvider","createBluetoothRuntime","getRestoredBleState","getBackgroundServiceUUIDs","BackgroundSyncCoordinator","BTManager","showBackgroundPushNotification","toBluetoothError","AndroidBluetoothForegroundService","jsx","_jsx","BTProviderChildWrapper","memo","bleManager","acceptedDevices","children","oneReadingPerConnection","deliveredEcgFileNames","onDeviceFound","onError","onDeviceStatusChanged","onConnectionEvent","onResult","resultPolicies","backgroundSync","btManagerRef","useRef","runtimeRef","backgroundSyncRef","backgroundSyncCoordinatorRef","setDeviceListItems","current","useEffect","length","runtime","currentBackgroundSync","isBackgroundEnabled","enabled","backgroundOptions","backgroundEnabled","serviceUUIDs","undefined","managerOptions","btManager","Object","keys","coordinator","result","latest","notifications","body","data","title","deviceData","name","error","setManager","setBackgroundScanEnabled","currentState","startScan","destroy","maxRetries","retryBackoffMs","storage","storageKey","manager","device","deviceManager","upsertDevice","emit","Promise","resolve","callback","enqueue","catch","status","measurementTypeKey","setDeviceStatus","prev","newList","index","findIndex","item","deviceType","event","restoredState","restoreStateIdentifier","connectedPeripherals","restoreDevices","flush","includeExhausted","resetExhausted","listener","addEventListener","state","remove","options","android","foregroundService"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/bt-provider-child-wrapper.tsx"],"mappings":";;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]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","URINE_ANALYTE_DEFINITIONS","urineAnalyteRanges","uro","min","max","normalMin","normalMax","bld","bil","ket","glu","pro","ph","nit","leu","sg","vc","urineAnalyteCatalog","Object","fromEntries","entries","map","key","range","definition","find","analyte","Error","display","unit","measurementFieldCatalog","bloodPressure","systolic","required","diastolic","heartRate","bodyWeight","temperature","bodyTemp","bloodGlucose","bloodOxygenPulseRate","bloodOxygen","pulseRate","perfusionIndex","rrInterval","respiratoryRate","uricAcid"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/constants/measurement-field-catalog.ts"],"mappings":";;AAAA,SACEA,kBAAkB,EAClBC,yBAAyB,QACpB,YAAY;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,MAAMC,kBAAkB,GAAG;EACzBC,GAAG,EAAE;IAAEC,GAAG,EAAE,GAAG;IAAEC,GAAG,EAAE,CAAC;IAAEC,SAAS,EAAE,GAAG;IAAEC,SAAS,EAAE;EAAE,CAAC;EACvDC,GAAG,EAAE;IAAEJ,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE,GAAG;IAAEC,SAAS,EAAE,CAAC;IAAEC,SAAS,EAAE;EAAE,CAAC;EACrDE,GAAG,EAAE;IAAEL,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE,CAAC;IAAEC,SAAS,EAAE,CAAC;IAAEC,SAAS,EAAE;EAAE,CAAC;EACnDG,GAAG,EAAE;IAAEN,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE,EAAE;IAAEC,SAAS,EAAE,CAAC;IAAEC,SAAS,EAAE;EAAG,CAAC;EACrDI,GAAG,EAAE;IAAEP,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE,IAAI;IAAEC,SAAS,EAAE,CAAC;IAAEC,SAAS,EAAE;EAAE,CAAC;EACtDK,GAAG,EAAE;IA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,GAAG,EAAE,GAAG;MAAE6B,QAAQ,EAAE;IAAK,CAAC;IAC7DU,cAAc,EAAE;MAAEd,IAAI,EAAE,GAAG;MAAE1B,GAAG,EAAE,CAAC;MAAEC,GAAG,EAAE;IAAG,CAAC;IAC9CwC,UAAU,EAAE;MAAEf,IAAI,EAAE,IAAI;MAAE1B,GAAG,EAAE,GAAG;MAAEC,GAAG,EAAE;IAAK;EAChD,CAAC;EACD,CAACL,kBAAkB,CAACoC,SAAS,GAAG;IAC9BA,SAAS,EAAE;MAAEN,IAAI,EAAE,KAAK;MAAE1B,GAAG,EAAE,EAAE;MAAEC,GAAG,EAAE,GAAG;MAAE6B,QAAQ,EAAE;IAAK;EAC9D,CAAC;EACD,CAAClC,kBAAkB,CAAC8C,eAAe,GAAG;IACpCA,eAAe,EAAE;MAAEhB,IAAI,EAAE,MAAM;MAAE1B,GAAG,EAAE,CAAC;MAAEC,GAAG,EAAE,EAAE;MAAE6B,QAAQ,EAAE;IAAK;EACnE,CAAC;EACD,CAAClC,kBAAkB,CAAC+C,
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","URINE_ANALYTE_DEFINITIONS","urineAnalyteRanges","uro","min","max","normalMin","normalMax","bld","bil","ket","glu","pro","ph","nit","leu","sg","vc","urineAnalyteCatalog","Object","fromEntries","entries","map","key","range","definition","find","analyte","Error","display","unit","measurementFieldCatalog","bloodPressure","systolic","required","diastolic","heartRate","bodyWeight","temperature","bodyTemp","bloodGlucose","bloodOxygenPulseRate","bloodOxygen","pulseRate","perfusionIndex","rrInterval","respiratoryRate","urineAnalysis","uricAcid"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/constants/measurement-field-catalog.ts"],"mappings":";;AAAA,SACEA,kBAAkB,EAClBC,yBAAyB,QACpB,YAAY;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,MAAMC,kBAAkB,GAAG;EACzBC,GAAG,EAAE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,EAAE;IAAK;EACnE,CAAC;EACD,CAAClC,kBAAkB,CAAC+C,aAAa,GAAG7B,mBAAmB;EACvD,CAAClB,kBAAkB,CAACgD,QAAQ,GAAG9B;AACjC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
subscribeState: callback => {
|
|
28
|
+
subscribers.add(callback);
|
|
29
|
+
return () => subscribers.delete(callback);
|
|
30
|
+
},
|
|
31
|
+
hasListeners: event => (listeners.get(event)?.size ?? 0) > 0,
|
|
32
|
+
emit: (event, value) => {
|
|
33
|
+
listeners.get(event)?.forEach(callback => callback(value));
|
|
34
|
+
subscribers.forEach(notify => notify());
|
|
35
|
+
},
|
|
36
|
+
setManager: manager => {
|
|
37
|
+
currentManager = manager;
|
|
38
|
+
subscribers.forEach(notify => notify());
|
|
39
|
+
},
|
|
40
|
+
upsertDevice: device => {
|
|
41
|
+
const existing = currentDevices.findIndex(item => item.id === device.id);
|
|
42
|
+
const next = {
|
|
43
|
+
id: device.id,
|
|
44
|
+
deviceData: device.deviceData,
|
|
45
|
+
device,
|
|
46
|
+
status: existing === -1 ? undefined : currentDevices[existing]?.status
|
|
47
|
+
};
|
|
48
|
+
currentDevices = existing === -1 ? [...currentDevices, next] : currentDevices.map((item, index) => index === existing ? next : item);
|
|
49
|
+
subscribers.forEach(notify => notify());
|
|
50
|
+
},
|
|
51
|
+
setDeviceStatus: ({
|
|
52
|
+
deviceData,
|
|
53
|
+
status
|
|
54
|
+
}) => {
|
|
55
|
+
currentDevices = currentDevices.map(item => item.id === deviceData.id ? {
|
|
56
|
+
...item,
|
|
57
|
+
deviceData,
|
|
58
|
+
status
|
|
59
|
+
} : item);
|
|
60
|
+
subscribers.forEach(notify => notify());
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export const BluetoothRuntimeProvider = ({
|
|
65
|
+
runtime,
|
|
66
|
+
children
|
|
67
|
+
}) => /*#__PURE__*/_jsx(RuntimeContext.Provider, {
|
|
68
|
+
value: runtime,
|
|
69
|
+
children: children
|
|
70
|
+
});
|
|
71
|
+
export const useBluetoothRuntime = () => {
|
|
72
|
+
const runtime = React.useContext(RuntimeContext);
|
|
73
|
+
if (!runtime) {
|
|
74
|
+
throw new Error("Bluetooth hooks must be rendered inside BTProvider");
|
|
75
|
+
}
|
|
76
|
+
return runtime;
|
|
77
|
+
};
|
|
78
|
+
export const useRuntimeEvent = (event, callback) => {
|
|
79
|
+
const runtime = useBluetoothRuntime();
|
|
80
|
+
const callbackRef = React.useRef(callback);
|
|
81
|
+
callbackRef.current = callback;
|
|
82
|
+
React.useEffect(() => runtime.subscribe(event, value => callbackRef.current(value)), [event, runtime]);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** Typed union exposed when a host listens to every accepted device. */
|
|
86
|
+
//# 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","subscribeState","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;AA2D/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,cAAc,EAAGN,QAAQ,IAAK;MAC5BN,WAAW,CAACS,GAAG,CAACH,QAAQ,CAAC;MAE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@ -0,0 +1,45 @@
|
|
|
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 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
|
+
React.useSyncExternalStore(runtime.subscribeState, () => runtime.manager, () => undefined);
|
|
17
|
+
const setEnabled = React.useCallback(async next => {
|
|
18
|
+
setError(undefined);
|
|
19
|
+
try {
|
|
20
|
+
if (next && canEnable && !(await canEnable())) {
|
|
21
|
+
setStatus("restricted");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (next && !runtime.manager) {
|
|
25
|
+
throw new Error("Bluetooth background sync is not ready yet.");
|
|
26
|
+
}
|
|
27
|
+
runtime.manager?.setBackgroundScanEnabled(next);
|
|
28
|
+
await onEnabledChange?.(next);
|
|
29
|
+
setEnabledState(next);
|
|
30
|
+
setStatus(next ? "on" : "off");
|
|
31
|
+
} catch (cause) {
|
|
32
|
+
const nextError = cause instanceof Error ? cause : new Error(String(cause));
|
|
33
|
+
setError(nextError);
|
|
34
|
+
setStatus("blocked");
|
|
35
|
+
}
|
|
36
|
+
}, [canEnable, onEnabledChange, runtime]);
|
|
37
|
+
return {
|
|
38
|
+
enabled,
|
|
39
|
+
setEnabled,
|
|
40
|
+
status,
|
|
41
|
+
error,
|
|
42
|
+
reason: status === "restricted" ? "background access is restricted" : undefined
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
//# 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","useSyncExternalStore","subscribeState","manager","undefined","setEnabled","useCallback","next","Error","setBackgroundScanEnabled","cause","nextError","String","reason"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-background-sync.ts"],"mappings":";;AAAA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,mBAAmB,QAAQ,sBAAmB;AAUvD,OAAO,MAAMC,iBAAiB,GAAGA,CAAC;EAChCC,OAAO,EAAEC,cAAc,GAAG,KAAK;EAC/BC,SAAS;EACTC;AACwB,CAAC,GAAG,CAAC,CAAC,KAM3B;EACH,MAAMC,OAAO,GAAGN,mBAAmB,CAAC,CAAC;EACrC,MAAM,CAACE,OAAO,EAAEK,eAAe,CAAC,GAAGR,KAAK,CAACS,QAAQ,CAACL,cAAc,CAAC;EACjE,MAAM,CAACM,KAAK,EAAEC,QAAQ,CAAC,GAAGX,KAAK,CAACS,QAAQ,CAAQ,CAAC;EAEjD,MAAM,CAACG,MAAM,EAAEC,SAAS,CAAC,GAAGb,KAAK,CAACS,QAAQ,CACxCL,cAAc,GAAG,IAAI,GAAG,KAC1B,CAAC;EAEDJ,KAAK,CAACc,oBAAoB,CACxBP,OAAO,CAACQ,cAAc,EACtB,MAAMR,OAAO,CAACS,OAAO,EACrB,MAAMC,SACR,CAAC;EAED,MAAMC,UAAU,GAAGlB,KAAK,CAACmB,WAAW,CAAC,MAAOC,IAAa,IAAK;IAC5DT,QAAQ,CAACM,SAAS,CAAC;IAEnB,IAAI;MACF,IAAIG,IAAI,IAAIf,SAAS,IAAI,EAAE,MAAMA,SAAS,CAAC,CAAC,CAAC,EAAE;QAC7CQ,SAAS,CAAC,YAAY,CAAC;QAEvB;MACF;MAEA,IAAIO,IAAI,IAAI,CAACb,OAAO,CAACS,OAAO,EAAE;QAC5B,MAAM,IAAIK,KAAK,CAAC,6CAA6C,CAAC;MAChE;MAEAd,OAAO,CAACS,OAAO,EAAEM,wBAAwB,CAACF,IAAI,CAAC;MAC/C,MAAMd,eAAe,GAAGc,IAAI,CAAC;MAC7BZ,eAAe,CAACY,IAAI,CAAC;MACrBP,SAAS,CAACO,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAChC,CAAC,CAAC,OAAOG,KAAK,EAAE;MACd,MAAMC,SAAS,GAAGD,KAAK,YAAYF,KAAK,GAAGE,KAAK,GAAG,IAAIF,KAAK,CAACI,MAAM,CAACF,KAAK,CAAC,CAAC;MAE3EZ,QAAQ,CAACa,SAAS,CAAC;MACnBX,SAAS,CAAC,SAAS,CAAC;IACtB;EACF,CAAC,EAAE,CAACR,SAAS,EAAEC,eAAe,EAAEC,OAAO,CAAC,CAAC;EAEzC,OAAO;IAAEJ,OAAO;IAAEe,UAAU;IAAEN,MAAM;IAAEF,KAAK;IAAEgB,MAAM,EAAEd,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;AAS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oC,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,34 @@
|
|
|
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
|
+
setStatus(runtime.devices.find(device => device.id === id)?.status);
|
|
11
|
+
setEvents([]);
|
|
12
|
+
}, [id, runtime]);
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
const unsubStatus = runtime.subscribe("status", value => {
|
|
15
|
+
if (value.deviceData.id === id) {
|
|
16
|
+
setStatus(value.status);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const unsubEvent = runtime.subscribe("connection", event => {
|
|
20
|
+
if (event.deviceData.id === id) {
|
|
21
|
+
setEvents(current => [...current, event].slice(-100));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return () => {
|
|
25
|
+
unsubStatus();
|
|
26
|
+
unsubEvent();
|
|
27
|
+
};
|
|
28
|
+
}, [id, runtime]);
|
|
29
|
+
return {
|
|
30
|
+
status,
|
|
31
|
+
events
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# 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","slice"],"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;IACpBP,SAAS,CAACF,OAAO,CAACI,OAAO,CAACC,IAAI,CAAEC,MAAM,IAAKA,MAAM,CAACP,EAAE,KAAKA,EAAE,CAAC,EAAEE,MAAM,CAAC;IACrEO,SAAS,CAAC,EAAE,CAAC;EACf,CAAC,EAAE,CAACT,EAAE,EAAEC,OAAO,CAAC,CAAC;EAEjBJ,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;QAC9BS,SAAS,CAAEQ,OAAO,IAAK,CAAC,GAAGA,OAAO,EAAED,KAAK,CAAC,CAACE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;MACzD;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACXP,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,76 @@
|
|
|
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 typesKey = React.useMemo(() => types.join("\u0000"), [types]);
|
|
13
|
+
const configRef = React.useRef({
|
|
14
|
+
adapter,
|
|
15
|
+
types,
|
|
16
|
+
background
|
|
17
|
+
});
|
|
18
|
+
configRef.current = {
|
|
19
|
+
adapter,
|
|
20
|
+
types,
|
|
21
|
+
background
|
|
22
|
+
};
|
|
23
|
+
const refresh = React.useCallback(async () => {
|
|
24
|
+
void typesKey;
|
|
25
|
+
const {
|
|
26
|
+
adapter: currentAdapter,
|
|
27
|
+
types: currentTypes
|
|
28
|
+
} = configRef.current;
|
|
29
|
+
const entries = await Promise.allSettled(currentTypes.map(async type => [type, await currentAdapter.getStatus(type)]));
|
|
30
|
+
const rejected = entries.find(entry => entry.status === "rejected");
|
|
31
|
+
setStatusByType(current => {
|
|
32
|
+
const next = {
|
|
33
|
+
...current
|
|
34
|
+
};
|
|
35
|
+
entries.forEach(entry => {
|
|
36
|
+
if (entry.status === "fulfilled") {
|
|
37
|
+
next[entry.value[0]] = entry.value[1];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return next;
|
|
41
|
+
});
|
|
42
|
+
setEnabled(currentTypes.length > 0 && entries.every(entry => entry.status === "fulfilled" && entry.value[1] === "authorized"));
|
|
43
|
+
setError(rejected ? rejected.reason instanceof Error ? rejected.reason : new Error(String(rejected.reason)) : undefined);
|
|
44
|
+
}, [typesKey]);
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
void refresh();
|
|
47
|
+
}, [refresh]);
|
|
48
|
+
const setEnabledForTypes = React.useCallback(async next => {
|
|
49
|
+
const {
|
|
50
|
+
adapter: currentAdapter,
|
|
51
|
+
types: currentTypes,
|
|
52
|
+
background: currentBackground
|
|
53
|
+
} = configRef.current;
|
|
54
|
+
setError(undefined);
|
|
55
|
+
try {
|
|
56
|
+
if (next) {
|
|
57
|
+
await currentAdapter.request(currentTypes, currentBackground);
|
|
58
|
+
await refresh();
|
|
59
|
+
}
|
|
60
|
+
setEnabled(next);
|
|
61
|
+
} catch (cause) {
|
|
62
|
+
const nextError = cause instanceof Error ? cause : new Error(String(cause));
|
|
63
|
+
setError(nextError);
|
|
64
|
+
throw nextError;
|
|
65
|
+
}
|
|
66
|
+
}, [refresh]);
|
|
67
|
+
const notShared = types.filter(type => statusByType[type] === "refused");
|
|
68
|
+
return {
|
|
69
|
+
enabled,
|
|
70
|
+
setEnabled: setEnabledForTypes,
|
|
71
|
+
statusByType: statusByType,
|
|
72
|
+
notShared,
|
|
73
|
+
error
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=use-health-import.js.map
|