@ovok/native 1.17.0-dev.2215 → 1.17.0-dev.2222

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/ecg-measurements.js +25 -0
  4. package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
  5. package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js +62 -0
  6. package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
  7. package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js +42 -0
  8. package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
  9. package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js +97 -96
  10. package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
  11. package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js +33 -0
  12. package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
  13. package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js +38 -0
  14. package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
  15. package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js +101 -0
  16. package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
  17. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js +24 -0
  18. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
  19. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +65 -0
  20. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
  21. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +53 -0
  22. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
  23. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js +82 -0
  24. package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
  25. package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
  26. package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
  27. package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js +9 -3
  28. package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js.map +1 -1
  29. package/lib/commonjs/modules/next/bluetooth/core/device-deps.js +6 -0
  30. package/lib/commonjs/modules/next/bluetooth/core/device-deps.js.map +1 -0
  31. package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js +3 -1
  32. package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
  33. package/lib/commonjs/modules/next/bluetooth/core/device.js +19 -6
  34. package/lib/commonjs/modules/next/bluetooth/core/device.js.map +1 -1
  35. package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js +54 -0
  36. package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js.map +1 -0
  37. package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js +59 -0
  38. package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
  39. package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js +17 -0
  40. package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
  41. package/lib/commonjs/modules/next/bluetooth/core/paired-device.js +1 -0
  42. package/lib/commonjs/modules/next/bluetooth/core/paired-device.js.map +1 -1
  43. package/lib/commonjs/modules/next/bluetooth/core/ports.js.map +1 -1
  44. package/lib/commonjs/modules/next/bluetooth/core/reading-log.js +89 -7
  45. package/lib/commonjs/modules/next/bluetooth/core/reading-log.js.map +1 -1
  46. package/lib/commonjs/modules/next/bluetooth/core/series-slots.js +94 -0
  47. package/lib/commonjs/modules/next/bluetooth/core/series-slots.js.map +1 -0
  48. package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js +219 -0
  49. package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
  50. package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js +110 -0
  51. package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
  52. package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js +19 -11
  53. package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js.map +1 -1
  54. package/lib/commonjs/modules/next/bluetooth/families/viatom/bp2-real-time.js +6 -0
  55. package/lib/commonjs/modules/next/bluetooth/families/viatom/bp2-real-time.js.map +1 -1
  56. package/lib/commonjs/modules/next/bluetooth/families/viatom/recorder-real-time.js +12 -4
  57. package/lib/commonjs/modules/next/bluetooth/families/viatom/recorder-real-time.js.map +1 -1
  58. package/lib/commonjs/modules/next/bluetooth/shared.js +14 -0
  59. package/lib/commonjs/modules/next/bluetooth/shared.js.map +1 -1
  60. package/lib/commonjs/modules/next/bluetooth/sqlite/index.js +13 -0
  61. package/lib/commonjs/modules/next/bluetooth/sqlite/index.js.map +1 -0
  62. package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
  63. package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
  64. package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js +59 -6
  65. package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
  66. package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js +22 -0
  67. package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
  68. package/lib/module/modules/next/bluetooth/adapters/live-supersession.js +59 -0
  69. package/lib/module/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
  70. package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js +38 -0
  71. package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
  72. package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js +76 -75
  73. package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
  74. package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js +27 -0
  75. package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
  76. package/lib/module/modules/next/bluetooth/adapters/reading-values.js +33 -0
  77. package/lib/module/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
  78. package/lib/module/modules/next/bluetooth/adapters/series-saving.js +94 -0
  79. package/lib/module/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
  80. package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js +20 -0
  81. package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
  82. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +59 -0
  83. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
  84. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +49 -0
  85. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
  86. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js +79 -0
  87. package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
  88. package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
  89. package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
  90. package/lib/module/modules/next/bluetooth/core/bluetooth.js +9 -3
  91. package/lib/module/modules/next/bluetooth/core/bluetooth.js.map +1 -1
  92. package/lib/module/modules/next/bluetooth/core/device-deps.js +4 -0
  93. package/lib/module/modules/next/bluetooth/core/device-deps.js.map +1 -0
  94. package/lib/module/modules/next/bluetooth/core/device-snapshot.js +3 -1
  95. package/lib/module/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
  96. package/lib/module/modules/next/bluetooth/core/device.js +19 -6
  97. package/lib/module/modules/next/bluetooth/core/device.js.map +1 -1
  98. package/lib/module/modules/next/bluetooth/core/live-ledger.js +50 -0
  99. package/lib/module/modules/next/bluetooth/core/live-ledger.js.map +1 -0
  100. package/lib/module/modules/next/bluetooth/core/measuring-watch.js +55 -0
  101. package/lib/module/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
  102. package/lib/module/modules/next/bluetooth/core/outbox-watch.js +14 -0
  103. package/lib/module/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
  104. package/lib/module/modules/next/bluetooth/core/paired-device.js +1 -0
  105. package/lib/module/modules/next/bluetooth/core/paired-device.js.map +1 -1
  106. package/lib/module/modules/next/bluetooth/core/ports.js.map +1 -1
  107. package/lib/module/modules/next/bluetooth/core/reading-log.js +89 -7
  108. package/lib/module/modules/next/bluetooth/core/reading-log.js.map +1 -1
  109. package/lib/module/modules/next/bluetooth/core/series-slots.js +90 -0
  110. package/lib/module/modules/next/bluetooth/core/series-slots.js.map +1 -0
  111. package/lib/module/modules/next/bluetooth/core/stream-recorder.js +215 -0
  112. package/lib/module/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
  113. package/lib/module/modules/next/bluetooth/core/waveform-segments.js +106 -0
  114. package/lib/module/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
  115. package/lib/module/modules/next/bluetooth/create-bluetooth.js +19 -11
  116. package/lib/module/modules/next/bluetooth/create-bluetooth.js.map +1 -1
  117. package/lib/module/modules/next/bluetooth/families/viatom/bp2-real-time.js +6 -0
  118. package/lib/module/modules/next/bluetooth/families/viatom/bp2-real-time.js.map +1 -1
  119. package/lib/module/modules/next/bluetooth/families/viatom/recorder-real-time.js +12 -4
  120. package/lib/module/modules/next/bluetooth/families/viatom/recorder-real-time.js.map +1 -1
  121. package/lib/module/modules/next/bluetooth/shared.js +2 -0
  122. package/lib/module/modules/next/bluetooth/shared.js.map +1 -1
  123. package/lib/module/modules/next/bluetooth/sqlite/index.js +10 -0
  124. package/lib/module/modules/next/bluetooth/sqlite/index.js.map +1 -0
  125. package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
  126. package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
  127. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
  128. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
  130. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
  132. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
  134. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
  136. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
  137. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
  138. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
  140. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
  142. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
  144. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
  146. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
  148. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
  149. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
  150. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
  153. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
  156. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
  158. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts +6 -13
  160. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
  161. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
  162. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts +22 -0
  164. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
  166. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
  168. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts +3 -2
  170. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
  172. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts +18 -1
  174. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
  176. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
  178. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
  180. package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
  182. package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
  183. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/viatom/bp2-real-time.d.ts.map +1 -1
  184. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/viatom/recorder-real-time.d.ts +1 -1
  185. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/viatom/recorder-real-time.d.ts.map +1 -1
  186. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +1 -1
  187. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
  188. package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts +5 -1
  189. package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts.map +1 -1
  190. package/lib/typescript/commonjs/src/modules/next/bluetooth/sqlite/index.d.ts +10 -0
  191. package/lib/typescript/commonjs/src/modules/next/bluetooth/sqlite/index.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
  193. package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
  194. package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
  195. package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
  196. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
  197. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
  198. package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
  199. package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
  200. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
  201. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
  202. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
  203. package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
  204. package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
  205. package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
  206. package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
  207. package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
  208. package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
  209. package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
  210. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
  211. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
  212. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
  213. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
  214. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
  215. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
  216. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
  217. package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
  218. package/lib/typescript/module/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
  219. package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
  220. package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
  221. package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
  222. package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
  223. package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
  224. package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
  225. package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
  226. package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts +6 -13
  227. package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
  228. package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
  229. package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
  230. package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts +22 -0
  231. package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
  232. package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
  233. package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
  234. package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
  235. package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
  236. package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts +3 -2
  237. package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
  238. package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
  239. package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
  240. package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts +18 -1
  241. package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
  242. package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
  243. package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
  244. package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
  245. package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
  246. package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
  247. package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
  248. package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
  249. package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
  250. package/lib/typescript/module/src/modules/next/bluetooth/families/viatom/bp2-real-time.d.ts.map +1 -1
  251. package/lib/typescript/module/src/modules/next/bluetooth/families/viatom/recorder-real-time.d.ts +1 -1
  252. package/lib/typescript/module/src/modules/next/bluetooth/families/viatom/recorder-real-time.d.ts.map +1 -1
  253. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +1 -1
  254. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
  255. package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts +5 -1
  256. package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts.map +1 -1
  257. package/lib/typescript/module/src/modules/next/bluetooth/sqlite/index.d.ts +10 -0
  258. package/lib/typescript/module/src/modules/next/bluetooth/sqlite/index.d.ts.map +1 -0
  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,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"}
@@ -0,0 +1,28 @@
1
+ import { BuildObservationsParams, MeasurementTypeKey, Ovok, SaveObservationsResult, SeriesObservationParams } from "@ovok/core/next";
2
+ import { Reading, Series } from "../core/reading";
3
+ type MeasurementDevice = NonNullable<BuildObservationsParams["device"]>;
4
+ /** What saves and signs a series: the measurements API and the session. */
5
+ type SeriesClient = Pick<Ovok, "measurements" | "session">;
6
+ /** A reading that holds a series. */
7
+ type SeriesReading = Reading & {
8
+ series: Series;
9
+ };
10
+ /** Where Ovok keeps one metric's series: the measurement type and the property on it. */
11
+ type SeriesField = {
12
+ type: MeasurementTypeKey;
13
+ property: string;
14
+ };
15
+ declare const isSeriesReading: (reading: Reading) => reading is SeriesReading;
16
+ /** The field Ovok keeps a metric's series in; `undefined` for a metric it keeps none for. */
17
+ declare const seriesFieldOf: (metric: string) => SeriesField | undefined;
18
+ /** The id of the signed-in patient, which a series is saved for. */
19
+ declare const signedInPatientId: ({ session }: Pick<Ovok, "session">) => Promise<string>;
20
+ /** The observations that hold one metric's values, one per second or at the interval given. */
21
+ declare const seriesObservationsOf: (field: SeriesField, { start, intervalMs, values }: Pick<Series, "start" | "intervalMs" | "values">, rest: Pick<SeriesObservationParams, "patientId" | "sourceId"> & {
22
+ device?: MeasurementDevice;
23
+ }) => import("@medplum/fhirtypes").Observation[];
24
+ /** Saves a series, in Ovok's unit, under a stable id; saving a longer version of it writes over the earlier one. */
25
+ declare const saveSeries: (client: SeriesClient, reading: SeriesReading, device: MeasurementDevice) => Promise<SaveObservationsResult>;
26
+ export { isSeriesReading, saveSeries, seriesFieldOf, seriesObservationsOf, signedInPatientId };
27
+ export type { MeasurementDevice, SeriesClient };
28
+ //# sourceMappingURL=series-saving.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,IAAI,EAAE,sBAAsB,EAAsB,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAIzJ,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKlD,KAAK,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExE,2EAA2E;AAC3E,KAAK,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;AAE3D,qCAAqC;AACrC,KAAK,aAAa,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,yFAAyF;AACzF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAYlE,QAAA,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,aAA6C,CAAC;AAErG,6FAA6F;AAC7F,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,WAAW,GAAG,SAAgD,CAAC;AAEvG,oEAAoE;AACpE,QAAA,MAAM,iBAAiB,GAAU,aAAa,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAG,OAAO,CAAC,MAAM,CAUnF,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,oBAAoB,GACxB,OAAO,WAAW,EAClB,+BAA+B,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC,EAC9E,MAAM,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAE,+CAK5F,CAAC;AAEL,oHAAoH;AACpH,QAAA,MAAM,UAAU,GAAU,QAAQ,YAAY,EAAE,SAAS,aAAa,EAAE,QAAQ,iBAAiB,KAAG,OAAO,CAAC,sBAAsB,CAgBjI,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,CAAC;AAC/F,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ /** A value SQLite binds to a `?` placeholder. */
2
+ type SqliteBindValue = string | number | null;
3
+ /** The part of an `expo-sqlite` transaction the outbox store uses. */
4
+ interface SqliteTransaction {
5
+ /** Runs statements that take no parameters. */
6
+ execAsync(source: string): Promise<void>;
7
+ /** Runs one statement that writes. */
8
+ runAsync(source: string, params?: SqliteBindValue[]): Promise<unknown>;
9
+ /** Returns the first row a query finds, or `null`. */
10
+ getFirstAsync<Row>(source: string, params?: SqliteBindValue[]): Promise<Row | null>;
11
+ }
12
+ /** The part of an `expo-sqlite` database the outbox store uses. */
13
+ interface SqliteDatabase extends SqliteTransaction {
14
+ /** Returns every row a query finds. */
15
+ getAllAsync<Row>(source: string, params?: SqliteBindValue[]): Promise<Row[]>;
16
+ /** Runs `task` in one exclusive transaction: it commits when `task` resolves and rolls back when it throws. */
17
+ withExclusiveTransactionAsync(task: (transaction: SqliteTransaction) => Promise<void>): Promise<void>;
18
+ }
19
+ /** Opens the named database with `expo-sqlite`, which an app without the package never loads. */
20
+ declare const openExpoSqlite: (name: string) => Promise<SqliteDatabase>;
21
+ export { openExpoSqlite };
22
+ export type { SqliteBindValue, SqliteDatabase, SqliteTransaction };
23
+ //# sourceMappingURL=sqlite-database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-database.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-database.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAE9C,sEAAsE;AACtE,UAAU,iBAAiB;IAEzB,+CAA+C;IAC/C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvE,sDAAsD;IACtD,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;CACrF;AAED,mEAAmE;AACnE,UAAU,cAAe,SAAQ,iBAAiB;IAEhD,uCAAuC;IACvC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAE7E,+GAA+G;IAC/G,6BAA6B,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvG;AAYD,iGAAiG;AACjG,QAAA,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OAAO,CAAC,cAAc,CAA6C,CAAC;AAE3G,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { OutboxItem, OutboxItemSummary, OutboxKind, OutboxState } from "@ovok/core/next";
2
+ import { SqliteBindValue } from "./sqlite-database";
3
+ /** One row of `outbox_items`: a column per item field, the failure and the entries as JSON text. */
4
+ type OutboxRow = {
5
+ id: string;
6
+ owner_key: string;
7
+ kind: OutboxKind;
8
+ group_id: string | null;
9
+ seq: number | null;
10
+ state: OutboxState;
11
+ attempts: number;
12
+ next_attempt_at: number;
13
+ created_at: number;
14
+ recorded_at: number;
15
+ last_failure: string | null;
16
+ entries: string;
17
+ };
18
+ type SummaryRow = Omit<OutboxRow, "entries">;
19
+ declare const ITEM_COLUMN_LIST: string;
20
+ declare const ITEM_PLACEHOLDERS: string;
21
+ declare const SUMMARY_COLUMN_LIST: string;
22
+ /** The values of `item`, in the order of `ITEM_COLUMNS`. */
23
+ declare const bindValuesOf: (item: OutboxItem) => SqliteBindValue[];
24
+ /** A field that is `null` in the table is absent on the item. */
25
+ declare const summaryOf: (row: SummaryRow) => OutboxItemSummary;
26
+ declare const itemOf: (row: OutboxRow) => OutboxItem;
27
+ export { bindValuesOf, ITEM_COLUMN_LIST, ITEM_PLACEHOLDERS, itemOf, SUMMARY_COLUMN_LIST, summaryOf };
28
+ export type { OutboxRow, SummaryRow };
29
+ //# sourceMappingURL=sqlite-outbox-rows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-outbox-rows.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/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from "../core/ports";
2
+ import { SqliteDatabase } from "./sqlite-database";
3
+ /** Brings the database to the latest schema; every pending migration runs in one transaction, so a crash leaves none. */
4
+ declare const migrateOutboxSchema: (database: SqliteDatabase, logger?: Logger) => Promise<void>;
5
+ export { migrateOutboxSchema };
6
+ //# sourceMappingURL=sqlite-outbox-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-outbox-schema.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-outbox-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA8BnD,yHAAyH;AACzH,QAAA,MAAM,mBAAmB,GAAU,UAAU,cAAc,EAAE,SAAQ,MAAqB,KAAG,OAAO,CAAC,IAAI,CAkBxG,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { OutboxItem, OutboxItemSummary, OutboxState, OutboxStore } from "@ovok/core/next";
2
+ import { Logger } from "../core/ports";
3
+ import { SqliteDatabase } from "./sqlite-database";
4
+ /** How `SqliteOutboxStore` finds its database; every field has a default for a phone app. */
5
+ type SqliteOutboxOptions = {
6
+ /** The database file name; `ovok-outbox.db` by default. */
7
+ name?: string;
8
+ /** Opens the named database; `expo-sqlite`'s `openDatabaseAsync` by default, swapped in tests. */
9
+ open?: (name: string) => Promise<SqliteDatabase>;
10
+ /** Where structured events go; silent by default. */
11
+ logger?: Logger;
12
+ };
13
+ /**
14
+ * An `OutboxStore` on `expo-sqlite`, for phones: one row per item in `outbox_items`, the entries as one JSON text
15
+ * column, so listing and counting never read them. `expo-sqlite` is an optional peer dependency, loaded on first use.
16
+ */
17
+ declare class SqliteOutboxStore implements OutboxStore {
18
+ private readonly options;
19
+ private database;
20
+ constructor(options?: SqliteOutboxOptions);
21
+ /** Stores an item, replacing the one with the same id. */
22
+ put(item: OutboxItem): Promise<void>;
23
+ /** Returns an item, or `null` when there is none. */
24
+ get(id: string): Promise<OutboxItem | null>;
25
+ /** Deletes an item; an unknown id is not an error. */
26
+ remove(id: string): Promise<void>;
27
+ /** The owner's pending items that are due, newest recorded first, then by position in the recording. */
28
+ due(ownerKey: string, now: number, limit: number): Promise<OutboxItem[]>;
29
+ /** Every item of the owner in any state, newest recorded first, without its entries. */
30
+ summaries(ownerKey: string): Promise<OutboxItemSummary[]>;
31
+ /** How many of the owner's items are in `state`. */
32
+ count(ownerKey: string, state: OutboxState): Promise<number>;
33
+ private open;
34
+ private connect;
35
+ }
36
+ export { SqliteOutboxStore };
37
+ export type { SqliteOutboxOptions };
38
+ //# sourceMappingURL=sqlite-outbox-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-outbox-store.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-outbox-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAkB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAanE,6FAA6F;AAC7F,KAAK,mBAAmB,GAAG;IAEzB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,kGAAkG;IAClG,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAEjD,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAiBF;;;GAGG;AACH,cAAM,iBAAkB,YAAW,WAAW;IAGzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF3C,OAAO,CAAC,QAAQ,CAAwC;gBAEpB,OAAO,GAAE,mBAAwB;IAErE,0DAA0D;IAC7C,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,qDAAqD;IACxC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAMxD,sDAAsD;IACzC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,wGAAwG;IAC3F,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAMrF,wFAAwF;IAC3E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAMtE,oDAAoD;IACvC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAMzE,OAAO,CAAC,IAAI;YASE,OAAO;CAQtB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"storage-paired-devices.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/storage-paired-devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AA8BlD,mGAAmG;AACnG,QAAA,MAAM,oBAAoB,GAAI,SAAS,WAAW,EAAE,YAAiB,KAAG,iBAkBvE,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"storage-paired-devices.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/storage-paired-devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AA+BlD,mGAAmG;AACnG,QAAA,MAAM,oBAAoB,GAAI,SAAS,WAAW,EAAE,YAAiB,KAAG,iBAkBvE,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { DeviceModel } from "./catalog";
2
+ import { OutboxWatch } from "./outbox-watch";
2
3
  import { AdapterState, AppLifecycle, BleCentral, BluetoothPermission, BluetoothPermissions, KeepAlive, Logger, PairedDeviceStore, ReadingSink } from "./ports";
3
4
  import { DeviceProtocol } from "./protocol";
4
5
  /** The ports and data `Bluetooth` runs on; each platform entry point fills them in. */
@@ -25,6 +26,8 @@ type BluetoothOptions = {
25
26
  lifecycle?: AppLifecycle;
26
27
  /** Keeps the process alive while devices are connected; nothing extra, by default. */
27
28
  keepAlive?: KeepAlive;
29
+ /** The offline queue behind the sink; the reading log follows it, so a queued reading becomes saved. Nothing waits, by default. */
30
+ outbox?: OutboxWatch;
28
31
  /** Whether paired devices sync by themselves when seen; turn it off where a scan needs the user, as in a browser. */
29
32
  autoSync?: boolean;
30
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"bluetooth-options.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/bluetooth-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,uFAAuF;AACvF,KAAK,gBAAgB,GAAG;IAEtB,gCAAgC;IAChC,OAAO,EAAE,UAAU,CAAC;IAEpB,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,CAAC;IAEzB,gCAAgC;IAChC,IAAI,EAAE,WAAW,CAAC;IAElB,iCAAiC;IACjC,WAAW,EAAE,oBAAoB,CAAC;IAElC,yDAAyD;IACzD,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAE/B,gGAAgG;IAChG,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IAErC,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAEjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gEAAgE;IAChE,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB,sFAAsF;IACtF,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,qHAAqH;IACrH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,mEAAmE;AACnE,KAAK,eAAe,GAAG;IAErB,mCAAmC;IACnC,KAAK,EAAE,YAAY,CAAC;IAEpB,kCAAkC;IAClC,UAAU,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"bluetooth-options.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/bluetooth-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,uFAAuF;AACvF,KAAK,gBAAgB,GAAG;IAEtB,gCAAgC;IAChC,OAAO,EAAE,UAAU,CAAC;IAEpB,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,CAAC;IAEzB,gCAAgC;IAChC,IAAI,EAAE,WAAW,CAAC;IAElB,iCAAiC;IACjC,WAAW,EAAE,oBAAoB,CAAC;IAElC,yDAAyD;IACzD,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAE/B,gGAAgG;IAChG,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IAErC,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAEjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gEAAgE;IAChE,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB,sFAAsF;IACtF,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,mIAAmI;IACnI,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,qHAAqH;IACrH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,mEAAmE;AACnE,KAAK,eAAe,GAAG;IAErB,mCAAmC;IACnC,KAAK,EAAE,YAAY,CAAC;IAEpB,kCAAkC;IAClC,UAAU,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"bluetooth.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/bluetooth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAQ/C,OAAO,EAAmC,mBAAmB,EAAiD,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IAEF,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,UAAU,CAIhB;IAEF,OAAO,CAAC,UAAU;IAIlB,qGAAqG;IACrG,OAAO,CAAC,OAAO,CAQb;IAEF,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,YAAY;CAKrB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { DeviceModel } from "./catalog";
2
+ import { BleCentral, Logger, PairedDeviceStore, ReadingSink } from "./ports";
3
+ import { DeviceProtocol } from "./protocol";
4
+ /** What a `Device` runs on. */
5
+ type DeviceDeps = {
6
+ model: DeviceModel;
7
+ protocol: DeviceProtocol;
8
+ central: BleCentral;
9
+ store: PairedDeviceStore;
10
+ /** Where the device's live recording is saved; a device without one only shows what it streams. */
11
+ sink?: ReadingSink;
12
+ now: () => Date;
13
+ logger: Logger;
14
+ };
15
+ export type { DeviceDeps };
16
+ //# sourceMappingURL=device-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-deps.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,+BAA+B;AAC/B,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,iBAAiB,CAAC;IAEzB,mGAAmG;IACnG,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -30,6 +30,8 @@ type DeviceSnapshot = {
30
30
  activity: Exclude<DeviceAction, "live"> | null;
31
31
  /** Whether a live stream is running. */
32
32
  live: boolean;
33
+ /** Since when live frames have kept arriving, so the device is measuring; `null` once they stop for a few seconds. */
34
+ measuringSince: Date | null;
33
35
  /** How far a running sync has got; `null` when none is running. */
34
36
  progress: {
35
37
  /** Records fetched so far. */
@@ -63,6 +65,8 @@ type DeviceSnapshot = {
63
65
  autoSync: boolean;
64
66
  /** Whether its link stays open while the app is in the background. */
65
67
  keepInBackground: boolean;
68
+ /** Whether what it streams live is recorded and saved, as well as shown. */
69
+ record: boolean;
66
70
  /** The device's own run status, raw; `null` until its protocol reports one. */
67
71
  deviceStatus: {
68
72
  /** The status code exactly as the device sent it. */
@@ -122,6 +126,7 @@ declare const storedFields: (record: PairedDevice, model: DeviceModel) => {
122
126
  identity: DeviceIdentity | null;
123
127
  autoSync: boolean;
124
128
  keepInBackground: boolean;
129
+ record: boolean;
125
130
  };
126
131
  declare const initialSnapshot: (record: PairedDevice, model: DeviceModel, protocol: DeviceProtocol) => DeviceSnapshot;
127
132
  /** The display events one live frame becomes: its numbers, then its samples. */
@@ -1 +1 @@
1
- {"version":3,"file":"device-snapshot.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAA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D;AAC5D,QAAA,MAAM,YAAY,GAAI,QAAQ,YAAY,EAAE,OAAO,WAAW;;;;;;;;;;;CAW5D,CAAC;AAEH,QAAA,MAAM,eAAe,GAAI,QAAQ,YAAY,EAAE,OAAO,WAAW,EAAE,UAAU,cAAc,KAAG,cAgB5F,CAAC;AAEH,gFAAgF;AAChF,QAAA,MAAM,YAAY,GAAI,sBAAsB,SAAS,KAAG,WAAW,EAGlE,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC"}
@@ -1,17 +1,8 @@
1
1
  import { Advertisement } from "./advertisement";
2
- import { DeviceModel } from "./catalog";
2
+ import { DeviceDeps } from "./device-deps";
3
3
  import { DeviceEvent, DeviceSnapshot, SyncSummary } from "./device-snapshot";
4
4
  import { DeviceSettings, PairedDevice } from "./paired-device";
5
- import { BleCentral, Logger, PairedDeviceStore } from "./ports";
6
- import { DeviceProtocol, RecordInfo } from "./protocol";
7
- type DeviceDeps = {
8
- model: DeviceModel;
9
- protocol: DeviceProtocol;
10
- central: BleCentral;
11
- store: PairedDeviceStore;
12
- now: () => Date;
13
- logger: Logger;
14
- };
5
+ import { RecordInfo } from "./protocol";
15
6
  /** One paired device: it owns the link, queues every action on it, and reconnects when a press needs it. */
16
7
  declare class Device {
17
8
  private record;
@@ -22,6 +13,8 @@ declare class Device {
22
13
  private readonly link;
23
14
  private queue;
24
15
  private readonly unacknowledged;
16
+ private readonly recorder;
17
+ private readonly measuring;
25
18
  private readonly liveStream;
26
19
  constructor(record: PairedDevice, deps: DeviceDeps, latestAdvertisement?: Advertisement | undefined);
27
20
  /** The address its record is stored under. */
@@ -40,7 +33,7 @@ declare class Device {
40
33
  fetch: (recordId: string) => Promise<void>;
41
34
  /** Sets the device's clock to now. */
42
35
  setClock: () => Promise<void>;
43
- /** Starts `live` and `waveform` events, which are for display only and never saved. */
36
+ /** Starts `live` and `waveform` events, which the device also records and saves while its `record` setting is on. */
44
37
  startLive: () => Promise<void>;
45
38
  /** Stops the stream and waits until the device has stopped sending. */
46
39
  stopLive: () => Promise<void>;
@@ -48,7 +41,7 @@ declare class Device {
48
41
  acknowledge: (recordId: string) => Promise<void>;
49
42
  /** Forgets a delivered record without saving it, so the next sync delivers it again. */
50
43
  release: (recordId: string) => void;
51
- /** Changes and stores whether it syncs by itself and whether it stays connected in the background. */
44
+ /** Changes and stores whether it syncs by itself, stays connected in the background, and records what it streams. */
52
45
  configure: (settings: Partial<DeviceSettings>) => Promise<void>;
53
46
  /** Stops live, waits for queued actions, then closes the link. */
54
47
  disconnect: () => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAGL,WAAW,EACX,cAAc,EAId,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxD,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,iBAAiB,CAAC;IACzB,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAIF,4GAA4G;AAC5G,cAAM,MAAM;IAYS,OAAO,CAAC,MAAM;IAAgB,O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G,kEAAkE;IAC3D,UAAU,QAAa,OAAO,CAAC,IAAI,CAAC,CAIzC;IAEF,6GAA6G;IACtG,IAAI,QAAO,OAAO,CAAC,IAAI,CAAC,CAA4G;IAE3I,qHAAqH;IAC9G,IAAI,CAAC,EAAE,EAAE,aAAa,GAAG,IAAI;IAapC,OAAO,CAAC,GAAG;YAYG,OAAO;YAmBP,OAAO;YAaP,SAAS;YAaT,WAAW;IAazB,8DAA8D;IAC9D,OAAO,CAAC,KAAK,CAA2F;YAE1F,WAAW;YAIX,OAAO;IAiBrB,OAAO,CAAC,SAAS;IASjB,iGAAiG;IACjG,OAAO,CAAC,WAAW;YAIL,YAAY;IAM1B,OAAO,CAAC,KAAK;CAId;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { DecodedReading, LiveSpan } from "./reading";
2
+ /** The live recordings that were saved and that a stored record of the same time may still replace. */
3
+ declare class LiveLedger {
4
+ private spans;
5
+ /** Remembers a recording that was saved whole. */
6
+ add(span: LiveSpan): void;
7
+ /** The recordings of the same metric that lie inside what a stored record covers. */
8
+ inside(record: DecodedReading): LiveSpan[];
9
+ /** Forgets recordings a stored record has replaced. */
10
+ remove(replaced: readonly LiveSpan[]): void;
11
+ }
12
+ export { LiveLedger };
13
+ //# sourceMappingURL=live-ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-ledger.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/live-ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA+BrD,uGAAuG;AACvG,cAAM,UAAU;IACd,OAAO,CAAC,KAAK,CAA2B;IAExC,kDAAkD;IAC3C,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAIhC,qFAAqF;IAC9E,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,EAAE;IAMjD,uDAAuD;IAChD,MAAM,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI;CAGnD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { LiveFrame } from "./reading";
2
+ /** How long a device may go without a measuring frame before it no longer counts as measuring. */
3
+ declare const QUIET_MS = 5000;
4
+ /**
5
+ * Whether the device is measuring: its own word when it gives one, else whether its frames carry numbers or samples.
6
+ * A quiet spell or the stream's end also ends a measurement.
7
+ */
8
+ declare class MeasuringWatch {
9
+ private readonly changed;
10
+ private readonly now;
11
+ private since;
12
+ private quiet;
13
+ constructor(changed: (since: Date | null) => void, now: () => Date);
14
+ /** A live frame arrived; one with nothing measured and no word from the device leaves the state as it is. */
15
+ frame(frame: LiveFrame): void;
16
+ /** Nothing is being measured any more. */
17
+ stop(): void;
18
+ private measured;
19
+ private clearQuiet;
20
+ }
21
+ export { MeasuringWatch, QUIET_MS };
22
+ //# sourceMappingURL=measuring-watch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measuring-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/measuring-watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,kGAAkG;AAClG,QAAA,MAAM,QAAQ,OAAQ,CAAC;AAKvB;;;GAGG;AACH,cAAM,cAAc;IAKhB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,KAAK,CAA8C;gBAGxC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,EACrC,GAAG,EAAE,MAAM,IAAI;IAGlC,6GAA6G;IACtG,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAQpC,0CAA0C;IACnC,IAAI,IAAI,IAAI;IAQnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,UAAU;CAMnB;AAED,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { SaveOutcome } from "./ports";
2
+ /** Where each outbox item stands, by id, at one moment. */
3
+ type OutboxView = {
4
+ /** Items still to be sent, including the one in flight. */
5
+ waiting: ReadonlySet<string>;
6
+ /** Items the server refused; they wait for a resend or a discard. */
7
+ rejected: ReadonlySet<string>;
8
+ /** Items the server accepted lately; an item that is in none of the three sets was discarded, or is another account's. */
9
+ sent: ReadonlySet<string>;
10
+ };
11
+ /** The offline queue behind a sink, which the reading log and the foreground notification watch; the sink side provides it. */
12
+ interface OutboxWatch {
13
+ /** Calls `listener` with the view now and after every change, until the returned stop is called. */
14
+ subscribe(listener: (view: OutboxView) => void): () => void;
15
+ }
16
+ /** What a sink says about a save: how it went and, for a queued reading, which outbox items hold it. */
17
+ type SaveReceipt = {
18
+ /** Saved, or kept in the outbox. */
19
+ status: SaveOutcome;
20
+ /** The outbox items that hold the queued part of the reading, as `ovok.outbox.items` lists them; one per queued measurement. */
21
+ queueIds?: readonly string[];
22
+ };
23
+ /** No offline queue: nothing is ever waiting. */
24
+ declare const noOutboxWatch: OutboxWatch;
25
+ export { noOutboxWatch };
26
+ export type { OutboxView, OutboxWatch, SaveReceipt };
27
+ //# sourceMappingURL=outbox-watch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outbox-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/outbox-watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,2DAA2D;AAC3D,KAAK,UAAU,GAAG;IAEhB,2DAA2D;IAC3D,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAE7B,qEAAqE;IACrE,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAE9B,0HAA0H;IAC1H,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3B,CAAC;AAEF,+HAA+H;AAC/H,UAAU,WAAW;IAEnB,oGAAoG;IACpG,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7D;AAED,wGAAwG;AACxG,KAAK,WAAW,GAAG;IAEjB,oCAAoC;IACpC,MAAM,EAAE,WAAW,CAAC;IAEpB,gIAAgI;IAChI,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF,iDAAiD;AACjD,QAAA,MAAM,aAAa,EAAE,WAAkD,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
@@ -50,11 +50,13 @@ type PairedDevice = {
50
50
  autoSync: boolean;
51
51
  /** Whether its link stays open while the app is in the background, reconnecting when it drops. */
52
52
  keepInBackground: boolean;
53
+ /** Whether what it streams live is recorded and saved, as well as shown. */
54
+ record: boolean;
53
55
  /** The value the device handed over when it paired, such as a password; `null` when it gave none. */
54
56
  secret: string | null;
55
57
  };
56
58
  /** The settings a user can change on a paired device. */
57
- type DeviceSettings = Pick<PairedDevice, "autoSync" | "keepInBackground">;
59
+ type DeviceSettings = Pick<PairedDevice, "autoSync" | "keepInBackground" | "record">;
58
60
  /** A device just paired: nothing synced, nothing reported yet. */
59
61
  declare const newPairedDevice: (address: string, modelId: string, name: string | null, pairedAt: Date) => PairedDevice;
60
62
  export { newPairedDevice };
@@ -1 +1 @@
1
- {"version":3,"file":"paired-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/paired-device.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,KAAK,cAAc,GAAG;IAEpB,yBAAyB;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,4BAA4B;I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G;IACrG,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,yDAAyD;AACzD,KAAK,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,kBAAkB,CAAC,CAAC;AAE1E,kEAAkE;AAClE,QAAA,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,MAAM,MAAM,GAAG,IAAI,EAAE,UAAU,IAAI,KAAG,YAe/F,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"paired-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/paired-device.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,KAAK,cAAc,GAAG;IAEpB,yBAAyB;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,oFAAoF;IACpF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,wBAAwB;IACxB,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF,mDAAmD;AACnD,KAAK,OAAO,GAAG;IAEb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,mEAAmE;IACnE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzB,mCAAmC;IACnC,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF,sEAAsE;AACtE,KAAK,YAAY,GAAG;IAElB,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAEhB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB,gCAAgC;IAChC,QAAQ,EAAE,IAAI,CAAC;IAEf,gGAAgG;IAChG,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAE1B,+BAA+B;IAC/B,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAE7B,kCAAkC;IAClC,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAE1B,0DAA0D;IAC1D,eAAe,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;IAE7C,wCAAwC;IACxC,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAE3B,iCAAiC;IACjC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAExB,kCAAkC;IAClC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAEhC,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAC;IAElB,kGAAkG;IAClG,gBAAgB,EAAE,OAAO,CAAC;IAE1B,4EAA4E;IAC5E,MAAM,EAAE,OAAO,CAAC;IAEhB,qGAAqG;IACrG,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,yDAAyD;AACzD,KAAK,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,kBAAkB,GAAG,QAAQ,CAAC,CAAC;AAErF,kEAAkE;AAClE,QAAA,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,MAAM,MAAM,GAAG,IAAI,EAAE,UAAU,IAAI,KAAG,YAgB/F,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { Advertisement } from "./advertisement";
2
2
  import { DeviceSnapshot } from "./device-snapshot";
3
3
  import { DeviceError } from "./errors";
4
+ import { SaveReceipt } from "./outbox-watch";
4
5
  import { PairedDevice } from "./paired-device";
5
6
  import { Reading } from "./reading";
6
7
  /** The Bluetooth adapter; `unknown` until the platform reports it. */
@@ -77,8 +78,8 @@ interface PairedDeviceStore {
77
78
  type SaveOutcome = "saved" | "queued";
78
79
  /** Where readings are saved; `device` is the snapshot of the device that took it. */
79
80
  interface ReadingSink {
80
- /** Saves one reading; rejects when it could be neither saved nor queued. */
81
- save(reading: Reading, device: DeviceSnapshot): Promise<SaveOutcome>;
81
+ /** Saves one reading, and says which outbox items hold it when it was queued; rejects when it could be neither saved nor queued. */
82
+ save(reading: Reading, device: DeviceSnapshot): Promise<SaveOutcome | SaveReceipt>;
82
83
  }
83
84
  /** Whether the app is in front of the user. */
84
85
  type AppVisibility = "foreground" | "background";
@@ -1 +1 @@
1
- {"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,sEAAsE;AACtE,KAAK,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,cAAc,GAAG,aAAa,CAAC;AAE9E,gGAAgG;AAChG,KAAK,mBAAmB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE,8EAA8E;AAC9E,KAAK,aAAa,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE9E,2DAA2D;AAC3D,KAAK,UAAU,GAAG;IAEhB,iGAAiG;IACjG,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG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,UAAU,SAAS;IAEjB,wCAAwC;IACxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB,4CAA4C;IAC5C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AAEnE,0GAA0G;AAC1G,UAAU,MAAM;IAEd,0BAA0B;IAC1B,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAEjD,kDAAkD;IAClD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAEhD,kDAAkD;IAClD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAEhD,uCAAuC;IACvC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CAClD;AAED,QAAA,MAAM,YAAY,EAAE,MAA6E,CAAC;AAElG,qEAAqE;AACrE,QAAA,MAAM,gBAAgB,EAAE,YAMvB,CAAC;AAEF,8DAA8D;AAC9D,QAAA,MAAM,WAAW,EAAE,SAAyE,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACvD,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,GACb,CAAC"}
1
+ {"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/ports.ts"],"names":[],"mappings":"AAAA,OAAO,E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