@ovok/native 1.11.2 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/modules/bt-device/constants/device-model.js +82 -0
- package/lib/commonjs/modules/bt-device/constants/device-model.js.map +1 -0
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js +21 -1
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-device/hooks/use-supported-devices.js +16 -0
- package/lib/commonjs/modules/bt-device/hooks/use-supported-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-device/index.js +117 -0
- package/lib/commonjs/modules/bt-device/index.js.map +1 -1
- package/lib/commonjs/modules/bt-device/types/device-kind.js +2 -0
- package/lib/commonjs/modules/bt-device/types/device-kind.js.map +1 -0
- package/lib/commonjs/modules/bt-device/utils/device-query.js +57 -0
- package/lib/commonjs/modules/bt-device/utils/device-query.js.map +1 -0
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +3 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/blood-pressure-translated-exception-map.js +2 -1
- package/lib/commonjs/modules/bt-management/constants/blood-pressure-translated-exception-map.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/measurement-feedback.js +25 -0
- package/lib/commonjs/modules/bt-management/constants/measurement-feedback.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bt-device.js +8 -7
- package/lib/commonjs/modules/bt-management/hooks/use-bt-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-bt-devices.js +41 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bt-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-open-series.js +18 -0
- package/lib/commonjs/modules/bt-management/hooks/use-open-series.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-queued-results.js +15 -0
- package/lib/commonjs/modules/bt-management/hooks/use-queued-results.js.map +1 -0
- package/lib/commonjs/modules/bt-management/index.js +60 -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 +34 -1
- 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 +23 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +2 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js +13 -12
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +4 -3
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +10 -1
- 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 +6 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/f4/f4.device.js +4 -3
- package/lib/commonjs/modules/bt-management/services/devices/f4/f4.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.device.js +2 -1
- package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/series-recorder.js +176 -0
- package/lib/commonjs/modules/bt-management/services/series-recorder.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/series-slots.js +93 -0
- package/lib/commonjs/modules/bt-management/services/series-slots.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/measurement-series.js +6 -0
- package/lib/commonjs/modules/bt-management/types/measurement-series.js.map +1 -0
- package/lib/commonjs/modules/data-sync/constants.js +14 -1
- package/lib/commonjs/modules/data-sync/constants.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +6 -5
- 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 +10 -7
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/storage-manager.js +10 -4
- package/lib/commonjs/modules/data-sync/services/managers/storage-manager.js.map +1 -1
- package/lib/commonjs/modules/data-sync/types/health-data.js +5 -1
- package/lib/commonjs/modules/data-sync/types/health-data.js.map +1 -1
- package/lib/commonjs/modules/data-sync/types/health-sync-keys.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js +19 -5
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/fhir-systems.js +4 -1
- package/lib/commonjs/modules/data-sync/utils/fhir-systems.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js +10 -5
- package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-health-record-sync-id.js +18 -12
- package/lib/commonjs/modules/data-sync/utils/get-health-record-sync-id.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-latest-valid-start-date.js +6 -1
- package/lib/commonjs/modules/data-sync/utils/get-latest-valid-start-date.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js +4 -0
- package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js +3 -2
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-connect-series.js +101 -0
- package/lib/commonjs/modules/data-sync/utils/health-connect-series.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-series.js +44 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-series.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/hourly-series.js +57 -0
- package/lib/commonjs/modules/data-sync/utils/hourly-series.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/replaces-saved-observation.js +13 -0
- package/lib/commonjs/modules/data-sync/utils/replaces-saved-observation.js.map +1 -0
- package/lib/module/modules/bt-device/constants/device-model.js +74 -0
- package/lib/module/modules/bt-device/constants/device-model.js.map +1 -0
- package/lib/module/modules/bt-device/constants/supported-devices.js +21 -1
- package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/module/modules/bt-device/hooks/use-supported-devices.js +12 -0
- package/lib/module/modules/bt-device/hooks/use-supported-devices.js.map +1 -0
- package/lib/module/modules/bt-device/index.js +4 -0
- package/lib/module/modules/bt-device/index.js.map +1 -1
- package/lib/module/modules/bt-device/types/device-kind.js +2 -0
- package/lib/module/modules/bt-device/types/device-kind.js.map +1 -0
- package/lib/module/modules/bt-device/utils/device-query.js +50 -0
- package/lib/module/modules/bt-device/utils/device-query.js.map +1 -0
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +3 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/constants/blood-pressure-translated-exception-map.js +2 -1
- package/lib/module/modules/bt-management/constants/blood-pressure-translated-exception-map.js.map +1 -1
- package/lib/module/modules/bt-management/constants/measurement-feedback.js +22 -0
- package/lib/module/modules/bt-management/constants/measurement-feedback.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-bt-device.js +9 -8
- package/lib/module/modules/bt-management/hooks/use-bt-device.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/use-bt-devices.js +37 -0
- package/lib/module/modules/bt-management/hooks/use-bt-devices.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-open-series.js +13 -0
- package/lib/module/modules/bt-management/hooks/use-open-series.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-queued-results.js +10 -0
- package/lib/module/modules/bt-management/hooks/use-queued-results.js.map +1 -0
- package/lib/module/modules/bt-management/index.js +5 -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 +34 -1
- 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 +23 -1
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +2 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js +13 -12
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +4 -3
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +10 -1
- 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 +6 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/f4/f4.device.js +4 -3
- package/lib/module/modules/bt-management/services/devices/f4/f4.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/spo/spo2.device.js +2 -1
- package/lib/module/modules/bt-management/services/devices/spo/spo2.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/series-recorder.js +173 -0
- package/lib/module/modules/bt-management/services/series-recorder.js.map +1 -0
- package/lib/module/modules/bt-management/services/series-slots.js +85 -0
- package/lib/module/modules/bt-management/services/series-slots.js.map +1 -0
- package/lib/module/modules/bt-management/types/measurement-series.js +4 -0
- package/lib/module/modules/bt-management/types/measurement-series.js.map +1 -0
- package/lib/module/modules/data-sync/constants.js +14 -1
- package/lib/module/modules/data-sync/constants.js.map +1 -1
- package/lib/module/modules/data-sync/services/base-health-sync-service.js +6 -5
- 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 +11 -8
- package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/storage-manager.js +10 -4
- package/lib/module/modules/data-sync/services/managers/storage-manager.js.map +1 -1
- package/lib/module/modules/data-sync/types/health-data.js +6 -1
- package/lib/module/modules/data-sync/types/health-data.js.map +1 -1
- package/lib/module/modules/data-sync/types/health-sync-keys.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js +19 -6
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/module/modules/data-sync/utils/fhir-systems.js +4 -1
- package/lib/module/modules/data-sync/utils/fhir-systems.js.map +1 -1
- package/lib/module/modules/data-sync/utils/generate-observation-entry.js +10 -5
- package/lib/module/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-health-record-sync-id.js +16 -11
- package/lib/module/modules/data-sync/utils/get-health-record-sync-id.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-latest-valid-start-date.js +7 -2
- package/lib/module/modules/data-sync/utils/get-latest-valid-start-date.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js +4 -0
- package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js +3 -2
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-connect-series.js +97 -0
- package/lib/module/modules/data-sync/utils/health-connect-series.js.map +1 -0
- package/lib/module/modules/data-sync/utils/healthkit-series.js +40 -0
- package/lib/module/modules/data-sync/utils/healthkit-series.js.map +1 -0
- package/lib/module/modules/data-sync/utils/hourly-series.js +52 -0
- package/lib/module/modules/data-sync/utils/hourly-series.js.map +1 -0
- package/lib/module/modules/data-sync/utils/replaces-saved-observation.js +8 -0
- package/lib/module/modules/data-sync/utils/replaces-saved-observation.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-model.d.ts +32 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-model.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts +18 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/hooks/use-supported-devices.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-device/hooks/use-supported-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/types/device-kind.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-device/types/device-kind.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/utils/device-query.d.ts +49 -0
- package/lib/typescript/commonjs/src/modules/bt-device/utils/device-query.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/blood-pressure-translated-exception-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-feedback.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-feedback.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bt-device.d.ts +5 -4
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bt-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bt-devices.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bt-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-open-series.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-open-series.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-queued-results.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-queued-results.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +5 -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 +11 -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 +13 -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/bc01/bc01.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +4 -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/f4/f4.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/series-recorder.d.ts +56 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/series-recorder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/series-slots.d.ts +36 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/series-slots.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +7 -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/measurement-series.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/measurement-series.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +6 -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 +6 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/constants.d.ts +11 -1
- package/lib/typescript/commonjs/src/modules/data-sync/constants.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 +3 -2
- 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/storage-manager.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/storage-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-data.d.ts +15 -2
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-data.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-keys.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-keys.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/fhir-systems.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/fhir-systems.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/generate-observation-entry.d.ts +3 -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/get-health-record-sync-id.d.ts +9 -6
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-health-record-sync-id.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-latest-valid-start-date.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-connect-series.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-connect-series.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/hourly-series.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/hourly-series.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/replaces-saved-observation.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/replaces-saved-observation.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/device-model.d.ts +32 -0
- package/lib/typescript/module/src/modules/bt-device/constants/device-model.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts +18 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/hooks/use-supported-devices.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-device/hooks/use-supported-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/index.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-device/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/types/device-kind.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-device/types/device-kind.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/utils/device-query.d.ts +49 -0
- package/lib/typescript/module/src/modules/bt-device/utils/device-query.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/blood-pressure-translated-exception-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-feedback.d.ts +21 -0
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-feedback.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bt-device.d.ts +5 -4
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bt-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bt-devices.d.ts +24 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bt-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-open-series.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-open-series.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-queued-results.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-queued-results.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +5 -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 +11 -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 +13 -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/bc01/bc01.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +4 -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/f4/f4.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/series-recorder.d.ts +56 -0
- package/lib/typescript/module/src/modules/bt-management/services/series-recorder.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/series-slots.d.ts +36 -0
- package/lib/typescript/module/src/modules/bt-management/services/series-slots.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +7 -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/measurement-series.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/types/measurement-series.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +6 -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 +6 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/constants.d.ts +11 -1
- package/lib/typescript/module/src/modules/data-sync/constants.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 +3 -2
- 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/storage-manager.d.ts +2 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/storage-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-data.d.ts +15 -2
- package/lib/typescript/module/src/modules/data-sync/types/health-data.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-sync-keys.d.ts +3 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-sync-keys.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts +5 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/fhir-systems.d.ts +3 -1
- package/lib/typescript/module/src/modules/data-sync/utils/fhir-systems.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/generate-observation-entry.d.ts +3 -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/get-health-record-sync-id.d.ts +9 -6
- package/lib/typescript/module/src/modules/data-sync/utils/get-health-record-sync-id.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-latest-valid-start-date.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-records-from-health-connect.d.ts +2 -2
- package/lib/typescript/module/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -2
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-connect-series.d.ts +9 -0
- package/lib/typescript/module/src/modules/data-sync/utils/health-connect-series.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts +12 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/hourly-series.d.ts +22 -0
- package/lib/typescript/module/src/modules/data-sync/utils/hourly-series.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/replaces-saved-observation.d.ts +7 -0
- package/lib/typescript/module/src/modules/data-sync/utils/replaces-saved-observation.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { subDays } from "date-fns";
|
|
3
|
+
import { subDays, subHours } from "date-fns";
|
|
4
|
+
import { DAILY_REREAD_DAYS, SERIES_REREAD_HOURS } from "../constants.js";
|
|
4
5
|
import { isDailyAggregateMode } from "./is-daily-aggregate-mode.js";
|
|
5
6
|
export const getLatestValidStartDate = ({
|
|
6
7
|
latestObservationDates,
|
|
@@ -13,7 +14,11 @@ export const getLatestValidStartDate = ({
|
|
|
13
14
|
const latestObservationDate = latestObservationDates.find(latestObservationDate => data.typeIdentifiers.some(identifier => identifier.code === latestObservationDate.code))?.date;
|
|
14
15
|
let latestValidStartDate;
|
|
15
16
|
const latestDate = latestObservationDate ? new Date(latestObservationDate) : undefined;
|
|
16
|
-
const
|
|
17
|
+
const resolvedMode = mode ?? data.mode;
|
|
18
|
+
|
|
19
|
+
// A total or an hour of a series already imported may still change, so it is read again.
|
|
20
|
+
const rereadFrom = date => resolvedMode === "series" ? subHours(date, SERIES_REREAD_HOURS) : isDailyAggregateMode(mode) || isDailyAggregateMode(data.mode) ? subDays(date, DAILY_REREAD_DAYS) : date;
|
|
21
|
+
const dates = [latestDate && rereadFrom(latestDate), data.minDate].filter(Boolean);
|
|
17
22
|
if (dates.length > 0) {
|
|
18
23
|
latestValidStartDate = new Date(Math.max(...dates.map(date => date.getTime())));
|
|
19
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["subDays","isDailyAggregateMode","getLatestValidStartDate","latestObservationDates","data","mode","undefined","latestObservationDate","find","typeIdentifiers","some","identifier","code","date","latestValidStartDate","latestDate","Date","dates","minDate","filter","Boolean","length","Math","max","map","getTime"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-latest-valid-start-date.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,UAAU;
|
|
1
|
+
{"version":3,"names":["subDays","subHours","DAILY_REREAD_DAYS","SERIES_REREAD_HOURS","isDailyAggregateMode","getLatestValidStartDate","latestObservationDates","data","mode","undefined","latestObservationDate","find","typeIdentifiers","some","identifier","code","date","latestValidStartDate","latestDate","Date","resolvedMode","rereadFrom","dates","minDate","filter","Boolean","length","Math","max","map","getTime"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-latest-valid-start-date.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,UAAU;AAE5C,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,iBAAc;AAKrE,SAASC,oBAAoB,QAAQ,8BAA2B;AAYhE,OAAO,MAAMC,uBAAuB,GAAGA,CAAC;EACtCC,sBAAsB;EACtBC,IAAI;EACJC;AAC4B,CAAC,KAAK;EAClC,IAAI,CAACD,IAAI,EAAE;IACT,OAAOE,SAAS;EAClB;EAEA,MAAMC,qBAAqB,GAAGJ,sBAAsB,CAACK,IAAI,CACtDD,qBAAqB,IACpBH,IAAI,CAACK,eAAe,CAACC,IAAI,CACtBC,UAAU,IAAKA,UAAU,CAACC,IAAI,KAAKL,qBAAqB,CAACK,IAC5D,CACJ,CAAC,EAAEC,IAAI;EAEP,IAAIC,oBAAsC;EAE1C,MAAMC,UAAU,GAAGR,qBAAqB,GACpC,IAAIS,IAAI,CAACT,qBAAqB,CAAC,GAC/BD,SAAS;EAEb,MAAMW,YAAY,GAAGZ,IAAI,IAAID,IAAI,CAACC,IAAI;;EAEtC;EACA,MAAMa,UAAU,GAAIL,IAAU,IAC5BI,YAAY,KAAK,QAAQ,GACrBnB,QAAQ,CAACe,IAAI,EAAEb,mBAAmB,CAAC,GACnCC,oBAAoB,CAACI,IAAI,CAAC,IAAIJ,oBAAoB,CAACG,IAAI,CAACC,IAAI,CAAC,GAC3DR,OAAO,CAACgB,IAAI,EAAEd,iBAAiB,CAAC,GAChCc,IAAI;EAEZ,MAAMM,KAAK,GAAG,CAACJ,UAAU,IAAIG,UAAU,CAACH,UAAU,CAAC,EAAEX,IAAI,CAACgB,OAAO,CAAC,CAACC,MAAM,CAACC,OAAO,CAAW;EAE5F,IAAIH,KAAK,CAACI,MAAM,GAAG,CAAC,EAAE;IACpBT,oBAAoB,GAAG,IAAIE,IAAI,CAC7BQ,IAAI,CAACC,GAAG,CAAC,GAAGN,KAAK,CAACO,GAAG,CAAEb,IAAI,IAAKA,IAAI,CAACc,OAAO,CAAC,CAAC,CAAC,CACjD,CAAC;EACH;EAEA,OAAOb,oBAAoB;AAC7B,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { startOfDay, subDays } from "date-fns";
|
|
6
6
|
import { aggregateGroupByPeriod, getChanges, readRecords } from "react-native-health-connect";
|
|
7
7
|
import { DEFAULT_HEALTH_SYNC_CHUNK_SIZE, DEFAULT_SYNC_LOOKBACK_DAYS } from "../constants.js";
|
|
8
|
+
import { getHealthConnectSeries } from "./health-connect-series.js";
|
|
8
9
|
import { isDailyAggregateMode } from "./is-daily-aggregate-mode.js";
|
|
9
10
|
import { syncWindowStart } from "./sync-window-start.js";
|
|
10
11
|
export const getRecordsFromHealthConnect = async ({
|
|
@@ -17,6 +18,9 @@ export const getRecordsFromHealthConnect = async ({
|
|
|
17
18
|
if (isDailyAggregateMode(mode)) {
|
|
18
19
|
return getDailyAggregates(typeIdentifier, mode, _startDate);
|
|
19
20
|
}
|
|
21
|
+
if (mode === "series") {
|
|
22
|
+
return getHealthConnectSeries(typeIdentifier, syncWindowStart(_startDate));
|
|
23
|
+
}
|
|
20
24
|
const savedAnchor = decodeAnchor(anchor);
|
|
21
25
|
if (savedAnchor?.phase === "changes") {
|
|
22
26
|
const changes = await getChanges({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["startOfDay","subDays","aggregateGroupByPeriod","getChanges","readRecords","DEFAULT_HEALTH_SYNC_CHUNK_SIZE","DEFAULT_SYNC_LOOKBACK_DAYS","isDailyAggregateMode","syncWindowStart","getRecordsFromHealthConnect","typeIdentifier","startDate","_startDate","chunkSize","anchor","mode","getDailyAggregates","savedAnchor","decodeAnchor","phase","changes","changesToken","recordTypes","changesTokenExpired","data","upsertionChanges","map","record","deletionChanges","length","deletedRecordIds","recordId","hasMore","encodeAnchor","version","nextChangesToken","baseline","readSnapshot","pageToken","undefined","snapshotAnchor","endDate","Date","toISOString","resolvedStartDate","result","timeRangeFilter","operator","startTime","endTime","pageSize","nextAnchor","records","Boolean","JSON","stringify","startsWith","parsed","parse","aggregateType","today","groups","recordType","timeRangeSlicer","period","flatMap","group","end","measurement","aggregateMeasurement","dataOrigins","kind","sourceApp","average","numberValue","BPM_AVG","unit","minimum","BPM_MIN","maximum","BPM_MAX","value","COUNT_TOTAL","nestedNumber","DISTANCE","ACTIVE_CALORIES_TOTAL","FLOORS_CLIMBED_TOTAL","scale","EXERCISE_DURATION_TOTAL","Number","isFinite","key","factor"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-records-from-health-connect.ts"],"mappings":";;AAAA;;AAEA,SAASA,UAAU,EAAEC,OAAO,QAAQ,UAAU;AAC9C,SACEC,sBAAsB,EAEtBC,UAAU,EACVC,WAAW,QAGN,6BAA6B;AAEpC,SAASC,8BAA8B,EAAEC,0BAA0B,QAAQ,iBAAc;AAMzF,SAASC,oBAAoB,QAAQ,8BAA2B;AAChE,SAASC,eAAe,QAAQ,wBAAqB;AAOrD,OAAO,MAAMC,2BAA2B,GAAG,MAAAA,CAAO;EAChDC,cAAc;EACdC,SAAS,EAAEC,UAAU;EACrBC,SAAS,
|
|
1
|
+
{"version":3,"names":["startOfDay","subDays","aggregateGroupByPeriod","getChanges","readRecords","DEFAULT_HEALTH_SYNC_CHUNK_SIZE","DEFAULT_SYNC_LOOKBACK_DAYS","getHealthConnectSeries","isDailyAggregateMode","syncWindowStart","getRecordsFromHealthConnect","typeIdentifier","startDate","_startDate","chunkSize","anchor","mode","getDailyAggregates","savedAnchor","decodeAnchor","phase","changes","changesToken","recordTypes","changesTokenExpired","data","upsertionChanges","map","record","deletionChanges","length","deletedRecordIds","recordId","hasMore","encodeAnchor","version","nextChangesToken","baseline","readSnapshot","pageToken","undefined","snapshotAnchor","endDate","Date","toISOString","resolvedStartDate","result","timeRangeFilter","operator","startTime","endTime","pageSize","nextAnchor","records","Boolean","JSON","stringify","startsWith","parsed","parse","aggregateType","today","groups","recordType","timeRangeSlicer","period","flatMap","group","end","measurement","aggregateMeasurement","dataOrigins","kind","sourceApp","average","numberValue","BPM_AVG","unit","minimum","BPM_MIN","maximum","BPM_MAX","value","COUNT_TOTAL","nestedNumber","DISTANCE","ACTIVE_CALORIES_TOTAL","FLOORS_CLIMBED_TOTAL","scale","EXERCISE_DURATION_TOTAL","Number","isFinite","key","factor"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-records-from-health-connect.ts"],"mappings":";;AAAA;;AAEA,SAASA,UAAU,EAAEC,OAAO,QAAQ,UAAU;AAC9C,SACEC,sBAAsB,EAEtBC,UAAU,EACVC,WAAW,QAGN,6BAA6B;AAEpC,SAASC,8BAA8B,EAAEC,0BAA0B,QAAQ,iBAAc;AAMzF,SAASC,sBAAsB,QAAQ,4BAAyB;AAChE,SAASC,oBAAoB,QAAQ,8BAA2B;AAChE,SAASC,eAAe,QAAQ,wBAAqB;AAOrD,OAAO,MAAMC,2BAA2B,GAAG,MAAAA,CAAO;EAChDC,cAAc;EACdC,SAAS,EAAEC,UAAU;EACrBC,SAAS,GAAGT,8BAA8B;EAC1CU,MAAM;EACNC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EtE,MAAMM,WAAW,GAAIO,KAAc,IACjC,OAAOA,KAAK,KAAK,QAAQ,IAAIQ,MAAM,CAACC,QAAQ,CAACT,KAAK,CAAC,GAAGA,KAAK,GAAG1C,SAAS;AAEzE,MAAM4C,YAAY,GAAGA,CAACF,KAAc,EAAEU,GAAW,KAC/CjB,WAAW,CAAEO,KAAK,GAA2CU,GAAG,CAAC,CAAC;AAEpE,MAAMJ,KAAK,GAAGA,CAACN,KAAyB,EAAEW,MAAc,KACtDX,KAAK,KAAK1C,SAAS,GAAGA,SAAS,GAAG0C,KAAK,GAAGW,MAAM","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ import { addDays, startOfDay } from "date-fns";
|
|
|
5
5
|
import { DEFAULT_HEALTH_SYNC_CHUNK_SIZE } from "../constants.js";
|
|
6
6
|
import { healthUnitFor } from "./health-units.js";
|
|
7
7
|
import { isCategoryIdentifier, isCorrelationIdentifier, isQuantityIdentifier, UnsupportedHealthKitDataError, unsupportedHealthKitTypeReason } from "./healthkit-data-types.js";
|
|
8
|
+
import { getHealthKitSeries } from "./healthkit-series.js";
|
|
8
9
|
import { isDailyAggregateMode } from "./is-daily-aggregate-mode.js";
|
|
9
10
|
import { syncWindowStart } from "./sync-window-start.js";
|
|
10
11
|
const getSamplesFromHealth = async ({
|
|
@@ -16,11 +17,11 @@ const getSamplesFromHealth = async ({
|
|
|
16
17
|
}) => {
|
|
17
18
|
const startDate = syncWindowStart(_startDate);
|
|
18
19
|
const endDate = new Date();
|
|
19
|
-
if (isDailyAggregateMode(mode)) {
|
|
20
|
+
if (isDailyAggregateMode(mode) || mode === "series") {
|
|
20
21
|
if (!isQuantityIdentifier(typeIdentifier)) {
|
|
21
22
|
throw new UnsupportedHealthKitDataError(typeIdentifier, `HealthKit ${mode} mode is only supported for quantity samples.`);
|
|
22
23
|
}
|
|
23
|
-
return getDailyStatistics(typeIdentifier, mode, startDate, endDate);
|
|
24
|
+
return mode === "series" ? getHealthKitSeries(typeIdentifier, startDate) : getDailyStatistics(typeIdentifier, mode, startDate, endDate);
|
|
24
25
|
}
|
|
25
26
|
const options = {
|
|
26
27
|
from: startDate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Healthkit","HKStatisticsOptions","HKWorkoutTypeIdentifier","UnitOfEnergy","addDays","startOfDay","DEFAULT_HEALTH_SYNC_CHUNK_SIZE","healthUnitFor","isCategoryIdentifier","isCorrelationIdentifier","isQuantityIdentifier","UnsupportedHealthKitDataError","unsupportedHealthKitTypeReason","isDailyAggregateMode","syncWindowStart","getSamplesFromHealth","startDate","_startDate","typeIdentifier","anchor","chunkSize","mode","endDate","Date","getDailyStatistics","options","from","to","limit","queryWorkoutSamplesWithAnchor","result","energyUnit","Kilocalories","distanceUnit","data","undefined","toAnchoredResult","queryHeartbeatSeriesSamplesWithAnchor","queryCategorySamplesWithAnchor","samples","queryCorrelationSamples","queryStateOfMindSamples","ascending","queryQuantitySamplesWithAnchor","unit","deletedRecordIds","recordIds","map","uuid","length","deletedSamples","newAnchor","firstDay","today","cumulativeSum","discreteAverage","discreteMin","discreteMax","statistics","queryStatisticsCollectionForQuantity","day","flatMap","statistic","index","dayStart","dayEnd","total","sumQuantity","quantity","average","averageQuantity","minimum","minimumQuantity","maximum","maximumQuantity","kind","value"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-samples-from-health.ts"],"mappings":";;AAAA,OAAOA,SAAS,IAIdC,mBAAmB,EACnBC,uBAAuB,EACvBC,YAAY,QACP,oCAAoC;AAC3C,SAASC,OAAO,EAAEC,UAAU,QAAQ,UAAU;AAE9C,SAASC,8BAA8B,QAAQ,iBAAc;AAM7D,SAASC,aAAa,QAAQ,mBAAgB;AAC9C,SACEC,oBAAoB,EACpBC,uBAAuB,EACvBC,oBAAoB,EACpBC,6BAA6B,EAC7BC,8BAA8B,QACzB,2BAAwB;AAC/B,SAASC,oBAAoB,QAAQ,8BAA2B;AAChE,SAASC,eAAe,QAAQ,wBAAqB;AAErD,MAAMC,oBAAoB,GAAG,MAAAA,CAAO;EAClCC,SAAS,EAAEC,UAAU;EACrBC,cAAc;EACdC,MAAM;EACNC,SAAS,
|
|
1
|
+
{"version":3,"names":["Healthkit","HKStatisticsOptions","HKWorkoutTypeIdentifier","UnitOfEnergy","addDays","startOfDay","DEFAULT_HEALTH_SYNC_CHUNK_SIZE","healthUnitFor","isCategoryIdentifier","isCorrelationIdentifier","isQuantityIdentifier","UnsupportedHealthKitDataError","unsupportedHealthKitTypeReason","getHealthKitSeries","isDailyAggregateMode","syncWindowStart","getSamplesFromHealth","startDate","_startDate","typeIdentifier","anchor","chunkSize","mode","endDate","Date","getDailyStatistics","options","from","to","limit","queryWorkoutSamplesWithAnchor","result","energyUnit","Kilocalories","distanceUnit","data","undefined","toAnchoredResult","queryHeartbeatSeriesSamplesWithAnchor","queryCategorySamplesWithAnchor","samples","queryCorrelationSamples","queryStateOfMindSamples","ascending","queryQuantitySamplesWithAnchor","unit","deletedRecordIds","recordIds","map","uuid","length","deletedSamples","newAnchor","firstDay","today","cumulativeSum","discreteAverage","discreteMin","discreteMax","statistics","queryStatisticsCollectionForQuantity","day","flatMap","statistic","index","dayStart","dayEnd","total","sumQuantity","quantity","average","averageQuantity","minimum","minimumQuantity","maximum","maximumQuantity","kind","value"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-samples-from-health.ts"],"mappings":";;AAAA,OAAOA,SAAS,IAIdC,mBAAmB,EACnBC,uBAAuB,EACvBC,YAAY,QACP,oCAAoC;AAC3C,SAASC,OAAO,EAAEC,UAAU,QAAQ,UAAU;AAE9C,SAASC,8BAA8B,QAAQ,iBAAc;AAM7D,SAASC,aAAa,QAAQ,mBAAgB;AAC9C,SACEC,oBAAoB,EACpBC,uBAAuB,EACvBC,oBAAoB,EACpBC,6BAA6B,EAC7BC,8BAA8B,QACzB,2BAAwB;AAC/B,SAASC,kBAAkB,QAAQ,uBAAoB;AACvD,SAASC,oBAAoB,QAAQ,8BAA2B;AAChE,SA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AAI,KAAK,aAAa,GACtB;QAAEuD,KAAK,EAAEV;MAAM,CAAC,GAChB;QAAEG,OAAO;QAAEE,OAAO;QAAEE;MAAQ,CAAC;IACnC,CAAC,CACF;EACH,CAAC,CAAC;EAEF,OAAO;IAAEvC,IAAI;IAAEf,MAAM,EAAEgB;EAAU,CAAC;AACpC,CAAC;AAED,SAASpB,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { aggregateGroupByDuration, readRecords } from "react-native-health-connect";
|
|
4
|
+
import { SERIES_SLOT_MS } from "../constants.js";
|
|
5
|
+
import { extractValue } from "./convert-generic-health-data.js";
|
|
6
|
+
import { finishedHourWindows, toHourlySeries } from "./hourly-series.js";
|
|
7
|
+
const HEART_RATE_UNIT = "count/min";
|
|
8
|
+
const between = (from, to) => ({
|
|
9
|
+
operator: "between",
|
|
10
|
+
startTime: from.toISOString(),
|
|
11
|
+
endTime: to.toISOString()
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/** Health Connect's own average a minute, which follows the user's app priority where sources overlap. */
|
|
15
|
+
const heartRateMinutes = async (from, to) => {
|
|
16
|
+
const groups = await aggregateGroupByDuration({
|
|
17
|
+
recordType: "HeartRate",
|
|
18
|
+
timeRangeFilter: between(from, to),
|
|
19
|
+
timeRangeSlicer: {
|
|
20
|
+
duration: "MINUTES",
|
|
21
|
+
length: 1
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return groups.flatMap(group => {
|
|
25
|
+
const average = group.result.BPM_AVG;
|
|
26
|
+
return typeof average === "number" && Number.isFinite(average) ? [{
|
|
27
|
+
start: new Date(group.startTime),
|
|
28
|
+
value: average
|
|
29
|
+
}] : [];
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** Records of a type Health Connect doesn't average, such as SpO₂ and respiratory rate, averaged a minute here. */
|
|
34
|
+
const recordMinutes = async (typeIdentifier, from, to) => {
|
|
35
|
+
const sums = new Map();
|
|
36
|
+
let unit;
|
|
37
|
+
let pageToken;
|
|
38
|
+
do {
|
|
39
|
+
const page = await readRecords(typeIdentifier, {
|
|
40
|
+
timeRangeFilter: between(from, to),
|
|
41
|
+
pageToken
|
|
42
|
+
});
|
|
43
|
+
page.records.forEach(record => {
|
|
44
|
+
const raw = record;
|
|
45
|
+
const measured = extractValue(raw);
|
|
46
|
+
const time = raw.time ?? raw.startTime;
|
|
47
|
+
if (!measured || typeof time !== "string") {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const minute = Math.floor(new Date(time).getTime() / SERIES_SLOT_MS) * SERIES_SLOT_MS;
|
|
51
|
+
const sum = sums.get(minute) ?? {
|
|
52
|
+
total: 0,
|
|
53
|
+
count: 0
|
|
54
|
+
};
|
|
55
|
+
sums.set(minute, {
|
|
56
|
+
total: sum.total + measured.value,
|
|
57
|
+
count: sum.count + 1
|
|
58
|
+
});
|
|
59
|
+
unit ??= measured.unit;
|
|
60
|
+
});
|
|
61
|
+
pageToken = page.pageToken;
|
|
62
|
+
} while (pageToken);
|
|
63
|
+
return {
|
|
64
|
+
unit,
|
|
65
|
+
minutes: [...sums.entries()].map(([minute, {
|
|
66
|
+
total,
|
|
67
|
+
count
|
|
68
|
+
}]) => ({
|
|
69
|
+
start: new Date(minute),
|
|
70
|
+
value: total / count
|
|
71
|
+
}))
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** The finished hours from `startDate`, one `series` item an hour, read a day at a time. */
|
|
76
|
+
const getHealthConnectSeries = async (typeIdentifier, startDate) => {
|
|
77
|
+
const minutes = [];
|
|
78
|
+
let unit = typeIdentifier === "HeartRate" ? HEART_RATE_UNIT : undefined;
|
|
79
|
+
for (const {
|
|
80
|
+
from,
|
|
81
|
+
to
|
|
82
|
+
} of finishedHourWindows(startDate)) {
|
|
83
|
+
if (typeIdentifier === "HeartRate") {
|
|
84
|
+
minutes.push(...(await heartRateMinutes(from, to)));
|
|
85
|
+
} else {
|
|
86
|
+
const read = await recordMinutes(typeIdentifier, from, to);
|
|
87
|
+
minutes.push(...read.minutes);
|
|
88
|
+
unit ??= read.unit;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
data: toHourlySeries(typeIdentifier, unit ?? "1", minutes),
|
|
93
|
+
anchor: undefined
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export { getHealthConnectSeries };
|
|
97
|
+
//# sourceMappingURL=health-connect-series.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["aggregateGroupByDuration","readRecords","SERIES_SLOT_MS","extractValue","finishedHourWindows","toHourlySeries","HEART_RATE_UNIT","between","from","to","operator","startTime","toISOString","endTime","heartRateMinutes","groups","recordType","timeRangeFilter","timeRangeSlicer","duration","length","flatMap","group","average","result","BPM_AVG","Number","isFinite","start","Date","value","recordMinutes","typeIdentifier","sums","Map","unit","pageToken","page","records","forEach","record","raw","measured","time","minute","Math","floor","getTime","sum","get","total","count","set","minutes","entries","map","getHealthConnectSeries","startDate","undefined","push","read","data","anchor"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/health-connect-series.ts"],"mappings":";;AAAA,SAASA,wBAAwB,EAAEC,WAAW,QAAoB,6BAA6B;AAE/F,SAASC,cAAc,QAAQ,iBAAc;AAG7C,SAASC,YAAY,QAAQ,kCAA+B;AAC5D,SAASC,mBAAmB,EAAeC,cAAc,QAAQ,oBAAiB;AAElF,MAAMC,eAAe,GAAG,WAAW;AAEnC,MAAMC,OAAO,GAAGA,CAACC,IAAU,EAAEC,EAAQ,MAAM;EACzCC,QAAQ,EAAE,SAAkB;EAC5BC,SAAS,EAAEH,IAAI,CAACI,WAAW,CAAC,CAAC;EAC7BC,OAAO,EAAEJ,EAAE,CAACG,WAAW,CAAC;AAC1B,CAAC,CAAC;;AAEF;AACA,MAAME,gBAAgB,GAAG,MAAAA,CAAON,IAAU,EAAEC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AAM7C,gBAAgB,CAACN,IAAI,EAAEC,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC,MAAM;MACL,MAAMmD,IAAI,GAAG,MAAM7B,aAAa,CAACC,cAAc,EAAExB,IAAI,EAAEC,EAAE,CAAC;MAE1D4C,OAAO,CAACM,IAAI,CAAC,GAAGC,IAAI,CAACP,OAAO,CAAC;MAC7BlB,IAAI,KAAKyB,IAAI,CAACzB,IAAI;IACpB;EACF;EAEA,OAAO;IAAE0B,IAAI,EAAExD,cAAc,CAAC2B,cAAc,EAAEG,IAAI,IAAI,GAAG,EAAEkB,OAAO,CAAC;IAAES,MAAM,EAAEJ;EAAU,CAAC;AAC1F,CAAC;AAED,SAASF,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import Healthkit, { HKStatisticsOptions } from "@kingstinct/react-native-healthkit";
|
|
4
|
+
import { SERIES_SLOT_MS } from "../constants.js";
|
|
5
|
+
import { healthUnitFor } from "./health-units.js";
|
|
6
|
+
import { finishedHourWindows, toHourlySeries } from "./hourly-series.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The finished hours from `startDate`, one `series` item an hour, from HealthKit's own average a minute: it follows
|
|
10
|
+
* the user's source priority where a watch and another app both recorded. Read a day at a time.
|
|
11
|
+
*/
|
|
12
|
+
const getHealthKitSeries = async (typeIdentifier, startDate) => {
|
|
13
|
+
const unit = healthUnitFor(typeIdentifier);
|
|
14
|
+
const minutes = [];
|
|
15
|
+
for (const {
|
|
16
|
+
from,
|
|
17
|
+
to
|
|
18
|
+
} of finishedHourWindows(startDate)) {
|
|
19
|
+
const statistics = await Healthkit.queryStatisticsCollectionForQuantity(typeIdentifier, [HKStatisticsOptions.discreteAverage], from, {
|
|
20
|
+
minute: 1
|
|
21
|
+
}, from, to, unit);
|
|
22
|
+
|
|
23
|
+
// One statistic per minute from `from`, empty minutes included.
|
|
24
|
+
statistics.forEach((statistic, index) => {
|
|
25
|
+
const value = statistic.averageQuantity?.quantity;
|
|
26
|
+
if (value !== undefined) {
|
|
27
|
+
minutes.push({
|
|
28
|
+
start: new Date(from.getTime() + index * SERIES_SLOT_MS),
|
|
29
|
+
value
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
data: toHourlySeries(typeIdentifier, unit ?? "1", minutes),
|
|
36
|
+
anchor: undefined
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export { getHealthKitSeries };
|
|
40
|
+
//# sourceMappingURL=healthkit-series.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Healthkit","HKStatisticsOptions","SERIES_SLOT_MS","healthUnitFor","finishedHourWindows","toHourlySeries","getHealthKitSeries","typeIdentifier","startDate","unit","minutes","from","to","statistics","queryStatisticsCollectionForQuantity","discreteAverage","minute","forEach","statistic","index","value","averageQuantity","quantity","undefined","push","start","Date","getTime","data","anchor"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/healthkit-series.ts"],"mappings":";;AAAA,OAAOA,SAAS,IAA8BC,mBAAmB,QAAQ,oCAAoC;AAE7G,SAASC,cAAc,QAAQ,iBAAc;AAG7C,SAASC,aAAa,QAAQ,mBAAgB;AAC9C,SAASC,mBAAmB,EAAeC,cAAc,QAAQ,oBAAiB;;AAElF;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GAAG,MAAAA,CACzBC,cAAwC,EACxCC,SAAe,KAC8C;EAC7D,MAAMC,IAAI,GAAGN,aAAa,CAACI,cAAc,CAAC;EAC1C,MAAMG,OAAsB,GAAG,EAAE;EAEjC,KAAK,MAAM;IAAEC,IAAI;IAAEC;EAAG,CAAC,IAAIR,mBAAmB,CAACI,SAAS,CAAC,EAAE;IACzD,MAAMK,UAAU,GAAG,MAAMb,SAAS,CAACc,oCAAoC,CACrEP,cAAc,EACd,CAACN,mBAAmB,CAACc,eAAe,CAAC,EACrCJ,IAAI,EACJ;MAAEK,MAAM,EAAE;IAAE,CAAC,EACbL,IAAI,EACJC,EAAE,EACFH,IACF,CAAC;;IAED;IACAI,UAAU,CAACI,OAAO,CAAC,CAACC,SAAS,EAAEC,KAAK,KAAK;MACvC,MAAMC,KAAK,GAAGF,SAAS,CAACG,eAAe,EAAEC,QAAQ;MAEjD,IAAIF,KAAK,KAAKG,SAAS,EAAE;QACvBb,OAAO,CAACc,IAAI,CAAC;UAAEC,KAAK,EAAE,IAAIC,IAAI,CAACf,IAAI,CAACgB,OAAO,CAAC,CAAC,GAAGR,KAAK,GAAGjB,cAAc,CAAC;UAAEkB;QAAM,CAAC,CAAC;MACnF;IACF,CAAC,CAAC;EACJ;EAEA,OAAO;IAAEQ,IAAI,EAAEvB,cAAc,CAACE,cAAc,EAAEE,IAAI,IAAI,GAAG,EAAEC,OAAO,CAAC;IAAEmB,MAAM,EAAEN;EAAU,CAAC;AAC1F,CAAC;AAED,SAASjB,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { SERIES_SLOT_MS } from "../constants.js";
|
|
4
|
+
const HOUR_MS = 3_600_000;
|
|
5
|
+
const DAY_MS = 24 * HOUR_MS;
|
|
6
|
+
|
|
7
|
+
/** A minute's value: the average of what was measured in it. */
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Per-minute values grouped into hours (UTC, so a day never has two 01:00s), each with one slot a minute and `null`
|
|
11
|
+
* for a minute without a value. Hours without any value are left out.
|
|
12
|
+
*/
|
|
13
|
+
const toHourlySeries = (typeIdentifier, unit, minutes) => {
|
|
14
|
+
const hours = new Map();
|
|
15
|
+
minutes.forEach(({
|
|
16
|
+
start,
|
|
17
|
+
value
|
|
18
|
+
}) => {
|
|
19
|
+
const time = start.getTime();
|
|
20
|
+
const hour = Math.floor(time / HOUR_MS) * HOUR_MS;
|
|
21
|
+
const slots = hours.get(hour) ?? Array(HOUR_MS / SERIES_SLOT_MS).fill(null);
|
|
22
|
+
slots[Math.floor((time - hour) / SERIES_SLOT_MS)] = value;
|
|
23
|
+
hours.set(hour, slots);
|
|
24
|
+
});
|
|
25
|
+
return [...hours.entries()].sort(([first], [second]) => first - second).map(([hour, values]) => ({
|
|
26
|
+
kind: "series",
|
|
27
|
+
typeIdentifier,
|
|
28
|
+
startDate: new Date(hour),
|
|
29
|
+
endDate: new Date(hour + HOUR_MS),
|
|
30
|
+
unit,
|
|
31
|
+
periodMs: SERIES_SLOT_MS,
|
|
32
|
+
values
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The finished hours from `start`'s hour up to the current one, in windows of a day at most: one health-store query
|
|
38
|
+
* each, so a first import of months doesn't ask for everything at once.
|
|
39
|
+
*/
|
|
40
|
+
const finishedHourWindows = (start, now = new Date()) => {
|
|
41
|
+
const windows = [];
|
|
42
|
+
const end = Math.floor(now.getTime() / HOUR_MS) * HOUR_MS;
|
|
43
|
+
for (let from = Math.floor(start.getTime() / HOUR_MS) * HOUR_MS; from < end; from += DAY_MS) {
|
|
44
|
+
windows.push({
|
|
45
|
+
from: new Date(from),
|
|
46
|
+
to: new Date(Math.min(from + DAY_MS, end))
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return windows;
|
|
50
|
+
};
|
|
51
|
+
export { finishedHourWindows, toHourlySeries };
|
|
52
|
+
//# sourceMappingURL=hourly-series.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SERIES_SLOT_MS","HOUR_MS","DAY_MS","toHourlySeries","typeIdentifier","unit","minutes","hours","Map","forEach","start","value","time","getTime","hour","Math","floor","slots","get","Array","fill","set","entries","sort","first","second","map","values","kind","startDate","Date","endDate","periodMs","finishedHourWindows","now","windows","end","from","push","to","min"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/hourly-series.ts"],"mappings":";;AAAA,SAASA,cA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;EACF,CAAC,CAAC,CAAC;AACP,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMM,mBAAmB,GAAGA,CAACvB,KAAW,EAAEwB,GAAG,GAAG,IAAIJ,IAAI,CAAC,CAAC,KAAsC;EAC9F,MAAMK,OAAwC,GAAG,EAAE;EACnD,MAAMC,GAAG,GAAGrB,IAAI,CAACC,KAAK,CAACkB,GAAG,CAACrB,OAAO,CAAC,CAAC,GAAGZ,OAAO,CAAC,GAAGA,OAAO;EAEzD,KAAK,IAAIoC,IAAI,GAAGtB,IAAI,CAACC,KAAK,CAACN,KAAK,CAACG,OAAO,CAAC,CAAC,GAAGZ,OAAO,CAAC,GAAGA,OAAO,EAAEoC,IAAI,GAAGD,GAAG,EAAEC,IAAI,IAAInC,MAAM,EAAE;IAC3FiC,OAAO,CAACG,IAAI,CAAC;MAAED,IAAI,EAAE,IAAIP,IAAI,CAACO,IAAI,CAAC;MAAEE,EAAE,EAAE,IAAIT,IAAI,CAACf,IAAI,CAACyB,GAAG,CAACH,IAAI,GAAGnC,MAAM,EAAEkC,GAAG,CAAC;IAAE,CAAC,CAAC;EACpF;EAEA,OAAOD,OAAO;AAChB,CAAC;AAED,SAASF,mBAAmB,EAAE9B,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Modes whose observation is written over when its source changes, a day's total that grew or an hour of a series
|
|
5
|
+
* that got more minutes, instead of being created once.
|
|
6
|
+
*/
|
|
7
|
+
export const replacesSavedObservation = mode => mode === "daily-total" || mode === "daily-summary" || mode === "series";
|
|
8
|
+
//# sourceMappingURL=replaces-saved-observation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["replacesSavedObservation","mode"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/replaces-saved-observation.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMA,wBAAwB,GAAIC,IAAqB,IAC5DA,IAAI,KAAK,aAAa,IAAIA,IAAI,KAAK,eAAe,IAAIA,IAAI,KAAK,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
2
|
+
import type { AcceptedDevice } from "../../bt-management/types/accepted-device";
|
|
3
|
+
import type { DeviceKey } from "../../bt-management/types/device-key";
|
|
4
|
+
import type { DeviceResultPolicy } from "../../bt-management/types/result-policy";
|
|
5
|
+
import type { DeviceDelivery, DeviceImageCredit, DeviceKind } from "../types/device-kind";
|
|
6
|
+
/** The key BTManager reports a device under (`deviceData.name`): a built-in parser or a declaration id. */
|
|
7
|
+
declare const deviceKeyOf: (device: AcceptedDevice) => DeviceKey;
|
|
8
|
+
/**
|
|
9
|
+
* The reading a device is for. Heart rate comes along with most readings (a blood pressure, an ECG,
|
|
10
|
+
* a step count), so it is the main one only on a device that measures nothing else.
|
|
11
|
+
*/
|
|
12
|
+
declare const primaryMeasurementOf: (types: readonly MeasurementTypeKey[]) => MeasurementTypeKey | undefined;
|
|
13
|
+
declare const kindOf: (types: readonly MeasurementTypeKey[]) => DeviceKind;
|
|
14
|
+
/**
|
|
15
|
+
* Devices that send readings continuously while connected rather than one per measurement: the
|
|
16
|
+
* live oximeters, the PC-100 and PC-300 monitors, the wearable T31 thermometer, the Lepod after
|
|
17
|
+
* its stored recordings, and Bluetooth SIG heart-rate straps (a value a second).
|
|
18
|
+
*/
|
|
19
|
+
declare const LIVE_DEVICE_KEYS: ReadonlySet<string>;
|
|
20
|
+
declare const deliveryOf: (keys: readonly DeviceKey[]) => DeviceDelivery;
|
|
21
|
+
/**
|
|
22
|
+
* Keeps a live device's whole stream: every live value goes into a series of one-second slots, reported as one
|
|
23
|
+
* result when it closes (after an hour, or 15 minutes without a value). The single measurements a live device also
|
|
24
|
+
* takes, a blood pressure, a glucose reading or an ECG recording, are each reported. Pass it in `resultPolicies` for
|
|
25
|
+
* live devices (`resultPoliciesFor` does it for a whole list), with `seriesStorage` so a series survives the app
|
|
26
|
+
* closing.
|
|
27
|
+
*/
|
|
28
|
+
declare const LIVE_RESULT_POLICY: DeviceResultPolicy;
|
|
29
|
+
/** `"Label: https://…"` as `{ label, url }`; an SDK illustration's note as its first clause. */
|
|
30
|
+
declare const imageCreditOf: (credit: string) => DeviceImageCredit;
|
|
31
|
+
export { deliveryOf, deviceKeyOf, imageCreditOf, kindOf, LIVE_DEVICE_KEYS, LIVE_RESULT_POLICY, primaryMeasurementOf, };
|
|
32
|
+
//# sourceMappingURL=device-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-model.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/device-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAM1F,2GAA2G;AAC3G,QAAA,MAAM,WAAW,GAAI,QAAQ,cAAc,KAAG,SACG,CAAC;AAoBlD;;;GAGG;AACH,QAAA,MAAM,oBAAoB,GACxB,OAAO,SAAS,kBAAkB,EAAE,KACnC,kBAAkB,GAAG,SAAoE,CAAC;AAE7F,QAAA,MAAM,MAAM,GAAI,OAAO,SAAS,kBAAkB,EAAE,KAAG,UAQtD,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAaxC,CAAC;AAEH,QAAA,MAAM,UAAU,GAAI,MAAM,SAAS,SAAS,EAAE,KAAG,cACgB,CAAC;AAElE;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB,EAAE,kBAGzB,CAAC;AAEF,gGAAgG;AAChG,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,iBAIvC,CAAC;AAEF,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { MeasurementTypeKey } from "@ovok/core";
|
|
2
2
|
import type { AcceptedDevice } from "../../bt-management/types/accepted-device";
|
|
3
|
+
import type { DeviceKey } from "../../bt-management/types/device-key";
|
|
4
|
+
import type { DeviceDelivery, DeviceImageCredit, DeviceKind } from "../types/device-kind";
|
|
3
5
|
type SupportedDevice = {
|
|
4
6
|
name: string;
|
|
5
7
|
nameKey: string;
|
|
@@ -15,6 +17,21 @@ type SupportedDeviceDefinition = SupportedDevice & {
|
|
|
15
17
|
acceptedDevices: readonly AcceptedDevice[];
|
|
16
18
|
measurementTypes: readonly MeasurementTypeKey[];
|
|
17
19
|
manualUrl?: string;
|
|
20
|
+
/** Every key BTManager reports this product's devices under (`deviceData.name`). */
|
|
21
|
+
keys: readonly DeviceKey[];
|
|
22
|
+
/** What the product is for: a blood-pressure monitor, a weight scale, an ECG recorder… */
|
|
23
|
+
kind: DeviceKind;
|
|
24
|
+
/** The reading it is for; the rest of `measurementTypes` come along with it. */
|
|
25
|
+
primaryMeasurement?: MeasurementTypeKey;
|
|
26
|
+
/** One reading per measurement, or values continuously while connected. */
|
|
27
|
+
delivery: DeviceDelivery;
|
|
28
|
+
/**
|
|
29
|
+
* Its parser also serves other products (rebadged models, a Bluetooth SIG profile), so a
|
|
30
|
+
* connected device may be any of them: `deviceData.variant` names the one it is, when known.
|
|
31
|
+
*/
|
|
32
|
+
shared: boolean;
|
|
33
|
+
/** `creditsForImage` as a label and, for a web source, its URL. */
|
|
34
|
+
imageCredit: DeviceImageCredit;
|
|
18
35
|
};
|
|
19
36
|
/**
|
|
20
37
|
* Concrete devices and device families supported by the Bluetooth module.
|
|
@@ -220,7 +237,7 @@ declare const Devices: readonly [{
|
|
|
220
237
|
readonly creditsForImage: "Bluetooth SIG official brand assets: https://www.bluetooth.com/media/";
|
|
221
238
|
readonly standardProfile: true;
|
|
222
239
|
}, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, SupportedDevice, ...SupportedDevice[]];
|
|
223
|
-
/**
|
|
240
|
+
/** The catalog with what each product is: its kind, main reading, delivery and keys. */
|
|
224
241
|
declare const supportedDevices: readonly SupportedDeviceDefinition[];
|
|
225
242
|
declare const SUPPORTED_DEVICES: readonly SupportedDeviceDefinition[];
|
|
226
243
|
/** A de-duplicated list ready to pass directly to BTProvider.acceptedDevices. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supported-devices.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/supported-devices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"supported-devices.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/supported-devices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAyG1F,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IAC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E,eAAe,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SupportedDeviceDefinition } from "../constants/supported-devices";
|
|
2
|
+
import { type DeviceFilter } from "../utils/device-query";
|
|
3
|
+
/**
|
|
4
|
+
* The catalog products matching `filter`, in catalog order: by kind, manufacturer, what they
|
|
5
|
+
* measure, delivery, key, or a `where` of your own. Every product without a filter.
|
|
6
|
+
*/
|
|
7
|
+
declare const useSupportedDevices: (filter?: DeviceFilter) => SupportedDeviceDefinition[];
|
|
8
|
+
export { useSupportedDevices };
|
|
9
|
+
//# sourceMappingURL=use-supported-devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supported-devices.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/hooks/use-supported-devices.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAElF;;;GAGG;AACH,QAAA,MAAM,mBAAmB,GAAI,SAAS,YAAY,KAAG,yBAAyB,EACf,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -8,6 +8,11 @@ export * from "./constants/device-list-items";
|
|
|
8
8
|
export * from "./constants/device-instruction-pdfs";
|
|
9
9
|
export * from "./constants/device-images";
|
|
10
10
|
export * from "./constants/supported-devices";
|
|
11
|
+
export { deliveryOf, deviceKeyOf, imageCreditOf, kindOf, LIVE_DEVICE_KEYS, LIVE_RESULT_POLICY, primaryMeasurementOf, } from "./constants/device-model";
|
|
12
|
+
export * from "./types/device-kind";
|
|
13
|
+
export { deviceMatches, filterSupportedDevices, findSupportedDevice, resultPoliciesFor, } from "./utils/device-query";
|
|
14
|
+
export type { DeviceFilter, OneOrMany, TextMatch } from "./utils/device-query";
|
|
15
|
+
export * from "./hooks/use-supported-devices";
|
|
11
16
|
export * from "./types/device-list-item";
|
|
12
17
|
export * from "./types/supported-device-list-props";
|
|
13
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/bt-device/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qCAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/bt-device/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/E,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** What a device is for, named after its main measurement. */
|
|
2
|
+
type DeviceKind = "blood-pressure-monitor" | "weight-scale" | "pulse-oximeter" | "thermometer" | "glucose-meter" | "ecg-recorder" | "heart-rate-monitor" | "activity-tracker" | "urine-analyzer" | "lipid-analyzer" | "respiratory-therapy" | "sleep-monitor"
|
|
3
|
+
/** Three or more kinds of reading, such as the Checkme, the PC-300 or the Lepod. */
|
|
4
|
+
| "multi-parameter-monitor" | "other";
|
|
5
|
+
/**
|
|
6
|
+
* How a device hands over readings: `spot` gives one per measurement; `live` sends values every
|
|
7
|
+
* second or so for as long as it is connected (a heart-rate strap, a live oximeter, the Lepod).
|
|
8
|
+
*/
|
|
9
|
+
type DeviceDelivery = "spot" | "live";
|
|
10
|
+
/** Who made the catalog image, and where it came from when that is a web page. */
|
|
11
|
+
type DeviceImageCredit = {
|
|
12
|
+
label: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
};
|
|
15
|
+
export type { DeviceDelivery, DeviceImageCredit, DeviceKind };
|
|
16
|
+
//# sourceMappingURL=device-kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-kind.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/types/device-kind.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,KAAK,UAAU,GACX,wBAAwB,GACxB,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,eAAe,GACf,cAAc,GACd,oBAAoB,GACpB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,qBAAqB,GACrB,eAAe;AAEjB,oFAAoF;GAClF,yBAAyB,GACzB,OAAO,CAAC;AAEZ;;;GAGG;AACH,KAAK,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC,kFAAkF;AAClF,KAAK,iBAAiB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { DeviceData } from "../../bt-management/types/device-data";
|
|
2
|
+
import type { DeviceKey } from "../../bt-management/types/device-key";
|
|
3
|
+
import type { DeviceResultPolicy } from "../../bt-management/types/result-policy";
|
|
4
|
+
import type { DeviceDelivery, DeviceKind } from "../types/device-kind";
|
|
5
|
+
import type { MeasurementTypeKey } from "@ovok/core";
|
|
6
|
+
import { type SupportedDeviceDefinition } from "../constants/supported-devices";
|
|
7
|
+
type OneOrMany<T> = T | readonly T[];
|
|
8
|
+
/** Text to match: a value (in any case), any of several, or a pattern. */
|
|
9
|
+
type TextMatch = OneOrMany<string> | RegExp;
|
|
10
|
+
/**
|
|
11
|
+
* Narrows the device catalog. Every field given must match, and a list matches any one of its
|
|
12
|
+
* values: `{ kind: "blood-pressure-monitor", manufacturer: "HARTMANN" }`,
|
|
13
|
+
* `{ measures: MeasurementTypeKey.ecg, delivery: "spot" }`, `{ manufacturer: /yonker/i }`.
|
|
14
|
+
*/
|
|
15
|
+
type DeviceFilter = {
|
|
16
|
+
id?: OneOrMany<string>;
|
|
17
|
+
name?: TextMatch;
|
|
18
|
+
manufacturer?: TextMatch;
|
|
19
|
+
kind?: OneOrMany<DeviceKind>;
|
|
20
|
+
/** Measures any of these. */
|
|
21
|
+
measures?: OneOrMany<MeasurementTypeKey>;
|
|
22
|
+
primaryMeasurement?: OneOrMany<MeasurementTypeKey>;
|
|
23
|
+
delivery?: DeviceDelivery;
|
|
24
|
+
/** Reported under any of these keys (`deviceData.name`). */
|
|
25
|
+
key?: OneOrMany<DeviceKey>;
|
|
26
|
+
shared?: boolean;
|
|
27
|
+
standardProfile?: boolean;
|
|
28
|
+
/** Anything the fields above don't cover. */
|
|
29
|
+
where?: (device: SupportedDeviceDefinition) => boolean;
|
|
30
|
+
};
|
|
31
|
+
declare const listOf: <T>(value: OneOrMany<T>) => readonly T[];
|
|
32
|
+
/** Whether a catalog product matches every field of `filter`. */
|
|
33
|
+
declare const deviceMatches: (device: SupportedDeviceDefinition, filter?: DeviceFilter) => boolean;
|
|
34
|
+
/** The catalog products matching `filter`, in catalog order. */
|
|
35
|
+
declare const filterSupportedDevices: (filter?: DeviceFilter, devices?: readonly SupportedDeviceDefinition[]) => SupportedDeviceDefinition[];
|
|
36
|
+
/**
|
|
37
|
+
* The catalog product behind a string (a catalog id, else a product name, else a reported key) or
|
|
38
|
+
* a connected device's `deviceData`: the product its advertised name identified, else its key's
|
|
39
|
+
* product. Pass `deviceData` for a device: a key can also be another product's name.
|
|
40
|
+
*/
|
|
41
|
+
declare const findSupportedDevice: (of: string | Pick<DeviceData, "name" | "variant">) => SupportedDeviceDefinition | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* `resultPolicies` keeping each live device in `devices` as series (`LIVE_RESULT_POLICY`); spot devices keep every
|
|
44
|
+
* reading.
|
|
45
|
+
*/
|
|
46
|
+
declare const resultPoliciesFor: (devices: readonly SupportedDeviceDefinition[]) => Record<string, DeviceResultPolicy>;
|
|
47
|
+
export { deviceMatches, filterSupportedDevices, findSupportedDevice, listOf, resultPoliciesFor, };
|
|
48
|
+
export type { DeviceFilter, OneOrMany, TextMatch };
|
|
49
|
+
//# sourceMappingURL=device-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-query.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/utils/device-query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MA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AyB,EAA+D,CAAC;AAe5F;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,GACvB,IAAI,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC,KAChD,yBAAyB,GAAG,SAQ9B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,iBAAiB,GACrB,SAAS,SAAS,yBAAyB,EAAE,KAC5C,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAKjC,CAAC;AAEJ,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,MAAM,EACN,iBAAiB,GAClB,CAAC;AACF,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt-provider-child-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/components/bt-provider-child-wrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAsCjF,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,SAAS,cAAc,EAAE,EAAE,mWAqBvE,KAAK,CAAC,iBAAiB,CACxB,2BAA2B,CAAC,CAAC,CAAC,GAAG;IAAE,wBAAwB,CAAC,EAAE,OAAO,CAAA;CAAE,CACxE,
|
|
1
|
+
{"version":3,"file":"bt-provider-child-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/components/bt-provider-child-wrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAsCjF,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,SAAS,cAAc,EAAE,EAAE,mWAqBvE,KAAK,CAAC,iBAAiB,CACxB,2BAA2B,CAAC,CAAC,CAAC,GAAG;IAAE,wBAAwB,CAAC,EAAE,OAAO,CAAA;CAAE,CACxE,sBAqgBF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blood-pressure-translated-exception-map.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/blood-pressure-translated-exception-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"blood-pressure-translated-exception-map.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/blood-pressure-translated-exception-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,eAAO,MAAM,mCAAmC,kCAoB9C,CAAC"}
|