@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.
Files changed (261) hide show
  1. package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js +58 -5
  2. package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
  3. package/lib/commonjs/modules/next/bluetooth/adapters/ble-plx-central.js +45 -24
  4. package/lib/commonjs/modules/next/bluetooth/adapters/ble-plx-central.js.map +1 -1
  5. package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js +25 -0
  6. package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
  7. package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js +62 -0
  8. package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
  9. package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js +42 -0
  10. package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
  11. package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js +97 -96
  12. package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
  13. package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js +33 -0
  14. package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
  15. package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js +38 -0
  16. package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
  17. package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js +101 -0
  18. package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
  19. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js +24 -0
  20. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
  21. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +65 -0
  22. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
  23. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +53 -0
  24. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
  25. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js +82 -0
  26. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
  27. package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
  28. package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
  29. package/lib/commonjs/modules/next/bluetooth/adapters/web-bluetooth-central.js +9 -1
  30. package/lib/commonjs/modules/next/bluetooth/adapters/web-bluetooth-central.js.map +1 -1
  31. package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js +9 -3
  32. package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js.map +1 -1
  33. package/lib/commonjs/modules/next/bluetooth/core/device-deps.js +6 -0
  34. package/lib/commonjs/modules/next/bluetooth/core/device-deps.js.map +1 -0
  35. package/lib/commonjs/modules/next/bluetooth/core/device-link.js +2 -1
  36. package/lib/commonjs/modules/next/bluetooth/core/device-link.js.map +1 -1
  37. package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js +3 -1
  38. package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
  39. package/lib/commonjs/modules/next/bluetooth/core/device.js +19 -6
  40. package/lib/commonjs/modules/next/bluetooth/core/device.js.map +1 -1
  41. package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js +54 -0
  42. package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js.map +1 -0
  43. package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js +45 -0
  44. package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
  45. package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js +17 -0
  46. package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
  47. package/lib/commonjs/modules/next/bluetooth/core/paired-device.js +1 -0
  48. package/lib/commonjs/modules/next/bluetooth/core/paired-device.js.map +1 -1
  49. package/lib/commonjs/modules/next/bluetooth/core/ports.js.map +1 -1
  50. package/lib/commonjs/modules/next/bluetooth/core/reading-log.js +89 -7
  51. package/lib/commonjs/modules/next/bluetooth/core/reading-log.js.map +1 -1
  52. package/lib/commonjs/modules/next/bluetooth/core/series-slots.js +94 -0
  53. package/lib/commonjs/modules/next/bluetooth/core/series-slots.js.map +1 -0
  54. package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js +219 -0
  55. package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
  56. package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js +110 -0
  57. package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
  58. package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js +19 -11
  59. package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js.map +1 -1
  60. package/lib/commonjs/modules/next/bluetooth/index.js +9 -1
  61. package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
  62. package/lib/commonjs/modules/next/bluetooth/shared.js +14 -0
  63. package/lib/commonjs/modules/next/bluetooth/shared.js.map +1 -1
  64. package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
  65. package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
  66. package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js +59 -6
  67. package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
  68. package/lib/module/modules/next/bluetooth/adapters/ble-plx-central.js +45 -24
  69. package/lib/module/modules/next/bluetooth/adapters/ble-plx-central.js.map +1 -1
  70. package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js +22 -0
  71. package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
  72. package/lib/module/modules/next/bluetooth/adapters/live-supersession.js +59 -0
  73. package/lib/module/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
  74. package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js +38 -0
  75. package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
  76. package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js +76 -75
  77. package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
  78. package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js +27 -0
  79. package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
  80. package/lib/module/modules/next/bluetooth/adapters/reading-values.js +33 -0
  81. package/lib/module/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
  82. package/lib/module/modules/next/bluetooth/adapters/series-saving.js +94 -0
  83. package/lib/module/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
  84. package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js +20 -0
  85. package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
  86. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +59 -0
  87. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
  88. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +49 -0
  89. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
  90. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js +79 -0
  91. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
  92. package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
  93. package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
  94. package/lib/module/modules/next/bluetooth/adapters/web-bluetooth-central.js +9 -1
  95. package/lib/module/modules/next/bluetooth/adapters/web-bluetooth-central.js.map +1 -1
  96. package/lib/module/modules/next/bluetooth/core/bluetooth.js +9 -3
  97. package/lib/module/modules/next/bluetooth/core/bluetooth.js.map +1 -1
  98. package/lib/module/modules/next/bluetooth/core/device-deps.js +4 -0
  99. package/lib/module/modules/next/bluetooth/core/device-deps.js.map +1 -0
  100. package/lib/module/modules/next/bluetooth/core/device-link.js +2 -1
  101. package/lib/module/modules/next/bluetooth/core/device-link.js.map +1 -1
  102. package/lib/module/modules/next/bluetooth/core/device-snapshot.js +3 -1
  103. package/lib/module/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
  104. package/lib/module/modules/next/bluetooth/core/device.js +19 -6
  105. package/lib/module/modules/next/bluetooth/core/device.js.map +1 -1
  106. package/lib/module/modules/next/bluetooth/core/live-ledger.js +50 -0
  107. package/lib/module/modules/next/bluetooth/core/live-ledger.js.map +1 -0
  108. package/lib/module/modules/next/bluetooth/core/measuring-watch.js +41 -0
  109. package/lib/module/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
  110. package/lib/module/modules/next/bluetooth/core/outbox-watch.js +14 -0
  111. package/lib/module/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
  112. package/lib/module/modules/next/bluetooth/core/paired-device.js +1 -0
  113. package/lib/module/modules/next/bluetooth/core/paired-device.js.map +1 -1
  114. package/lib/module/modules/next/bluetooth/core/ports.js.map +1 -1
  115. package/lib/module/modules/next/bluetooth/core/reading-log.js +89 -7
  116. package/lib/module/modules/next/bluetooth/core/reading-log.js.map +1 -1
  117. package/lib/module/modules/next/bluetooth/core/series-slots.js +90 -0
  118. package/lib/module/modules/next/bluetooth/core/series-slots.js.map +1 -0
  119. package/lib/module/modules/next/bluetooth/core/stream-recorder.js +215 -0
  120. package/lib/module/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
  121. package/lib/module/modules/next/bluetooth/core/waveform-segments.js +106 -0
  122. package/lib/module/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
  123. package/lib/module/modules/next/bluetooth/create-bluetooth.js +19 -11
  124. package/lib/module/modules/next/bluetooth/create-bluetooth.js.map +1 -1
  125. package/lib/module/modules/next/bluetooth/index.js +1 -0
  126. package/lib/module/modules/next/bluetooth/index.js.map +1 -1
  127. package/lib/module/modules/next/bluetooth/shared.js +2 -0
  128. package/lib/module/modules/next/bluetooth/shared.js.map +1 -1
  129. package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
  130. package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
  131. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
  132. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ble-plx-central.d.ts.map +1 -1
  134. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
  135. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
  136. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
  137. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
  138. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
  139. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
  140. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
  141. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
  143. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
  144. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
  145. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
  147. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
  149. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
  151. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
  153. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
  155. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/web-bluetooth-central.d.ts +4 -0
  158. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/web-bluetooth-central.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
  160. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
  161. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
  163. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
  165. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
  166. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts +6 -13
  167. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
  168. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
  169. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
  171. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
  173. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
  175. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
  176. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts +3 -2
  177. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
  179. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts +16 -1
  181. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
  182. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
  183. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
  185. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
  187. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
  189. package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
  190. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +4 -1
  191. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
  192. package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts +5 -1
  193. package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts.map +1 -1
  194. package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
  195. package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
  196. package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
  197. package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
  198. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ble-plx-central.d.ts.map +1 -1
  199. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
  200. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
  201. package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
  202. package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
  203. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
  204. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
  205. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
  206. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
  207. package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
  208. package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
  209. package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
  210. package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
  211. package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
  212. package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
  213. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
  214. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
  215. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
  216. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
  217. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
  218. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
  219. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
  220. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
  221. package/lib/typescript/module/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
  222. package/lib/typescript/module/src/modules/next/bluetooth/adapters/web-bluetooth-central.d.ts +4 -0
  223. package/lib/typescript/module/src/modules/next/bluetooth/adapters/web-bluetooth-central.d.ts.map +1 -1
  224. package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
  225. package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
  226. package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
  227. package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
  228. package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
  229. package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
  230. package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
  231. package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts +6 -13
  232. package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
  233. package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
  234. package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
  235. package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
  236. package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
  237. package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
  238. package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
  239. package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
  240. package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
  241. package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts +3 -2
  242. package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
  243. package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
  244. package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
  245. package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts +16 -1
  246. package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
  247. package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
  248. package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
  249. package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
  250. package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
  251. package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
  252. package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
  253. package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
  254. package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
  255. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +4 -1
  256. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
  257. package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts +5 -1
  258. package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts.map +1 -1
  259. package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
  260. package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
  261. package/package.json +7 -3
@@ -0,0 +1,215 @@
1
+ "use strict";
2
+
3
+ import { DeviceError } from "./errors.js";
4
+ import { LiveLedger } from "./live-ledger.js";
5
+ import { RECORDED_METRICS, SlotSeries } from "./series-slots.js";
6
+ import { ChannelSegment } from "./waveform-segments.js";
7
+ const MS_PER_SECOND = 1_000;
8
+ const SAVE_OPEN_EVERY_MS = 60_000;
9
+
10
+ /** The device being recorded. */
11
+
12
+ /**
13
+ * Records what one device streams live and saves it through the sink: numbers as series of one-second slots, waveforms
14
+ * as segments of five minutes at the waveform's own sample rate. It does the same for every device.
15
+ */
16
+ class StreamRecorder {
17
+ open = new Map();
18
+ segments = new Map();
19
+ ledger = new LiveLedger();
20
+ replacing = new Map();
21
+ unsupported = new Set();
22
+ saving = Promise.resolve();
23
+ streaming = false;
24
+ constructor(device, sink, deps) {
25
+ this.device = device;
26
+ this.sink = sink;
27
+ this.deps = deps;
28
+ this.origin = {
29
+ modelId: deps.model.id,
30
+ protocolId: deps.protocol.id,
31
+ address: device.address,
32
+ recordId: null
33
+ };
34
+ }
35
+
36
+ /** Records from the device's events: live numbers and samples, and the end of the stream. */
37
+ follow(events) {
38
+ events.add(event => this.observe(event));
39
+ }
40
+
41
+ /** Takes one device event: numbers and samples while recording is on, and the end of the stream. */
42
+ observe(event) {
43
+ if (event.kind === "state") {
44
+ this.followStream(event.snapshot.live);
45
+ } else if (event.kind === "live" && this.device.snapshot().record) {
46
+ this.recordNumbers(event.values);
47
+ } else if (event.kind === "waveform" && this.device.snapshot().record) {
48
+ this.recordWaveform(event.waveform);
49
+ }
50
+ }
51
+
52
+ /** Marks the live recordings a stored record replaces, which the sink removes once it has saved the record. */
53
+ supersede(recordId, record) {
54
+ const spans = this.ledger.inside(record);
55
+ if (spans.length === 0) {
56
+ return record;
57
+ }
58
+ this.replacing.set(recordId, spans);
59
+ return {
60
+ ...record,
61
+ supersedes: spans
62
+ };
63
+ }
64
+
65
+ /** The record was saved, so the recordings it replaced are gone for good. */
66
+ acknowledged(recordId) {
67
+ this.ledger.remove(this.replacing.get(recordId) ?? []);
68
+ this.replacing.delete(recordId);
69
+ }
70
+
71
+ /** Saves everything still open, and resolves once every save has finished. */
72
+ close() {
73
+ this.stopTimer();
74
+ [...this.open.keys()].forEach(metric => this.finish(metric));
75
+ this.segments.forEach(segment => segment.flush().forEach(reading => this.saveSettled(reading)));
76
+ this.segments.clear();
77
+ return this.saving;
78
+ }
79
+ followStream(streaming) {
80
+ if (this.streaming && !streaming) {
81
+ void this.close();
82
+ }
83
+ this.streaming = streaming;
84
+ }
85
+ recordNumbers({
86
+ values,
87
+ at
88
+ }) {
89
+ Object.entries(values).forEach(([metric, quantity]) => {
90
+ const type = RECORDED_METRICS[metric];
91
+ if (quantity && type && Number.isFinite(quantity.value) && !this.unsupported.has(metric)) {
92
+ const takenAt = at.getTime();
93
+ this.seriesFor({
94
+ metric,
95
+ type,
96
+ unit: quantity.unit
97
+ }, takenAt).put(quantity.value, takenAt);
98
+ }
99
+ });
100
+ }
101
+ seriesFor(kind, at) {
102
+ const current = this.open.get(kind.metric);
103
+ if (current?.takes(kind.unit, at)) {
104
+ return current;
105
+ }
106
+ if (current) {
107
+ this.finish(kind.metric);
108
+ }
109
+ const series = new SlotSeries(kind, at);
110
+ this.open.set(kind.metric, series);
111
+ this.timer ??= setInterval(() => this.saveOpenSeries(), SAVE_OPEN_EVERY_MS);
112
+ return series;
113
+ }
114
+ recordWaveform(waveform) {
115
+ if (this.unsupported.has(waveform.metric) || !(waveform.sampleRateHz > 0)) {
116
+ return;
117
+ }
118
+ const arrivedAt = this.deps.now().getTime();
119
+ waveform.channels.forEach((channel, index) => {
120
+ const samples = waveform.samples[index];
121
+ const firstAt = waveform.firstSampleAt?.getTime() ?? arrivedAt - (samples?.length ?? 0) / waveform.sampleRateHz * MS_PER_SECOND;
122
+ if (samples?.length) {
123
+ this.segmentFor(waveform, channel).add(samples, firstAt).forEach(reading => this.saveSettled(reading));
124
+ }
125
+ });
126
+ }
127
+ segmentFor(waveform, channel) {
128
+ const {
129
+ metric,
130
+ sampleRateHz,
131
+ unit,
132
+ scale
133
+ } = waveform;
134
+ const key = [metric, channel, sampleRateHz, unit, scale].join("|");
135
+ const segment = this.segments.get(key) ?? new ChannelSegment({
136
+ metric,
137
+ channel,
138
+ sampleRateHz,
139
+ unit,
140
+ scale
141
+ }, this.origin);
142
+ this.segments.set(key, segment);
143
+ return segment;
144
+ }
145
+
146
+ /** The 60-second save: an open series that grew goes out again under its own name, so the outbox keeps one copy. */
147
+ saveOpenSeries() {
148
+ const now = this.deps.now().getTime();
149
+ [...this.open.entries()].forEach(([metric, series]) => {
150
+ if (series.isQuiet(now)) {
151
+ this.finish(metric);
152
+ } else if (series.unsaved) {
153
+ this.enqueue(series.reading(this.origin), () => undefined);
154
+ series.markSaved();
155
+ }
156
+ });
157
+ if (this.open.size === 0) {
158
+ this.stopTimer();
159
+ }
160
+ }
161
+ finish(metric) {
162
+ const series = this.open.get(metric);
163
+ this.open.delete(metric);
164
+ if (series) {
165
+ this.saveSettled(series.reading(this.origin));
166
+ }
167
+ }
168
+ saveSettled(reading) {
169
+ this.enqueue(reading, ({
170
+ live
171
+ }) => {
172
+ if (live) {
173
+ this.ledger.add(live);
174
+ }
175
+ });
176
+ }
177
+
178
+ /** Saves one at a time, in the order they were made. */
179
+ enqueue(reading, onSaved) {
180
+ this.saving = this.saving.then(async () => {
181
+ if (reading.live && this.unsupported.has(reading.live.metric)) {
182
+ return;
183
+ }
184
+ try {
185
+ await this.sink.save(reading, this.device.snapshot());
186
+ onSaved(reading);
187
+ } catch (error) {
188
+ this.failed(reading, error);
189
+ }
190
+ });
191
+ }
192
+ failed(reading, error) {
193
+ const metric = reading.live?.metric ?? null;
194
+ const protocol = this.origin.protocolId;
195
+ if (error instanceof DeviceError && error.code === "unsupported" && reading.live) {
196
+ this.unsupported.add(reading.live.metric);
197
+ this.deps.logger.warn("bluetooth.stream.unsupported", {
198
+ protocol,
199
+ metric
200
+ });
201
+ } else {
202
+ this.deps.logger.error("bluetooth.stream.save-failed", {
203
+ protocol,
204
+ metric,
205
+ code: error instanceof DeviceError ? error.code : null
206
+ });
207
+ }
208
+ }
209
+ stopTimer() {
210
+ clearInterval(this.timer);
211
+ this.timer = undefined;
212
+ }
213
+ }
214
+ export { StreamRecorder };
215
+ //# sourceMappingURL=stream-recorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DeviceError","LiveLedger","RECORDED_METRICS","SlotSeries","ChannelSegment","MS_PER_SECOND","SAVE_OPEN_EVERY_MS","StreamRecorder","open","Map","segments","ledger","replacing","unsupported","Set","saving","Promise","resolve","streaming","constructor","device","sink","deps","origin","modelId","model","id","protocolId","protocol","address","recordId","follow","events","add","event","observe","kind","followStream","snapshot","live","record","recordNumbers","values","recordWaveform","waveform","supersede","spans","inside","length","set","supersedes","acknowledged","remove","get","delete","close","stopTimer","keys","forEach","metric","finish","segment","flush","reading","saveSettled","clear","at","Object","entries","quantity","type","Number","isFinite","value","has","takenAt","getTime","seriesFor","unit","put","current","takes","series","timer","setInterval","saveOpenSeries","sampleRateHz","arrivedAt","now","channels","channel","index","samples","firstAt","firstSampleAt","segmentFor","scale","key","join","isQuiet","unsaved","enqueue","undefined","markSaved","size","onSaved","then","save","error","failed","code","logger","warn","clearInterval"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/stream-recorder.ts"],"mappings":";;AAEA,SAASA,WAAW,QAAQ,aAAU;AAEtC,SAASC,UAAU,QAAQ,kBAAe;AAI1C,SAASC,gBAAgB,EAAcC,UAAU,QAAQ,mBAAgB;AACzE,SAASC,cAAc,QAAQ,wBAAqB;AAEpD,MAAMC,aAAa,GAAG,KAAK;AAC3B,MAAMC,kBAAkB,GAAG,MAAM;;AAEjC;;AAYA;AACA;AACA;AACA;AACA,MAAMC,cAAc,CAAC;EACFC,IAAI,GAAG,IAAIC,GAAG,CAAyB,CAAC;EACxCC,QAAQ,GAAG,IAAID,GAAG,CAAyB,CAAC;EAC5CE,MAAM,GAAG,IAAIV,UAAU,CAAC,CAAC;EACzBW,SAAS,GAAG,IAAIH,GAAG,CAA8B,CAAC;EAClDI,WAAW,GAAG,IAAIC,GAAG,CAAqB,CAAC;EACpDC,MAAM,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAEzCC,SAAS,GAAG,KAAK;EAGlBC,WAAWA,CACCC,MAAsB,EACtBC,IAAiB,EACjBC,IAAkB,EACnC;IAAA,KAHiBF,MAAsB,GAAtBA,MAAsB;IAAA,KACtBC,IAAiB,GAAjBA,IAAiB;IAAA,KACjBC,IAAkB,GAAlBA,IAAkB;IAEnC,IAAI,CAACC,MAAM,GAAG;MAAEC,OAAO,EAAEF,IAAI,CAACG,KAAK,CAACC,EAAE;MAAEC,UAAU,EAAEL,IAAI,CAACM,QAAQ,CAACF,EAAE;MAAEG,OAAO,EAAET,MAAM,CAACS,OAAO;MAAEC,QAAQ,EAAE;IAAK,CAAC;EACjH;;EAEA;EACOC,MAAMA,CAACC,MAA8B,EAAQ;IAClDA,MAAM,CAACC,GAAG,CAAEC,KAAK,IA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MAAM,CAACkB,QAAQ,CAAC,CAAC,CAAC;QACrDmE,OAAO,CAAC1C,OAAO,CAAC;MAClB,CAAC,CAAC,OAAO6C,KAAK,EAAE;QACd,IAAI,CAACC,MAAM,CAAC9C,OAAO,EAAE6C,KAAK,CAAC;MAC7B;IACF,CAAC,CAAC;EACJ;EAEQC,MAAMA,CAAC9C,OAAgB,EAAE6C,KAAc,EAAQ;IACrD,MAAMjD,MAAM,GAAGI,OAAO,CAACxB,IAAI,EAAEoB,MAAM,IAAI,IAAI;IAC3C,MAAM/B,QAAQ,GAAG,IAAI,CAACL,MAAM,CAACI,UAAU;IAEvC,IAAIiF,KAAK,YAAY5G,WAAW,IAAI4G,KAAK,CAACE,IAAI,KAAK,aAAa,IAAI/C,OAAO,CAACxB,IAAI,EAAE;MAChF,IAAI,CAAC1B,WAAW,CAACoB,GAAG,CAAC8B,OAAO,CAACxB,IAAI,CAACoB,MAAM,CAAC;MACzC,IAAI,CAACrC,IAAI,CAACyF,MAAM,CAACC,IAAI,CAAC,8BAA8B,EAAE;QAAEpF,QAAQ;QAAE+B;MAAO,CAAC,CAAC;IAC7E,CAAC,MAAM;MACL,IAAI,CAACrC,IAAI,CAACyF,MAAM,CAACH,KAAK,CAAC,8BAA8B,EAAE;QAAEhF,QAAQ;QAAE+B,MAAM;QAAEmD,IAAI,EAAEF,KAAK,YAAY5G,WAAW,GAAG4G,KAAK,CAACE,IAAI,GAAG;MAAK,CAAC,CAAC;IACtI;EACF;EAEQtD,SAASA,CAAA,EAAS;IACxByD,aAAa,CAAC,IAAI,CAAC9B,KAAK,CAAC;IACzB,IAAI,CAACA,KAAK,GAAGmB,SAAS;EACxB;AACF;AAEA,SAAS/F,cAAc","ignoreList":[]}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ const MS_PER_SECOND = 1_000;
4
+ const SEGMENT_MS = 5 * 60_000;
5
+
6
+ /** Samples that arrive this much later than the ones before them leave a hole, so they start a new segment. */
7
+ const MAX_GAP_MS = 5_000;
8
+ const MEASUREMENT_OF_WAVEFORM = {
9
+ ecg_waveform: "ecg",
10
+ pleth_waveform: "oxygen_saturation"
11
+ };
12
+
13
+ /** What stays the same while one channel of a waveform streams. */
14
+
15
+ /** One channel's samples, collected until they fill five minutes, a gap opens, or the stream ends. */
16
+ class ChannelSegment {
17
+ chunks = [];
18
+ count = 0;
19
+ from = 0;
20
+ constructor(shape, origin) {
21
+ this.shape = shape;
22
+ this.origin = origin;
23
+ }
24
+
25
+ /** Adds samples whose first was taken at `at`; returns the segments they completed. */
26
+ add(samples, at) {
27
+ const completed = this.count > 0 && at - this.endsAt() > MAX_GAP_MS ? this.flush() : [];
28
+ let rest = samples;
29
+ let restAt = at;
30
+ while (rest.length > 0) {
31
+ const part = rest.subarray(0, this.capacity() - this.count);
32
+ this.append(part, restAt);
33
+ rest = rest.subarray(part.length);
34
+ restAt += this.durationOf(part.length);
35
+ completed.push(...(this.count >= this.capacity() ? this.flush() : []));
36
+ }
37
+ return completed;
38
+ }
39
+
40
+ /** Hands over what is collected as one reading, none when it is empty. */
41
+ flush() {
42
+ if (this.count === 0) {
43
+ return [];
44
+ }
45
+ const samples = new Int16Array(this.count);
46
+ let filled = 0;
47
+ this.chunks.forEach(chunk => {
48
+ samples.set(chunk, filled);
49
+ filled += chunk.length;
50
+ });
51
+ const reading = this.readingOf(samples);
52
+ this.chunks = [];
53
+ this.count = 0;
54
+ return [reading];
55
+ }
56
+ append(part, at) {
57
+ if (this.count === 0) {
58
+ this.from = at;
59
+ }
60
+ this.chunks.push(part.slice());
61
+ this.count += part.length;
62
+ }
63
+ readingOf(samples) {
64
+ const from = new Date(this.from);
65
+ const {
66
+ metric,
67
+ channel,
68
+ sampleRateHz,
69
+ unit,
70
+ scale
71
+ } = this.shape;
72
+ return {
73
+ type: MEASUREMENT_OF_WAVEFORM[metric],
74
+ takenAt: from,
75
+ values: {},
76
+ deviceFlags: [],
77
+ waveform: {
78
+ metric,
79
+ sampleRateHz,
80
+ unit,
81
+ scale,
82
+ channels: [channel],
83
+ samples: [samples],
84
+ firstSampleAt: from
85
+ },
86
+ live: {
87
+ metric,
88
+ channel,
89
+ from,
90
+ to: new Date(this.endsAt())
91
+ },
92
+ source: this.origin
93
+ };
94
+ }
95
+ capacity() {
96
+ return Math.round(this.shape.sampleRateHz * SEGMENT_MS / MS_PER_SECOND);
97
+ }
98
+ endsAt() {
99
+ return this.from + this.durationOf(this.count);
100
+ }
101
+ durationOf(samples) {
102
+ return samples / this.shape.sampleRateHz * MS_PER_SECOND;
103
+ }
104
+ }
105
+ export { ChannelSegment };
106
+ //# sourceMappingURL=waveform-segments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MS_PER_SECOND","SEGMENT_MS","MAX_GAP_MS","MEASUREMENT_OF_WAVEFORM","ecg_waveform","pleth_waveform","ChannelSegment","chunks","count","from","constructor","shape","origin","add","samples","at","completed","endsAt","flush","rest","restAt","length","part","subarray","capacity","append","durationOf","push","Int16Array","filled","forEach","chunk","set","reading","readingOf","slice","Date","metric","channel","sampleRateHz","unit","scale","type","takenAt","values","deviceFlags","waveform","channels","firstSampleAt","live","to","source","Math","round"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/waveform-segments.ts"],"mappings":";;AAGA,MAAMA,aAAa,GAAG,KAAK;AAC3B,MAAMC,UAAU,GAAG,CAAC,GAAG,MAAM;;AAE7B;AACA,MAAMC,UAAU,GAAG,KAAK;AAExB,MAAMC,uBAAoE,GAAG;EAC3EC,YAAY,EAAE,KAAK;EACnBC,cAAc,EAAE;AAClB,CAAC;;AAED;;AAGA;AACA,MAAMC,cAAc,CAAC;EACXC,MAAM,GAAiB,EAAE;EACzBC,KAAK,GAAG,CAAC;EACTC,IAAI,GAAG,CAAC;EAETC,WAAWA,CAAkBC,KAAmB,EAAmBC,MAAqB,EAAE;IAAA,KAA7DD,KAAmB,GAAnBA,KAAmB;IAAA,KAAmBC,MAAqB,GAArBA,MAAqB;EAAG;;EAElG;EACOC,GAAG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,IAAI,CAAC1C,KAAK,CAAC4B,YAAY,GAAGtC,UAAU,GAAID,aAAa,CAAC;EAC3E;EAEQiB,MAAMA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACR,IAAI,GAAG,IAAI,CAACiB,UAAU,CAAC,IAAI,CAAClB,KAAK,CAAC;EAChD;EAEQkB,UAAUA,CAACZ,OAAe,EAAU;IAC1C,OAAQA,OAAO,GAAG,IAAI,CAACH,KAAK,CAAC4B,YAAY,GAAIvC,aAAa;EAC5D;AACF;AAEA,SAASM,cAAc","ignoreList":[]}
@@ -4,6 +4,7 @@ import { BleManager } from "react-native-ble-plx";
4
4
  import { androidForegroundService } from "./adapters/android-foreground-service.js";
5
5
  import { blePlxCentral } from "./adapters/ble-plx-central.js";
6
6
  import { osBluetoothPermissions } from "./adapters/os-permissions.js";
7
+ import { ovokOutboxWatch } from "./adapters/ovok-outbox-watch.js";
7
8
  import { ovokReadingSink } from "./adapters/ovok-reading-sink.js";
8
9
  import { reactNativeLifecycle } from "./adapters/react-native-lifecycle.js";
9
10
  import { storagePairedDevices } from "./adapters/storage-paired-devices.js";
@@ -17,16 +18,23 @@ const createBluetooth = ({
17
18
  ovok,
18
19
  storage,
19
20
  ...overrides
20
- }) => new Bluetooth({
21
- central: blePlxCentral(new BleManager()),
22
- store: storagePairedDevices(storage),
23
- sink: ovokReadingSink(ovok),
24
- permissions: osBluetoothPermissions(),
25
- models: BUILT_IN_MODELS,
26
- protocols: BUILT_IN_PROTOCOLS,
27
- lifecycle: reactNativeLifecycle(),
28
- keepAlive: androidForegroundService(),
29
- ...overrides
30
- });
21
+ }) => {
22
+ const outbox = ovokOutboxWatch(ovok.outbox, overrides.logger);
23
+ return new Bluetooth({
24
+ central: blePlxCentral(new BleManager()),
25
+ store: storagePairedDevices(storage),
26
+ sink: ovokReadingSink(ovok),
27
+ permissions: osBluetoothPermissions(),
28
+ models: BUILT_IN_MODELS,
29
+ protocols: BUILT_IN_PROTOCOLS,
30
+ lifecycle: reactNativeLifecycle(),
31
+ keepAlive: androidForegroundService({}, {
32
+ outbox,
33
+ logger: overrides.logger
34
+ }),
35
+ outbox,
36
+ ...overrides
37
+ });
38
+ };
31
39
  export { createBluetooth };
32
40
  //# sourceMappingURL=create-bluetooth.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BleManager","androidForegroundService","blePlxCentral","osBluetoothPermissions","ovokReadingSink","reactNativeLifecycle","storagePairedDevices","Bluetooth","BUILT_IN_MODELS","BUILT_IN_PROTOCOLS","createBluetooth","ovok","storage","overrides","central","store","sink","permissions","models","protocols","lifecycle","keepAlive"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/create-bluetooth.ts"],"mappings":";;AACA,SAASA,UAAU,QAAQ,sBAAsB;AAEjD,SAASC,wBAAwB,QAAQ,0CAAuC;AAChF,SAASC,aAAa,QAAQ,+BAA4B;AAC1D,SAASC,sBAAsB,QAAQ,8BAA2B;AAClE,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,SAAS,QAA0B,qBAAkB;AAC9D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,wBAAqB;;AAEzE;;AAUA;AACA,MAAMC,eAAe,GAAGA,CAAC;EAAEC,IAAI;EAAEC,OAAO;EAAE,GAAGC;AAAkC,CAAC,KAC9E,IAAIN,SAAS,CAAC;EACZO,OAAO,EAAEZ,aAAa,CAAC,IAAIF,UAAU,CAAC,CAAC,CAAC;EACxCe,KAAK,EAAET,oBAAoB,CAACM,OAAO,CAAC;EACpCI,IAAI,EAAEZ,eAAe,CAACO,IAAI,CAAC;EAC3BM,WAAW,EAAEd,sBAAsB,CAAC,CAAC;EACrCe,MAAM,EAAEV,eAAe;EACvBW,SAAS,EAAEV,kBAAkB;EAC7BW,SAAS,EAAEf,oBAAoB,CAAC,CAAC;EACjCgB,SAAS,EAAEpB,wBAAwB,CAAC,CAAC;EACrC,GAAGY;AACL,CAAC,CAAC;AAEJ,SAASH,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["BleManager","androidForegroundService","blePlxCentral","osBluetoothPermissions","ovokOutboxWatch","ovokReadingSink","reactNativeLifecycle","storagePairedDevices","Bluetooth","BUILT_IN_MODELS","BUILT_IN_PROTOCOLS","createBluetooth","ovok","storage","overrides","outbox","logger","central","store","sink","permissions","models","protocols","lifecycle","keepAlive"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/create-bluetooth.ts"],"mappings":";;AACA,SAASA,UAAU,QAAQ,sBAAsB;AAEjD,SAASC,wBAAwB,QAAQ,0CAAuC;AAChF,SAASC,aAAa,QAAQ,+BAA4B;AAC1D,SAASC,sBAAsB,QAAQ,8BAA2B;AAClE,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAAyBC,eAAe,QAAQ,iCAA8B;AAC9E,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,SAAS,QAA0B,qBAAkB;AAC9D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,wBAAqB;;AAEzE;;AAUA;AACA,MAAMC,eAAe,GAAGA,CAAC;EAAEC,IAAI;EAAEC,OAAO;EAAE,GAAGC;AAAkC,CAAC,KAAgB;EAC9F,MAAMC,MAAM,GAAGX,eAAe,CAACQ,IAAI,CAACG,MAAM,EAAED,SAAS,CAACE,MAAM,CAAC;EAE7D,OAAO,IAAIR,SAAS,CAAC;IACnBS,OAAO,EAAEf,aAAa,CAAC,IAAIF,UAAU,CAAC,CAAC,CAAC;IACxCkB,KAAK,EAAEX,oBAAoB,CAACM,OAAO,CAAC;IACpCM,IAAI,EAAEd,eAAe,CAACO,IAAI,CAAC;IAC3BQ,WAAW,EAAEjB,sBAAsB,CAAC,CAAC;IACrCkB,MAAM,EAAEZ,eAAe;IACvBa,SAAS,EAAEZ,kBAAkB;IAC7Ba,SAAS,EAAEjB,oBAAoB,CAAC,CAAC;IACjCkB,SAAS,EAAEvB,wBAAwB,CAAC,CAAC,CAAC,EAAE;MAAEc,MAAM;MAAEC,MAAM,EAAEF,SAAS,CAACE;IAAO,CAAC,CAAC;IAC7ED,MAAM;IACN,GAAGD;EACL,CAAC,CAAC;AACJ,CAAC;AAED,SAASH,eAAe","ignoreList":[]}
@@ -12,4 +12,5 @@ export { blePlxCentral } from "./adapters/ble-plx-central.js";
12
12
  export { osBluetoothPermissions } from "./adapters/os-permissions.js";
13
13
  export { reactNativeLifecycle } from "./adapters/react-native-lifecycle.js";
14
14
  export { createBluetooth } from "./create-bluetooth.js";
15
+ export { SqliteOutboxStore } from "./adapters/sqlite-outbox-store.js";
15
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["androidForegroundService","blePlxCentral","osBluetoothPermissions","reactNativeLifecycle","createBluetooth"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,aAAU;AACxB,SAASA,wBAAwB,QAAQ,0CAAuC;AAEhF,SAASC,aAAa,QAAQ,+BAA4B;AAC1D,SAASC,sBAAsB,QAAQ,8BAA2B;AAClE,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,eAAe,QAAQ,uBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["androidForegroundService","blePlxCentral","osBluetoothPermissions","reactNativeLifecycle","createBluetooth","SqliteOutboxStore"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,aAAU;AACxB,SAASA,wBAAwB,QAAQ,0CAAuC;AAEhF,SAASC,aAAa,QAAQ,+BAA4B;AAC1D,SAASC,sBAAsB,QAAQ,8BAA2B;AAClE,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,eAAe,QAAQ,uBAAoB;AAEpD,SAASC,iBAAiB,QAAQ,mCAAgC","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ export { ovokOutboxWatch } from "./adapters/ovok-outbox-watch.js";
3
4
  export { ovokReadingSink } from "./adapters/ovok-reading-sink.js";
4
5
  export { storagePairedDevices } from "./adapters/storage-paired-devices.js";
5
6
  export { Bluetooth } from "./core/bluetooth.js";
@@ -12,4 +13,5 @@ export { BluetoothProvider, useBluetooth } from "./react/context.js";
12
13
  export { useBluetoothAdapter, useCatalog, usePairedDevices, useReadings } from "./react/hooks.js";
13
14
  export { useDevice, useLiveValues, useWaveform } from "./react/use-device.js";
14
15
  export { useDiscovery } from "./react/use-discovery.js";
16
+ export { useOutbox } from "@ovok/core/next/react";
15
17
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ovokReadingSink","storagePairedDevices","Bluetooth","Catalog","Device","Discovery","DeviceError","BUILT_IN_MODELS","BUILT_IN_PROTOCOLS","BluetoothProvider","useBluetooth","useBluetoothAdapter","useCatalog","usePairedDevices","useReadings","useDevice","useLiveValues","useWaveform","useDiscovery"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/shared.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,SAAS,QAAQ,qBAAkB;AAE5C,SAASC,OAAO,QAAQ,mBAAgB;AAExC,SAASC,MAAM,QAAQ,kBAAe;AAEtC,SAASC,SAAS,QAAQ,qBAAkB;AAE5C,SAASC,WAAW,QAAQ,kBAAe;AAwB3C,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,wBAAqB;AACzE,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,oBAAiB;AAEjE,SAASC,mBAAmB,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,WAAW,QAAQ,kBAAe;AAC9F,SAASC,SAAS,EAAEC,aAAa,EAAEC,WAAW,QAAQ,uBAAoB;AAE1E,SAASC,YAAY,QAAQ,0BAAuB","ignoreList":[]}
1
+ {"version":3,"names":["ovokOutboxWatch","ovokReadingSink","storagePairedDevices","Bluetooth","Catalog","Device","Discovery","DeviceError","BUILT_IN_MODELS","BUILT_IN_PROTOCOLS","BluetoothProvider","useBluetooth","useBluetoothAdapter","useCatalog","usePairedDevices","useReadings","useDevice","useLiveValues","useWaveform","useDiscovery","useOutbox"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/shared.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,SAAS,QAAQ,qBAAkB;AAE5C,SAASC,OAAO,QAAQ,mBAAgB;AAExC,SAASC,MAAM,QAAQ,kBAAe;AAEtC,SAASC,SAAS,QAAQ,qBAAkB;AAE5C,SAASC,WAAW,QAAQ,kBAAe;AA0B3C,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,wBAAqB;AACzE,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,oBAAiB;AAEjE,SAASC,mBAAmB,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,WAAW,QAAQ,kBAAe;AAC9F,SAASC,SAAS,EAAEC,aAAa,EAAEC,WAAW,QAAQ,uBAAoB;AAE1E,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAASC,SAAS,QAAQ,uBAAuB","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ import { ovokOutboxWatch } from "../adapters/ovok-outbox-watch.js";
3
4
  import { ovokReadingSink } from "../adapters/ovok-reading-sink.js";
4
5
  import { storagePairedDevices } from "../adapters/storage-paired-devices.js";
5
6
  import { webBluetoothCentral } from "../adapters/web-bluetooth-central.js";
@@ -25,6 +26,7 @@ const createWebBluetooth = ({
25
26
  central: webBluetoothCentral(browserBluetooth()),
26
27
  store: storagePairedDevices(storage),
27
28
  sink: ovokReadingSink(ovok),
29
+ outbox: ovokOutboxWatch(ovok.outbox, overrides.logger),
28
30
  permissions: chooserPermissions,
29
31
  models: BUILT_IN_MODELS,
30
32
  protocols: BUILT_IN_PROTOCOLS,
@@ -1 +1 @@
1
- {"version":3,"names":["ovokReadingSink","storagePairedDevices","webBluetoothCentral","Bluetooth","BUILT_IN_MODELS","BUILT_IN_PROTOCOLS","chooserPermissions","check","request","openSettings","undefined","browserBluetooth","globalThis","navigator","bluetooth","createWebBluetooth","ovok","storage","overrides","central","store","sink","permissions","models","protocols","autoSync"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/web/create-web-bluetooth.ts"],"mappings":";;AAEA,SAASA,eAAe,QAAQ,kCAA+B;AAC/D,SAASC,oBAAoB,QAAQ,uCAAoC;AACzE,SAAuBC,mBAAmB,QAAQ,sCAAmC;AACrF,SAASC,SAAS,QAA0B,sBAAmB;AAE/D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,yBAAsB;;AAE1E;;AAUA;AACA,MAAMC,kBAAwC,GAAG;EAC/CC,KAAK,EAAE,MAAAA,CAAA,KAAY,SAAS;EAC5BC,OAAO,EAAE,MAAAA,CAAA,KAAY,SAAS;EAC9BC,YAAY,EAAE,MAAAA,CAAA,KAAYC;AAC5B,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAAA,KACtBC,UAAU,CAAkDC,SAAS,EAAEC,SAAS;;AAEnF;AACA,MAAMC,kBAAkB,GAAGA,CAAC;EAAEC,IAAI;EAAEC,OAAO;EAAE,GAAGC;AAAqC,CAAC,KACpF,IAAIf,SAAS,CAAC;EACZgB,OAAO,EAAEjB,mBAAmB,CAACS,gBAAgB,CAAC,CAAC,CAAC;EAChDS,KAAK,EAAEnB,oBAAoB,CAACgB,OAAO,CAAC;EACpCI,IAAI,EAAErB,eAAe,CAACgB,IAAI,CAAC;EAC3BM,WAAW,EAAEhB,kBAAkB;EAC/BiB,MAAM,EAAEnB,eAAe;EACvBoB,SAAS,EAAEnB,kBAAkB;EAC7BoB,QAAQ,EAAE,KAAK;EACf,GAAGP;AACL,CAAC,CAAC;AAEJ,SAASH,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["ovokOutboxWatch","ovokReadingSink","storagePairedDevices","webBluetoothCentral","Bluetooth","BUILT_IN_MODELS","BUILT_IN_PROTOCOLS","chooserPermissions","check","request","openSettings","undefined","browserBluetooth","globalThis","navigator","bluetooth","createWebBluetooth","ovok","storage","overrides","central","store","sink","outbox","logger","permissions","models","protocols","autoSync"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/web/create-web-bluetooth.ts"],"mappings":";;AAEA,SAASA,eAAe,QAAQ,kCAA+B;AAC/D,SAAyBC,eAAe,QAAQ,kCAA+B;AAC/E,SAASC,oBAAoB,QAAQ,uCAAoC;AACzE,SAAuBC,mBAAmB,QAAQ,sCAAmC;AACrF,SAASC,SAAS,QAA0B,sBAAmB;AAE/D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,yBAAsB;;AAE1E;;AAUA;AACA,MAAMC,kBAAwC,GAAG;EAC/CC,KAAK,EAAE,MAAAA,CAAA,KAAY,SAAS;EAC5BC,OAAO,EAAE,MAAAA,CAAA,KAAY,SAAS;EAC9BC,YAAY,EAAE,MAAAA,CAAA,KAAYC;AAC5B,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAAA,KACtBC,UAAU,CAAkDC,SAAS,EAAEC,SAAS;;AAEnF;AACA,MAAMC,kBAAkB,GAAGA,CAAC;EAAEC,IAAI;EAAEC,OAAO;EAAE,GAAGC;AAAqC,CAAC,KACpF,IAAIf,SAAS,CAAC;EACZgB,OAAO,EAAEjB,mBAAmB,CAACS,gBAAgB,CAAC,CAAC,CAAC;EAChDS,KAAK,EAAEnB,oBAAoB,CAACgB,OAAO,CAAC;EACpCI,IAAI,EAAErB,eAAe,CAACgB,IAAI,CAAC;EAC3BM,MAAM,EAAEvB,eAAe,CAACiB,IAAI,CAACM,MAAM,EAAEJ,SAAS,CAACK,MAAM,CAAC;EACtDC,WAAW,EAAElB,kBAAkB;EAC/BmB,MAAM,EAAErB,eAAe;EACvBsB,SAAS,EAAErB,kBAAkB;EAC7BsB,QAAQ,EAAE,KAAK;EACf,GAAGT;AACL,CAAC,CAAC;AAEJ,SAASH,kBAAkB","ignoreList":[]}
@@ -1,13 +1,26 @@
1
- import { KeepAlive } from "../core/ports";
1
+ import { OutboxWatch } from "../core/outbox-watch";
2
+ import { KeepAlive, Logger } from "../core/ports";
2
3
  /** The notification Android shows while the service runs. */
3
4
  type ForegroundServiceText = {
4
5
  /** The notification's title. */
5
6
  notificationTitle?: string;
6
7
  /** The notification's body. */
7
8
  notificationBody?: string;
9
+ /** The body while readings wait to upload, given how many; "3 readings waiting to upload" by default. */
10
+ unsentBody?: (unsent: number) => string;
8
11
  };
9
- /** Android's connected-device foreground service, which keeps the process alive for background sync; nothing elsewhere. */
10
- declare const androidForegroundService: (text?: ForegroundServiceText) => KeepAlive;
12
+ /** What the service watches and reports besides its text. */
13
+ type ForegroundServiceOptions = {
14
+ /** The offline queue whose waiting readings the notification counts; with none, it never shows a count. */
15
+ outbox?: OutboxWatch;
16
+ /** Where structured events go; silent by default. */
17
+ logger?: Logger;
18
+ };
19
+ /**
20
+ * Android's connected-device foreground service, which keeps the process alive for background sync; nothing elsewhere.
21
+ * With an `outbox`, its notification says how many readings wait to upload.
22
+ */
23
+ declare const androidForegroundService: (text?: ForegroundServiceText, { outbox, logger }?: ForegroundServiceOptions) => KeepAlive;
11
24
  export { androidForegroundService };
12
- export type { ForegroundServiceText };
25
+ export type { ForegroundServiceOptions, ForegroundServiceText };
13
26
  //# sourceMappingURL=android-foreground-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"android-foreground-service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/android-foreground-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAe,MAAM,eAAe,CAAC;AAEvD,6DAA6D;AAC7D,KAAK,qBAAqB,GAAG;IAE3B,gCAAgC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAiBF,2HAA2H;AAC3H,QAAA,MAAM,wBAAwB,GAAI,OAAM,qBAA0B,KAAG,SAMpD,CAAC;AAElB,OAAO,EAAE,wBAAwB,EAAE,CAAC;AACpC,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"android-foreground-service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/android-foreground-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,EAA6B,MAAM,eAAe,CAAC;AAE7E,6DAA6D;AAC7D,KAAK,qBAAqB,GAAG;IAE3B,gCAAgC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,yGAAyG;IACzG,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC,CAAC;AAEF,6DAA6D;AAC7D,KAAK,wBAAwB,GAAG;IAE9B,2GAA2G;IAC3G,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA+DF;;;GAGG;AACH,QAAA,MAAM,wBAAwB,GAC5B,OAAM,qBAA0B,EAChC,qBAAmD,wBAA6B,KAC/E,SAA2G,CAAC;AAE/G,OAAO,EAAE,wBAAwB,EAAE,CAAC;AACpC,YAAY,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ble-plx-central.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ble-plx-central.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAA8B,MAAM,sBAAsB,CAAC;AAMtG,OAAO,EAAgB,UAAU,EAAY,MAAM,eAAe,CAAC;AAkEnE,sEAAsE;AACtE,QAAA,MAAM,aAAa,GAAI,SAAS,UAAU,KAAG,UAwB3C,CAAC;AAEH,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"ble-plx-central.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ble-plx-central.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAA8B,MAAM,sBAAsB,CAAC;AAMtG,OAAO,EAAgB,UAAU,EAAY,MAAM,eAAe,CAAC;AA4FnE,sEAAsE;AACtE,QAAA,MAAM,aAAa,GAAI,SAAS,UAAU,KAAG,UAwB3C,CAAC;AAEH,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { EcgMeasurement } from "@ovok/core/next";
2
+ import { Reading } from "../core/reading";
3
+ /** One ECG recording per channel, each in millivolts at the waveform's sample rate; the heart rate goes with the first. */
4
+ declare const ecgMeasurements: (reading: Reading) => EcgMeasurement[];
5
+ export { ecgMeasurements };
6
+ //# sourceMappingURL=ecg-measurements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecg-measurements.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ecg-measurements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO1C,2HAA2H;AAC3H,QAAA,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,cAAc,EAWzD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Ovok } from "@ovok/core/next";
2
+ import { Reading } from "../core/reading";
3
+ /** What queues the deletions: the outbox, with the measurements API and the session that name what to delete. */
4
+ type SupersessionClient = Pick<Ovok, "measurements" | "outbox" | "session">;
5
+ /** Queues the deletion of the live recordings a stored record replaces, so the outbox holds them before it holds the record. */
6
+ declare const replaceLiveRecordings: (client: SupersessionClient, reading: Reading) => Promise<void>;
7
+ export { replaceLiveRecordings };
8
+ export type { SupersessionClient };
9
+ //# sourceMappingURL=live-supersession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-supersession.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/live-supersession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,IAAI,EAA6B,MAAM,iBAAiB,CAAC;AAItG,OAAO,EAAY,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAKpD,iHAAiH;AACjH,KAAK,kBAAkB,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAC;AA0B5E,gIAAgI;AAChI,QAAA,MAAM,qBAAqB,GAAU,QAAQ,kBAAkB,EAAE,SAAS,OAAO,KAAG,OAAO,CAAC,IAAI,CAM/F,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { OutboxResource } from "@ovok/core/next";
2
+ import { OutboxWatch } from "../core/outbox-watch";
3
+ import { Logger } from "../core/ports";
4
+ type WatchedOutbox = Pick<OutboxResource, "subscribe" | "items" | "recentlySent">;
5
+ /** Watches the signed-in account's Ovok outbox, so the reading log and the notification follow what it sends. */
6
+ declare const ovokOutboxWatch: (outbox: WatchedOutbox, logger?: Logger) => OutboxWatch;
7
+ export { ovokOutboxWatch };
8
+ //# sourceMappingURL=ovok-outbox-watch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ovok-outbox-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,cAAc,EAA+B,MAAM,iBAAiB,CAAC;AAEtG,OAAO,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAErD,KAAK,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC,CAAC;AAalF,iHAAiH;AACjH,QAAA,MAAM,eAAe,GAAI,QAAQ,aAAa,EAAE,SAAQ,MAAqB,KAAG,WAwB9E,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,6 +1,12 @@
1
- import { Ovok } from "@ovok/core/next";
2
1
  import { ReadingSink } from "../core/ports";
3
- /** Saves readings for the signed-in account through the Ovok measurements API, queueing them offline. */
4
- declare const ovokReadingSink: (client: Pick<Ovok, "measurements">) => ReadingSink;
2
+ import { SupersessionClient } from "./live-supersession";
3
+ /** What the sink saves with: the measurements API, the outbox that deletes, and the session that names the patient. */
4
+ type OvokSinkClient = SupersessionClient;
5
+ /**
6
+ * Saves readings for the signed-in account through the Ovok measurements API, queueing them offline. A reading with a
7
+ * series also saves it; a stored record then removes the live recordings it replaces, once it is saved.
8
+ */
9
+ declare const ovokReadingSink: (client: OvokSinkClient) => ReadingSink;
5
10
  export { ovokReadingSink };
11
+ export type { OvokSinkClient };
6
12
  //# sourceMappingURL=ovok-reading-sink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ovok-reading-sink.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-reading-sink.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,IAAI,EAIL,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA8K5C,yGAAyG;AACzG,QAAA,MAAM,eAAe,GAAI,QAAQ,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,KAAG,WAmB5D,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"ovok-reading-sink.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-reading-sink.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,OAAO,EAAyB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAwIhF,uHAAuH;AACvH,KAAK,cAAc,GAAG,kBAAkB,CAAC;AAuCzC;;;GAGG;AACH,QAAA,MAAM,eAAe,GAAI,QAAQ,cAAc,KAAG,WAqBhD,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { LiveSpan, Reading } from "../core/reading";
2
+ /** The name a live recording is saved under: the device, what it holds, and when it began. */
3
+ declare const liveSourceId: (address: string, { metric, channel, from }: LiveSpan) => string;
4
+ /** 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. */
5
+ declare const sourceIdOf: ({ live, source: { address, recordId } }: Reading) => string | undefined;
6
+ /** 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. */
7
+ declare const partSourceId: (sourceId: string | undefined, index: number) => string | undefined;
8
+ export { liveSourceId, partSourceId, sourceIdOf };
9
+ //# sourceMappingURL=reading-source-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reading-source-id.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/reading-source-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEpD,8FAA8F;AAC9F,QAAA,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,2BAA2B,QAAQ,KAAG,MAC6B,CAAC;AAE3G,kJAAkJ;AAClJ,QAAA,MAAM,UAAU,GAAI,yCAAyC,OAAO,KAAG,MAAM,GAAG,SAM/E,CAAC;AAEF,wIAAwI;AACxI,QAAA,MAAM,YAAY,GAAI,UAAU,MAAM,GAAG,SAAS,EAAE,OAAO,MAAM,KAAG,MAAM,GAAG,SACJ,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { MetricCode } from "../core/measurement-type";
2
+ import { Reading } from "../core/reading";
3
+ /** A device's UCUM unit to the unit Ovok stores the value in: mg/dL, kg, °C, mmHg, L, L/s, % or per minute. */
4
+ declare const TO_OVOK_UNIT: Record<string, (value: number) => number>;
5
+ declare const valueOf: (reading: Reading, metric: MetricCode) => number | undefined;
6
+ /** The value in Ovok's unit; `undefined` when the reading lacks it or uses a unit Ovok has no conversion for. */
7
+ declare const ovokValueOf: (reading: Reading, metric: MetricCode) => number | undefined;
8
+ export { ovokValueOf, TO_OVOK_UNIT, valueOf };
9
+ //# sourceMappingURL=reading-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reading-values.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/reading-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQ1C,+GAA+G;AAC/G,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAc3D,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,SAAS,OAAO,EAAE,QAAQ,UAAU,KAAG,MAAM,GAAG,SAA0C,CAAC;AAE5G,iHAAiH;AACjH,QAAA,MAAM,WAAW,GAAI,SAAS,OAAO,EAAE,QAAQ,UAAU,KAAG,MAAM,GAAG,SAIpE,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC"}