@ovok/native 1.16.1-rc.6 → 1.16.1-rc.7
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-management/components/bt-provider-child-wrapper.js +19 -7
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -1
- package/lib/commonjs/modules/bt-management/index.js +12 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +27 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js +39 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js +36 -10
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +2 -2
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js +69 -25
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +30 -2
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +1 -1
- 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 +48 -3
- 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-lepu-sequencer.js +6 -2
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +113 -24
- 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.advertisement.js +19 -2
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.advertisement.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.connect-retry.js +32 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.connect-retry.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.delivered-files.js +73 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.delivered-files.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js +130 -30
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js +103 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +20 -14
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +4 -2
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +94 -10
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js +75 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js +113 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js +67 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recorder.js +55 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recorder.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recording-watch.js +57 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recording-watch.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.session.js +49 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.session.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.stored-files.js +46 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.stored-files.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +10 -4
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.waveform.js +27 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.waveform.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +0 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +3 -5
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +17 -8
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js +47 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +58 -32
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/series-recorder.js +27 -5
- package/lib/commonjs/modules/bt-management/services/series-recorder.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/device-waveform.js +6 -0
- package/lib/commonjs/modules/bt-management/types/device-waveform.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/i-16-from-hex.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/le-32-from-hex.js.map +1 -1
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js +15 -8
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-utils.js +1 -1
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-utils.js.map +1 -1
- package/lib/commonjs/modules/data-sync/constants.js +4 -1
- package/lib/commonjs/modules/data-sync/constants.js.map +1 -1
- package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js +6 -9
- package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +1 -0
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/commonjs/modules/data-sync/types/health-sync-keys.js +13 -0
- package/lib/commonjs/modules/data-sync/types/health-sync-keys.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-ecg-samples-to-observation.js +47 -0
- package/lib/commonjs/modules/data-sync/utils/convert-ecg-samples-to-observation.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js +6 -3
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js +7 -15
- package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/default-health-coding.js +25 -4
- package/lib/commonjs/modules/data-sync/utils/default-health-coding.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js +20 -4
- 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 +43 -86
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js +6 -5
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js +15 -15
- package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-units.js +6 -1
- package/lib/commonjs/modules/data-sync/utils/health-units.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/healthkit-daily-statistics.js +64 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-daily-statistics.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/healthkit-query-options.js +20 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-query-options.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-sample-source.js +21 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-sample-source.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-samples.js +59 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-samples.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-series.js +20 -11
- package/lib/commonjs/modules/data-sync/utils/healthkit-series.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js +12 -2
- package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +39 -5
- package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/connections.js +45 -2
- package/lib/commonjs/modules/next/bluetooth/connections.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/errors.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/readings.js +10 -2
- package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/runtime.js +37 -1
- package/lib/commonjs/modules/next/bluetooth/runtime.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/web/index.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +19 -7
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -1
- package/lib/module/modules/bt-management/index.js +1 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +27 -1
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +39 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js +36 -10
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +2 -3
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js +68 -25
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +30 -2
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +1 -1
- 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 +48 -3
- 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-lepu-sequencer.js +6 -2
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +113 -24
- 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.advertisement.js +17 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.advertisement.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.connect-retry.js +28 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.connect-retry.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.delivered-files.js +69 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.delivered-files.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js +129 -30
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js +99 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +20 -14
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +4 -2
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +94 -10
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js +72 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js +109 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js +64 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.recorder.js +51 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.recorder.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.recording-watch.js +53 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.recording-watch.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.session.js +45 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.session.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.stored-files.js +42 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.stored-files.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +10 -4
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.waveform.js +22 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.waveform.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +0 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +3 -6
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +17 -8
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js +44 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +58 -32
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
- package/lib/module/modules/bt-management/services/series-recorder.js +27 -5
- package/lib/module/modules/bt-management/services/series-recorder.js.map +1 -1
- package/lib/module/modules/bt-management/types/device-waveform.js +4 -0
- package/lib/module/modules/bt-management/types/device-waveform.js.map +1 -0
- package/lib/module/modules/bt-management/utils/i-16-from-hex.js.map +1 -1
- package/lib/module/modules/bt-management/utils/le-32-from-hex.js.map +1 -1
- package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js +16 -9
- package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
- package/lib/module/modules/data-sync/components/apple/apple-health-authorization-utils.js +2 -2
- package/lib/module/modules/data-sync/components/apple/apple-health-authorization-utils.js.map +1 -1
- package/lib/module/modules/data-sync/constants.js +4 -1
- package/lib/module/modules/data-sync/constants.js.map +1 -1
- package/lib/module/modules/data-sync/hooks/use-listen-changes.js +7 -10
- package/lib/module/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/data-processor.js +1 -0
- package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/module/modules/data-sync/types/health-sync-keys.js +13 -0
- package/lib/module/modules/data-sync/types/health-sync-keys.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-ecg-samples-to-observation.js +43 -0
- package/lib/module/modules/data-sync/utils/convert-ecg-samples-to-observation.js.map +1 -0
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js +6 -3
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js +7 -15
- package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
- package/lib/module/modules/data-sync/utils/default-health-coding.js +25 -4
- package/lib/module/modules/data-sync/utils/default-health-coding.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js +20 -4
- 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 +44 -87
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js +5 -4
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-data-catalog.js +15 -15
- package/lib/module/modules/data-sync/utils/health-data-catalog.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-units.js +6 -1
- package/lib/module/modules/data-sync/utils/health-units.js.map +1 -1
- package/lib/module/modules/data-sync/utils/healthkit-daily-statistics.js +59 -0
- package/lib/module/modules/data-sync/utils/healthkit-daily-statistics.js.map +1 -0
- package/lib/module/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
- package/lib/module/modules/data-sync/utils/healthkit-query-options.js +16 -0
- package/lib/module/modules/data-sync/utils/healthkit-query-options.js.map +1 -0
- package/lib/module/modules/data-sync/utils/healthkit-sample-source.js +17 -0
- package/lib/module/modules/data-sync/utils/healthkit-sample-source.js.map +1 -0
- package/lib/module/modules/data-sync/utils/healthkit-samples.js +52 -0
- package/lib/module/modules/data-sync/utils/healthkit-samples.js.map +1 -0
- package/lib/module/modules/data-sync/utils/healthkit-series.js +19 -10
- package/lib/module/modules/data-sync/utils/healthkit-series.js.map +1 -1
- package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js +12 -2
- package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -1
- package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +39 -5
- package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -1
- package/lib/module/modules/next/bluetooth/connections.js +45 -2
- package/lib/module/modules/next/bluetooth/connections.js.map +1 -1
- package/lib/module/modules/next/bluetooth/driver.js.map +1 -1
- package/lib/module/modules/next/bluetooth/errors.js.map +1 -1
- package/lib/module/modules/next/bluetooth/index.js.map +1 -1
- package/lib/module/modules/next/bluetooth/readings.js +10 -2
- package/lib/module/modules/next/bluetooth/readings.js.map +1 -1
- package/lib/module/modules/next/bluetooth/runtime.js +37 -1
- package/lib/module/modules/next/bluetooth/runtime.js.map +1 -1
- package/lib/module/modules/next/bluetooth/web/index.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +21 -5
- 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/custom/compile-custom-lepu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts +4 -0
- 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/bp2/bp2.frame-reader.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts +24 -4
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +6 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +23 -3
- 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-lepu-sequencer.d.ts +6 -3
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +20 -0
- 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.advertisement.d.ts +8 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts +40 -5
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +6 -3
- 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/lepu/lepu.frame-reader.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +26 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts +42 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts +32 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/series-recorder.d.ts +6 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/series-recorder.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +7 -1
- 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/custom-lepu-spec.d.ts +42 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +17 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-waveform.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-waveform.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/i-16-from-hex.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/i-16-from-hex.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-from-hex.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-from-hex.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/constants.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/data-sync/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
- 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/types/apple-health-authorization-provider-props.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts +4 -7
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/get-data-from-provider-props.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/get-data-from-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -2
- 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/health-sync-keys.d.ts +11 -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-ecg-samples-to-observation.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts +1 -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/convert-samples-to-observation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/default-health-coding.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts +1 -1
- 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 +12 -46
- 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/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts +5 -5
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-query-options.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-query-options.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-sample-source.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-sample-source.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-samples.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-samples.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/to-core-health-observations.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/to-core-health-observations.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +12 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts +13 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts +19 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts +33 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +4 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +21 -5
- 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/custom/compile-custom-lepu.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts +4 -0
- 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/bp2/bp2.frame-reader.d.ts +2 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts +24 -4
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +6 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +23 -3
- 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-lepu-sequencer.d.ts +6 -3
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +20 -0
- 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.advertisement.d.ts +8 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts +24 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts +40 -5
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts +20 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +6 -3
- 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/lepu/lepu.frame-reader.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +26 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts +42 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts +28 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts +32 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts +28 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts +17 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts +33 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/series-recorder.d.ts +6 -1
- package/lib/typescript/module/src/modules/bt-management/services/series-recorder.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +7 -1
- 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/custom-lepu-spec.d.ts +42 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +17 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-waveform.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-waveform.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/i-16-from-hex.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/i-16-from-hex.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/le-32-from-hex.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/le-32-from-hex.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts +2 -2
- package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/constants.d.ts +3 -1
- package/lib/typescript/module/src/modules/data-sync/constants.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
- 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/types/apple-health-authorization-provider-props.d.ts +2 -2
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts +4 -7
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/get-data-from-provider-props.d.ts +3 -1
- package/lib/typescript/module/src/modules/data-sync/types/get-data-from-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -2
- 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/health-sync-keys.d.ts +11 -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-ecg-samples-to-observation.d.ts +6 -0
- package/lib/typescript/module/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts +1 -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/convert-samples-to-observation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/default-health-coding.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-records-from-health-connect.d.ts +1 -1
- 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 +12 -46
- 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/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts +2 -2
- package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts +10 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts +5 -5
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-query-options.d.ts +7 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-query-options.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-sample-source.d.ts +8 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-sample-source.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-samples.d.ts +30 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-samples.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts +2 -2
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/to-core-health-observations.d.ts +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/to-core-health-observations.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +12 -1
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +2 -1
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts +13 -1
- package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +20 -0
- package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +2 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts +19 -1
- package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts +33 -1
- package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts.map +1 -1
- package/package.json +8 -3
|
@@ -6,15 +6,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.clockPayload = exports.LepuEcgTransferSequencer = void 0;
|
|
7
7
|
var _clockSync = require("../../../types/clock-sync.js");
|
|
8
8
|
var _lepuCommands = require("./lepu.commands.js");
|
|
9
|
-
var
|
|
9
|
+
var _lepuConnectRetry = require("./lepu.connect-retry.js");
|
|
10
10
|
var _lepuFrame = require("./lepu.frame.js");
|
|
11
11
|
var _lepuIdentityGate = require("./lepu.identity-gate.js");
|
|
12
12
|
var _lepuResponseType = require("./lepu.response-type.js");
|
|
13
|
-
|
|
13
|
+
var _lepuStoredFiles = require("./lepu.stored-files.js");
|
|
14
|
+
/* eslint-disable max-lines */
|
|
15
|
+
|
|
16
|
+
/** How long past its delay a poll may go unanswered before it is sent again. */
|
|
17
|
+
const POLL_ANSWER_GRACE_MS = 1_000;
|
|
18
|
+
|
|
19
|
+
/** Lets a device finish writing a record before its file list is read. */
|
|
20
|
+
const FILE_LIST_DELAY_MS = 3_000;
|
|
21
|
+
const hexOf = opcode => `0x${(opcode ?? 0).toString(16).padStart(2, "0")}`;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Identifies a recorder, sets its local clock, then polls it live. Its stored files are only
|
|
25
|
+
* listed on connect: they are read when the app asks (`takeHistorySync`), and a record the
|
|
26
|
+
* device stores while connected is read as it is saved. A device that does not poll reads its
|
|
27
|
+
* files on connect, as nothing else would ever ask for them.
|
|
28
|
+
*/
|
|
14
29
|
class LepuEcgTransferSequencer {
|
|
15
30
|
phase = "identity";
|
|
31
|
+
clockRetry = new _lepuConnectRetry.LepuConnectRetry();
|
|
16
32
|
constructor(params) {
|
|
17
33
|
this.params = params;
|
|
34
|
+
this.storedFiles = new _lepuStoredFiles.LepuStoredFiles({
|
|
35
|
+
write: params.write,
|
|
36
|
+
builder: params.builder,
|
|
37
|
+
onFile: params.onFile,
|
|
38
|
+
onError: params.onError,
|
|
39
|
+
skipFiles: params.skipFiles,
|
|
40
|
+
deliveredFiles: params.deliveredFiles,
|
|
41
|
+
acceptFile: params.acceptFile,
|
|
42
|
+
onProgress: params.onProgress
|
|
43
|
+
});
|
|
18
44
|
this.identity = new _lepuIdentityGate.LepuIdentityGate({
|
|
19
45
|
write: params.write,
|
|
20
46
|
builder: params.builder,
|
|
@@ -23,11 +49,51 @@ class LepuEcgTransferSequencer {
|
|
|
23
49
|
rejectEncryptionAtBytes: params.rejectEncryptionAtBytes,
|
|
24
50
|
onIdentified: params.onIdentified,
|
|
25
51
|
onRefused: params.onRefused,
|
|
26
|
-
onAdmitted: this.
|
|
52
|
+
onAdmitted: this.startClockOrFiles
|
|
27
53
|
});
|
|
28
54
|
}
|
|
29
55
|
initialCommands = () => this.identity.initialCommands();
|
|
30
56
|
isHistoryTransfer = () => true;
|
|
57
|
+
commandTimeoutMs = () => {
|
|
58
|
+
if (this.phase === "identity") {
|
|
59
|
+
return this.identity.commandTimeoutMs();
|
|
60
|
+
}
|
|
61
|
+
if (this.phase === "polling" && this.params.pollIntervalMs !== undefined) {
|
|
62
|
+
return this.params.pollIntervalMs + POLL_ANSWER_GRACE_MS;
|
|
63
|
+
}
|
|
64
|
+
if (this.phase === "requested") {
|
|
65
|
+
return _lepuConnectRetry.LEPU_CONNECT_REPLY_TIMEOUT_MS;
|
|
66
|
+
}
|
|
67
|
+
return this.phase === "clock" ? _lepuConnectRetry.LEPU_CONNECT_REPLY_TIMEOUT_MS : undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** An unanswered clock is sent once more, then skipped; nothing after it needs it. */
|
|
71
|
+
onCommandTimeout = () => {
|
|
72
|
+
if (this.phase === "identity") {
|
|
73
|
+
return this.identity.onCommandTimeout();
|
|
74
|
+
}
|
|
75
|
+
if (this.phase === "requested") {
|
|
76
|
+
this.params.onError(`the device did not answer command ${hexOf(this.requestedCommand)}`);
|
|
77
|
+
}
|
|
78
|
+
if (this.phase === "polling" || this.phase === "requested") {
|
|
79
|
+
return {
|
|
80
|
+
commands: this.resumePolling()
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
if (this.phase !== "clock") {
|
|
84
|
+
return {};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
commands: this.clockRetry.mayRetry() ? [this.setTimeCommand()] : this.startFiles()
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
commandProgress = frame => {
|
|
91
|
+
if (this.phase === "identity") {
|
|
92
|
+
return this.identity.commandProgress(frame);
|
|
93
|
+
}
|
|
94
|
+
const awaited = this.phase === "clock" ? _lepuCommands.LepuCommand.SET_TIME : this.phase === "polling" ? this.params.pollCommand : this.phase === "requested" ? this.requestedCommand : undefined;
|
|
95
|
+
return awaited !== undefined && (0, _lepuFrame.lepuCommandOf)(frame) !== awaited ? "ignored" : "complete";
|
|
96
|
+
};
|
|
31
97
|
nextCommand = frame => {
|
|
32
98
|
if (this.phase === "identity") {
|
|
33
99
|
return this.identity.nextCommand(frame);
|
|
@@ -39,20 +105,60 @@ class LepuEcgTransferSequencer {
|
|
|
39
105
|
if (this.params.pollCommand === undefined || (0, _lepuFrame.lepuCommandOf)(frame) !== this.params.pollCommand) {
|
|
40
106
|
return undefined;
|
|
41
107
|
}
|
|
42
|
-
return this.
|
|
108
|
+
return this.afterPollAnswer(frame);
|
|
109
|
+
}
|
|
110
|
+
if (this.phase === "requested") {
|
|
111
|
+
return this.finishRequested(frame);
|
|
43
112
|
}
|
|
44
113
|
return this.transfer?.nextCommand(frame);
|
|
45
114
|
};
|
|
46
|
-
|
|
115
|
+
afterPollAnswer = frame => {
|
|
116
|
+
const stored = this.params.shouldStartTransfer?.(frame) ?? true;
|
|
117
|
+
const delayBeforeWriteMs = stored ? FILE_LIST_DELAY_MS : undefined;
|
|
118
|
+
if (this.params.takeHistorySync?.()) {
|
|
119
|
+
return this.startTransfer(this.storedFiles.readAll, delayBeforeWriteMs);
|
|
120
|
+
}
|
|
121
|
+
return stored ? this.startTransfer(this.storedFiles.readNew, delayBeforeWriteMs) : this.requestedOrPoll();
|
|
122
|
+
};
|
|
123
|
+
requestedOrPoll = () => {
|
|
124
|
+
const requested = this.params.takeRequestedCommand?.();
|
|
125
|
+
if (requested === undefined) {
|
|
126
|
+
return [this.pollCommand()];
|
|
127
|
+
}
|
|
128
|
+
this.phase = "requested";
|
|
129
|
+
this.requestedCommand = requested;
|
|
130
|
+
return [{
|
|
131
|
+
...this.params.write,
|
|
132
|
+
frame: this.params.builder.build(requested)
|
|
133
|
+
}];
|
|
134
|
+
};
|
|
135
|
+
finishRequested = frame => {
|
|
136
|
+
if ((0, _lepuFrame.lepuCommandOf)(frame) !== this.requestedCommand) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
if (!(0, _lepuResponseType.isLepuSuccess)(frame)) {
|
|
140
|
+
this.params.onError(`the device refused command ${hexOf(this.requestedCommand)}: ${(0, _lepuResponseType.describeLepuResponseType)(frame)}`);
|
|
141
|
+
}
|
|
142
|
+
return this.resumePolling();
|
|
143
|
+
};
|
|
144
|
+
resumePolling = () => {
|
|
145
|
+
this.phase = "polling";
|
|
146
|
+
this.requestedCommand = undefined;
|
|
147
|
+
return [this.pollCommand()];
|
|
148
|
+
};
|
|
149
|
+
startClockOrFiles = () => {
|
|
47
150
|
if ((0, _clockSync.isClockSyncEnabled)(this.params.clockSync)) {
|
|
48
151
|
this.phase = "clock";
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
frame: this.params.builder.build(_lepuCommands.LepuCommand.SET_TIME, clockPayload(this.params.clockSync))
|
|
52
|
-
}];
|
|
152
|
+
this.clockRetry.started();
|
|
153
|
+
return [this.setTimeCommand()];
|
|
53
154
|
}
|
|
54
|
-
return this.
|
|
155
|
+
return this.startFiles();
|
|
55
156
|
};
|
|
157
|
+
startFiles = () => this.params.pollCommand === undefined || this.params.takeHistorySync?.() ? this.startTransfer(this.storedFiles.readAll) : this.startTransfer(this.storedFiles.listExisting);
|
|
158
|
+
setTimeCommand = () => ({
|
|
159
|
+
...this.params.write,
|
|
160
|
+
frame: this.params.builder.build(_lepuCommands.LepuCommand.SET_TIME, clockPayload(this.params.clockSync))
|
|
161
|
+
});
|
|
56
162
|
finishClock = frame => {
|
|
57
163
|
if ((0, _lepuFrame.lepuCommandOf)(frame) !== _lepuCommands.LepuCommand.SET_TIME) {
|
|
58
164
|
return undefined;
|
|
@@ -60,20 +166,11 @@ class LepuEcgTransferSequencer {
|
|
|
60
166
|
if (!(0, _lepuResponseType.isLepuSuccess)(frame)) {
|
|
61
167
|
this.params.onError(`the device refused SET_TIME: ${(0, _lepuResponseType.describeLepuResponseType)(frame)}`);
|
|
62
168
|
}
|
|
63
|
-
return this.
|
|
169
|
+
return this.startFiles();
|
|
64
170
|
};
|
|
65
|
-
startTransfer = delayBeforeWriteMs => {
|
|
171
|
+
startTransfer = (files, delayBeforeWriteMs) => {
|
|
66
172
|
this.phase = "files";
|
|
67
|
-
this.transfer =
|
|
68
|
-
write: this.params.write,
|
|
69
|
-
builder: this.params.builder,
|
|
70
|
-
onFile: this.params.onFile,
|
|
71
|
-
onError: this.params.onError,
|
|
72
|
-
skipFiles: this.params.skipFiles,
|
|
73
|
-
acceptFile: this.params.acceptFile,
|
|
74
|
-
afterTransfer: this.finishTransfer,
|
|
75
|
-
onProgress: this.params.onProgress
|
|
76
|
-
});
|
|
173
|
+
this.transfer = files(this.finishTransfer);
|
|
77
174
|
return this.transfer.initialCommands(delayBeforeWriteMs);
|
|
78
175
|
};
|
|
79
176
|
finishTransfer = () => {
|
|
@@ -82,15 +179,18 @@ class LepuEcgTransferSequencer {
|
|
|
82
179
|
this.phase = "polling";
|
|
83
180
|
return [this.pollCommand()];
|
|
84
181
|
}
|
|
85
|
-
return
|
|
182
|
+
return [];
|
|
183
|
+
};
|
|
184
|
+
pollCommand = () => {
|
|
185
|
+
const delayBeforeWriteMs = this.params.pollsOnAnswer?.() ? undefined : this.params.pollIntervalMs;
|
|
186
|
+
return {
|
|
187
|
+
...this.params.write,
|
|
188
|
+
frame: this.params.builder.build(this.params.pollCommand),
|
|
189
|
+
...(delayBeforeWriteMs === undefined ? {} : {
|
|
190
|
+
delayBeforeWriteMs
|
|
191
|
+
})
|
|
192
|
+
};
|
|
86
193
|
};
|
|
87
|
-
pollCommand = () => ({
|
|
88
|
-
...this.params.write,
|
|
89
|
-
frame: this.params.builder.build(this.params.pollCommand),
|
|
90
|
-
...(this.params.pollIntervalMs === undefined ? {} : {
|
|
91
|
-
delayBeforeWriteMs: this.params.pollIntervalMs
|
|
92
|
-
})
|
|
93
|
-
});
|
|
94
194
|
}
|
|
95
195
|
exports.LepuEcgTransferSequencer = LepuEcgTransferSequencer;
|
|
96
196
|
const clockPayload = clockSync => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clockSync","require","_lepuCommands","
|
|
1
|
+
{"version":3,"names":["_clockSync","require","_lepuCommands","_lepuConnectRetry","_lepuFrame","_lepuIdentityGate","_lepuResponseType","_lepuStoredFiles","POLL_ANSWER_GRACE_MS","FILE_LIST_DELAY_MS","hexOf","opcode","toString","padStart","LepuEcgTransferSequencer","phase","clockRetry","LepuConnectRetry","constructor","params","storedFiles","LepuStoredFiles","write","builder","onFile","onError","skipFiles","deliveredFiles","acceptFile","onProgress","identity","LepuIdentityGate","expectedDeviceTypes","manufacturerData","rejectEncryptionAtBytes","onIdentified","onRefused","onAdmitted","startClockOrFiles","initialCommands","isHistoryTransfer","commandTimeoutMs","pollIntervalMs","undefined","LEPU_CONNECT_REPLY_TIMEOUT_MS","onCommandTimeout","requestedCommand","commands","resumePolling","mayRetry","setTimeCommand","startFiles","commandProgress","frame","awaited","LepuCommand","SET_TIME","pollCommand","lepuCommandOf","nextCommand","finishClock","afterPollAnswer","finishRequested","transfer","stored","shouldStartTransfer","delayBeforeWriteMs","takeHistorySync","startTransfer","readAll","readNew","requestedOrPoll","requested","takeRequestedCommand","build","isLepuSuccess","describeLepuResponseType","isClockSyncEnabled","clockSync","started","listExisting","clockPayload","files","finishTransfer","pollsOnAnswer","exports","parts","getClockParts","now","Date","timezone","year","month","day","hours","minutes","seconds"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.ecg-transfer.ts"],"mappings":";;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAYA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAIA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AArBA;;AAqEA;AACA,MAAMO,oBAAoB,GAAG,KAAK;;AAElC;AACA,MAAMC,kBAAkB,GAAG,KAAK;AAEhC,MAAMC,KA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AC;IACpE,CAAC;EACH,CAAC;AACH;AAACmB,OAAA,CAAAvE,wBAAA,GAAAA,wBAAA;AAED,MAAMmE,YAAY,GAAIH,SAA4B,IAAe;EAC/D,MAAMQ,KAAK,GAAG,IAAAC,wBAAa,EACzBT,SAAS,EAAEU,GAAG,GAAG,CAAC,IAAI,IAAIC,IAAI,CAAC,CAAC,EAChCX,SAAS,EAAEY,QACb,CAAC;EAED,OAAO,CACLJ,KAAK,CAACK,IAAI,GAAG,IAAI,EAChBL,KAAK,CAACK,IAAI,IAAI,CAAC,GAAI,IAAI,EACxBL,KAAK,CAACM,KAAK,EACXN,KAAK,CAACO,GAAG,EACTP,KAAK,CAACQ,KAAK,EACXR,KAAK,CAACS,OAAO,EACbT,KAAK,CAACU,OAAO,CACd;AACH,CAAC;AAACX,OAAA,CAAAJ,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withLepuEncryption = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
var _viatomLepuCrypto = require("../viatom/viatom-lepu-crypto.js");
|
|
9
|
+
var _lepuAdvertisement = require("./lepu.advertisement.js");
|
|
10
|
+
var _lepuCommandBuilder = require("./lepu.command-builder.js");
|
|
11
|
+
var _lepuConnectRetry = require("./lepu.connect-retry.js");
|
|
12
|
+
var _lepuFrame = require("./lepu.frame.js");
|
|
13
|
+
var _lepuResponseType = require("./lepu.response-type.js");
|
|
14
|
+
const LEPU_ENCRYPT_COMMAND = 0xff;
|
|
15
|
+
/**
|
|
16
|
+
* Runs the vendor's encryption handshake before a standard Lepu exchange, when the
|
|
17
|
+
* advertisement asks for one.
|
|
18
|
+
*
|
|
19
|
+
* The access token goes out in plain text; the reply carries the session key, and from then
|
|
20
|
+
* on every request is encrypted here and every reply is decrypted by the frame reader that
|
|
21
|
+
* shares the session. Without the flag the exchange runs exactly as it did before.
|
|
22
|
+
*/
|
|
23
|
+
class LepuEncryptionHandshake {
|
|
24
|
+
state = "awaiting-key";
|
|
25
|
+
retry = new _lepuConnectRetry.LepuConnectRetry();
|
|
26
|
+
constructor(inner, params) {
|
|
27
|
+
this.inner = inner;
|
|
28
|
+
this.params = params;
|
|
29
|
+
}
|
|
30
|
+
initialCommands = () => {
|
|
31
|
+
this.retry.started();
|
|
32
|
+
return [this.tokenCommand()];
|
|
33
|
+
};
|
|
34
|
+
nextCommand = (frame, characteristicUuid) => {
|
|
35
|
+
if (this.state === "done") {
|
|
36
|
+
return this.encrypted(this.inner.nextCommand(frame, characteristicUuid));
|
|
37
|
+
}
|
|
38
|
+
if (this.state === "refused" || (0, _lepuFrame.lepuCommandOf)(frame) !== LEPU_ENCRYPT_COMMAND) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return this.acceptKey(frame);
|
|
42
|
+
};
|
|
43
|
+
commandTimeoutMs = () => this.state === "awaiting-key" ? _lepuConnectRetry.LEPU_CONNECT_REPLY_TIMEOUT_MS : this.state === "done" ? this.inner.commandTimeoutMs?.() : undefined;
|
|
44
|
+
|
|
45
|
+
/** A device just woken can drop the token, so it is sent once more before giving up. */
|
|
46
|
+
onCommandTimeout = () => {
|
|
47
|
+
if (this.state === "done") {
|
|
48
|
+
const result = this.inner.onCommandTimeout?.() ?? {};
|
|
49
|
+
return {
|
|
50
|
+
...result,
|
|
51
|
+
commands: this.encrypted(result.commands)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (this.state === "refused") {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
return this.retry.mayRetry() ? {
|
|
58
|
+
commands: [this.tokenCommand()]
|
|
59
|
+
} : {
|
|
60
|
+
terminal: true
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
commandProgress = frame => {
|
|
64
|
+
if (this.state === "done") {
|
|
65
|
+
return this.inner.commandProgress?.(frame) ?? "complete";
|
|
66
|
+
}
|
|
67
|
+
return (0, _lepuFrame.lepuCommandOf)(frame) === LEPU_ENCRYPT_COMMAND ? "complete" : "ignored";
|
|
68
|
+
};
|
|
69
|
+
onServicesDiscovered = serviceUuids => this.inner.onServicesDiscovered?.(serviceUuids);
|
|
70
|
+
isNormalDisconnect = () => this.inner.isNormalDisconnect?.() ?? false;
|
|
71
|
+
isHistoryTransfer = () => this.inner.isHistoryTransfer?.() ?? false;
|
|
72
|
+
acceptKey = frame => {
|
|
73
|
+
const reply = (0, _lepuFrame.lepuPayloadOf)(frame).map(_hexToByte.hexToByte);
|
|
74
|
+
const key = (0, _lepuResponseType.isLepuSuccess)(frame) ? (0, _viatomLepuCrypto.parseLepuSessionKey)((0, _viatomLepuCrypto.decryptLepuHandshake)(reply)) : undefined;
|
|
75
|
+
if (!key) {
|
|
76
|
+
this.state = "refused";
|
|
77
|
+
this.params.onRefused("the device refused the encryption handshake");
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
this.params.session.begin(key);
|
|
81
|
+
this.state = "done";
|
|
82
|
+
return this.encrypted(this.inner.initialCommands());
|
|
83
|
+
};
|
|
84
|
+
tokenCommand = () => ({
|
|
85
|
+
...this.params.write,
|
|
86
|
+
frame: new _lepuCommandBuilder.LepuCommandBuilder(this.params.startByte).build(LEPU_ENCRYPT_COMMAND, (0, _viatomLepuCrypto.createLepuAccessToken)())
|
|
87
|
+
});
|
|
88
|
+
encrypted = commands => commands?.map(command => ({
|
|
89
|
+
...command,
|
|
90
|
+
frame: this.params.session.encryptFrame(command.frame)
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The sequencer for one connection: wrapped in the handshake when the advertisement asks
|
|
96
|
+
* for encryption, unchanged otherwise. Either way the session starts without a key.
|
|
97
|
+
*/
|
|
98
|
+
const withLepuEncryption = (inner, params) => {
|
|
99
|
+
params.session.end();
|
|
100
|
+
return (0, _lepuAdvertisement.advertisesLepuEncryption)(params.manufacturerData) ? new LepuEncryptionHandshake(inner, params) : inner;
|
|
101
|
+
};
|
|
102
|
+
exports.withLepuEncryption = withLepuEncryption;
|
|
103
|
+
//# sourceMappingURL=lepu.encryption-handshake.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","_viatomLepuCrypto","_lepuAdvertisement","_lepuCommandBuilder","_lepuConnectRetry","_lepuFrame","_lepuResponseType","LEPU_ENCRYPT_COMMAND","LepuEncryptionHandshake","state","retry","LepuConnectRetry","constructor","inner","params","initialCommands","started","tokenCommand","nextCommand","frame","characteristicUuid","encrypted","lepuCommandOf","undefined","acceptKey","commandTimeoutMs","LEPU_CONNECT_REPLY_TIMEOUT_MS","onCommandTimeout","result","commands","mayRetry","terminal","commandProgress","onServicesDiscovered","serviceUuids","isNormalDisconnect","isHistoryTransfer","reply","lepuPayloadOf","map","hexToByte","key","isLepuSuccess","parseLepuSessionKey","decryptLepuHandshake","onRefused","session","begin","write","LepuCommandBuilder","startByte","build","createLepuAccessToken","command","encryptFrame","withLepuEncryption","end","advertisesLepuEncryption","manufacturerData","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.encryption-handshake.ts"],"mappings":";;;;;;AAKA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAMA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAGA,MAAMO,oBAAoB,GAAG,IAAI;AAgBjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,CAA6B;EAChDC,KA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AClB;IAEA,IAAI,CAACT,MAAM,CAACgC,OAAO,CAACC,KAAK,CAACN,GAAG,CAAC;IAC9B,IAAI,CAAChC,KAAK,GAAG,MAAM;IAEnB,OAAO,IAAI,CAACY,SAAS,CAAC,IAAI,CAACR,KAAK,CAACE,eAAe,CAAC,CAAC,CAAC;EACrD,CAAC;EAEOE,YAAY,GAAGA,CAAA,MAAsB;IAC3C,GAAG,IAAI,CAACH,MAAM,CAACkC,KAAK;IACpB7B,KAAK,EAAE,IAAI8B,sCAAkB,CAAC,IAAI,CAACnC,MAAM,CAACoC,SAAS,CAAC,CAACC,KAAK,CACxD5C,oBAAoB,EACpB,IAAA6C,uCAAqB,EAAC,CACxB;EACF,CAAC,CAAC;EAEM/B,SAAS,GACfQ,QAA8C,IAE9CA,QAAQ,EAAEU,GAAG,CAAEc,OAAO,KAAM;IAC1B,GAAGA,OAAO;IACVlC,KAAK,EAAE,IAAI,CAACL,MAAM,CAACgC,OAAO,CAACQ,YAAY,CAACD,OAAO,CAAClC,KAAK;EACvD,CAAC,CAAC,CAAC;AACP;;AAEA;AACA;AACA;AACA;AACA,MAAMoC,kBAAkB,GAAGA,CACzB1C,KAA2B,EAC3BC,MAA4B,KACP;EACrBA,MAAM,CAACgC,OAAO,CAACU,GAAG,CAAC,CAAC;EAEpB,OAAO,IAAAC,2CAAwB,EAAC3C,MAAM,CAAC4C,gBAAgB,CAAC,GACpD,IAAIlD,uBAAuB,CAACK,KAAK,EAAEC,MAAM,CAAC,GAC1CD,KAAK;AACX,CAAC;AAAC8C,OAAA,CAAAJ,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.LepuFileTransfer = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
7
8
|
var _le32FromHex = require("../../../utils/le-32-from-hex.js");
|
|
8
9
|
var _le32ToBytes = require("../../../utils/le-32-to-bytes.js");
|
|
9
10
|
var _lepuCommands = require("./lepu.commands.js");
|
|
@@ -15,11 +16,10 @@ var _lepuResponseType = require("./lepu.response-type.js");
|
|
|
15
16
|
const FILE_SIZE_OFFSET = 0;
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
|
-
* A
|
|
19
|
-
*
|
|
20
|
-
* is a length to refuse rather than try to hold on a low-memory tablet.
|
|
19
|
+
* A size beyond this is a corrupt length field rather than a recording. A holter ECG takes about
|
|
20
|
+
* a byte per sample at 125 Hz, so this holds about 140 hours.
|
|
21
21
|
*/
|
|
22
|
-
const MAX_FILE_BYTES =
|
|
22
|
+
const MAX_FILE_BYTES = 64 * 1_024 * 1_024;
|
|
23
23
|
const TRANSFER_COMMANDS = [_lepuCommands.LepuCommand.GET_FILE_LIST, _lepuCommands.LepuCommand.READ_FILE_START, _lepuCommands.LepuCommand.READ_FILE_DATA, _lepuCommands.LepuCommand.READ_FILE_END];
|
|
24
24
|
|
|
25
25
|
/** A file read from a Lepu device. */
|
|
@@ -48,7 +48,8 @@ class LepuFileTransfer {
|
|
|
48
48
|
fileIndex = 0;
|
|
49
49
|
name = "";
|
|
50
50
|
totalBytes = 0;
|
|
51
|
-
|
|
51
|
+
bytes = new Uint8Array(0);
|
|
52
|
+
received = 0;
|
|
52
53
|
isSessionOpen = false;
|
|
53
54
|
isDone = false;
|
|
54
55
|
constructor(params) {
|
|
@@ -70,6 +71,7 @@ class LepuFileTransfer {
|
|
|
70
71
|
if (command === _lepuCommands.LepuCommand.GET_FILE_LIST) {
|
|
71
72
|
this.files = (0, _lepuFileNames.lepuNamesFrom)((0, _lepuFrame.lepuPayloadOf)(frame));
|
|
72
73
|
this.fileIndex = 0;
|
|
74
|
+
this.params.onFileList?.(this.files);
|
|
73
75
|
return this.openNextFile();
|
|
74
76
|
}
|
|
75
77
|
if (command === _lepuCommands.LepuCommand.READ_FILE_START) {
|
|
@@ -92,7 +94,8 @@ class LepuFileTransfer {
|
|
|
92
94
|
}
|
|
93
95
|
this.name = name;
|
|
94
96
|
this.totalBytes = 0;
|
|
95
|
-
this.
|
|
97
|
+
this.bytes = new Uint8Array(0);
|
|
98
|
+
this.received = 0;
|
|
96
99
|
return [this.commandFor(_lepuCommands.LepuCommand.READ_FILE_START, [...(0, _lepuFileNames.lepuNameBytes)(name), ...(0, _le32ToBytes.le32ToBytes)(0)])];
|
|
97
100
|
};
|
|
98
101
|
|
|
@@ -107,6 +110,7 @@ class LepuFileTransfer {
|
|
|
107
110
|
if (this.totalBytes === 0) {
|
|
108
111
|
return this.closeFile();
|
|
109
112
|
}
|
|
113
|
+
this.bytes = new Uint8Array(this.totalBytes);
|
|
110
114
|
return [this.commandFor(_lepuCommands.LepuCommand.READ_FILE_DATA, (0, _le32ToBytes.le32ToBytes)(0))];
|
|
111
115
|
};
|
|
112
116
|
|
|
@@ -117,28 +121,30 @@ class LepuFileTransfer {
|
|
|
117
121
|
*/
|
|
118
122
|
appendChunk = payload => {
|
|
119
123
|
if (payload.length === 0) {
|
|
120
|
-
return this.fail(`"${this.name}" stopped sending at ${this.
|
|
124
|
+
return this.fail(`"${this.name}" stopped sending at ${this.received} of ${this.totalBytes} bytes`);
|
|
121
125
|
}
|
|
122
|
-
this.
|
|
126
|
+
const fits = payload.slice(0, this.totalBytes - this.received);
|
|
127
|
+
this.bytes.set(fits.map(_hexToByte.hexToByte), this.received);
|
|
128
|
+
this.received += fits.length;
|
|
123
129
|
this.params.onProgress?.({
|
|
124
130
|
name: this.name,
|
|
125
|
-
receivedBytes: this.
|
|
131
|
+
receivedBytes: this.received,
|
|
126
132
|
totalBytes: this.totalBytes
|
|
127
133
|
});
|
|
128
|
-
if (this.
|
|
134
|
+
if (this.received >= this.totalBytes) {
|
|
129
135
|
return this.closeFile();
|
|
130
136
|
}
|
|
131
|
-
return [this.commandFor(_lepuCommands.LepuCommand.READ_FILE_DATA, (0, _le32ToBytes.le32ToBytes)(this.
|
|
137
|
+
return [this.commandFor(_lepuCommands.LepuCommand.READ_FILE_DATA, (0, _le32ToBytes.le32ToBytes)(this.received))];
|
|
132
138
|
};
|
|
133
139
|
closedFile = () => {
|
|
134
140
|
this.isSessionOpen = false;
|
|
135
|
-
if (this.totalBytes > 0 && this.
|
|
136
|
-
return this.fail(`"${this.name}" ended at ${this.
|
|
141
|
+
if (this.totalBytes > 0 && this.received !== this.totalBytes) {
|
|
142
|
+
return this.fail(`"${this.name}" ended at ${this.received} of ${this.totalBytes} bytes`);
|
|
137
143
|
}
|
|
138
144
|
if (this.totalBytes > 0) {
|
|
139
145
|
this.params.onFile({
|
|
140
146
|
name: this.name,
|
|
141
|
-
|
|
147
|
+
bytes: this.bytes
|
|
142
148
|
});
|
|
143
149
|
}
|
|
144
150
|
this.fileIndex++;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","_le32FromHex","_le32ToBytes","_lepuCommands","_lepuFileNames","_lepuFrame","_lepuResponseType","FILE_SIZE_OFFSET","MAX_FILE_BYTES","TRANSFER_COMMANDS","LepuCommand","GET_FILE_LIST","READ_FILE_START","READ_FILE_DATA","READ_FILE_END","LepuFileTransfer","files","fileIndex","name","totalBytes","bytes","Uint8Array","received","isSessionOpen","isDone","constructor","params","isHistoryTransfer","initialCommands","delayBeforeWriteMs","commandFor","nextCommand","frame","command","lepuCommandOf","afterTransfer","includes","undefined","isLepuSuccess","fail","describeLepuResponseType","lepuNamesFrom","lepuPayloadOf","onFileList","openNextFile","openedFile","appendChunk","closedFile","skipFiles","has","acceptFile","lepuNameBytes","le32ToBytes","payload","le32FromHex","limit","maxFileBytes","closeFile","length","fits","slice","set","map","hexToByte","onProgress","receivedBytes","onFile","reason","onError","write","builder","build","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.file-transfer.ts"],"mappings":";;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAC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th having once rather than once per device.
|
|
32
32
|
*/
|
|
33
33
|
class LepuFrameReader {
|
|
34
|
-
constructor(startBytes) {
|
|
34
|
+
constructor(startBytes, session) {
|
|
35
35
|
this.startBytes = startBytes;
|
|
36
|
+
this.session = session;
|
|
36
37
|
}
|
|
37
38
|
readFrame(buffer) {
|
|
38
39
|
const start = this.findFrameStart(buffer);
|
|
@@ -48,7 +49,8 @@ class LepuFrameReader {
|
|
|
48
49
|
if (!this.hasValidChecksum(frame)) {
|
|
49
50
|
return (0, _frameReadResults.corrupt)(start + START_PATTERN_BYTES);
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
+
const plainFrame = this.session ? this.session.decryptFrame(frame) : frame;
|
|
53
|
+
return plainFrame ? (0, _frameReadResults.complete)(plainFrame, start + frameLength) : (0, _frameReadResults.corrupt)(start + frameLength);
|
|
52
54
|
}
|
|
53
55
|
isFrameStart(buffer, index) {
|
|
54
56
|
if (!this.startBytes.includes((buffer[index] || "").toLowerCase())) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_calculateCrc","require","_frameReadResults","_hexToByte","_le16FromHex","COMMAND_INDEX","COMMAND_COMPLEMENT_INDEX","PAYLOAD_LENGTH_INDEX","HEADER_BYTES","CHECKSUM_BYTES","BYTE_MASK","START_PATTERN_BYTES","LepuFrameReader","constructor","startBytes","readFrame","buffer","start","findFrameStart","incomplete","droppableLeadingBytes","payloadLength","le16FromHex","frameLength","length","frame","slice","hasValidChecksum","corrupt","complete","isFrameStart","index","includes","toLowerCase","command","hexToByte","complement","lastCandidate","Math","max","checksummedBytes","declared","calculateCrc8","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.frame-reader.ts"],"mappings":";;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;
|
|
1
|
+
{"version":3,"names":["_calculateCrc","require","_frameReadResults","_hexToByte","_le16FromHex","COMMAND_INDEX","COMMAND_COMPLEMENT_INDEX","PAYLOAD_LENGTH_INDEX","HEADER_BYTES","CHECKSUM_BYTES","BYTE_MASK","START_PATTERN_BYTES","LepuFrameReader","constructor","startBytes","session","readFrame","buffer","start","findFrameStart","incomplete","droppableLeadingBytes","payloadLength","le16FromHex","frameLength","length","frame","slice","hasValidChecksum","corrupt","plainFrame","decryptFrame","complete","isFrameStart","index","includes","toLowerCase","command","hexToByte","complement","lastCandidate","Math","max","checksummedBytes","declared","calculateCrc8","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.frame-reader.ts"],"mappings":";;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,MAAMI,aAAa,GAAG,CAAC;AACvB,MAAMC,wBAAwB,GAAG,CAAC;AAClC,MAAMC,oBAAoB,GAAG,CAAC;AAC9B,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,SAAS,GAAG,IAAI;;AAEtB;AACA,MAAMC,mBAAmB,GAAG,CAAC;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,CAAwB;EAC3CC,WAAWA,CACCC,UAA6B,EAC7BC,OAAqB,EACtC;IAAA,KAFiBD,UAA6B,GAA7BA,UAA6B;IAAA,KAC7BC,OAAqB,GAArBA,OAAqB;EACrC;EAEIC,SAASA,CAACC,MAAyB,EAAmB;IAC3D,MAAMC,KAAK,GAAG,IAAI,CAACC,cAAc,CAACF,MAAM,CAAC;IAEzC,IAAIC,KAAK,KAAK,CAAC,CAAC,EAAE;MAChB,OAAO,IAAAE,4BAAU,EAAC,IAAI,CAACC,qBAAqB,CAACJ,MAAM,C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