@ovok/native 1.17.0-dev.2215 → 1.17.0-dev.2219
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/next/bluetooth/adapters/android-foreground-service.js +58 -5
- package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js +25 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js +62 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js +42 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js +97 -96
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js +33 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js +38 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js +101 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js +24 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +65 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +53 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js +82 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js +9 -3
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-deps.js +6 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-deps.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js +3 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device.js +19 -6
- package/lib/commonjs/modules/next/bluetooth/core/device.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js +54 -0
- package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js +45 -0
- package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js +17 -0
- package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/paired-device.js +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/paired-device.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/reading-log.js +89 -7
- package/lib/commonjs/modules/next/bluetooth/core/reading-log.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/series-slots.js +94 -0
- package/lib/commonjs/modules/next/bluetooth/core/series-slots.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js +219 -0
- package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js +110 -0
- package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js +19 -11
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/index.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/shared.js +14 -0
- package/lib/commonjs/modules/next/bluetooth/shared.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js +59 -6
- package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js +22 -0
- package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js +59 -0
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js +38 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js +76 -75
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js +27 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-values.js +33 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js +94 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js +20 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +59 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +49 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js +79 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
- package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/bluetooth.js +9 -3
- package/lib/module/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device-deps.js +4 -0
- package/lib/module/modules/next/bluetooth/core/device-deps.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/device-snapshot.js +3 -1
- package/lib/module/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device.js +19 -6
- package/lib/module/modules/next/bluetooth/core/device.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/live-ledger.js +50 -0
- package/lib/module/modules/next/bluetooth/core/live-ledger.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/measuring-watch.js +41 -0
- package/lib/module/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/outbox-watch.js +14 -0
- package/lib/module/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/paired-device.js +1 -0
- package/lib/module/modules/next/bluetooth/core/paired-device.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/reading-log.js +89 -7
- package/lib/module/modules/next/bluetooth/core/reading-log.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/series-slots.js +90 -0
- package/lib/module/modules/next/bluetooth/core/series-slots.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/stream-recorder.js +215 -0
- package/lib/module/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/waveform-segments.js +106 -0
- package/lib/module/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
- package/lib/module/modules/next/bluetooth/create-bluetooth.js +19 -11
- package/lib/module/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/index.js +1 -0
- package/lib/module/modules/next/bluetooth/index.js.map +1 -1
- package/lib/module/modules/next/bluetooth/shared.js +2 -0
- package/lib/module/modules/next/bluetooth/shared.js.map +1 -1
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts +6 -13
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts +16 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts +6 -13
- package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts +16 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +4 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts +5 -1
- package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
- package/package.json +7 -3
|
@@ -5,9 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.androidForegroundService = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
+
var _outboxWatch = require("../core/outbox-watch.js");
|
|
8
9
|
var _ports = require("../core/ports.js");
|
|
9
10
|
/** The notification Android shows while the service runs. */
|
|
10
11
|
|
|
12
|
+
/** What the service watches and reports besides its text. */
|
|
13
|
+
|
|
11
14
|
const nativeService = () => {
|
|
12
15
|
const service = _reactNative.NativeModules.OvokBackgroundSync;
|
|
13
16
|
if (!service) {
|
|
@@ -15,11 +18,61 @@ const nativeService = () => {
|
|
|
15
18
|
}
|
|
16
19
|
return service;
|
|
17
20
|
};
|
|
21
|
+
const describeUnsent = unsent => `${unsent} ${unsent === 1 ? "reading" : "readings"} waiting to upload`;
|
|
22
|
+
|
|
23
|
+
/** The text for the native module: the function is dropped, and the body names the unsent count while there is one. */
|
|
24
|
+
const textFor = ({
|
|
25
|
+
unsentBody = describeUnsent,
|
|
26
|
+
...text
|
|
27
|
+
}, unsent) => unsent > 0 ? {
|
|
28
|
+
...text,
|
|
29
|
+
notificationBody: unsentBody(unsent)
|
|
30
|
+
} : text;
|
|
31
|
+
|
|
32
|
+
/** Android re-posts the same notification when the service is started again, which is how the text changes. */
|
|
33
|
+
class AndroidForegroundService {
|
|
34
|
+
stopWatching = null;
|
|
35
|
+
shownUnsent = 0;
|
|
36
|
+
constructor(text, outbox, logger) {
|
|
37
|
+
this.text = text;
|
|
38
|
+
this.outbox = outbox;
|
|
39
|
+
this.logger = logger;
|
|
40
|
+
}
|
|
41
|
+
start = async () => {
|
|
42
|
+
this.stopWatching?.();
|
|
43
|
+
this.shownUnsent = 0;
|
|
44
|
+
|
|
45
|
+
// Watch before the first await, so a stop that follows at once also ends the watching.
|
|
46
|
+
this.stopWatching = this.outbox.subscribe(({
|
|
47
|
+
waiting
|
|
48
|
+
}) => this.showCount(waiting.size));
|
|
49
|
+
await this.show();
|
|
50
|
+
};
|
|
51
|
+
stop = async () => {
|
|
52
|
+
this.stopWatching?.();
|
|
53
|
+
this.stopWatching = null;
|
|
54
|
+
await nativeService().stopBluetoothForegroundService();
|
|
55
|
+
};
|
|
56
|
+
showCount(unsent) {
|
|
57
|
+
if (unsent !== this.shownUnsent) {
|
|
58
|
+
this.shownUnsent = unsent;
|
|
59
|
+
this.show().catch(() => this.logger.error("bluetooth.keep-alive.notification-failed", {
|
|
60
|
+
unsent
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
show() {
|
|
65
|
+
return nativeService().startBluetoothForegroundService(textFor(this.text, this.shownUnsent));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
18
68
|
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
69
|
+
/**
|
|
70
|
+
* Android's connected-device foreground service, which keeps the process alive for background sync; nothing elsewhere.
|
|
71
|
+
* With an `outbox`, its notification says how many readings wait to upload.
|
|
72
|
+
*/
|
|
73
|
+
const androidForegroundService = (text = {}, {
|
|
74
|
+
outbox = _outboxWatch.noOutboxWatch,
|
|
75
|
+
logger = _ports.silentLogger
|
|
76
|
+
} = {}) => _reactNative.Platform.OS === "android" ? new AndroidForegroundService(text, outbox, logger) : _ports.noKeepAlive;
|
|
24
77
|
exports.androidForegroundService = androidForegroundService;
|
|
25
78
|
//# sourceMappingURL=android-foreground-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_ports","nativeService","service","NativeModules","OvokBackgroundSync","Error","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_outboxWatch","_ports","nativeService","service","NativeModules","OvokBackgroundSync","Error","describeUnsent","unsent","textFor","unsentBody","text","notificationBody","AndroidForegroundService","stopWatching","shownUnsent","constructor","outbox","logger","start","subscribe","waiting","showCount","size","show","stop","stopBluetoothForegroundService","catch","error","startBluetoothForegroundService","androidForegroundService","noOutboxWatch","silentLogger","Platform","OS","noKeepAlive","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/android-foreground-service.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA;;AAaA;;AAiBA,MAAMG,aAAa,GAAGA,CAAA,KAA+B;EACnD,MAAMC,OAAO,GAAGC,0BAAa,CAACC,kBAAyD;EAEvF,IAAI,CAACF,OAAO,EAAE;IACZ,MAAM,IAAIG,KAAK,CAAC,2FAA2F,CAAC;EAC9G;EAEA,OAAOH,OAAO;AAChB,CAAC;AAED,MAAMI,cAAc,GAAIC,MAAc,IAAa,GAAGA,MAAM,IAAIA,MAAM,KAAK,CAAC,GAAG,SAAS,GAAG,UAAU,oBAAoB;;AAEzH;AACA,MAAMC,OAAO,GAAGA,CAAC;EAAEC,UAAU,GAAGH,cAAc;EAAE,GAAGI;AAA4B,CAAC,EAAEH,MAAc,KAC9FA,MAAM,GAAG,CAAC,GAAG;EAAE,GAAGG,IAAI;EAAEC,gBAAgB,EAAEF,UAAU,CAACF,MAAM;AAAE,CAAC,GAAGG,IAAI;;AAEvE;AACA,MAAME,wBAAwB,CAAsB;EAC1CC,YAAY,GAAwB,IAAI;EACxCC,WAAW,GAAG,CAAC;EAEhBC,WAAWA,CACCL,IAA2B,EAC3BM,MAAmB,EACnBC,MAAc,EAC/B;IAAA,KAHiBP,IAA2B,GAA3BA,IAA2B;IAAA,KAC3BM,MAAmB,GAAnBA,MAAmB;IAAA,KACnBC,MAAc,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AEC,MAAM,CAAC,GAAGiB,kBAAY;AAACC,OAAA,CAAAN,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ecgMeasurements = void 0;
|
|
7
|
+
var _next = require("@ovok/core/next");
|
|
8
|
+
var _readingValues = require("./reading-values.js");
|
|
9
|
+
/** Ovok stores ECG points in millivolts; a trace in any other unit is left out rather than mislabelled. */
|
|
10
|
+
const ECG_POINT_UNIT = "mV";
|
|
11
|
+
|
|
12
|
+
/** One ECG recording per channel, each in millivolts at the waveform's sample rate; the heart rate goes with the first. */
|
|
13
|
+
const ecgMeasurements = reading => {
|
|
14
|
+
const waveform = reading.waveform?.unit === ECG_POINT_UNIT ? reading.waveform : undefined;
|
|
15
|
+
const channels = waveform?.samples ?? [new Int16Array(0)];
|
|
16
|
+
return channels.map((samples, index) => ({
|
|
17
|
+
measurementTypeKey: _next.MeasurementTypeKey.ecg,
|
|
18
|
+
heartRate: index === 0 ? (0, _readingValues.valueOf)(reading, "heart_rate") : undefined,
|
|
19
|
+
diagramPoints: Array.from(samples, sample => sample * (waveform?.scale ?? 1)),
|
|
20
|
+
duration: waveform ? samples.length / waveform.sampleRateHz : undefined,
|
|
21
|
+
recordedAt: reading.takenAt ?? undefined
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
exports.ecgMeasurements = ecgMeasurements;
|
|
25
|
+
//# sourceMappingURL=ecg-measurements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_next","require","_readingValues","ECG_POINT_UNIT","ecgMeasurements","reading","waveform","unit","undefined","channels","samples","Int16Array","map","index","measurementTypeKey","MeasurementTypeKey","ecg","heartRate","valueOf","diagramPoints","Array","from","sample","scale","duration","length","sampleRateHz","recordedAt","takenAt","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/ecg-measurements.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,cAAA,GAAAD,OAAA;AAEA;AACA,MAAME,cAAc,GAAG,IAAI;;AAE3B;AACA,MAAMC,eAAe,GAAIC,OAAgB,IAAuB;EAC9D,MAAMC,QAAQ,GAAGD,OAAO,CAACC,QAAQ,EAAEC,IAAI,KAAKJ,cAAc,GAAGE,OAAO,CAACC,QAAQ,GAAGE,SAAS;EACzF,MAAMC,QAAQ,GAAGH,QAAQ,EAAEI,OAAO,IAAI,CAAC,IAAIC,UAAU,CAAC,CAAC,CAAC,CAAC;EAEzD,OAAOF,QAAQ,CAACG,GAAG,CAAC,CAACF,OAAO,EAAEG,KAAK,MAAM;IACvCC,kBAAkB,EAAEC,wBAAkB,CAACC,GAAG;IAC1CC,SAAS,EAAEJ,KAAK,KAAK,CAAC,GAAG,IAAAK,sBAAO,EAACb,OAAO,EAAE,YAAY,CAAC,GAAGG,SAAS;IACnEW,aAAa,EAAEC,KAAK,CAACC,IAAI,CAACX,OAAO,EAAGY,MAAM,IAAKA,MAAM,IAAIhB,QAAQ,EAAEiB,KAAK,IAAI,CAAC,CAAC,CAAC;IAC/EC,QAAQ,EAAElB,QAAQ,GAAGI,OAAO,CAACe,MAAM,GAAGnB,QAAQ,CAACoB,YAAY,GAAGlB,SAAS;IACvEmB,UAAU,EAAEtB,OAAO,CAACuB,OAAO,IAAIpB;EACjC,CAAC,CAAC,CAAC;AACL,CAAC;AAACqB,OAAA,CAAAzB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.replaceLiveRecordings = void 0;
|
|
7
|
+
var _next = require("@ovok/core/next");
|
|
8
|
+
var _readingSourceId = require("./reading-source-id.js");
|
|
9
|
+
var _seriesSaving = require("./series-saving.js");
|
|
10
|
+
/** What queues the deletions: the outbox, with the measurements API and the session that name what to delete. */
|
|
11
|
+
|
|
12
|
+
const LIVE_SLOT_MS = 1_000;
|
|
13
|
+
|
|
14
|
+
/** The observations a live recording was saved as, rebuilt from its span alone; a single stand-in value gives each its identifiers. */
|
|
15
|
+
const observationsOfSpan = async (client, address, span) => {
|
|
16
|
+
const patientId = await (0, _seriesSaving.signedInPatientId)(client);
|
|
17
|
+
const sourceId = (0, _readingSourceId.liveSourceId)(address, span);
|
|
18
|
+
if (span.channel === null) {
|
|
19
|
+
const field = (0, _seriesSaving.seriesFieldOf)(span.metric);
|
|
20
|
+
return field ? (0, _seriesSaving.seriesObservationsOf)(field, {
|
|
21
|
+
start: span.from,
|
|
22
|
+
intervalMs: LIVE_SLOT_MS,
|
|
23
|
+
values: [0]
|
|
24
|
+
}, {
|
|
25
|
+
patientId,
|
|
26
|
+
sourceId
|
|
27
|
+
}) : [];
|
|
28
|
+
}
|
|
29
|
+
const measurement = {
|
|
30
|
+
measurementTypeKey: _next.MeasurementTypeKey.ecg,
|
|
31
|
+
diagramPoints: [0],
|
|
32
|
+
duration: 1,
|
|
33
|
+
recordedAt: span.from
|
|
34
|
+
};
|
|
35
|
+
return client.measurements.build({
|
|
36
|
+
measurement,
|
|
37
|
+
sourceId,
|
|
38
|
+
patientId
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** The identifiers that name an observation for good; a segment's own depends on its sample count, which a span does not carry. */
|
|
43
|
+
const deleteTargetsOf = observations => observations.flatMap(({
|
|
44
|
+
identifier = []
|
|
45
|
+
}) => identifier.flatMap(({
|
|
46
|
+
system,
|
|
47
|
+
value
|
|
48
|
+
}) => system && value && system !== _next.SEGMENT_IDENTIFIER_SYSTEM ? [{
|
|
49
|
+
system,
|
|
50
|
+
value
|
|
51
|
+
}] : []));
|
|
52
|
+
|
|
53
|
+
/** Queues the deletion of the live recordings a stored record replaces, so the outbox holds them before it holds the record. */
|
|
54
|
+
const replaceLiveRecordings = async (client, reading) => {
|
|
55
|
+
for (const span of reading.supersedes ?? []) {
|
|
56
|
+
for (const target of deleteTargetsOf(await observationsOfSpan(client, reading.source.address, span))) {
|
|
57
|
+
await client.outbox.enqueueDelete(target);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.replaceLiveRecordings = replaceLiveRecordings;
|
|
62
|
+
//# sourceMappingURL=live-supersession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_next","require","_readingSourceId","_seriesSaving","LIVE_SLOT_MS","observationsOfSpan","client","address","span","patientId","signedInPatientId","sourceId","liveSourceId","channel","field","seriesFieldOf","metric","seriesObservationsOf","start","from","intervalMs","values","measurement","measurementTypeKey","MeasurementTypeKey","ecg","diagramPoints","duration","recordedAt","measurements","build","deleteTargetsOf","observations","flatMap","identifier","system","value","SEGMENT_IDENTIFIER_SYSTEM","replaceLiveRecordings","reading","supersedes","target","source","outbox","enqueueDelete","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/live-supersession.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA;;AAGA,MAAMG,YAAY,GAAG,KAAK;;AAE1B;AACA,MAAMC,kBAAkB,GAAG,MAAAA,CAAOC,MAA0B,EAAEC,OAAe,EAAEC,IAAc,KAA6B;EACxH,MAAMC,SAAS,GAAG,MAAM,IAAAC,+BAAiB,EAACJ,MAAM,CAAC;EACjD,MAAMK,QAAQ,GAAG,IAAAC,6BAAY,EAACL,OAAO,EAAEC,IAAI,CAAC;EAE5C,IAAIA,IAAI,CAACK,OAAO,KAAK,IAAI,EAAE;IACzB,MAAMC,KAAK,GAAG,IAAAC,2BAAa,EAACP,IAAI,CAACQ,MAAM,CAAC;IAExC,O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AA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ovokOutboxWatch = void 0;
|
|
7
|
+
var _ports = require("../core/ports.js");
|
|
8
|
+
const idsOf = items => new Set(items.map(({
|
|
9
|
+
id
|
|
10
|
+
}) => id));
|
|
11
|
+
const itemsIn = (items, state) => idsOf(items.filter(item => item.state === state));
|
|
12
|
+
const viewOf = (items, sent) => ({
|
|
13
|
+
waiting: itemsIn(items, "pending"),
|
|
14
|
+
rejected: itemsIn(items, "rejected"),
|
|
15
|
+
sent: idsOf(sent)
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
/** Watches the signed-in account's Ovok outbox, so the reading log and the notification follow what it sends. */
|
|
19
|
+
const ovokOutboxWatch = (outbox, logger = _ports.silentLogger) => ({
|
|
20
|
+
subscribe: listener => {
|
|
21
|
+
let requests = 0;
|
|
22
|
+
let watching = true;
|
|
23
|
+
|
|
24
|
+
// The outbox's snapshot only says something changed; the items say what.
|
|
25
|
+
const stop = outbox.subscribe(() => {
|
|
26
|
+
const request = ++requests;
|
|
27
|
+
void outbox.items().then(items => {
|
|
28
|
+
if (watching && request === requests) {
|
|
29
|
+
listener(viewOf(items, outbox.recentlySent()));
|
|
30
|
+
}
|
|
31
|
+
}, error => logger.error("bluetooth.outbox-watch.failed", {
|
|
32
|
+
error: error.name
|
|
33
|
+
}));
|
|
34
|
+
});
|
|
35
|
+
return () => {
|
|
36
|
+
watching = false;
|
|
37
|
+
stop();
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
exports.ovokOutboxWatch = ovokOutboxWatch;
|
|
42
|
+
//# sourceMappingURL=ovok-outbox-watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ports","require","idsOf","items","Set","map","id","itemsIn","state","filter","item","viewOf","sent","waiting","rejected","ovokOutboxWatch","outbox","logger","silentLogger","subscribe","listener","requests","watching","stop","request","then","recentlySent","error","name","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAIA,MAAMC,KAAK,GAAIC,KAAoC,IAAkB,IAAIC,GAAG,CAACD,KAAK,CAACE,GAAG,CAAC,CAAC;EAAEC;AAAG,CAAC,KAAKA,EAAE,CAAC,CAAC;AAEvG,MAAMC,OAAO,GAAGA,CAACJ,KAA0B,EAAEK,KAAkB,KAC7DN,KAAK,CAACC,KAAK,CAACM,MAAM,CAAEC,IAAI,IAAKA,IAAI,CAACF,KAAK,KAAKA,KAAK,CAAC,CAAC;AAErD,MAAMG,MAAM,GAAGA,CAACR,KAA0B,EAAES,IAAsB,MAAkB;EAClFC,OAAO,EAAEN,OAAO,CAACJ,KAAK,EAAE,SAAS,CAAC;EAClCW,QAAQ,EAAEP,OAAO,CAACJ,KAAK,EAAE,UAAU,CAAC;EACpCS,IAAI,EAAEV,KAAK,CAACU,IAAI;AAClB,CAAC,CAAC;;AAEF;AACA,MAAMG,eAAe,GAAGA,CAACC,MAAqB,EAAEC,MAAc,GAAGC,mBAAY,MAAmB;EAC9FC,SAAS,EAAGC,QAAQ,IAAK;IACvB,IAAIC,QAAQ,GAAG,CAAC;IAChB,IAAIC,QAAQ,GAAG,IAAI;;IAEnB;IACA,MAAMC,IAAI,GAAGP,MAAM,CAACG,SAAS,CAAC,MAAM;MAClC,MAAMK,OAAO,GAAG,EAAEH,QAAQ;MAE1B,KAAKL,MAAM,CAACb,KAAK,CAAC,CAAC,CAACsB,IAAI,CACrBtB,KAAK,IAAK;QACT,IAAImB,QAAQ,IAAIE,OAAO,KAAKH,QAAQ,EAAE;UACpCD,QAAQ,CAACT,MAAM,CAACR,KAAK,EAAEa,MAAM,CAACU,YAAY,CAAC,CAAC,CAAC,CAAC;QAChD;MACF,CAAC,EACAC,KAAc,IAAKV,MAAM,CAACU,KAAK,CAAC,+BAA+B,EAAE;QAAEA,KAAK,EAAGA,KAAK,CAAWC;MAAK,CAAC,CACpG,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,MAAM;MACXN,QAAQ,GAAG,KAAK;MAChBC,IAAI,CAAC,CAAC;IACR,CAAC;EACH;AACF,CAAC,CAAC;AAACM,OAAA,CAAAd,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -6,48 +6,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ovokReadingSink = void 0;
|
|
7
7
|
var _next = require("@ovok/core/next");
|
|
8
8
|
var _errors = require("../core/errors.js");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/** A device's UCUM unit to the unit Ovok stores the value in: mg/dL, kg, °C, mmHg, L, L/s or %. */
|
|
16
|
-
const TO_OVOK_UNIT = {
|
|
17
|
-
"mg/dL": value => value,
|
|
18
|
-
"mmol/L": value => value * MG_PER_DL_PER_MMOL_PER_L,
|
|
19
|
-
kg: value => value,
|
|
20
|
-
"[lb_av]": value => value * KG_PER_POUND,
|
|
21
|
-
"[stone_av]": value => value * KG_PER_STONE,
|
|
22
|
-
Cel: value => value,
|
|
23
|
-
"[degF]": value => (value - FAHRENHEIT_ZERO_IN_CELSIUS_STEPS) * 5 / 9,
|
|
24
|
-
"mm[Hg]": value => value,
|
|
25
|
-
kPa: value => value * MMHG_PER_KPA,
|
|
26
|
-
L: value => value,
|
|
27
|
-
"L/s": value => value,
|
|
28
|
-
"%": value => value
|
|
29
|
-
};
|
|
30
|
-
const valueOf = (reading, metric) => reading.values[metric]?.value;
|
|
31
|
-
|
|
32
|
-
/** The value in Ovok's unit; `undefined` when the reading lacks it or uses a unit Ovok has no conversion for. */
|
|
33
|
-
const ovokValueOf = (reading, metric) => {
|
|
34
|
-
const quantity = reading.values[metric];
|
|
35
|
-
return quantity && TO_OVOK_UNIT[quantity.unit]?.(quantity.value);
|
|
36
|
-
};
|
|
9
|
+
var _ecgMeasurements = require("./ecg-measurements.js");
|
|
10
|
+
var _liveSupersession = require("./live-supersession.js");
|
|
11
|
+
var _readingSourceId = require("./reading-source-id.js");
|
|
12
|
+
var _readingValues = require("./reading-values.js");
|
|
13
|
+
var _seriesSaving = require("./series-saving.js");
|
|
37
14
|
const flagSet = (reading, code) => reading.deviceFlags.some(flag => flag.code === code && flag.raw !== 0) ? true : undefined;
|
|
38
15
|
const bloodPressure = reading => ({
|
|
39
16
|
measurementTypeKey: _next.MeasurementTypeKey.bloodPressure,
|
|
40
|
-
systolic: ovokValueOf(reading, "systolic"),
|
|
41
|
-
diastolic: ovokValueOf(reading, "diastolic"),
|
|
42
|
-
meanArterialPressure: ovokValueOf(reading, "mean_arterial_pressure"),
|
|
43
|
-
heartRate: valueOf(reading, "pulse_rate"),
|
|
17
|
+
systolic: (0, _readingValues.ovokValueOf)(reading, "systolic"),
|
|
18
|
+
diastolic: (0, _readingValues.ovokValueOf)(reading, "diastolic"),
|
|
19
|
+
meanArterialPressure: (0, _readingValues.ovokValueOf)(reading, "mean_arterial_pressure"),
|
|
20
|
+
heartRate: (0, _readingValues.valueOf)(reading, "pulse_rate"),
|
|
44
21
|
irregularHeartbeat: flagSet(reading, "irregular_pulse"),
|
|
45
22
|
recordedAt: reading.takenAt ?? undefined
|
|
46
23
|
});
|
|
47
24
|
|
|
48
25
|
/** A reading without its main value, or with it in an unconvertible unit, cannot be saved. */
|
|
49
26
|
const bloodGlucose = reading => {
|
|
50
|
-
const bloodGlucoseValue = ovokValueOf(reading, "blood_glucose");
|
|
27
|
+
const bloodGlucoseValue = (0, _readingValues.ovokValueOf)(reading, "blood_glucose");
|
|
51
28
|
return bloodGlucoseValue === undefined ? undefined : {
|
|
52
29
|
measurementTypeKey: _next.MeasurementTypeKey.bloodGlucose,
|
|
53
30
|
bloodGlucose: bloodGlucoseValue,
|
|
@@ -55,7 +32,7 @@ const bloodGlucose = reading => {
|
|
|
55
32
|
};
|
|
56
33
|
};
|
|
57
34
|
const bodyWeight = reading => {
|
|
58
|
-
const weight = ovokValueOf(reading, "body_weight");
|
|
35
|
+
const weight = (0, _readingValues.ovokValueOf)(reading, "body_weight");
|
|
59
36
|
return weight === undefined ? undefined : {
|
|
60
37
|
measurementTypeKey: _next.MeasurementTypeKey.bodyWeight,
|
|
61
38
|
bodyWeight: weight,
|
|
@@ -63,7 +40,7 @@ const bodyWeight = reading => {
|
|
|
63
40
|
};
|
|
64
41
|
};
|
|
65
42
|
const bodyTemperature = reading => {
|
|
66
|
-
const temperature = ovokValueOf(reading, "body_temperature");
|
|
43
|
+
const temperature = (0, _readingValues.ovokValueOf)(reading, "body_temperature");
|
|
67
44
|
return temperature === undefined ? undefined : {
|
|
68
45
|
measurementTypeKey: _next.MeasurementTypeKey.temperature,
|
|
69
46
|
bodyTemp: temperature,
|
|
@@ -72,37 +49,21 @@ const bodyTemperature = reading => {
|
|
|
72
49
|
};
|
|
73
50
|
const pulseOximetry = reading => ({
|
|
74
51
|
measurementTypeKey: _next.MeasurementTypeKey.bloodOxygenPulseRate,
|
|
75
|
-
bloodOxygen: valueOf(reading, "spo2"),
|
|
76
|
-
pulseRate: valueOf(reading, "pulse_rate"),
|
|
77
|
-
perfusionIndex: valueOf(reading, "perfusion_index"),
|
|
52
|
+
bloodOxygen: (0, _readingValues.valueOf)(reading, "spo2"),
|
|
53
|
+
pulseRate: (0, _readingValues.valueOf)(reading, "pulse_rate"),
|
|
54
|
+
perfusionIndex: (0, _readingValues.valueOf)(reading, "perfusion_index"),
|
|
78
55
|
recordedAt: reading.takenAt ?? undefined
|
|
79
56
|
});
|
|
80
|
-
|
|
81
|
-
/** Ovok stores ECG points in millivolts; a trace in any other unit is left out rather than mislabelled. */
|
|
82
|
-
const ECG_POINT_UNIT = "mV";
|
|
83
|
-
const ecg = reading => {
|
|
84
|
-
const waveform = reading.waveform?.unit === ECG_POINT_UNIT ? reading.waveform : undefined;
|
|
85
|
-
const samples = waveform?.samples[0] ?? new Int16Array(0);
|
|
86
|
-
return {
|
|
87
|
-
measurementTypeKey: _next.MeasurementTypeKey.ecg,
|
|
88
|
-
heartRate: valueOf(reading, "heart_rate"),
|
|
89
|
-
diagramPoints: Array.from(samples, sample => sample * (waveform?.scale ?? 1)),
|
|
90
|
-
duration: waveform ? samples.length / waveform.sampleRateHz : undefined,
|
|
91
|
-
recordedAt: reading.takenAt ?? undefined
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/** A per-second series, such as an ER1 trend, has no single-value measurement; it waits for series saving in core. */
|
|
96
|
-
const heartRate = reading => reading.series ? undefined : {
|
|
57
|
+
const heartRate = reading => ({
|
|
97
58
|
measurementTypeKey: _next.MeasurementTypeKey.heartRate,
|
|
98
|
-
heartRate: valueOf(reading, "heart_rate"),
|
|
59
|
+
heartRate: (0, _readingValues.valueOf)(reading, "heart_rate"),
|
|
99
60
|
recordedAt: reading.takenAt ?? undefined
|
|
100
|
-
};
|
|
101
|
-
const respiratoryRate = reading =>
|
|
61
|
+
});
|
|
62
|
+
const respiratoryRate = reading => ({
|
|
102
63
|
measurementTypeKey: _next.MeasurementTypeKey.respiratoryRate,
|
|
103
|
-
respiratoryRate: valueOf(reading, "respiration_rate"),
|
|
64
|
+
respiratoryRate: (0, _readingValues.valueOf)(reading, "respiration_rate"),
|
|
104
65
|
recordedAt: reading.takenAt ?? undefined
|
|
105
|
-
};
|
|
66
|
+
});
|
|
106
67
|
const LIPID_METRICS = ["blood_cholesterol", "hdl_cholesterol", "ldl_cholesterol", "triglycerides"];
|
|
107
68
|
const LIPID_UNITS = ["mg/dL", "mmol/L"];
|
|
108
69
|
const isLipidUnit = unit => LIPID_UNITS.some(lipidUnit => lipidUnit === unit);
|
|
@@ -113,10 +74,10 @@ const lipidPanel = reading => {
|
|
|
113
74
|
const [unit] = units;
|
|
114
75
|
return units.size === 1 && isLipidUnit(unit) ? {
|
|
115
76
|
measurementTypeKey: _next.MeasurementTypeKey.lipidPanel,
|
|
116
|
-
totalCholesterol: valueOf(reading, "blood_cholesterol"),
|
|
117
|
-
hdlCholesterol: valueOf(reading, "hdl_cholesterol"),
|
|
118
|
-
ldlCholesterol: valueOf(reading, "ldl_cholesterol"),
|
|
119
|
-
triglycerides: valueOf(reading, "triglycerides"),
|
|
77
|
+
totalCholesterol: (0, _readingValues.valueOf)(reading, "blood_cholesterol"),
|
|
78
|
+
hdlCholesterol: (0, _readingValues.valueOf)(reading, "hdl_cholesterol"),
|
|
79
|
+
ldlCholesterol: (0, _readingValues.valueOf)(reading, "ldl_cholesterol"),
|
|
80
|
+
triglycerides: (0, _readingValues.valueOf)(reading, "triglycerides"),
|
|
120
81
|
unit,
|
|
121
82
|
recordedAt: reading.takenAt ?? undefined
|
|
122
83
|
} : undefined;
|
|
@@ -125,11 +86,11 @@ const lipidPanel = reading => {
|
|
|
125
86
|
/** A spirometry test without any value in Ovok's units cannot be saved. */
|
|
126
87
|
const spirometry = reading => {
|
|
127
88
|
const values = {
|
|
128
|
-
fvc: ovokValueOf(reading, "fvc"),
|
|
129
|
-
fev1: ovokValueOf(reading, "fev1"),
|
|
130
|
-
"fev1/fvc": ovokValueOf(reading, "fev1_fvc_ratio"),
|
|
131
|
-
pef: ovokValueOf(reading, "pef"),
|
|
132
|
-
fef2575: ovokValueOf(reading, "fef25_75")
|
|
89
|
+
fvc: (0, _readingValues.ovokValueOf)(reading, "fvc"),
|
|
90
|
+
fev1: (0, _readingValues.ovokValueOf)(reading, "fev1"),
|
|
91
|
+
"fev1/fvc": (0, _readingValues.ovokValueOf)(reading, "fev1_fvc_ratio"),
|
|
92
|
+
pef: (0, _readingValues.ovokValueOf)(reading, "pef"),
|
|
93
|
+
fef2575: (0, _readingValues.ovokValueOf)(reading, "fef25_75")
|
|
133
94
|
};
|
|
134
95
|
return Object.values(values).some(value => value !== undefined) ? {
|
|
135
96
|
measurementTypeKey: _next.MeasurementTypeKey.spirometryPanel,
|
|
@@ -137,20 +98,24 @@ const spirometry = reading => {
|
|
|
137
98
|
recordedAt: reading.takenAt ?? undefined
|
|
138
99
|
} : undefined;
|
|
139
100
|
};
|
|
101
|
+
const single = measure => reading => {
|
|
102
|
+
const measurement = measure(reading);
|
|
103
|
+
return measurement ? [measurement] : [];
|
|
104
|
+
};
|
|
140
105
|
|
|
141
|
-
/** How each reading type becomes an
|
|
106
|
+
/** How each reading type becomes Ovok measurements, one for most and one per channel for an ECG; a type missing here cannot be saved yet. */
|
|
142
107
|
const MEASUREMENTS = {
|
|
143
|
-
blood_pressure: bloodPressure,
|
|
144
|
-
blood_glucose: bloodGlucose,
|
|
145
|
-
blood_cholesterol: lipidPanel,
|
|
146
|
-
ecg,
|
|
147
|
-
heart_rate: heartRate,
|
|
148
|
-
oxygen_saturation: pulseOximetry,
|
|
149
|
-
respiration_rate: respiratoryRate,
|
|
150
|
-
spirometry,
|
|
151
|
-
temperature: bodyTemperature,
|
|
152
|
-
triglycerides: lipidPanel,
|
|
153
|
-
weight: bodyWeight
|
|
108
|
+
blood_pressure: single(bloodPressure),
|
|
109
|
+
blood_glucose: single(bloodGlucose),
|
|
110
|
+
blood_cholesterol: single(lipidPanel),
|
|
111
|
+
ecg: _ecgMeasurements.ecgMeasurements,
|
|
112
|
+
heart_rate: single(heartRate),
|
|
113
|
+
oxygen_saturation: single(pulseOximetry),
|
|
114
|
+
respiration_rate: single(respiratoryRate),
|
|
115
|
+
spirometry: single(spirometry),
|
|
116
|
+
temperature: single(bodyTemperature),
|
|
117
|
+
triglycerides: single(lipidPanel),
|
|
118
|
+
weight: single(bodyWeight)
|
|
154
119
|
};
|
|
155
120
|
const deviceOf = (reading, device) => ({
|
|
156
121
|
id: reading.source.address,
|
|
@@ -167,24 +132,60 @@ const deviceOf = (reading, device) => ({
|
|
|
167
132
|
batteryPercentage: device.battery?.percent
|
|
168
133
|
});
|
|
169
134
|
|
|
170
|
-
/**
|
|
135
|
+
/** What the sink saves with: the measurements API, the outbox that deletes, and the session that names the patient. */
|
|
136
|
+
|
|
137
|
+
const unsupported = what => new _errors.DeviceError("unsupported", `Ovok cannot save ${what} yet`);
|
|
138
|
+
|
|
139
|
+
/** Live numbers are saved as series and a live ECG as a recording; any other live trace has no place in Ovok yet. */
|
|
140
|
+
const isUnsavableLive = reading => reading.live !== undefined && reading.series === undefined && reading.type !== "ecg";
|
|
141
|
+
const hasValues = reading => Object.keys(reading.values).length > 0;
|
|
142
|
+
const saveMeasurements = async (client, reading, device) => {
|
|
143
|
+
const measurements = MEASUREMENTS[reading.type]?.(reading) ?? [];
|
|
144
|
+
if (measurements.length === 0) {
|
|
145
|
+
throw unsupported(`a ${reading.type} reading of this shape`);
|
|
146
|
+
}
|
|
147
|
+
const results = [];
|
|
148
|
+
for (const [index, measurement] of measurements.entries()) {
|
|
149
|
+
results.push(await client.measurements.save({
|
|
150
|
+
measurement,
|
|
151
|
+
sourceId: (0, _readingSourceId.partSourceId)((0, _readingSourceId.sourceIdOf)(reading), index),
|
|
152
|
+
effectiveDateTime: reading.takenAt ?? undefined,
|
|
153
|
+
device
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
return results;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/** Queued when any part of the reading is, with the outbox item of each queued part. */
|
|
160
|
+
const receiptOf = results => {
|
|
161
|
+
const queueIds = results.flatMap(result => result.status === "queued" ? [result.queueId] : []);
|
|
162
|
+
return queueIds.length > 0 ? {
|
|
163
|
+
status: "queued",
|
|
164
|
+
queueIds
|
|
165
|
+
} : {
|
|
166
|
+
status: "saved"
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Saves readings for the signed-in account through the Ovok measurements API, queueing them offline. A reading with a
|
|
172
|
+
* series also saves it; a stored record then removes the live recordings it replaces, once it is saved.
|
|
173
|
+
*/
|
|
171
174
|
const ovokReadingSink = client => ({
|
|
172
175
|
save: async (reading, device) => {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
throw new _errors.DeviceError("unsupported", `Ovok cannot save a ${reading.type} reading of this shape yet`);
|
|
176
|
+
if (isUnsavableLive(reading)) {
|
|
177
|
+
throw unsupported(`a live ${reading.live?.metric} recording`);
|
|
176
178
|
}
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
return result.status;
|
|
179
|
+
const target = deviceOf(reading, device);
|
|
180
|
+
const results = [];
|
|
181
|
+
if ((0, _seriesSaving.isSeriesReading)(reading)) {
|
|
182
|
+
results.push(await (0, _seriesSaving.saveSeries)(client, reading, target));
|
|
183
|
+
}
|
|
184
|
+
if (!(0, _seriesSaving.isSeriesReading)(reading) || hasValues(reading)) {
|
|
185
|
+
results.push(...(await saveMeasurements(client, reading, target)));
|
|
186
|
+
}
|
|
187
|
+
await (0, _liveSupersession.replaceLiveRecordings)(client, reading);
|
|
188
|
+
return receiptOf(results);
|
|
188
189
|
}
|
|
189
190
|
});
|
|
190
191
|
exports.ovokReadingSink = ovokReadingSink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_next","require","_errors","
|
|
1
|
+
{"version":3,"names":["_next","require","_errors","_ecgMeasurements","_liveSupersession","_readingSourceId","_readingValues","_seriesSaving","flagSet","reading","code","deviceFlags","some","flag","raw","undefined","bloodPressure","measurementTypeKey","MeasurementTypeKey","systolic","ovokValueOf","diastolic","meanArterialPressure","heartRate","valueOf","irregularHeartbeat","recordedAt","takenAt","bloodGlucose","bloodGlucoseValue","bodyWeight","weight","bodyTemperature","temperature","bodyTemp","pulseOximetry","bloodOxygenPulseRate","bloodOxygen","pulseRate","perfusionIndex","respiratoryRate","LIPID_METRICS","LIPID_UNITS","isLipidUnit","unit","lipidUnit","lipidPanel","units","Set","flatMap","metric","values","size","totalCholesterol","hdlCholesterol","ldlCholesterol","triglycerides","spirometry","fvc","fev1","pef","fef2575","Object","value","spirometryPanel","single","measure","measurement","MEASUREMENTS","blood_pressure","blood_glucose","blood_cholesterol","ecg","ecgMeasurements","heart_rate","oxygen_saturation","respiration_rate","deviceOf","device","id","source","address","name","model","localName","manufacturerData","manufacturerName","identity","manufacturer","sn","serial","variant","vendor","batteryPercentage","battery","percent","unsupported","what","DeviceError","isUnsavableLive","live","series","type","hasValues","keys","length","saveMeasurements","client","measurements","results","index","entries","push","save","sourceId","partSourceId","sourceIdOf","effectiveDateTime","receiptOf","queueIds","result","status","queueId","ovokReadingSink","target","isSeriesReading","saveSeries","replaceLiveRecordings","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/ovok-reading-sink.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAgBA,IAAAC,OAAA,GAAAD,OAAA;AAMA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAEA,MAAMO,OAAO,GAAGA,CAACC,OAAgB,EAAEC,IAAY,KAC7CD,OAAO,CAACE,WAAW,CAACC,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACH,IAAI,KAAKA,IAAI,IAAIG,IAAI,CAACC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,GAAGC,SAAS;AAE7F,MAAMC,aAAa,GAAIP,OAAgB,KAAgC;EACrEQ,kBAAkB,EAAEC,wBAAkB,CAACF,aAAa;EACpDG,QAAQ,EAAE,IAAAC,0BAAW,EAACX,OAAO,EAAE,UAAU,CAAC;EAC1CY,SAAS,EAAE,IAAAD,0BAAW,EAACX,OAAO,EAAE,WAAW,CAAC;EAC5Ca,oBAAoB,EAAE,IAAAF,0BAAW,EAACX,OAAO,EAAE,wBAAwB,CAAC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AA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sourceIdOf = exports.partSourceId = exports.liveSourceId = void 0;
|
|
7
|
+
/** The name a live recording is saved under: the device, what it holds, and when it began. */
|
|
8
|
+
const liveSourceId = (address, {
|
|
9
|
+
metric,
|
|
10
|
+
channel,
|
|
11
|
+
from
|
|
12
|
+
}) => ["bluetooth", address, "live", metric, ...(channel === null ? [] : [channel]), from.getTime()].join(":");
|
|
13
|
+
|
|
14
|
+
/** The stable name a reading is saved under, so saving it again writes the same data; `undefined` for a measurement the device does not store. */
|
|
15
|
+
exports.liveSourceId = liveSourceId;
|
|
16
|
+
const sourceIdOf = ({
|
|
17
|
+
live,
|
|
18
|
+
source: {
|
|
19
|
+
address,
|
|
20
|
+
recordId
|
|
21
|
+
}
|
|
22
|
+
}) => {
|
|
23
|
+
if (live) {
|
|
24
|
+
return liveSourceId(address, live);
|
|
25
|
+
}
|
|
26
|
+
return recordId === null ? undefined : `bluetooth:${address}:${recordId}`;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** The name of the `index`th recording of a reading with several, such as the channels of an ECG; the first keeps the reading's own. */
|
|
30
|
+
exports.sourceIdOf = sourceIdOf;
|
|
31
|
+
const partSourceId = (sourceId, index) => sourceId !== undefined && index > 0 ? `${sourceId}:${index}` : sourceId;
|
|
32
|
+
exports.partSourceId = partSourceId;
|
|
33
|
+
//# sourceMappingURL=reading-source-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["liveSourceId","address","metric","channel","from","getTime","join","exports","sourceIdOf","live","source","recordId","undefined","partSourceId","sourceId","index"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/reading-source-id.ts"],"mappings":";;;;;;AAEA;AACA,MAAMA,YAAY,GAAGA,CAACC,OAAe,EAAE;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAe,CAAC,KACxE,CAAC,WAAW,EAAEH,OAAO,EAAE,MAAM,EAAEC,MAAM,EAAE,IAAIC,OAAO,KAAK,IAAI,GAAG,EAAE,GAAG,CAACA,OAAO,CAAC,CAAC,EAAEC,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;;AAE1G;AAAAC,OAAA,CAAAP,YAAA,GAAAA,YAAA;AACA,MAAMQ,UAAU,GAAGA,CAAC;EAAEC,IAAI;EAAEC,MAAM,EAAE;IAAET,OAAO;IAAEU;EAAS;AAAW,CAAC,KAAyB;EAC3F,IAAIF,IAAI,EAAE;IACR,OAAOT,YAAY,CAACC,OAAO,EAAEQ,IAAI,CAAC;EACpC;EAEA,OAAOE,QAAQ,KAAK,IAAI,GAAGC,SAAS,GAAG,aAAaX,OAAO,IAAIU,QAAQ,EAAE;AAC3E,CAAC;;AAED;AAAAJ,OAAA,CAAAC,UAAA,GAAAA,UAAA;AACA,MAAMK,YAAY,GAAGA,CAACC,QAA4B,EAAEC,KAAa,KAC/DD,QAAQ,KAAKF,SAAS,IAAIG,KAAK,GAAG,CAAC,GAAG,GAAGD,QAAQ,IAAIC,KAAK,EAAE,GAAGD,QAAQ;AAACP,OAAA,CAAAM,YAAA,GAAAA,YAAA","ignoreList":[]}
|