@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
|
@@ -13,6 +13,18 @@ const spo2MainServices = exports.spo2MainServices = [{
|
|
|
13
13
|
parsingModel: {
|
|
14
14
|
caseValuePosition: [0, 2, 3, 4],
|
|
15
15
|
cases: [{
|
|
16
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodOxygenPulseRate,
|
|
17
|
+
caseType: _caseType.CaseType.STREAM,
|
|
18
|
+
caseValue: "aa0f0621",
|
|
19
|
+
parseDefinitions: [],
|
|
20
|
+
description: "OxySmart measurement status"
|
|
21
|
+
}, {
|
|
22
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodOxygenPulseRate,
|
|
23
|
+
caseType: _caseType.CaseType.STREAM,
|
|
24
|
+
caseValue: "aaf003??",
|
|
25
|
+
parseDefinitions: [],
|
|
26
|
+
description: "OxySmart measurement status"
|
|
27
|
+
}, {
|
|
16
28
|
measurementTypeKey: _core.MeasurementTypeKey.bloodOxygenPulseRate,
|
|
17
29
|
caseType: _caseType.CaseType.STREAM,
|
|
18
30
|
caseValue: "aa0f0702",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_caseType","spo2MainServices","exports","uuid","monitorUuids","parsingModel","caseValuePosition","cases","measurementTypeKey","MeasurementTypeKey","bloodOxygenPulseRate","caseType","CaseType","STREAM","caseValue","parseDefinitions","RESULT","name","parseType","byteIndexes","parseReference"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/spo/spo2.main-services.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAGO,MAAME,gBAA4B,GAAAC,OAAA,CAAAD,gBAAA,GAAG,CAC1C;EACEE,IAAI,EAAE,sCAAsC;EAC5CC,YAAY,EAAE,CACZ;IACED,IAAI,EAAE,sCAAsC;IAC5CE,YAAY,EAAE;MACZC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;MAC/BC,KAAK,EAAE,CACL;QACEC,kBAAkB,EAAEC,wBAAkB,CAACC,oBAAoB;QAC3DC,QAAQ,EAAEC,kBAAQ,CAACC,MAAM;QACzBC,SAAS,EAAE,UAAU;QACrBC,gBAAgB,EAAE;MACpB,CAAC,EAED;QACEP,kBAAkB,EAAEC,wBAAkB,CAACC,oBAAoB;QAC3DC,QAAQ,EAAEC,kBAAQ,
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","spo2MainServices","exports","uuid","monitorUuids","parsingModel","caseValuePosition","cases","measurementTypeKey","MeasurementTypeKey","bloodOxygenPulseRate","caseType","CaseType","STREAM","caseValue","parseDefinitions","description","RESULT","name","parseType","byteIndexes","parseReference"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/spo/spo2.main-services.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAGO,MAAME,gBAA4B,GAAAC,OAAA,CAAAD,gBAAA,GAAG,CAC1C;EACEE,IAAI,EAAE,sCAAsC;EAC5CC,YAAY,EAAE,CACZ;IACED,IAAI,EAAE,sCAAsC;IAC5CE,YAAY,EAAE;MACZC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;MAC/BC,KAAK,EAAE,CACL;QACEC,kBAAkB,EAAEC,wBAAkB,CAACC,oBAAoB;QAC3DC,QAAQ,EAAEC,kBAAQ,CAACC,MAAM;QACzBC,SAAS,EAAE,UAAU;QACrBC,gBAAgB,EAAE,EAAE;QACpBC,WAAW,EAAE;MACf,CAAC,EAED;QACER,kBAAkB,EAAEC,wBAAkB,CAACC,oBAAoB;QAC3DC,QAAQ,EAAEC,kBAAQ,CAACC,MAAM;QACzBC,SAAS,EAAE,UAAU;QACrBC,gBAAgB,EAAE,EAAE;QACpBC,WAAW,EAAE;MACf,CAAC,EAED;QACER,kBAAkB,EAAEC,wBAAkB,CAACC,oBAAoB;QAC3DC,QAAQ,EAAEC,kBAAQ,CAACC,MAAM;QACzBC,SAAS,EAAE,UAAU;QACrBC,gBAAgB,EAAE;MACpB,CAAC,EAED;QACEP,kBAAkB,EAAEC,wBAAkB,CAACC,oBAAoB;QAC3DC,QAAQ,EAAEC,kBAAQ,CAACK,MAAM;QACzBH,SAAS,EAAE,UAAU;QACrBC,gBAAgB,EAAE,CAChB;UACEG,IAAI,EAAE,aAAa;UACnBC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,CAAC,CAAC;UAChBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,WAAW;UACjBC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;UACnBC,cAAc,EAAE;QAClB,CAAC;MAEL,CAAC;IAEL;EACF,CAAC;AAEL,CAAC,CACF","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.showBackgroundPushNotification = void 0;
|
|
7
|
+
// Keep this dependency out of the root Bluetooth barrel. It is loaded only when an
|
|
8
|
+
// app opts into background notifications, while the notifications subpath remains the
|
|
9
|
+
// public API for permission management.
|
|
10
|
+
const notificationsModuleName = "expo-notifications";
|
|
11
|
+
const getNotifications = () => {
|
|
12
|
+
try {
|
|
13
|
+
return require(notificationsModuleName);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
throw new Error("Background notifications require expo-notifications. Install it and configure its app plugin before using this feature.", {
|
|
16
|
+
cause: error
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const showBackgroundPushNotification = async ({
|
|
21
|
+
title,
|
|
22
|
+
body,
|
|
23
|
+
data
|
|
24
|
+
}) => {
|
|
25
|
+
await getNotifications().scheduleNotificationAsync({
|
|
26
|
+
content: {
|
|
27
|
+
title,
|
|
28
|
+
...(body === undefined ? {} : {
|
|
29
|
+
body
|
|
30
|
+
}),
|
|
31
|
+
...(data === undefined ? {} : {
|
|
32
|
+
data
|
|
33
|
+
})
|
|
34
|
+
},
|
|
35
|
+
trigger: null
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.showBackgroundPushNotification = showBackgroundPushNotification;
|
|
39
|
+
//# sourceMappingURL=push-notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["notificationsModuleName","getNotifications","require","error","Error","cause","showBackgroundPushNotification","title","body","data","scheduleNotificationAsync","content","undefined","trigger","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/push-notification.ts"],"mappings":";;;;;;AAiBA;AACA;AACA;AACA,MAAMA,uBAAuB,GAAG,oBAAoB;AAEpD,MAAMC,gBAAgB,GAAGA,CAAA,KAA2B;EAClD,IAAI;IACF,OAAOC,OAAO,CAACF,uBAAuB,CAAC;EACzC,CAAC,CAAC,OAAOG,KAAK,EAAE;IACd,MAAM,IAAIC,KAAK,CACb,yHAAyH,EACzH;MAAEC,KAAK,EAAEF;IAAM,CACjB,CAAC;EACH;AACF,CAAC;AAEM,MAAMG,8BAA8B,GAAG,MAAAA,CAAO;EACnDC,KAAK;EACLC,IAAI;EACJC;AACuB,CAAC,KAAoB;EAC5C,MAAMR,gBAAgB,CAAC,CAAC,CAACS,yBAAyB,CAAC;IACjDC,OAAO,EAAE;MACPJ,KAAK;MACL,IAAIC,IAAI,KAAKI,SAAS,GAAG,CAAC,CAAC,GAAG;QAAEJ;MAAK,CAAC,CAAC;MACvC,IAAIC,IAAI,KAAKG,SAAS,GAAG,CAAC,CAAC,GAAG;QAAEH;MAAK,CAAC;IACxC,CAAC;IACDI,OAAO,EAAE;EACX,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAR,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createFakeBleManager = exports.createFakeBleDevice = void 0;
|
|
7
|
+
var _reactNativeBlePlx = require("react-native-ble-plx");
|
|
8
|
+
/* eslint-disable import/group-exports */
|
|
9
|
+
|
|
10
|
+
/** A deterministic BLE manager for hook and scan integration tests. No hardware is used. */
|
|
11
|
+
|
|
12
|
+
const characteristicKey = (serviceUuid, characteristicUuid) => `${serviceUuid}/${characteristicUuid}`;
|
|
13
|
+
|
|
14
|
+
/** Creates a GATT-capable fake device for connection and notification tests. */
|
|
15
|
+
const createFakeBleDevice = ({
|
|
16
|
+
id,
|
|
17
|
+
name = id,
|
|
18
|
+
localName = name,
|
|
19
|
+
manufacturerData = "",
|
|
20
|
+
serviceUUIDs = [],
|
|
21
|
+
mtu = 23,
|
|
22
|
+
characteristics = {}
|
|
23
|
+
}) => {
|
|
24
|
+
let connected = false;
|
|
25
|
+
let currentMtu = mtu;
|
|
26
|
+
const values = new Map(Object.entries(characteristics));
|
|
27
|
+
const disconnectedCallbacks = new Set();
|
|
28
|
+
const notificationCallbacks = new Map();
|
|
29
|
+
const fake = {
|
|
30
|
+
id,
|
|
31
|
+
name,
|
|
32
|
+
localName,
|
|
33
|
+
manufacturerData,
|
|
34
|
+
serviceUUIDs: [...serviceUUIDs],
|
|
35
|
+
mtu: currentMtu,
|
|
36
|
+
isConnected: async () => connected,
|
|
37
|
+
connect: async () => {
|
|
38
|
+
connected = true;
|
|
39
|
+
return fake;
|
|
40
|
+
},
|
|
41
|
+
cancelConnection: async () => {
|
|
42
|
+
connected = false;
|
|
43
|
+
disconnectedCallbacks.forEach(callback => callback(null, fake));
|
|
44
|
+
return fake;
|
|
45
|
+
},
|
|
46
|
+
discoverAllServicesAndCharacteristics: async () => fake,
|
|
47
|
+
onDisconnected: callback => {
|
|
48
|
+
disconnectedCallbacks.add(callback);
|
|
49
|
+
return {
|
|
50
|
+
remove: () => disconnectedCallbacks.delete(callback)
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
requestMTU: async requestedMtu => {
|
|
54
|
+
currentMtu = requestedMtu;
|
|
55
|
+
return {
|
|
56
|
+
mtu: currentMtu
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
readCharacteristicForService: async (serviceUuid, characteristicUuid) => ({
|
|
60
|
+
value: values.get(characteristicKey(serviceUuid, characteristicUuid)) ?? null
|
|
61
|
+
}),
|
|
62
|
+
monitorCharacteristicForService: (serviceUuid, characteristicUuid, callback) => {
|
|
63
|
+
const key = characteristicKey(serviceUuid, characteristicUuid);
|
|
64
|
+
const callbacks = notificationCallbacks.get(key) ?? new Set();
|
|
65
|
+
callbacks.add(callback);
|
|
66
|
+
notificationCallbacks.set(key, callbacks);
|
|
67
|
+
return {
|
|
68
|
+
remove: () => callbacks.delete(callback)
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
writeCharacteristicWithResponseForService: async () => fake,
|
|
72
|
+
writeCharacteristicWithoutResponseForService: async () => fake
|
|
73
|
+
};
|
|
74
|
+
return {
|
|
75
|
+
device: fake,
|
|
76
|
+
emitCharacteristic: (serviceUuid, characteristicUuid, value) => {
|
|
77
|
+
const key = characteristicKey(serviceUuid, characteristicUuid);
|
|
78
|
+
const characteristic = {
|
|
79
|
+
uuid: characteristicUuid,
|
|
80
|
+
value
|
|
81
|
+
};
|
|
82
|
+
values.set(key, value);
|
|
83
|
+
notificationCallbacks.get(key)?.forEach(callback => callback(null, characteristic));
|
|
84
|
+
},
|
|
85
|
+
disconnect: async () => {
|
|
86
|
+
await fake.cancelConnection();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
exports.createFakeBleDevice = createFakeBleDevice;
|
|
91
|
+
const createFakeBleManager = ({
|
|
92
|
+
state = _reactNativeBlePlx.State.PoweredOn,
|
|
93
|
+
devices = []
|
|
94
|
+
} = {}) => {
|
|
95
|
+
let currentState = state;
|
|
96
|
+
let scanCallback;
|
|
97
|
+
const stateCallbacks = new Set();
|
|
98
|
+
let scannedServiceUUIDs = null;
|
|
99
|
+
const manager = {
|
|
100
|
+
onStateChange: (callback, emitCurrentState) => {
|
|
101
|
+
stateCallbacks.add(callback);
|
|
102
|
+
if (emitCurrentState) {
|
|
103
|
+
callback(currentState);
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
remove: () => stateCallbacks.delete(callback)
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
startDeviceScan: (serviceUUIDs, _options, callback) => {
|
|
110
|
+
scannedServiceUUIDs = serviceUUIDs;
|
|
111
|
+
scanCallback = callback;
|
|
112
|
+
devices.forEach(device => callback(null, device));
|
|
113
|
+
},
|
|
114
|
+
stopDeviceScan: () => {
|
|
115
|
+
scanCallback = undefined;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
manager,
|
|
120
|
+
createDevice: createFakeBleDevice,
|
|
121
|
+
emitDevice: device => scanCallback?.(null, device),
|
|
122
|
+
emitError: error => scanCallback?.(error, null),
|
|
123
|
+
setState: nextState => {
|
|
124
|
+
currentState = nextState;
|
|
125
|
+
stateCallbacks.forEach(callback => callback(nextState));
|
|
126
|
+
},
|
|
127
|
+
getScannedServiceUUIDs: () => scannedServiceUUIDs,
|
|
128
|
+
stopDeviceScan: () => manager.stopDeviceScan()
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
exports.createFakeBleManager = createFakeBleManager;
|
|
132
|
+
//# sourceMappingURL=fake-ble-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeBlePlx","require","characteristicKey","serviceUuid","characteristicUuid","createFakeBleDevice","id","name","localName","manufacturerData","serviceUUIDs","mtu","characteristics","connected","currentMtu","values","Map","Object","entries","disconnectedCallbacks","Set","notificationCallbacks","fake","isConnected","connect","cancelConnection","forEach","callback","discoverAllServicesAndCharacteristics","onDisconnected","add","remove","delete","requestMTU","requestedMtu","readCharacteristicForService","value","get","monitorCharacteristicForService","key","callbacks","set","writeCharacteristicWithResponseForService","writeCharacteristicWithoutResponseForService","device","emitCharacteristic","characteristic","uuid","disconnect","exports","createFakeBleManager","state","State","PoweredOn","devices","currentState","scanCallback","stateCallbacks","scannedServiceUUIDs","manager","onStateChange","emitCurrentState","startDeviceScan","_options","stopDeviceScan","undefined","createDevice","emitDevice","emitError","error","setState","nextState","getScannedServiceUUIDs"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/testing/fake-ble-manager.ts"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AAFA;;AA6BA;;AAWA,MAAMC,iBAAiB,GAAGA,CAACC,WAAmB,EAAEC,kBAA0B,KACxE,GAAGD,WAAW,IAAIC,kBAAkB,EAAE;;AAExC;AACO,MAAMC,mBAAmB,GAAGA,CAAC;EAClCC,EAAE;EACFC,IAAI,GAAGD,EAAE;EACTE,SAAS,GAAGD,IAAI;EAChBE,gBAAgB,GAAG,EAAE;EACrBC,YAAY,GAAG,EAAE;EACjBC,GAAG,GAAG,EAAE;EACRC,eAAe,GAAG,CAAC;AACC,CAAC,KAAoB;EACzC,IAAIC,SAAS,GAAG,KAAK;EACrB,IAAIC,UAAU,GAAGH,GAAG;EACp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d,mBAAmB;IACjDM,cAAc,EAAEA,CAAA,KAAML,OAAO,CAACK,cAAc,CAAC;EAC/C,CAAC;AACH,CAAC;AAACf,OAAA,CAAAC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _fakeBleManager = require("./fake-ble-manager.js");
|
|
7
|
+
Object.keys(_fakeBleManager).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _fakeBleManager[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _fakeBleManager[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _recordedFrames = require("./recorded-frames.js");
|
|
18
|
+
Object.keys(_recordedFrames).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _recordedFrames[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _recordedFrames[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_fakeBleManager","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_recordedFrames"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/testing/index.ts"],"mappings":";;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,eAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,eAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,eAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,eAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,eAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,eAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,eAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.replayRecordedFrames = exports.defineRecordedDeviceFrames = void 0;
|
|
7
|
+
/* eslint-disable import/group-exports */
|
|
8
|
+
|
|
9
|
+
/** Replays captured characteristic frames through an app-provided test sink. */
|
|
10
|
+
const replayRecordedFrames = async (frames, sink) => {
|
|
11
|
+
for (const frame of frames) {
|
|
12
|
+
if (frame.delayMs) {
|
|
13
|
+
await new Promise(resolve => setTimeout(resolve, frame.delayMs));
|
|
14
|
+
}
|
|
15
|
+
await sink(frame);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** A registry helper lets an app keep fixtures for every device it supports. */
|
|
20
|
+
exports.replayRecordedFrames = replayRecordedFrames;
|
|
21
|
+
const defineRecordedDeviceFrames = fixtures => fixtures;
|
|
22
|
+
exports.defineRecordedDeviceFrames = defineRecordedDeviceFrames;
|
|
23
|
+
//# sourceMappingURL=recorded-frames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["replayRecordedFrames","frames","sink","frame","delayMs","Promise","resolve","setTimeout","exports","defineRecordedDeviceFrames","fixtures"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/testing/recorded-frames.ts"],"mappings":";;;;;;AAAA;;AAYA;AACO,MAAMA,oBAAoB,GAAG,MAAAA,CAClCC,MAAmC,EACnCC,IAAuB,KACL;EAClB,KAAK,MAAMC,KAAK,IAAIF,MAAM,EAAE;IAC1B,IAAIE,KAAK,CAACC,OAAO,EAAE;MACjB,MAAM,IAAIC,OAAO,CAAEC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAEH,KAAK,CAACC,OAAO,CAAC,CAAC;IACpE;IACA,MAAMF,IAAI,CAACC,KAAK,CAAC;EACnB;AACF,CAAC;;AAED;AAAAK,OAAA,CAAAR,oBAAA,GAAAA,oBAAA;AACO,MAAMS,0BAA0B,GACrCC,QAAgD,IACKA,QAAQ;AAACF,OAAA,CAAAC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.toBluetoothError = exports.bluetoothErrorCodeFor = exports.BluetoothErrorCode = exports.BluetoothError = void 0;
|
|
7
|
+
/* eslint-disable import/group-exports */
|
|
8
|
+
let BluetoothErrorCode = exports.BluetoothErrorCode = /*#__PURE__*/function (BluetoothErrorCode) {
|
|
9
|
+
BluetoothErrorCode["UNKNOWN"] = "bluetooth.unknown";
|
|
10
|
+
BluetoothErrorCode["PERMISSION_DENIED"] = "bluetooth.permission-denied";
|
|
11
|
+
BluetoothErrorCode["UNSUPPORTED"] = "bluetooth.unsupported";
|
|
12
|
+
BluetoothErrorCode["SCAN_FAILED"] = "bluetooth.scan-failed";
|
|
13
|
+
BluetoothErrorCode["CONNECTION_FAILED"] = "bluetooth.connection-failed";
|
|
14
|
+
BluetoothErrorCode["PAIRING_REQUIRED"] = "bluetooth.pairing-required";
|
|
15
|
+
BluetoothErrorCode["DISCOVERY_FAILED"] = "bluetooth.discovery-failed";
|
|
16
|
+
BluetoothErrorCode["DEVICE_ERROR"] = "bluetooth.device-error";
|
|
17
|
+
BluetoothErrorCode["FRAME_INVALID"] = "bluetooth.frame-invalid";
|
|
18
|
+
BluetoothErrorCode["MEASUREMENT_FAILED"] = "bluetooth.measurement-failed";
|
|
19
|
+
BluetoothErrorCode["BACKGROUND_SYNC"] = "bluetooth.background-sync";
|
|
20
|
+
return BluetoothErrorCode;
|
|
21
|
+
}({});
|
|
22
|
+
class BluetoothError extends Error {
|
|
23
|
+
name = "BluetoothError";
|
|
24
|
+
constructor(code, message, translationKey, originalError) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.code = code;
|
|
27
|
+
this.translationKey = translationKey;
|
|
28
|
+
this.originalError = originalError;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.BluetoothError = BluetoothError;
|
|
32
|
+
const translationKeyFor = message => /^([\w-]+\.)+[\w-]+$/.test(message) ? message : undefined;
|
|
33
|
+
const messageFor = error => {
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
return error.message;
|
|
36
|
+
}
|
|
37
|
+
if (typeof error === "string") {
|
|
38
|
+
return error;
|
|
39
|
+
}
|
|
40
|
+
return String(error);
|
|
41
|
+
};
|
|
42
|
+
const bluetoothErrorCodeFor = error => {
|
|
43
|
+
if (error instanceof BluetoothError) {
|
|
44
|
+
return error.code;
|
|
45
|
+
}
|
|
46
|
+
const message = messageFor(error);
|
|
47
|
+
const structured = error;
|
|
48
|
+
const errorCode = structured?.errorCode;
|
|
49
|
+
const structuredCodes = [errorCode, structured?.androidErrorCode, structured?.iosErrorCode].map(value => String(value ?? "").toLowerCase());
|
|
50
|
+
if (/permission|unauthori[sz]ed|denied/i.test(message)) {
|
|
51
|
+
return BluetoothErrorCode.PERMISSION_DENIED;
|
|
52
|
+
}
|
|
53
|
+
if (/unsupported/i.test(message)) {
|
|
54
|
+
return BluetoothErrorCode.UNSUPPORTED;
|
|
55
|
+
}
|
|
56
|
+
if (/scan/i.test(message) || errorCode === "ScanStartFailed") {
|
|
57
|
+
return BluetoothErrorCode.SCAN_FAILED;
|
|
58
|
+
}
|
|
59
|
+
if (structuredCodes.some(code => /pair|bond|auth|encryption|insufficientsecurity/.test(code)) || [5, 8, 15, 137].includes(Number(structured?.androidErrorCode)) || /pair|bond|authentication|passkey|pin/i.test(message)) {
|
|
60
|
+
return BluetoothErrorCode.PAIRING_REQUIRED;
|
|
61
|
+
}
|
|
62
|
+
if (/connect|disconnect/i.test(message)) {
|
|
63
|
+
return BluetoothErrorCode.CONNECTION_FAILED;
|
|
64
|
+
}
|
|
65
|
+
if (/frame|parse|checksum|corrupt/i.test(message)) {
|
|
66
|
+
return BluetoothErrorCode.FRAME_INVALID;
|
|
67
|
+
}
|
|
68
|
+
if (/measurement|reading|result/i.test(message)) {
|
|
69
|
+
return BluetoothErrorCode.MEASUREMENT_FAILED;
|
|
70
|
+
}
|
|
71
|
+
return BluetoothErrorCode.UNKNOWN;
|
|
72
|
+
};
|
|
73
|
+
exports.bluetoothErrorCodeFor = bluetoothErrorCodeFor;
|
|
74
|
+
const toBluetoothError = error => {
|
|
75
|
+
if (error instanceof BluetoothError) {
|
|
76
|
+
return error;
|
|
77
|
+
}
|
|
78
|
+
const message = messageFor(error);
|
|
79
|
+
return new BluetoothError(bluetoothErrorCodeFor(error), message, translationKeyFor(message), error);
|
|
80
|
+
};
|
|
81
|
+
exports.toBluetoothError = toBluetoothError;
|
|
82
|
+
//# sourceMappingURL=bluetooth-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BluetoothErrorCode","exports","BluetoothError","Error","name","constructor","code","message","translationKey","originalError","translationKeyFor","test","undefined","messageFor","error","String","bluetoothErrorCodeFor","structured","errorCode","structuredCodes","androidErrorCode","iosErrorCode","map","value","toLowerCase","PERMISSION_DENIED","UNSUPPORTED","SCAN_FAILED","some","includes","Number","PAIRING_REQUIRED","CONNECTION_FAILED","FRAME_INVALID","MEASUREMENT_FAILED","UNKNOWN","toBluetoothError"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/bluetooth-error.ts"],"mappings":";;;;;;AAAA;AAAA,IAIYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAcvB,MAAME,cAAc,SAASC,KAAK,CAAC;EACxBC,IAAI,GAAG,gBAAgB;EAEhCC,WAAWA,CACAC,IAAwB,EACxCC,OAAe,EACCC,cAAuB,EACvBC,aAAuB,EACvC;IACA,KAAK,CAACF,OAAO,CAAC;IAAC,KALCD,IAAwB,GAAxBA,IAAwB;IAAA,KAExBE,cAAuB,GAAvBA,cAAuB;IAAA,KACvBC,aAAuB,GAAvBA,aAAuB;EAGzC;AACF;AAACR,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAED,MAAMQ,iBAAiB,GAAIH,OAAe,IACxC,qBAAqB,CAACI,IAAI,CAACJ,OAAO,CAAC,GAAGA,OAAO,GAAGK,SAAS;AAE3D,MAAMC,UAAU,GAAIC,KAAc,IAAa;EAC7C,IAAIA,KAAK,YAAYX,KAAK,EAAE;IAC1B,OAAOW,KAAK,CAACP,OAAO;EACtB;EAEA,IAAI,OAAOO,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EAEA,OAAOC,MAAM,CAACD,KAAK,CAAC;AACtB,CAAC;AAEM,MAAME,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C,EAAE;IACjD,OAAOP,kBAAkB,CAACiC,aAAa;EACzC;EAEA,IAAI,6BAA6B,CAACtB,IAAI,CAACJ,OAAO,CAAC,EAAE;IAC/C,OAAOP,kBAAkB,CAACkC,kBAAkB;EAC9C;EAEA,OAAOlC,kBAAkB,CAACmC,OAAO;AACnC,CAAC;AAAClC,OAAA,CAAAe,qBAAA,GAAAA,qBAAA;AAEK,MAAMoB,gBAAgB,GAAItB,KAAc,IAAqB;EAClE,IAAIA,KAAK,YAAYZ,cAAc,EAAE;IACnC,OAAOY,KAAK;EACd;EAEA,MAAMP,OAAO,GAAGM,UAAU,CAACC,KAAK,CAAC;EAEjC,OAAO,IAAIZ,cAAc,CACvBc,qBAAqB,CAACF,KAAK,CAAC,EAC5BP,OAAO,EACPG,iBAAiB,CAACH,OAAO,CAAC,EAC1BO,KACF,CAAC;AACH,CAAC;AAACb,OAAA,CAAAmC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-connection-event.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/result-policy.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.reviveResultDates = exports.createStableResultId = void 0;
|
|
7
|
+
/* eslint-disable import/group-exports */
|
|
8
|
+
|
|
9
|
+
const canonicalize = value => {
|
|
10
|
+
if (value instanceof Date) {
|
|
11
|
+
return value.toISOString();
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(value)) {
|
|
14
|
+
return value.map(canonicalize);
|
|
15
|
+
}
|
|
16
|
+
if (value && typeof value === "object") {
|
|
17
|
+
return Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, canonicalize(nested)]));
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
const hash = value => {
|
|
22
|
+
let first = 0x811c9dc5;
|
|
23
|
+
let second = 0x01000193;
|
|
24
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
25
|
+
const code = value.charCodeAt(index);
|
|
26
|
+
first = Math.imul(first ^ code, 0x01000193);
|
|
27
|
+
second = Math.imul(second ^ code + index, 0x811c9dc5);
|
|
28
|
+
}
|
|
29
|
+
return `${(first >>> 0).toString(16).padStart(8, "0")}${(second >>> 0).toString(16).padStart(8, "0")}`;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Creates an identity that is stable when a device sends its stored history again.
|
|
34
|
+
* Recording IDs, timestamps and indexes are retained in the canonical payload; transient
|
|
35
|
+
* delivery metadata is deliberately not part of the key.
|
|
36
|
+
*/
|
|
37
|
+
const createStableResultId = (deviceData, data) => {
|
|
38
|
+
const deviceIdentity = deviceData.sn || deviceData.manufacturerData || deviceData.model || deviceData.name || deviceData.id;
|
|
39
|
+
return `ovok:${hash(JSON.stringify(canonicalize({
|
|
40
|
+
device: deviceIdentity,
|
|
41
|
+
name: deviceData.name,
|
|
42
|
+
data
|
|
43
|
+
})))}`;
|
|
44
|
+
};
|
|
45
|
+
exports.createStableResultId = createStableResultId;
|
|
46
|
+
const reviveResultDates = value => {
|
|
47
|
+
const revive = (current, key) => {
|
|
48
|
+
if (typeof current === "string" && ["recordedAt", "start", "end"].includes(key ?? "")) {
|
|
49
|
+
const date = new Date(current);
|
|
50
|
+
return Number.isNaN(date.getTime()) ? current : date;
|
|
51
|
+
}
|
|
52
|
+
if (Array.isArray(current)) {
|
|
53
|
+
return current.map(item => revive(item));
|
|
54
|
+
}
|
|
55
|
+
if (current && typeof current === "object") {
|
|
56
|
+
return Object.fromEntries(Object.entries(current).map(([childKey, childValue]) => [childKey, revive(childValue, childKey)]));
|
|
57
|
+
}
|
|
58
|
+
return current;
|
|
59
|
+
};
|
|
60
|
+
return revive(value);
|
|
61
|
+
};
|
|
62
|
+
exports.reviveResultDates = reviveResultDates;
|
|
63
|
+
//# sourceMappingURL=result-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["canonicalize","value","Date","toISOString","Array","isArray","map","Object","fromEntries","entries","sort","left","right","localeCompare","key","nested","hash","first","second","index","length","code","charCodeAt","Math","imul","toString","padStart","createStableResultId","deviceData","data","deviceIdentity","sn","manufacturerData","model","name","id","JSON","stringify","device","exports","reviveResultDates","revive","current","includes","date","Number","isNaN","getTime","item","childKey","childValue"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/result-identity.ts"],"mappings":";;;;;;AAAA;;AAMA,MAAMA,YAAY,GAAIC,KAAc,IAAc;EAChD,IAAIA,KAAK,YAAYC,IAAI,EAAE;IACzB,OAAOD,KAAK,CAACE,WAAW,CAAC,CAAC;EAC5B;EAEA,IAAIC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK,CAACK,GAAG,CAACN,YAAY,CAAC;EAChC;EAEA,IAAIC,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACtC,OAAOM,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACR,KAAK,CAAC,CAClBS,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,EAAE,CAACC,KAAK,CAAC,KAAKD,IAAI,CAACE,aAAa,CAACD,KAAK,CAAC,CAAC,CACpDN,GAAG,CAAC,CAAC,CAACQ,GAAG,EAAEC,MAAM,CAAC,KAAK,CAACD,GAAG,EAAEd,YAAY,CAACe,MAAM,CAAC,CAAC,CACvD,CAAC;EACH;EAEA,OAAOd,KAAK;AACd,CAAC;AAED,MAAMe,IAAI,GAAIf,KAAa,IAAa;EACtC,IAAIgB,KAA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4B,OAAO,KAAK,QAAQ,IAC3B,CAAC,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC,CAACC,QAAQ,CAAC7B,GAAG,IAAI,EAAE,CAAC,EAClD;MACA,MAAM8B,IAAI,GAAG,IAAI1C,IAAI,CAACwC,OAAO,CAAC;MAE9B,OAAOG,MAAM,CAACC,KAAK,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,GAAGL,OAAO,GAAGE,IAAI;IACtD;IAEA,IAAIxC,KAAK,CAACC,OAAO,CAACqC,OAAO,CAAC,EAAE;MAC1B,OAAOA,OAAO,CAACpC,GAAG,CAAE0C,IAAI,IAAKP,MAAM,CAACO,IAAI,CAAC,CAAC;IAC5C;IAEA,IAAIN,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC1C,OAAOnC,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACiC,OAAO,CAAC,CAACpC,GAAG,CAAC,CAAC,CAAC2C,QAAQ,EAAEC,UAAU,CAAC,KAAK,CACtDD,QAAQ,EACRR,MAAM,CAACS,UAAU,EAAED,QAAQ,CAAC,CAC7B,CACH,CAAC;IACH;IAEA,OAAOP,OAAO;EAChB,CAAC;EAED,OAAOD,MAAM,CAACxC,KAAK,CAAC;AACtB,CAAC;AAACsC,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -9,7 +9,10 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _reactNativeHealthConnect = require("react-native-health-connect");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/* eslint-disable max-lines */
|
|
13
|
+
|
|
12
14
|
const toError = error => error instanceof Error ? error : new Error(String(error));
|
|
15
|
+
const isHealthConnectUnavailable = error => /not available|not installed|unsupported|unavailable/i.test(error instanceof Error ? error.message : String(error));
|
|
13
16
|
const useHealthConnectAuthorization = (readIdentifiers, writeIdentifiers, backgroundAccess = false, onStatusChange) => {
|
|
14
17
|
const [status, setStatus] = React.useState({
|
|
15
18
|
state: "unknown"
|
|
@@ -50,22 +53,34 @@ const useHealthConnectAuthorization = (readIdentifiers, writeIdentifiers, backgr
|
|
|
50
53
|
const error = new Error("Health Connect is not available");
|
|
51
54
|
updateStatus({
|
|
52
55
|
state: "error",
|
|
53
|
-
error
|
|
56
|
+
error,
|
|
57
|
+
...(backgroundAccess ? {
|
|
58
|
+
backgroundAccess: "unsupported"
|
|
59
|
+
} : {})
|
|
54
60
|
});
|
|
55
61
|
return;
|
|
56
62
|
}
|
|
57
63
|
const grantedPermissions = await (0, _reactNativeHealthConnect.getGrantedPermissions)();
|
|
58
|
-
const
|
|
64
|
+
const backgroundPermission = permissionsRef.current.find(permission => permission.recordType === "BackgroundAccessPermission");
|
|
65
|
+
const requiredPermissions = permissionsRef.current.filter(permission => permission !== backgroundPermission);
|
|
66
|
+
const allGranted = requiredPermissions.every(permission => grantedPermissions.some(granted => granted.accessType === permission.accessType && granted.recordType === permission.recordType));
|
|
67
|
+
const backgroundGranted = backgroundPermission ? grantedPermissions.some(granted => granted.accessType === backgroundPermission.accessType && granted.recordType === backgroundPermission.recordType) : undefined;
|
|
59
68
|
updateStatus({
|
|
60
|
-
state: allGranted ? "authorized" : hasRequestedRef.current ? "refused" : "shouldRequest"
|
|
69
|
+
state: allGranted ? "authorized" : hasRequestedRef.current ? "refused" : "shouldRequest",
|
|
70
|
+
...(backgroundPermission ? {
|
|
71
|
+
backgroundAccess: backgroundGranted ? "authorized" : hasRequestedRef.current ? "refused" : "shouldRequest"
|
|
72
|
+
} : {})
|
|
61
73
|
});
|
|
62
74
|
} catch (error) {
|
|
63
75
|
updateStatus({
|
|
64
76
|
state: "error",
|
|
65
|
-
error: toError(error)
|
|
77
|
+
error: toError(error),
|
|
78
|
+
...(backgroundAccess && isHealthConnectUnavailable(error) ? {
|
|
79
|
+
backgroundAccess: "unsupported"
|
|
80
|
+
} : {})
|
|
66
81
|
});
|
|
67
82
|
}
|
|
68
|
-
}, [updateStatus]);
|
|
83
|
+
}, [backgroundAccess, updateStatus]);
|
|
69
84
|
const requestAuthorization = React.useCallback(async () => {
|
|
70
85
|
hasRequestedRef.current = true;
|
|
71
86
|
updateStatus({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_reactNativeHealthConnect","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","toError","error","Error","String","useHealthConnectAuthorization","readIdentifiers","writeIdentifiers","backgroundAccess","onStatusChange","status","setStatus","useState","state","hasRequestedRef","useRef","identifiersRef","permissionsRef","current","readPermissions","map","recordType","accessType","writePermissions","backgroundPermissions","updateStatus","useCallback","nextStatus","checkAuthorization","isInitialized","initialize","grantedPermissions","getGrantedPermissions","
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_reactNativeHealthConnect","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","toError","error","Error","String","isHealthConnectUnavailable","test","message","useHealthConnectAuthorization","readIdentifiers","writeIdentifiers","backgroundAccess","onStatusChange","status","setStatus","useState","state","hasRequestedRef","useRef","identifiersRef","permissionsRef","current","readPermissions","map","recordType","accessType","writePermissions","backgroundPermissions","updateStatus","useCallback","nextStatus","checkAuthorization","isInitialized","initialize","grantedPermissions","getGrantedPermissions","backgroundPermission","find","permission","requiredPermissions","filter","allGranted","every","some","granted","backgroundGranted","undefined","requestAuthorization","requestPermission","useEffect","subscription","AppState","addEventListener","remove","AndroidHealthConnectAuthorizationProvider","exports","memo","fallback","children","skipRequest","renderManualRequestUI","onAuthorizationStatusChange","authorizationStatus","shouldRenderManualRequestUI","includes","shouldRenderFallback","jsx","Fragment"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/android/android-health-connect-authorization-provider.tsx"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AAIqC,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,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
5
|
});
|
|
6
6
|
exports.BaseHealthSyncService = void 0;
|
|
7
|
+
var _telemetry = require("../../helpers/utils/telemetry.js");
|
|
8
|
+
var _retrySave = require("../utils/retry-save.js");
|
|
7
9
|
var _dataProcessor = require("./managers/data-processor.js");
|
|
8
10
|
var _storageManager = require("./managers/storage-manager.js");
|
|
9
11
|
var _syncProgressManager = require("./managers/sync-progress-manager.js");
|
|
10
12
|
var _syncStateManager = require("./managers/sync-state-manager.js");
|
|
13
|
+
/* eslint-disable max-lines */
|
|
14
|
+
|
|
11
15
|
class BaseHealthSyncService {
|
|
12
16
|
constructor(props) {
|
|
13
17
|
this.client = props.client;
|
|
@@ -21,7 +25,9 @@ class BaseHealthSyncService {
|
|
|
21
25
|
}
|
|
22
26
|
/** One run at a time; see `SyncStateManager.once` for why that matters. */
|
|
23
27
|
async startSync() {
|
|
24
|
-
return this.stateManager.once(() =>
|
|
28
|
+
return this.stateManager.once(() => (0, _telemetry.withOvokSpan)("health.import", {
|
|
29
|
+
provider: this.getProviderName()
|
|
30
|
+
}, () => this.runSync()));
|
|
25
31
|
}
|
|
26
32
|
async runSync() {
|
|
27
33
|
try {
|
|
@@ -92,22 +98,41 @@ class BaseHealthSyncService {
|
|
|
92
98
|
while (hasAnchor && !this.stateManager.shouldStopSync) {
|
|
93
99
|
const {
|
|
94
100
|
observationBodies,
|
|
95
|
-
hasAnchor: currentHasAnchor
|
|
101
|
+
hasAnchor: currentHasAnchor,
|
|
102
|
+
anchors
|
|
96
103
|
} = await this.dataProcessor.getObservationBodiesForType(measurementTypeKey, data, latestValidStartDate);
|
|
97
104
|
hasAnchor = currentHasAnchor;
|
|
98
105
|
if (this.stateManager.shouldStopSync) {
|
|
99
106
|
break;
|
|
100
107
|
}
|
|
101
108
|
const entries = this.dataProcessor.generateObservationEntries(observationBodies);
|
|
102
|
-
this.progressManager.incrementSyncedObservations(measurementTypeKey, entries.length);
|
|
103
109
|
if (entries.length !== 0 && !this.stateManager.shouldStopSync) {
|
|
104
110
|
try {
|
|
105
|
-
const
|
|
111
|
+
const startedAt = Date.now();
|
|
112
|
+
const result = await (0, _retrySave.withSyncRetries)(() => this.storageManager.saveObservations(entries), () => this.stateManager.shouldStopSync);
|
|
113
|
+
if (this.stateManager.shouldStopSync) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
(0, _telemetry.recordOvokMetric)("ovok.health.samples.imported", entries.length, {
|
|
117
|
+
provider: this.getProviderName(),
|
|
118
|
+
measurementTypeKey
|
|
119
|
+
});
|
|
120
|
+
(0, _telemetry.recordOvokDuration)("ovok.measurement.save.duration", Date.now() - startedAt, {
|
|
121
|
+
provider: this.getProviderName()
|
|
122
|
+
});
|
|
106
123
|
this.stateManager.addResult(result);
|
|
124
|
+
this.progressManager.incrementSyncedObservations(measurementTypeKey, entries.length);
|
|
125
|
+
this.storageManager.saveAnchors(anchors);
|
|
107
126
|
} catch (error) {
|
|
127
|
+
if ((0, _retrySave.isSyncRetryCancelled)(error) || this.stateManager.shouldStopSync) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.progressManager.setStatus(measurementTypeKey, "failed");
|
|
108
131
|
this.onSyncError(error);
|
|
109
132
|
return;
|
|
110
133
|
}
|
|
134
|
+
} else {
|
|
135
|
+
this.storageManager.saveAnchors(anchors);
|
|
111
136
|
}
|
|
112
137
|
}
|
|
113
138
|
this.progressManager.setStatus(measurementTypeKey, this.stateManager.shouldStopSync ? "idle" : "completed");
|