@ovok/native 1.17.0-dev.2213 → 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/ble-plx-central.js +45 -24
- package/lib/commonjs/modules/next/bluetooth/adapters/ble-plx-central.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/adapters/web-bluetooth-central.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/web-bluetooth-central.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-link.js +2 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-link.js.map +1 -1
- 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/ble-plx-central.js +45 -24
- package/lib/module/modules/next/bluetooth/adapters/ble-plx-central.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/adapters/web-bluetooth-central.js +9 -1
- package/lib/module/modules/next/bluetooth/adapters/web-bluetooth-central.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-link.js +2 -1
- package/lib/module/modules/next/bluetooth/core/device-link.js.map +1 -1
- 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/ble-plx-central.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/adapters/web-bluetooth-central.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/web-bluetooth-central.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/ble-plx-central.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/adapters/web-bluetooth-central.d.ts +4 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/web-bluetooth-central.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
|
@@ -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,CA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,EAAElG,OAAO,EAAEmH,MAAM,CAAC,CAAC;IACzD;IAEA,IAAI,CAAC,IAAAC,6BAAe,EAACpH,OAAO,CAAC,IAAI8F,SAAS,CAAC9F,OAAO,CAAC,EAAE;MACnDoG,OAAO,CAACG,IAAI,CAAC,IAAI,MAAMN,gBAAgB,CAACC,MAAM,EAAElG,OAAO,EAAEmH,MAAM,CAAC,CAAC,CAAC;IACpE;IAEA,MAAM,IAAAG,uCAAqB,EAACpB,MAAM,EAAElG,OAAO,CAAC;IAE5C,OAAO6G,SAAS,CAACT,OAAO,CAAC;EAC3B;AACF,CAAC,CAAC;AAACmB,OAAA,CAAAL,eAAA,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":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.valueOf = exports.ovokValueOf = exports.TO_OVOK_UNIT = void 0;
|
|
7
|
+
const MG_PER_DL_PER_MMOL_PER_L = 18.0182;
|
|
8
|
+
const KG_PER_POUND = 0.45359237;
|
|
9
|
+
const KG_PER_STONE = 6.35029318;
|
|
10
|
+
const MMHG_PER_KPA = 7.50062;
|
|
11
|
+
const FAHRENHEIT_ZERO_IN_CELSIUS_STEPS = 32;
|
|
12
|
+
|
|
13
|
+
/** A device's UCUM unit to the unit Ovok stores the value in: mg/dL, kg, °C, mmHg, L, L/s, % or per minute. */
|
|
14
|
+
const TO_OVOK_UNIT = exports.TO_OVOK_UNIT = {
|
|
15
|
+
"mg/dL": value => value,
|
|
16
|
+
"mmol/L": value => value * MG_PER_DL_PER_MMOL_PER_L,
|
|
17
|
+
kg: value => value,
|
|
18
|
+
"[lb_av]": value => value * KG_PER_POUND,
|
|
19
|
+
"[stone_av]": value => value * KG_PER_STONE,
|
|
20
|
+
Cel: value => value,
|
|
21
|
+
"[degF]": value => (value - FAHRENHEIT_ZERO_IN_CELSIUS_STEPS) * 5 / 9,
|
|
22
|
+
"mm[Hg]": value => value,
|
|
23
|
+
kPa: value => value * MMHG_PER_KPA,
|
|
24
|
+
L: value => value,
|
|
25
|
+
"L/s": value => value,
|
|
26
|
+
"%": value => value,
|
|
27
|
+
"/min": value => value
|
|
28
|
+
};
|
|
29
|
+
const valueOf = (reading, metric) => reading.values[metric]?.value;
|
|
30
|
+
|
|
31
|
+
/** The value in Ovok's unit; `undefined` when the reading lacks it or uses a unit Ovok has no conversion for. */
|
|
32
|
+
exports.valueOf = valueOf;
|
|
33
|
+
const ovokValueOf = (reading, metric) => {
|
|
34
|
+
const quantity = reading.values[metric];
|
|
35
|
+
return quantity && TO_OVOK_UNIT[quantity.unit]?.(quantity.value);
|
|
36
|
+
};
|
|
37
|
+
exports.ovokValueOf = ovokValueOf;
|
|
38
|
+
//# sourceMappingURL=reading-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MG_PER_DL_PER_MMOL_PER_L","KG_PER_POUND","KG_PER_STONE","MMHG_PER_KPA","FAHRENHEIT_ZERO_IN_CELSIUS_STEPS","TO_OVOK_UNIT","exports","value","kg","Cel","kPa","L","valueOf","reading","metric","values","ovokValueOf","quantity","unit"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/reading-values.ts"],"mappings":";;;;;;AAGA,MAAMA,wBAAwB,GAAG,OAAO;AACxC,MAAMC,YAAY,GAAG,UAAU;AAC/B,MAAMC,YAAY,GAAG,UAAU;AAC/B,MAAMC,YAAY,GAAG,OAAO;AAC5B,MAAMC,gCAAgC,GAAG,EAAE;;AAE3C;AACA,MAAMC,YAAuD,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC9D,OAAO,EAAGE,KAAK,IAAKA,KAAK;EACzB,QAAQ,EAAGA,KAAK,IAAKA,KAAK,GAAGP,wBAAwB;EACrDQ,EAAE,EAAGD,KAAK,IAAKA,KAAK;EACpB,SAAS,EAAGA,KAAK,IAAKA,KAAK,GAAGN,YAAY;EAC1C,YAAY,EAAGM,KAAK,IAAKA,KAAK,GAAGL,YAAY;EAC7CO,GAAG,EAAGF,KAAK,IAAKA,KAAK;EACrB,QAAQ,EAAGA,KAAK,IAAM,CAACA,KAAK,GAAGH,gCAAgC,IAAI,CAAC,GAAI,CAAC;EACzE,QAAQ,EAAGG,KAAK,IAAKA,KAAK;EAC1BG,GAAG,EAAGH,KAAK,IAAKA,KAAK,GAAGJ,YAAY;EACpCQ,CAAC,EAAGJ,KAAK,IAAKA,KAAK;EACnB,KAAK,EAAGA,KAAK,IAAKA,KAAK;EACvB,GAAG,EAAGA,KAAK,IAAKA,KAAK;EACrB,MAAM,EAAGA,KAAK,IAAKA;AACrB,CAAC;AAED,MAAMK,OAAO,GAAGA,CAACC,OAAgB,EAAEC,MAAkB,KAAyBD,OAAO,CAACE,MAAM,CAACD,MAAM,CAAC,EAAEP,KAAK;;AAE3G;AAAAD,OAAA,CAAAM,OAAA,GAAAA,OAAA;AACA,MAAMI,WAAW,GAAGA,CAACH,OAAgB,EAAEC,MAAkB,KAAyB;EAChF,MAAMG,QAAQ,GAAGJ,OAAO,CAACE,MAAM,CAACD,MAAM,CAAC;EAEvC,OAAOG,QAAQ,IAAIZ,YAAY,CAACY,QAAQ,CAACC,IAAI,CAAC,GAAGD,QAAQ,CAACV,KAAK,CAAC;AAClE,CAAC;AAACD,OAAA,CAAAU,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.signedInPatientId = exports.seriesObservationsOf = exports.seriesFieldOf = exports.saveSeries = exports.isSeriesReading = void 0;
|
|
7
|
+
var _next = require("@ovok/core/next");
|
|
8
|
+
var _errors = require("../core/errors.js");
|
|
9
|
+
var _readingSourceId = require("./reading-source-id.js");
|
|
10
|
+
var _readingValues = require("./reading-values.js");
|
|
11
|
+
/** What saves and signs a series: the measurements API and the session. */
|
|
12
|
+
|
|
13
|
+
/** A reading that holds a series. */
|
|
14
|
+
|
|
15
|
+
/** Where Ovok keeps one metric's series: the measurement type and the property on it. */
|
|
16
|
+
|
|
17
|
+
const SERIES_FIELDS = {
|
|
18
|
+
heart_rate: {
|
|
19
|
+
type: _next.MeasurementTypeKey.heartRate,
|
|
20
|
+
property: "heartRate"
|
|
21
|
+
},
|
|
22
|
+
pulse_rate: {
|
|
23
|
+
type: _next.MeasurementTypeKey.bloodOxygenPulseRate,
|
|
24
|
+
property: "pulseRate"
|
|
25
|
+
},
|
|
26
|
+
spo2: {
|
|
27
|
+
type: _next.MeasurementTypeKey.bloodOxygenPulseRate,
|
|
28
|
+
property: "bloodOxygen"
|
|
29
|
+
},
|
|
30
|
+
respiration_rate: {
|
|
31
|
+
type: _next.MeasurementTypeKey.respiratoryRate,
|
|
32
|
+
property: "respiratoryRate"
|
|
33
|
+
},
|
|
34
|
+
body_temperature: {
|
|
35
|
+
type: _next.MeasurementTypeKey.temperature,
|
|
36
|
+
property: "bodyTemp"
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const unsupported = what => new _errors.DeviceError("unsupported", `Ovok cannot save ${what} as a series`);
|
|
40
|
+
const isSeriesReading = reading => reading.series !== undefined;
|
|
41
|
+
|
|
42
|
+
/** The field Ovok keeps a metric's series in; `undefined` for a metric it keeps none for. */
|
|
43
|
+
exports.isSeriesReading = isSeriesReading;
|
|
44
|
+
const seriesFieldOf = metric => SERIES_FIELDS[metric];
|
|
45
|
+
|
|
46
|
+
/** The id of the signed-in patient, which a series is saved for. */
|
|
47
|
+
exports.seriesFieldOf = seriesFieldOf;
|
|
48
|
+
const signedInPatientId = async ({
|
|
49
|
+
session
|
|
50
|
+
}) => {
|
|
51
|
+
const current = await session.current();
|
|
52
|
+
if (!current) {
|
|
53
|
+
throw new _errors.DeviceError("save-failed", "Sign in to save a series");
|
|
54
|
+
}
|
|
55
|
+
const {
|
|
56
|
+
reference
|
|
57
|
+
} = current.profile;
|
|
58
|
+
return reference.slice(reference.indexOf("/") + 1);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** The observations that hold one metric's values, one per second or at the interval given. */
|
|
62
|
+
exports.signedInPatientId = signedInPatientId;
|
|
63
|
+
const seriesObservationsOf = (field, {
|
|
64
|
+
start,
|
|
65
|
+
intervalMs,
|
|
66
|
+
values
|
|
67
|
+
}, rest) => (0, _next.seriesObservations)({
|
|
68
|
+
series: {
|
|
69
|
+
measurementTypeKey: field.type,
|
|
70
|
+
start,
|
|
71
|
+
periodMs: intervalMs,
|
|
72
|
+
values: {
|
|
73
|
+
[field.property]: values
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
...rest
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/** Saves a series, in Ovok's unit, under a stable id; saving a longer version of it writes over the earlier one. */
|
|
80
|
+
exports.seriesObservationsOf = seriesObservationsOf;
|
|
81
|
+
const saveSeries = async (client, reading, device) => {
|
|
82
|
+
const {
|
|
83
|
+
series
|
|
84
|
+
} = reading;
|
|
85
|
+
const field = seriesFieldOf(series.metric);
|
|
86
|
+
const toOvokUnit = _readingValues.TO_OVOK_UNIT[series.unit];
|
|
87
|
+
if (!field || !toOvokUnit) {
|
|
88
|
+
throw unsupported(`${series.metric} in ${series.unit}`);
|
|
89
|
+
}
|
|
90
|
+
const observations = seriesObservationsOf(field, {
|
|
91
|
+
...series,
|
|
92
|
+
values: series.values.map(value => value === null ? null : toOvokUnit(value))
|
|
93
|
+
}, {
|
|
94
|
+
patientId: await signedInPatientId(client),
|
|
95
|
+
sourceId: (0, _readingSourceId.sourceIdOf)(reading),
|
|
96
|
+
device
|
|
97
|
+
});
|
|
98
|
+
return client.measurements.saveObservations(observations);
|
|
99
|
+
};
|
|
100
|
+
exports.saveSeries = saveSeries;
|
|
101
|
+
//# sourceMappingURL=series-saving.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_next","require","_errors","_readingSourceId","_readingValues","SERIES_FIELDS","heart_rate","type","MeasurementTypeKey","heartRate","property","pulse_rate","bloodOxygenPulseRate","spo2","respiration_rate","respiratoryRate","body_temperature","temperature","unsupported","what","DeviceError","isSeriesReading","reading","series","undefined","exports","seriesFieldOf","metric","signedInPatientId","session","current","reference","profile","slice","indexOf","seriesObservationsOf","field","start","intervalMs","values","rest","seriesObservations","measurementTypeKey","periodMs","saveSeries","client","device","toOvokUnit","TO_OVOK_UNIT","unit","observations","map","value","patientId","sourceId","sourceIdOf","measurements","saveObservations"],"sourceRoot":"../../../../../../src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GAAG,IAAI,GAAGL,UAAU,CAACK,KAAK,CAAE;EAAE,CAAC,EAChG;IAAEC,SAAS,EAAE,MAAMzB,iBAAiB,CAACiB,MAAM,CAAC;IAAES,QAAQ,EAAE,IAAAC,2BAAU,EAACjC,OAAO,CAAC;IAAEwB;EAAO,CACtF,CAAC;EAED,OAAOD,MAAM,CAACW,YAAY,CAACC,gBAAgB,CAACP,YAAY,CAAC;AAC3D,CAAC;AAACzB,OAAA,CAAAmB,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.openExpoSqlite = void 0;
|
|
7
|
+
/** A value SQLite binds to a `?` placeholder. */
|
|
8
|
+
|
|
9
|
+
/** The part of an `expo-sqlite` transaction the outbox store uses. */
|
|
10
|
+
|
|
11
|
+
/** The part of an `expo-sqlite` database the outbox store uses. */
|
|
12
|
+
|
|
13
|
+
const loadExpoSqlite = () => {
|
|
14
|
+
try {
|
|
15
|
+
return require("expo-sqlite");
|
|
16
|
+
} catch {
|
|
17
|
+
throw new Error("SqliteOutboxStore requires the optional expo-sqlite peer dependency");
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Opens the named database with `expo-sqlite`, which an app without the package never loads. */
|
|
22
|
+
const openExpoSqlite = name => loadExpoSqlite().openDatabaseAsync(name);
|
|
23
|
+
exports.openExpoSqlite = openExpoSqlite;
|
|
24
|
+
//# sourceMappingURL=sqlite-database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["loadExpoSqlite","require","Error","openExpoSqlite","name","openDatabaseAsync","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/sqlite-database.ts"],"mappings":";;;;;;AAAA;;AAGA;;AAaA;;AAYA,MAAMA,cAAc,GAAGA,CAAA,KAAkB;EACvC,IAAI;IACF,OAAOC,OAAO,CAAC,aAAa,CAAC;EAC/B,CAAC,CAAC,MAAM;IACN,MAAM,IAAIC,KAAK,CAAC,qEAAqE,CAAC;EACxF;AACF,CAAC;;AAED;AACA,MAAMC,cAAc,GAAIC,IAAY,IAA8BJ,cAAc,CAAC,CAAC,CAACK,iBAAiB,CAACD,IAAI,CAAC;AAACE,OAAA,CAAAH,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.summaryOf = exports.itemOf = exports.bindValuesOf = exports.SUMMARY_COLUMN_LIST = exports.ITEM_PLACEHOLDERS = exports.ITEM_COLUMN_LIST = void 0;
|
|
7
|
+
/** One row of `outbox_items`: a column per item field, the failure and the entries as JSON text. */
|
|
8
|
+
|
|
9
|
+
/** The columns of a row, in the order `bindValuesOf` binds them. */
|
|
10
|
+
const ITEM_COLUMNS = ["id", "owner_key", "kind", "group_id", "seq", "state", "attempts", "next_attempt_at", "created_at", "recorded_at", "last_failure", "entries"];
|
|
11
|
+
|
|
12
|
+
/** Everything but the entries, which a listing or a count never reads. */
|
|
13
|
+
const SUMMARY_COLUMNS = ITEM_COLUMNS.filter(column => column !== "entries");
|
|
14
|
+
const ITEM_COLUMN_LIST = exports.ITEM_COLUMN_LIST = ITEM_COLUMNS.join(", ");
|
|
15
|
+
const ITEM_PLACEHOLDERS = exports.ITEM_PLACEHOLDERS = ITEM_COLUMNS.map(() => "?").join(", ");
|
|
16
|
+
const SUMMARY_COLUMN_LIST = exports.SUMMARY_COLUMN_LIST = SUMMARY_COLUMNS.join(", ");
|
|
17
|
+
const rowOf = item => ({
|
|
18
|
+
id: item.id,
|
|
19
|
+
owner_key: item.ownerKey,
|
|
20
|
+
kind: item.kind,
|
|
21
|
+
group_id: item.group ?? null,
|
|
22
|
+
seq: item.seq ?? null,
|
|
23
|
+
state: item.state,
|
|
24
|
+
attempts: item.attempts,
|
|
25
|
+
next_attempt_at: item.nextAttemptAt,
|
|
26
|
+
created_at: item.createdAt,
|
|
27
|
+
recorded_at: item.recordedAt,
|
|
28
|
+
last_failure: item.lastFailure ? JSON.stringify(item.lastFailure) : null,
|
|
29
|
+
entries: JSON.stringify(item.entries)
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** The values of `item`, in the order of `ITEM_COLUMNS`. */
|
|
33
|
+
const bindValuesOf = item => {
|
|
34
|
+
const row = rowOf(item);
|
|
35
|
+
return ITEM_COLUMNS.map(column => row[column]);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** A field that is `null` in the table is absent on the item. */
|
|
39
|
+
exports.bindValuesOf = bindValuesOf;
|
|
40
|
+
const summaryOf = row => ({
|
|
41
|
+
id: row.id,
|
|
42
|
+
ownerKey: row.owner_key,
|
|
43
|
+
kind: row.kind,
|
|
44
|
+
...(row.group_id !== null && {
|
|
45
|
+
group: row.group_id
|
|
46
|
+
}),
|
|
47
|
+
...(row.seq !== null && {
|
|
48
|
+
seq: row.seq
|
|
49
|
+
}),
|
|
50
|
+
state: row.state,
|
|
51
|
+
attempts: row.attempts,
|
|
52
|
+
nextAttemptAt: row.next_attempt_at,
|
|
53
|
+
createdAt: row.created_at,
|
|
54
|
+
recordedAt: row.recorded_at,
|
|
55
|
+
...(row.last_failure !== null && {
|
|
56
|
+
lastFailure: JSON.parse(row.last_failure)
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
exports.summaryOf = summaryOf;
|
|
60
|
+
const itemOf = row => ({
|
|
61
|
+
...summaryOf(row),
|
|
62
|
+
entries: JSON.parse(row.entries)
|
|
63
|
+
});
|
|
64
|
+
exports.itemOf = itemOf;
|
|
65
|
+
//# sourceMappingURL=sqlite-outbox-rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ITEM_COLUMNS","SUMMARY_COLUMNS","filter","column","ITEM_COLUMN_LIST","exports","join","ITEM_PLACEHOLDERS","map","SUMMARY_COLUMN_LIST","rowOf","item","id","owner_key","ownerKey","kind","group_id","group","seq","state","attempts","next_attempt_at","nextAttemptAt","created_at","createdAt","recorded_at","recordedAt","last_failure","lastFailure","JSON","stringify","entries","bindValuesOf","row","summaryOf","parse","itemOf"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/sqlite-outbox-rows.ts"],"mappings":";;;;;;AAIA;;AAkBA;AACA,MAAMA,YAAY,GAAG,CACnB,IAAI,EACJ,WAAW,EACX,MAAM,EACN,UAAU,EACV,KAAK,EACL,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,SAAS,CACwC;;AAEnD;AACA,MAAMC,eAAe,GAAGD,YAAY,CAACE,MAAM,CAAEC,MAAM,IAAKA,MAAM,KAAK,SAAS,CAAC;AAE7E,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGJ,YAAY,CAACM,IAAI,CAAC,IAAI,CAAC;AAChD,MAAMC,iBAAiB,GAAAF,OAAA,CAAAE,iBAAA,GAAGP,YAAY,CAACQ,GAAG,CAAC,MAAM,GAAG,CAAC,CAACF,IAAI,CAAC,IAAI,CAAC;AAChE,MAAMG,mBAAmB,GAAAJ,OAAA,CAAAI,mBAAA,GAAGR,eAAe,CAACK,IAAI,CAAC,IAAI,CAAC;AAEtD,MAAMI,KAAK,GAAIC,IAAgB,KAAiB;EAC9CC,EAAE,EAAED,IAAI,CAACC,EAAE;EACXC,SAAS,EAAEF,IAAI,CAACG,QAAQ;EACxBC,IAAI,EAAEJ,IAAI,CAACI,IAAI;EACfC,QAAQ,EAAEL,IAAI,CAACM,KAAK,IAAI,IAAI;EAC5BC,GAAG,EAAEP,IAAI,CAACO,GAAG,IAAI,IAAI;EACrBC,KAAK,EAAER,IAAI,CAACQ,KAAK;EACjBC,QAAQ,EAA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K,CAACF,GAAG,CAACN,YAAY;EAAmB,CAAC;AACjG,CAAC,CAAC;AAACtB,OAAA,CAAA6B,SAAA,GAAAA,SAAA;AAEH,MAAME,MAAM,GAAIH,GAAc,KAAkB;EAC9C,GAAGC,SAAS,CAACD,GAAG,CAAC;EACjBF,OAAO,EAAEF,IAAI,CAACM,KAAK,CAACF,GAAG,CAACF,OAAO;AACjC,CAAC,CAAC;AAAC1B,OAAA,CAAA+B,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.migrateOutboxSchema = void 0;
|
|
7
|
+
var _ports = require("../core/ports.js");
|
|
8
|
+
/** Schema changes in order; the schema version is how many have run, so an entry is never edited, only appended. */
|
|
9
|
+
const MIGRATIONS = [`CREATE TABLE outbox_items (
|
|
10
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
11
|
+
owner_key TEXT NOT NULL,
|
|
12
|
+
kind TEXT NOT NULL,
|
|
13
|
+
group_id TEXT,
|
|
14
|
+
seq INTEGER,
|
|
15
|
+
state TEXT NOT NULL,
|
|
16
|
+
attempts INTEGER NOT NULL,
|
|
17
|
+
next_attempt_at INTEGER NOT NULL,
|
|
18
|
+
created_at INTEGER NOT NULL,
|
|
19
|
+
recorded_at INTEGER NOT NULL,
|
|
20
|
+
last_failure TEXT,
|
|
21
|
+
entries TEXT NOT NULL
|
|
22
|
+
);
|
|
23
|
+
CREATE INDEX outbox_items_due ON outbox_items (owner_key, state, next_attempt_at);
|
|
24
|
+
CREATE INDEX outbox_items_recorded ON outbox_items (owner_key, recorded_at);
|
|
25
|
+
CREATE INDEX outbox_items_group ON outbox_items (group_id, seq);`];
|
|
26
|
+
const PREPARE = `
|
|
27
|
+
PRAGMA journal_mode = WAL;
|
|
28
|
+
CREATE TABLE IF NOT EXISTS schema_version (version INTEGER NOT NULL);`;
|
|
29
|
+
const READ_VERSION = "SELECT version FROM schema_version";
|
|
30
|
+
const WRITE_VERSION = "INSERT INTO schema_version (version) VALUES (?)";
|
|
31
|
+
|
|
32
|
+
/** Brings the database to the latest schema; every pending migration runs in one transaction, so a crash leaves none. */
|
|
33
|
+
const migrateOutboxSchema = async (database, logger = _ports.silentLogger) => {
|
|
34
|
+
await database.execAsync(PREPARE);
|
|
35
|
+
const from = (await database.getFirstAsync(READ_VERSION))?.version ?? 0;
|
|
36
|
+
const to = MIGRATIONS.length;
|
|
37
|
+
if (from >= to) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
await database.withExclusiveTransactionAsync(async transaction => {
|
|
41
|
+
for (const migration of MIGRATIONS.slice(from)) {
|
|
42
|
+
await transaction.execAsync(migration);
|
|
43
|
+
}
|
|
44
|
+
await transaction.execAsync("DELETE FROM schema_version");
|
|
45
|
+
await transaction.runAsync(WRITE_VERSION, [to]);
|
|
46
|
+
});
|
|
47
|
+
logger.info("outbox.sqlite.migrated", {
|
|
48
|
+
from,
|
|
49
|
+
to
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
exports.migrateOutboxSchema = migrateOutboxSchema;
|
|
53
|
+
//# sourceMappingURL=sqlite-outbox-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ports","require","MIGRATIONS","PREPARE","READ_VERSION","WRITE_VERSION","migrateOutboxSchema","database","logger","silentLogger","execAsync","from","getFirstAsync","version","to","length","withExclusiveTransactionAsync","transaction","migration","slice","runAsync","info","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/sqlite-outbox-schema.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA;AACA,MAAMC,UAA6B,GAAG,CACpC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,CAClE;AAED,MAAMC,OAAO,GAAG;AAChB;AACA,wEAAwE;AAExE,MAAMC,YAAY,GAAG,oCAAoC;AACzD,MAAMC,aAAa,GAAG,iDAAiD;;AAEvE;AACA,MAAMC,mBAAmB,GAAG,MAAAA,CAAOC,QAAwB,EAAEC,MAAc,GAAGC,mBAAY,KAAoB;EAC5G,MAAMF,QAAQ,CAACG,SAAS,CAACP,OAAO,CAAC;EAEjC,MAAMQ,IAAI,GAAG,CAAC,MAAMJ,QAAQ,CAACK,aAAa,CAAsBR,YAAY,CAAC,GAAGS,OAAO,IAAI,CAAC;EAC5F,MAAMC,EAAE,GAAGZ,UAAU,CAACa,MAAM;EAE5B,IAAIJ,IAAI,IAAIG,EAAE,EAAE;IACd;EACF;EAEA,MAAMP,QAAQ,CAACS,6BAA6B,CAAC,MAAOC,WAAW,IAAK;IAClE,KAAK,MAAMC,SAAS,IAAIhB,UAAU,CAACiB,KAAK,CAACR,IAAI,CAAC,EAAE;MAC9C,MAAMM,WAAW,CAACP,SAAS,CAACQ,SAAS,CAAC;IACxC;IACA,MAAMD,WAAW,CAACP,SAAS,CAAC,4BAA4B,CAAC;IACzD,MAAMO,WAAW,CAACG,QAAQ,CAACf,aAAa,EAAE,CAACS,EAAE,CAAC,CAAC;EACjD,CAAC,CAAC;EACFN,MAAM,CAACa,IAAI,CAAC,wBAAwB,EAAE;IAAEV,IAAI;IAAEG;EAAG,CAAC,CAAC;AACrD,CAAC;AAACQ,OAAA,CAAAhB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SqliteOutboxStore = void 0;
|
|
7
|
+
var _sqliteDatabase = require("./sqlite-database.js");
|
|
8
|
+
var _sqliteOutboxRows = require("./sqlite-outbox-rows.js");
|
|
9
|
+
var _sqliteOutboxSchema = require("./sqlite-outbox-schema.js");
|
|
10
|
+
/** How `SqliteOutboxStore` finds its database; every field has a default for a phone app. */
|
|
11
|
+
|
|
12
|
+
const DEFAULT_DATABASE_NAME = "ovok-outbox.db";
|
|
13
|
+
const PENDING = "pending";
|
|
14
|
+
const PUT = `INSERT OR REPLACE INTO outbox_items (${_sqliteOutboxRows.ITEM_COLUMN_LIST}) VALUES (${_sqliteOutboxRows.ITEM_PLACEHOLDERS})`;
|
|
15
|
+
const GET = `SELECT ${_sqliteOutboxRows.ITEM_COLUMN_LIST} FROM outbox_items WHERE id = ?`;
|
|
16
|
+
const REMOVE = "DELETE FROM outbox_items WHERE id = ?";
|
|
17
|
+
const DUE = `SELECT ${_sqliteOutboxRows.ITEM_COLUMN_LIST} FROM outbox_items
|
|
18
|
+
WHERE owner_key = ? AND state = ? AND next_attempt_at <= ?
|
|
19
|
+
ORDER BY recorded_at DESC, COALESCE(seq, 0), id
|
|
20
|
+
LIMIT ?`;
|
|
21
|
+
const SUMMARIES = `SELECT ${_sqliteOutboxRows.SUMMARY_COLUMN_LIST} FROM outbox_items WHERE owner_key = ? ORDER BY recorded_at DESC`;
|
|
22
|
+
const COUNT = "SELECT COUNT(*) AS total FROM outbox_items WHERE owner_key = ? AND state = ?";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An `OutboxStore` on `expo-sqlite`, for phones: one row per item in `outbox_items`, the entries as one JSON text
|
|
26
|
+
* column, so listing and counting never read them. `expo-sqlite` is an optional peer dependency, loaded on first use.
|
|
27
|
+
*/
|
|
28
|
+
class SqliteOutboxStore {
|
|
29
|
+
database = null;
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this.options = options;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Stores an item, replacing the one with the same id. */
|
|
35
|
+
async put(item) {
|
|
36
|
+
await (await this.open()).runAsync(PUT, (0, _sqliteOutboxRows.bindValuesOf)(item));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Returns an item, or `null` when there is none. */
|
|
40
|
+
async get(id) {
|
|
41
|
+
const row = await (await this.open()).getFirstAsync(GET, [id]);
|
|
42
|
+
return row && (0, _sqliteOutboxRows.itemOf)(row);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Deletes an item; an unknown id is not an error. */
|
|
46
|
+
async remove(id) {
|
|
47
|
+
await (await this.open()).runAsync(REMOVE, [id]);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The owner's pending items that are due, newest recorded first, then by position in the recording. */
|
|
51
|
+
async due(ownerKey, now, limit) {
|
|
52
|
+
const rows = await (await this.open()).getAllAsync(DUE, [ownerKey, PENDING, now, limit]);
|
|
53
|
+
return rows.map(_sqliteOutboxRows.itemOf);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Every item of the owner in any state, newest recorded first, without its entries. */
|
|
57
|
+
async summaries(ownerKey) {
|
|
58
|
+
const rows = await (await this.open()).getAllAsync(SUMMARIES, [ownerKey]);
|
|
59
|
+
return rows.map(_sqliteOutboxRows.summaryOf);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** How many of the owner's items are in `state`. */
|
|
63
|
+
async count(ownerKey, state) {
|
|
64
|
+
const row = await (await this.open()).getFirstAsync(COUNT, [ownerKey, state]);
|
|
65
|
+
return row?.total ?? 0;
|
|
66
|
+
}
|
|
67
|
+
open() {
|
|
68
|
+
this.database ??= this.connect().catch(error => {
|
|
69
|
+
this.database = null;
|
|
70
|
+
throw error;
|
|
71
|
+
});
|
|
72
|
+
return this.database;
|
|
73
|
+
}
|
|
74
|
+
async connect() {
|
|
75
|
+
const open = this.options.open ?? _sqliteDatabase.openExpoSqlite;
|
|
76
|
+
const database = await open(this.options.name ?? DEFAULT_DATABASE_NAME);
|
|
77
|
+
await (0, _sqliteOutboxSchema.migrateOutboxSchema)(database, this.options.logger);
|
|
78
|
+
return database;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.SqliteOutboxStore = SqliteOutboxStore;
|
|
82
|
+
//# sourceMappingURL=sqlite-outbox-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_sqliteDatabase","require","_sqliteOutboxRows","_sqliteOutboxSchema","DEFAULT_DATABASE_NAME","PENDING","PUT","ITEM_COLUMN_LIST","ITEM_PLACEHOLDERS","GET","REMOVE","DUE","SUMMARIES","SUMMARY_COLUMN_LIST","COUNT","SqliteOutboxStore","database","constructor","options","put","item","open","runAsync","bindValuesOf","get","id","row","getFirstAsync","itemOf","remove","due","ownerKey","now","limit","rows","getAllAsync","map","summaries","summaryOf","count","state","total","connect","catch","error","openExpoSqlite","name","migrateOutboxSchema","logger","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/sqlite-outbox-store.ts"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAUA,IAAAE,mBAAA,GAAAF,OAAA;AAEA;;AAaA,MAAMG,qBAAqB,GAAG,gBAAgB;AAC9C,MAAMC,OAAoB,GAAG,SAAS;AAEtC,MAAMC,GAAG,GAAG,wCAAwCC,kCAAgB,aAAaC,mCAAiB,GAAG;AACrG,MAAMC,GAAG,GAAG,UAAUF,kCAAgB,iCAAiC;AACvE,MAAMG,MAAM,GAAG,uCAAuC;AAEtD,MAAMC,GAAG,GAAG,UAAUJ,kCAAgB;AACtC;AACA;AACA,UAAU;AAEV,MAAMK,SAAS,GAAG,UAAUC,qCAAmB,kEAAkE;AACjH,MAAMC,KAAK,GAAG,8EAA8E;;AAE5F;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,CAAwB;EACrCC,QAAQ,GAAmC,IAAI;EAEhDC,WAAWA,CAAkBC,OAA4B,GAAG,CAAC,CAAC,EAAE;IAAA,KAAnCA,OAA4B,GAA5BA,OAA4B;EAAQ;;EAExE;EACA,MAAaC,GAAGA,CAACC,IAAgB,EAAiB;IAChD,MAAM,CAAC,MAAM,IAA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iB,QAAQ,EAAES,KAAK,CAAC,CAAC;IAEhG,OAAOd,GAAG,EAAEe,KAAK,IAAI,CAAC;EACxB;EAEQpB,IAAIA,CAAA,EAA4B;IACtC,IAAI,CAACL,QAAQ,KAAK,IAAI,CAAC0B,OAAO,CAAC,CAAC,CAACC,KAAK,CAAEC,KAAc,IAAK;MACzD,IAAI,CAAC5B,QAAQ,GAAG,IAAI;MACpB,MAAM4B,KAAK;IACb,CAAC,CAAC;IAEF,OAAO,IAAI,CAAC5B,QAAQ;EACtB;EAEA,MAAc0B,OAAOA,CAAA,EAA4B;IAC/C,MAAMrB,IAAI,GAAG,IAAI,CAACH,OAAO,CAACG,IAAI,IAAIwB,8BAAc;IAChD,MAAM7B,QAAQ,GAAG,MAAMK,IAAI,CAAC,IAAI,CAACH,OAAO,CAAC4B,IAAI,IAAI1C,qBAAqB,CAAC;IAEvE,MAAM,IAAA2C,uCAAmB,EAAC/B,QAAQ,EAAE,IAAI,CAACE,OAAO,CAAC8B,MAAM,CAAC;IAExD,OAAOhC,QAAQ;EACjB;AACF;AAACiC,OAAA,CAAAlC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -12,6 +12,7 @@ const reviveDevice = raw => ({
|
|
|
12
12
|
...raw,
|
|
13
13
|
autoSync: raw.autoSync ?? true,
|
|
14
14
|
keepInBackground: raw.keepInBackground ?? false,
|
|
15
|
+
record: raw.record ?? true,
|
|
15
16
|
secret: raw.secret ?? null,
|
|
16
17
|
pairedAt: dateOf(raw.pairedAt) ?? new Date(0),
|
|
17
18
|
lastConnectedAt: dateOf(raw.lastConnectedAt),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_KEY","dateOf","value","Date","reviveDevice","raw","autoSync","keepInBackground","secret","pairedAt","lastConnectedAt","lastSyncedAt","lastReadingAt","battery","at","identity","parseDevices","text","parsed","JSON","parse","Array","isArray","map","storagePairedDevices","storage","key","writes","Promise","resolve","load","getItem","change","update","write","then","setItem","stringify","catch","undefined","save","device","devices","filter","address","remove","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/storage-paired-devices.ts"],"mappings":";;;;;;AAKA,MAAMA,WAAW,GAAG,4CAA4C;AAEhE,MAAMC,MAAM,GAAIC,KAAc,IAAmB,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAAG,IAAIC,IAAI,CAACD,KAAK,CAAC,GAAG,IAAK;;AAEjI;AACA,MAAME,YAAY,GAAIC,GAAiB,KAAoB;EACzD,GAAGA,GAAG;EACNC,QAAQ,EAAED,GAAG,CAACC,QAAQ,IAAI,IAAI;EAC9BC,gBAAgB,EAAEF,GAAG,CAACE,gBAAgB,IAAI,KAAK;EAC/CC,MAAM,EAAEH,GAAG,CAACG,MAAM,IAAI,IAAI;EAC1BC,QAAQ,
|
|
1
|
+
{"version":3,"names":["DEFAULT_KEY","dateOf","value","Date","reviveDevice","raw","autoSync","keepInBackground","record","secret","pairedAt","lastConnectedAt","lastSyncedAt","lastReadingAt","battery","at","identity","parseDevices","text","parsed","JSON","parse","Array","isArray","map","storagePairedDevices","storage","key","writes","Promise","resolve","load","getItem","change","update","write","then","setItem","stringify","catch","undefined","save","device","devices","filter","address","remove","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/storage-paired-devices.ts"],"mappings":";;;;;;AAKA,MAAMA,WAAW,GAAG,4CAA4C;AAEhE,MAAMC,MAAM,GAAIC,KAAc,IAAmB,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAAG,IAAIC,IAAI,CAACD,KAAK,CAAC,GAAG,IAAK;;AAEjI;AACA,MAAME,YAAY,GAAIC,GAAiB,KAAoB;EACzD,GAAGA,GAAG;EACNC,QAAQ,EAAED,GAAG,CAACC,QAAQ,IAAI,IAAI;EAC9BC,gBAAgB,EAAEF,GAAG,CAACE,gBAAgB,IAAI,KAAK;EAC/CC,MAAM,EAAE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AA,CAAA,KAAYd,YAAY,CAAC,MAAMS,OAAO,CAACM,OAAO,CAACL,GAAG,CAAC,CAAC;EAEjE,MAAMM,MAAM,GAAIC,MAAmD,IAAoB;IACrF,MAAMC,KAAK,GAAGP,MAAM,CAACQ,IAAI,CAAC,YAAYV,OAAO,CAACW,OAAO,CAACV,GAAG,EAAEP,IAAI,CAACkB,SAAS,CAACJ,MAAM,CAAC,MAAMH,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjGH,MAAM,GAAGO,KAAK,CAACI,KAAK,CAAC,MAAMC,SAAS,CAAC;IAErC,OAAOL,KAAK;EACd,CAAC;EAED,OAAO;IACLJ,IAAI;IACJU,IAAI,EAAGC,MAAM,IAAKT,MAAM,CAAEU,OAAO,IAAK,CAAC,GAAGA,OAAO,CAACC,MAAM,CAAC,CAAC;MAAEC;IAAQ,CAAC,KAAKA,OAAO,KAAKH,MAAM,CAACG,OAAO,CAAC,EAAEH,MAAM,CAAC,CAAC;IAC/GI,MAAM,EAAGD,OAAO,IAAKZ,MAAM,CAAEU,OAAO,IAAKA,OAAO,CAACC,MAAM,CAAEF,MAAM,IAAKA,MAAM,CAACG,OAAO,KAAKA,OAAO,CAAC;EACjG,CAAC;AACH,CAAC;AAACE,OAAA,CAAAtB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -36,11 +36,19 @@ const advertisementOf = device => ({
|
|
|
36
36
|
serviceData: new Map(),
|
|
37
37
|
rssi: null
|
|
38
38
|
});
|
|
39
|
+
|
|
40
|
+
/** A characteristic that refuses a write with response; a plain write goes to it without one, as the vendor apps do. */
|
|
41
|
+
const takesOnlyWritesWithoutResponse = ({
|
|
42
|
+
properties
|
|
43
|
+
}) => !properties.write && properties.writeWithoutResponse;
|
|
39
44
|
const gattLinkOf = (device, server) => {
|
|
40
45
|
const characteristic = async (service, uuid) => (await server.getPrimaryService(lower(service))).getCharacteristic(lower(uuid));
|
|
41
46
|
return {
|
|
42
47
|
read: async (service, uuid) => bytesOf(await (await characteristic(service, uuid)).readValue()),
|
|
43
|
-
write: async (service, uuid, bytes) =>
|
|
48
|
+
write: async (service, uuid, bytes) => {
|
|
49
|
+
const target = await characteristic(service, uuid);
|
|
50
|
+
await (takesOnlyWritesWithoutResponse(target) ? target.writeValueWithoutResponse(bytes) : target.writeValueWithResponse(bytes));
|
|
51
|
+
},
|
|
44
52
|
writeWithoutResponse: async (service, uuid, bytes) => (await characteristic(service, uuid)).writeValueWithoutResponse(bytes),
|
|
45
53
|
subscribe: async (service, uuid, onValue) => {
|
|
46
54
|
const target = await characteristic(service, uuid);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_advertisement","require","_errors","lower","uuid","toLowerCase","bytesOf","view","Uint8Array","buffer","slice","byteOffset","byteLength","requestOptions","chooser","optionalServices","filters","map","entry","services","acceptAllDevices","advertisementOf","device","transport","address","id","name","manufacturerData","Map","serviceData","rssi","gattLinkOf","server","characteristic","service","getPrimaryService","getCharacteristic","read","readValue","
|
|
1
|
+
{"version":3,"names":["_advertisement","require","_errors","lower","uuid","toLowerCase","bytesOf","view","Uint8Array","buffer","slice","byteOffset","byteLength","requestOptions","chooser","optionalServices","filters","map","entry","services","acceptAllDevices","advertisementOf","device","transport","address","id","name","manufacturerData","Map","serviceData","rssi","takesOnlyWritesWithoutResponse","properties","write","writeWithoutResponse","gattLinkOf","server","characteristic","service","getPrimaryService","getCharacteristic","read","readValue","bytes","target","writeValueWithoutResponse","writeValueWithResponse","subscribe","onValue","listener","value","addEventListener","startNotifications","removeEventListener","stopNotifications","catch","undefined","onDisconnect","close","disconnect","webBluetoothCentral","bluetooth","picked","deviceFor","get","getDevices","find","addressKey","watchState","onChange","getAvailability","then","available","scan","filter","onAdvertisement","onError","onEnd","requestDevice","set","error","asDeviceError","connect","gatt","DeviceError","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/web-bluetooth-central.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,G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AAO,MAAMR,SAAS,CAACR,mBAAmB,CAAC,qBAAqB,EAAEgB,QAAQ,CAAC;IAC7E,CAAC;IACDI,IAAI,EAAEA,CAACC,MAAM,EAAE;MAAEC,eAAe;MAAEC,OAAO;MAAEC;IAAM,CAAC,KAAK;MACrDhB,SAAS,EACLiB,aAAa,CAACjE,cAAc,CAAC6D,MAAM,CAAC,CAAC,CACtCH,IAAI,CAAEjD,MAAM,IAAK;QAChBwC,MAAM,CAACiB,GAAG,CAAC,IAAAZ,yBAAU,EAAC7C,MAAM,CAACG,EAAE,CAAC,EAAEH,MAAM,CAAC;QACzCqD,eAAe,CAACtD,eAAe,CAACC,MAAM,CAAC,CAAC;QACxCuD,KAAK,CAAC,CAAC;MACT,CAAC,CAAC,CACDtB,KAAK,CAAEyB,KAAwB,IAAMA,KAAK,CAACtD,IAAI,KAAK,eAAe,GAAGmD,KAAK,CAAC,CAAC,GAAGD,OAAO,CAAC,IAAAK,qBAAa,EAACD,KAAK,EAAE,YAAY,CAAC,CAAE,CAAC;MAEhI,OAAO,MAAMxB,SAAS;IACxB,CAAC;IACD0B,OAAO,EAAE,MAAO1D,OAAO,IAAK;MAC1B,MAAMF,MAAM,GAAG,MAAMyC,SAAS,CAACvC,OAAO,CAAC;MAEvC,IAAI,CAACF,MAAM,EAAE6D,IAAI,EAAE;QACjB,MAAM,IAAIC,mBAAW,CAAC,gBAAgB,EAAE,8CAA8C,CAAC;MACzF;MAEA,OAAOjD,UAAU,CAACb,MAAM,EAAE,MAAMA,MAAM,CAAC6D,IAAI,CAACD,OAAO,CAAC,CAAC,CAAC;IACxD;EACF,CAAC;AACH,CAAC;AAACG,OAAA,CAAAzB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -43,7 +43,7 @@ class Bluetooth {
|
|
|
43
43
|
this.keepAlive = new _keepAliveHolder.KeepAliveHolder(options.keepAlive ?? _ports.noKeepAlive, this.logger);
|
|
44
44
|
this.catalog = new _catalog.Catalog(options.models);
|
|
45
45
|
this.protocols = new Map(options.protocols.map(protocol => [protocol.id, protocol]));
|
|
46
|
-
this.log = new _readingLog.ReadingLog(options.sink, this.logger, this.now);
|
|
46
|
+
this.log = new _readingLog.ReadingLog(options.sink, this.logger, this.now, options.outbox);
|
|
47
47
|
this.registry = new _pairedRegistry.PairedRegistry(record => this.createDevice(record), options.store, this.log, this.logger);
|
|
48
48
|
this.autoSync = options.autoSync === false ? undefined : this.createAutoSync();
|
|
49
49
|
this.stopFollowing = this.registry.subscribe(() => {
|
|
@@ -168,11 +168,17 @@ class Bluetooth {
|
|
|
168
168
|
createDevice(record, advertisement) {
|
|
169
169
|
const model = this.catalog.model(record.modelId);
|
|
170
170
|
const protocol = model && this.protocols.get(model.protocol);
|
|
171
|
+
const {
|
|
172
|
+
central,
|
|
173
|
+
store,
|
|
174
|
+
sink
|
|
175
|
+
} = this.options;
|
|
171
176
|
const deps = model && protocol && {
|
|
172
177
|
model,
|
|
173
178
|
protocol,
|
|
174
|
-
central
|
|
175
|
-
store
|
|
179
|
+
central,
|
|
180
|
+
store,
|
|
181
|
+
sink,
|
|
176
182
|
now: this.now,
|
|
177
183
|
logger: this.logger
|
|
178
184
|
};
|