@ovok/native 1.16.1-rc.5 → 1.16.1-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (712) hide show
  1. package/lib/commonjs/modules/auth/google-return-page/index.js +24 -0
  2. package/lib/commonjs/modules/auth/google-return-page/index.js.map +1 -0
  3. package/lib/commonjs/modules/auth/hooks/use-social-sign-in.web.js +15 -0
  4. package/lib/commonjs/modules/auth/hooks/use-social-sign-in.web.js.map +1 -0
  5. package/lib/commonjs/modules/auth/index.js +21 -10
  6. package/lib/commonjs/modules/auth/index.js.map +1 -1
  7. package/lib/commonjs/modules/auth/session/logout-session.js +1 -1
  8. package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login-button.web.js +73 -0
  9. package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login-button.web.js.map +1 -0
  10. package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login.js +1 -1
  11. package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login-button.web.js +73 -0
  12. package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login-button.web.js.map +1 -0
  13. package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login.js +1 -1
  14. package/lib/commonjs/modules/auth/sign-in/index.js +24 -0
  15. package/lib/commonjs/modules/auth/sign-in/index.js.map +1 -1
  16. package/lib/commonjs/modules/auth/sign-in/utils/apple-web-sign-in.js +90 -0
  17. package/lib/commonjs/modules/auth/sign-in/utils/apple-web-sign-in.js.map +1 -0
  18. package/lib/commonjs/modules/auth/sign-in/utils/google-redirect-sign-in.js +89 -0
  19. package/lib/commonjs/modules/auth/sign-in/utils/google-redirect-sign-in.js.map +1 -0
  20. package/lib/commonjs/modules/auth/sign-in/utils/jwt-claims.js +21 -0
  21. package/lib/commonjs/modules/auth/sign-in/utils/jwt-claims.js.map +1 -0
  22. package/lib/commonjs/modules/auth/utils/sign-out-google.web.js +10 -0
  23. package/lib/commonjs/modules/auth/utils/sign-out-google.web.js.map +1 -0
  24. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +19 -7
  25. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  26. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -1
  27. package/lib/commonjs/modules/bt-management/index.js +12 -0
  28. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  29. package/lib/commonjs/modules/bt-management/services/bt-manager.js +27 -1
  30. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  31. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js +42 -2
  32. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
  33. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +64 -44
  34. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
  35. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js +98 -0
  36. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js.map +1 -0
  37. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js +127 -0
  38. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js.map +1 -0
  39. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js +48 -17
  40. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
  41. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +2 -2
  42. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
  43. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js +78 -19
  44. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js.map +1 -1
  45. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +30 -2
  46. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  47. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +11 -3
  48. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  49. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +48 -3
  50. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  51. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js +2 -7
  52. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -1
  53. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +6 -2
  54. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
  55. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +115 -26
  56. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  57. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.advertisement.js +19 -2
  58. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.advertisement.js.map +1 -1
  59. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.connect-retry.js +32 -0
  60. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.connect-retry.js.map +1 -0
  61. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.delivered-files.js +73 -0
  62. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.delivered-files.js.map +1 -0
  63. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js +130 -30
  64. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js.map +1 -1
  65. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js +103 -0
  66. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js.map +1 -0
  67. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +20 -14
  68. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  69. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +4 -2
  70. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -1
  71. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +94 -10
  72. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -1
  73. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js +75 -0
  74. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js.map +1 -0
  75. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js +113 -0
  76. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js.map +1 -0
  77. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js +67 -0
  78. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js.map +1 -0
  79. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recorder.js +55 -0
  80. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recorder.js.map +1 -0
  81. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recording-watch.js +57 -0
  82. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recording-watch.js.map +1 -0
  83. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.session.js +49 -0
  84. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.session.js.map +1 -0
  85. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.stored-files.js +46 -0
  86. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.stored-files.js.map +1 -0
  87. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +10 -4
  88. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
  89. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.waveform.js +27 -0
  90. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.waveform.js.map +1 -0
  91. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +0 -1
  92. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -1
  93. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +75 -20
  94. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
  95. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +21 -12
  96. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
  97. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js +47 -0
  98. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js.map +1 -0
  99. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +58 -32
  100. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
  101. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js +3 -7
  102. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js.map +1 -1
  103. package/lib/commonjs/modules/bt-management/services/series-recorder.js +27 -5
  104. package/lib/commonjs/modules/bt-management/services/series-recorder.js.map +1 -1
  105. package/lib/commonjs/modules/bt-management/types/device-waveform.js +6 -0
  106. package/lib/commonjs/modules/bt-management/types/device-waveform.js.map +1 -0
  107. package/lib/commonjs/modules/bt-management/utils/calculate-crc-16-modbus.js +23 -0
  108. package/lib/commonjs/modules/bt-management/utils/calculate-crc-16-modbus.js.map +1 -0
  109. package/lib/commonjs/modules/bt-management/utils/i-16-from-hex.js.map +1 -1
  110. package/lib/commonjs/modules/bt-management/utils/le-32-from-hex.js.map +1 -1
  111. package/lib/commonjs/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js +13 -0
  112. package/lib/commonjs/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js.map +1 -0
  113. package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js +15 -8
  114. package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
  115. package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-utils.js +1 -1
  116. package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-utils.js.map +1 -1
  117. package/lib/commonjs/modules/data-sync/constants.js +4 -1
  118. package/lib/commonjs/modules/data-sync/constants.js.map +1 -1
  119. package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js +6 -9
  120. package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
  121. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +8 -7
  122. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
  123. package/lib/commonjs/modules/data-sync/types/health-sync-keys.js +13 -0
  124. package/lib/commonjs/modules/data-sync/types/health-sync-keys.js.map +1 -1
  125. package/lib/commonjs/modules/data-sync/utils/convert-ecg-samples-to-observation.js +47 -0
  126. package/lib/commonjs/modules/data-sync/utils/convert-ecg-samples-to-observation.js.map +1 -0
  127. package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js +14 -6
  128. package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
  129. package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js +7 -15
  130. package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
  131. package/lib/commonjs/modules/data-sync/utils/default-health-coding.js +68 -0
  132. package/lib/commonjs/modules/data-sync/utils/default-health-coding.js.map +1 -0
  133. package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js +20 -4
  134. package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js.map +1 -1
  135. package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js +43 -86
  136. package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
  137. package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js +6 -5
  138. package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
  139. package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js +15 -15
  140. package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js.map +1 -1
  141. package/lib/commonjs/modules/data-sync/utils/health-units.js +11 -1
  142. package/lib/commonjs/modules/data-sync/utils/health-units.js.map +1 -1
  143. package/lib/commonjs/modules/data-sync/utils/healthkit-daily-statistics.js +64 -0
  144. package/lib/commonjs/modules/data-sync/utils/healthkit-daily-statistics.js.map +1 -0
  145. package/lib/commonjs/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
  146. package/lib/commonjs/modules/data-sync/utils/healthkit-query-options.js +20 -0
  147. package/lib/commonjs/modules/data-sync/utils/healthkit-query-options.js.map +1 -0
  148. package/lib/commonjs/modules/data-sync/utils/healthkit-sample-source.js +21 -0
  149. package/lib/commonjs/modules/data-sync/utils/healthkit-sample-source.js.map +1 -0
  150. package/lib/commonjs/modules/data-sync/utils/healthkit-samples.js +59 -0
  151. package/lib/commonjs/modules/data-sync/utils/healthkit-samples.js.map +1 -0
  152. package/lib/commonjs/modules/data-sync/utils/healthkit-series.js +20 -11
  153. package/lib/commonjs/modules/data-sync/utils/healthkit-series.js.map +1 -1
  154. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js +12 -2
  155. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -1
  156. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +39 -5
  157. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -1
  158. package/lib/commonjs/modules/next/bluetooth/connections.js +45 -2
  159. package/lib/commonjs/modules/next/bluetooth/connections.js.map +1 -1
  160. package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -1
  161. package/lib/commonjs/modules/next/bluetooth/errors.js.map +1 -1
  162. package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
  163. package/lib/commonjs/modules/next/bluetooth/readings.js +10 -2
  164. package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -1
  165. package/lib/commonjs/modules/next/bluetooth/runtime.js +37 -1
  166. package/lib/commonjs/modules/next/bluetooth/runtime.js.map +1 -1
  167. package/lib/commonjs/modules/next/bluetooth/web/index.js.map +1 -1
  168. package/lib/module/modules/auth/google-return-page/index.js +21 -0
  169. package/lib/module/modules/auth/google-return-page/index.js.map +1 -0
  170. package/lib/module/modules/auth/hooks/use-social-sign-in.web.js +10 -0
  171. package/lib/module/modules/auth/hooks/use-social-sign-in.web.js.map +1 -0
  172. package/lib/module/modules/auth/index.js +2 -1
  173. package/lib/module/modules/auth/index.js.map +1 -1
  174. package/lib/module/modules/auth/session/logout-session.js +1 -1
  175. package/lib/module/modules/auth/session/logout-session.js.map +1 -1
  176. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.web.js +67 -0
  177. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.web.js.map +1 -0
  178. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login.js +1 -1
  179. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login.js.map +1 -1
  180. package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.web.js +68 -0
  181. package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.web.js.map +1 -0
  182. package/lib/module/modules/auth/sign-in/components/social-logins/google-login.js +1 -1
  183. package/lib/module/modules/auth/sign-in/components/social-logins/google-login.js.map +1 -1
  184. package/lib/module/modules/auth/sign-in/index.js +2 -0
  185. package/lib/module/modules/auth/sign-in/index.js.map +1 -1
  186. package/lib/module/modules/auth/sign-in/utils/apple-web-sign-in.js +84 -0
  187. package/lib/module/modules/auth/sign-in/utils/apple-web-sign-in.js.map +1 -0
  188. package/lib/module/modules/auth/sign-in/utils/google-redirect-sign-in.js +84 -0
  189. package/lib/module/modules/auth/sign-in/utils/google-redirect-sign-in.js.map +1 -0
  190. package/lib/module/modules/auth/sign-in/utils/jwt-claims.js +17 -0
  191. package/lib/module/modules/auth/sign-in/utils/jwt-claims.js.map +1 -0
  192. package/lib/module/modules/auth/utils/sign-out-google.web.js +5 -0
  193. package/lib/module/modules/auth/utils/sign-out-google.web.js.map +1 -0
  194. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +19 -7
  195. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  196. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -1
  197. package/lib/module/modules/bt-management/index.js +1 -0
  198. package/lib/module/modules/bt-management/index.js.map +1 -1
  199. package/lib/module/modules/bt-management/services/bt-manager.js +27 -1
  200. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  201. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +42 -2
  202. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
  203. package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +64 -44
  204. package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
  205. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js +91 -0
  206. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js.map +1 -0
  207. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js +123 -0
  208. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js.map +1 -0
  209. package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js +48 -17
  210. package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
  211. package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +2 -3
  212. package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
  213. package/lib/module/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js +77 -19
  214. package/lib/module/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js.map +1 -1
  215. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +30 -2
  216. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  217. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +11 -3
  218. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  219. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +48 -3
  220. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  221. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js +2 -7
  222. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -1
  223. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +6 -2
  224. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
  225. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +115 -26
  226. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  227. package/lib/module/modules/bt-management/services/devices/lepu/lepu.advertisement.js +17 -1
  228. package/lib/module/modules/bt-management/services/devices/lepu/lepu.advertisement.js.map +1 -1
  229. package/lib/module/modules/bt-management/services/devices/lepu/lepu.connect-retry.js +28 -0
  230. package/lib/module/modules/bt-management/services/devices/lepu/lepu.connect-retry.js.map +1 -0
  231. package/lib/module/modules/bt-management/services/devices/lepu/lepu.delivered-files.js +69 -0
  232. package/lib/module/modules/bt-management/services/devices/lepu/lepu.delivered-files.js.map +1 -0
  233. package/lib/module/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js +129 -30
  234. package/lib/module/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js.map +1 -1
  235. package/lib/module/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js +99 -0
  236. package/lib/module/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js.map +1 -0
  237. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +20 -14
  238. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  239. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +4 -2
  240. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -1
  241. package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +94 -10
  242. package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -1
  243. package/lib/module/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js +72 -0
  244. package/lib/module/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js.map +1 -0
  245. package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js +109 -0
  246. package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js.map +1 -0
  247. package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js +64 -0
  248. package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js.map +1 -0
  249. package/lib/module/modules/bt-management/services/devices/lepu/lepu.recorder.js +51 -0
  250. package/lib/module/modules/bt-management/services/devices/lepu/lepu.recorder.js.map +1 -0
  251. package/lib/module/modules/bt-management/services/devices/lepu/lepu.recording-watch.js +53 -0
  252. package/lib/module/modules/bt-management/services/devices/lepu/lepu.recording-watch.js.map +1 -0
  253. package/lib/module/modules/bt-management/services/devices/lepu/lepu.session.js +45 -0
  254. package/lib/module/modules/bt-management/services/devices/lepu/lepu.session.js.map +1 -0
  255. package/lib/module/modules/bt-management/services/devices/lepu/lepu.stored-files.js +42 -0
  256. package/lib/module/modules/bt-management/services/devices/lepu/lepu.stored-files.js.map +1 -0
  257. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +10 -4
  258. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
  259. package/lib/module/modules/bt-management/services/devices/lepu/lepu.waveform.js +22 -0
  260. package/lib/module/modules/bt-management/services/devices/lepu/lepu.waveform.js.map +1 -0
  261. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +0 -1
  262. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -1
  263. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +75 -21
  264. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
  265. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +21 -12
  266. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
  267. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js +44 -0
  268. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js.map +1 -0
  269. package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +58 -32
  270. package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
  271. package/lib/module/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js +3 -7
  272. package/lib/module/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js.map +1 -1
  273. package/lib/module/modules/bt-management/services/series-recorder.js +27 -5
  274. package/lib/module/modules/bt-management/services/series-recorder.js.map +1 -1
  275. package/lib/module/modules/bt-management/types/device-waveform.js +4 -0
  276. package/lib/module/modules/bt-management/types/device-waveform.js.map +1 -0
  277. package/lib/module/modules/bt-management/utils/calculate-crc-16-modbus.js +18 -0
  278. package/lib/module/modules/bt-management/utils/calculate-crc-16-modbus.js.map +1 -0
  279. package/lib/module/modules/bt-management/utils/i-16-from-hex.js.map +1 -1
  280. package/lib/module/modules/bt-management/utils/le-32-from-hex.js.map +1 -1
  281. package/lib/module/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js +8 -0
  282. package/lib/module/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js.map +1 -0
  283. package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js +16 -9
  284. package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
  285. package/lib/module/modules/data-sync/components/apple/apple-health-authorization-utils.js +2 -2
  286. package/lib/module/modules/data-sync/components/apple/apple-health-authorization-utils.js.map +1 -1
  287. package/lib/module/modules/data-sync/constants.js +4 -1
  288. package/lib/module/modules/data-sync/constants.js.map +1 -1
  289. package/lib/module/modules/data-sync/hooks/use-listen-changes.js +7 -10
  290. package/lib/module/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
  291. package/lib/module/modules/data-sync/services/managers/data-processor.js +8 -7
  292. package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
  293. package/lib/module/modules/data-sync/types/health-sync-keys.js +13 -0
  294. package/lib/module/modules/data-sync/types/health-sync-keys.js.map +1 -1
  295. package/lib/module/modules/data-sync/utils/convert-ecg-samples-to-observation.js +43 -0
  296. package/lib/module/modules/data-sync/utils/convert-ecg-samples-to-observation.js.map +1 -0
  297. package/lib/module/modules/data-sync/utils/convert-generic-health-data.js +14 -6
  298. package/lib/module/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
  299. package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js +7 -15
  300. package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
  301. package/lib/module/modules/data-sync/utils/default-health-coding.js +65 -0
  302. package/lib/module/modules/data-sync/utils/default-health-coding.js.map +1 -0
  303. package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js +20 -4
  304. package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js.map +1 -1
  305. package/lib/module/modules/data-sync/utils/get-samples-from-health.js +44 -87
  306. package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
  307. package/lib/module/modules/data-sync/utils/get-total-samples-count.js +5 -4
  308. package/lib/module/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
  309. package/lib/module/modules/data-sync/utils/health-data-catalog.js +15 -15
  310. package/lib/module/modules/data-sync/utils/health-data-catalog.js.map +1 -1
  311. package/lib/module/modules/data-sync/utils/health-units.js +11 -1
  312. package/lib/module/modules/data-sync/utils/health-units.js.map +1 -1
  313. package/lib/module/modules/data-sync/utils/healthkit-daily-statistics.js +59 -0
  314. package/lib/module/modules/data-sync/utils/healthkit-daily-statistics.js.map +1 -0
  315. package/lib/module/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
  316. package/lib/module/modules/data-sync/utils/healthkit-query-options.js +16 -0
  317. package/lib/module/modules/data-sync/utils/healthkit-query-options.js.map +1 -0
  318. package/lib/module/modules/data-sync/utils/healthkit-sample-source.js +17 -0
  319. package/lib/module/modules/data-sync/utils/healthkit-sample-source.js.map +1 -0
  320. package/lib/module/modules/data-sync/utils/healthkit-samples.js +52 -0
  321. package/lib/module/modules/data-sync/utils/healthkit-samples.js.map +1 -0
  322. package/lib/module/modules/data-sync/utils/healthkit-series.js +19 -10
  323. package/lib/module/modules/data-sync/utils/healthkit-series.js.map +1 -1
  324. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js +12 -2
  325. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -1
  326. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +39 -5
  327. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -1
  328. package/lib/module/modules/next/bluetooth/connections.js +45 -2
  329. package/lib/module/modules/next/bluetooth/connections.js.map +1 -1
  330. package/lib/module/modules/next/bluetooth/driver.js.map +1 -1
  331. package/lib/module/modules/next/bluetooth/errors.js.map +1 -1
  332. package/lib/module/modules/next/bluetooth/index.js.map +1 -1
  333. package/lib/module/modules/next/bluetooth/readings.js +10 -2
  334. package/lib/module/modules/next/bluetooth/readings.js.map +1 -1
  335. package/lib/module/modules/next/bluetooth/runtime.js +37 -1
  336. package/lib/module/modules/next/bluetooth/runtime.js.map +1 -1
  337. package/lib/module/modules/next/bluetooth/web/index.js.map +1 -1
  338. package/lib/typescript/commonjs/src/modules/auth/google-return-page/index.d.ts +8 -0
  339. package/lib/typescript/commonjs/src/modules/auth/google-return-page/index.d.ts.map +1 -0
  340. package/lib/typescript/commonjs/src/modules/auth/hooks/use-social-sign-in.web.d.ts +7 -0
  341. package/lib/typescript/commonjs/src/modules/auth/hooks/use-social-sign-in.web.d.ts.map +1 -0
  342. package/lib/typescript/commonjs/src/modules/auth/index.d.ts +1 -0
  343. package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/modules/auth/register/components/register.d.ts +2 -2
  345. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +2 -2
  346. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts +5 -0
  347. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts.map +1 -0
  348. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login.d.ts +1 -1
  349. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts +5 -0
  350. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts.map +1 -0
  351. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login.d.ts +1 -1
  352. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/social-logins.d.ts +2 -2
  353. package/lib/typescript/commonjs/src/modules/auth/sign-in/index.d.ts +2 -0
  354. package/lib/typescript/commonjs/src/modules/auth/sign-in/index.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/apple-login-props.d.ts +13 -0
  356. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/apple-login-props.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/google-login-props.d.ts +13 -0
  358. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/google-login-props.d.ts.map +1 -1
  359. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts +17 -0
  360. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts +14 -0
  362. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts.map +1 -0
  363. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/jwt-claims.d.ts +9 -0
  364. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/jwt-claims.d.ts.map +1 -0
  365. package/lib/typescript/commonjs/src/modules/auth/utils/sign-out-google.web.d.ts +3 -0
  366. package/lib/typescript/commonjs/src/modules/auth/utils/sign-out-google.web.d.ts.map +1 -0
  367. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +4 -1
  369. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
  370. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +1 -0
  371. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  372. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +21 -5
  373. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  374. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -1
  375. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -1
  376. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts +34 -0
  377. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts +32 -0
  379. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts +4 -0
  381. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts.map +1 -1
  382. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +2 -1
  383. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
  384. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts +29 -3
  385. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts.map +1 -1
  386. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +6 -1
  387. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  388. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +2 -0
  389. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  390. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +23 -3
  391. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  392. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -1
  393. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +6 -3
  394. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
  395. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +20 -0
  396. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  397. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts +8 -1
  398. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts.map +1 -1
  399. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts +12 -0
  400. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts.map +1 -0
  401. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts +24 -0
  402. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts +40 -5
  404. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts.map +1 -1
  405. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts +20 -0
  406. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts.map +1 -0
  407. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +6 -3
  408. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  409. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +3 -1
  410. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -1
  411. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +26 -1
  412. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -1
  413. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts +42 -0
  414. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts.map +1 -0
  415. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts +28 -0
  416. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts.map +1 -0
  417. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts +16 -0
  418. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts.map +1 -0
  419. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts +32 -0
  420. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts.map +1 -0
  421. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts +28 -0
  422. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts.map +1 -0
  423. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts +17 -0
  424. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts.map +1 -0
  425. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts +33 -0
  426. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts.map +1 -0
  427. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +6 -1
  428. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
  429. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts +9 -0
  430. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts.map +1 -0
  431. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -1
  432. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +9 -3
  433. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
  434. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
  435. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts +8 -0
  436. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts.map +1 -0
  437. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.d.ts.map +1 -1
  439. package/lib/typescript/commonjs/src/modules/bt-management/services/series-recorder.d.ts +6 -1
  440. package/lib/typescript/commonjs/src/modules/bt-management/services/series-recorder.d.ts.map +1 -1
  441. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +7 -1
  442. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  443. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +47 -3
  444. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
  445. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +17 -1
  446. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -1
  447. package/lib/typescript/commonjs/src/modules/bt-management/types/device-waveform.d.ts +15 -0
  448. package/lib/typescript/commonjs/src/modules/bt-management/types/device-waveform.d.ts.map +1 -0
  449. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts +3 -0
  450. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts.map +1 -0
  451. package/lib/typescript/commonjs/src/modules/bt-management/utils/i-16-from-hex.d.ts +1 -1
  452. package/lib/typescript/commonjs/src/modules/bt-management/utils/i-16-from-hex.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-from-hex.d.ts +1 -1
  454. package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-from-hex.d.ts.map +1 -1
  455. package/lib/typescript/commonjs/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts +3 -0
  456. package/lib/typescript/commonjs/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts.map +1 -0
  457. package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
  458. package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts +2 -2
  459. package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts.map +1 -1
  460. package/lib/typescript/commonjs/src/modules/data-sync/constants.d.ts +3 -1
  461. package/lib/typescript/commonjs/src/modules/data-sync/constants.d.ts.map +1 -1
  462. package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
  463. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  464. package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +2 -2
  465. package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
  466. package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts +4 -7
  467. package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
  468. package/lib/typescript/commonjs/src/modules/data-sync/types/get-data-from-provider-props.d.ts +3 -1
  469. package/lib/typescript/commonjs/src/modules/data-sync/types/get-data-from-provider-props.d.ts.map +1 -1
  470. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -2
  471. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  472. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-keys.d.ts +11 -1
  473. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-keys.d.ts.map +1 -1
  474. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-props.d.ts +1 -1
  475. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-props.d.ts.map +1 -1
  476. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts +6 -0
  477. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts.map +1 -0
  478. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts +1 -1
  479. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
  480. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
  481. package/lib/typescript/commonjs/src/modules/data-sync/utils/default-health-coding.d.ts +10 -0
  482. package/lib/typescript/commonjs/src/modules/data-sync/utils/default-health-coding.d.ts.map +1 -0
  483. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts +1 -1
  484. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map +1 -1
  485. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +12 -46
  486. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
  487. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
  488. package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
  489. package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts +2 -2
  490. package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
  491. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts +10 -0
  492. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts.map +1 -0
  493. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts +5 -5
  494. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
  495. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-query-options.d.ts +7 -0
  496. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-query-options.d.ts.map +1 -0
  497. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-sample-source.d.ts +8 -0
  498. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-sample-source.d.ts.map +1 -0
  499. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-samples.d.ts +30 -0
  500. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-samples.d.ts.map +1 -0
  501. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts +2 -2
  502. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -1
  503. package/lib/typescript/commonjs/src/modules/data-sync/utils/to-core-health-observations.d.ts +1 -0
  504. package/lib/typescript/commonjs/src/modules/data-sync/utils/to-core-health-observations.d.ts.map +1 -1
  505. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +12 -1
  506. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -1
  507. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +2 -1
  508. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -1
  509. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts +13 -1
  510. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts.map +1 -1
  511. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +20 -0
  512. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  513. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts +1 -1
  514. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts.map +1 -1
  515. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +2 -1
  516. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
  517. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts +3 -2
  518. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts.map +1 -1
  519. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts +19 -1
  520. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts.map +1 -1
  521. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts +33 -1
  522. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts.map +1 -1
  523. package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts +1 -0
  524. package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts.map +1 -1
  525. package/lib/typescript/module/src/modules/auth/google-return-page/index.d.ts +8 -0
  526. package/lib/typescript/module/src/modules/auth/google-return-page/index.d.ts.map +1 -0
  527. package/lib/typescript/module/src/modules/auth/hooks/use-social-sign-in.web.d.ts +7 -0
  528. package/lib/typescript/module/src/modules/auth/hooks/use-social-sign-in.web.d.ts.map +1 -0
  529. package/lib/typescript/module/src/modules/auth/index.d.ts +1 -0
  530. package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
  531. package/lib/typescript/module/src/modules/auth/register/components/register.d.ts +2 -2
  532. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +2 -2
  533. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts +5 -0
  534. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts.map +1 -0
  535. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login.d.ts +1 -1
  536. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts +5 -0
  537. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts.map +1 -0
  538. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login.d.ts +1 -1
  539. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/social-logins.d.ts +2 -2
  540. package/lib/typescript/module/src/modules/auth/sign-in/index.d.ts +2 -0
  541. package/lib/typescript/module/src/modules/auth/sign-in/index.d.ts.map +1 -1
  542. package/lib/typescript/module/src/modules/auth/sign-in/types/apple-login-props.d.ts +13 -0
  543. package/lib/typescript/module/src/modules/auth/sign-in/types/apple-login-props.d.ts.map +1 -1
  544. package/lib/typescript/module/src/modules/auth/sign-in/types/google-login-props.d.ts +13 -0
  545. package/lib/typescript/module/src/modules/auth/sign-in/types/google-login-props.d.ts.map +1 -1
  546. package/lib/typescript/module/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts +17 -0
  547. package/lib/typescript/module/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts.map +1 -0
  548. package/lib/typescript/module/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts +14 -0
  549. package/lib/typescript/module/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts.map +1 -0
  550. package/lib/typescript/module/src/modules/auth/sign-in/utils/jwt-claims.d.ts +9 -0
  551. package/lib/typescript/module/src/modules/auth/sign-in/utils/jwt-claims.d.ts.map +1 -0
  552. package/lib/typescript/module/src/modules/auth/utils/sign-out-google.web.d.ts +3 -0
  553. package/lib/typescript/module/src/modules/auth/utils/sign-out-google.web.d.ts.map +1 -0
  554. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  555. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +4 -1
  556. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
  557. package/lib/typescript/module/src/modules/bt-management/index.d.ts +1 -0
  558. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  559. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +21 -5
  560. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  561. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -1
  562. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -1
  563. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts +34 -0
  564. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts.map +1 -0
  565. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts +32 -0
  566. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts.map +1 -0
  567. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts +4 -0
  568. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts.map +1 -1
  569. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +2 -1
  570. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
  571. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts +29 -3
  572. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts.map +1 -1
  573. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +6 -1
  574. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  575. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +2 -0
  576. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  577. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +23 -3
  578. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  579. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -1
  580. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +6 -3
  581. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
  582. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +20 -0
  583. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  584. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts +8 -1
  585. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts.map +1 -1
  586. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts +12 -0
  587. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts.map +1 -0
  588. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts +24 -0
  589. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts.map +1 -0
  590. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts +40 -5
  591. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts.map +1 -1
  592. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts +20 -0
  593. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts.map +1 -0
  594. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +6 -3
  595. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  596. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +3 -1
  597. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -1
  598. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +26 -1
  599. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -1
  600. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts +42 -0
  601. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts.map +1 -0
  602. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts +28 -0
  603. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts.map +1 -0
  604. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts +16 -0
  605. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts.map +1 -0
  606. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts +32 -0
  607. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts.map +1 -0
  608. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts +28 -0
  609. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts.map +1 -0
  610. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts +17 -0
  611. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts.map +1 -0
  612. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts +33 -0
  613. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts.map +1 -0
  614. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +6 -1
  615. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
  616. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts +9 -0
  617. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts.map +1 -0
  618. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -1
  619. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +9 -3
  620. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
  621. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
  622. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts +8 -0
  623. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts.map +1 -0
  624. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
  625. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.d.ts.map +1 -1
  626. package/lib/typescript/module/src/modules/bt-management/services/series-recorder.d.ts +6 -1
  627. package/lib/typescript/module/src/modules/bt-management/services/series-recorder.d.ts.map +1 -1
  628. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +7 -1
  629. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  630. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +47 -3
  631. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
  632. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +17 -1
  633. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -1
  634. package/lib/typescript/module/src/modules/bt-management/types/device-waveform.d.ts +15 -0
  635. package/lib/typescript/module/src/modules/bt-management/types/device-waveform.d.ts.map +1 -0
  636. package/lib/typescript/module/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts +3 -0
  637. package/lib/typescript/module/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts.map +1 -0
  638. package/lib/typescript/module/src/modules/bt-management/utils/i-16-from-hex.d.ts +1 -1
  639. package/lib/typescript/module/src/modules/bt-management/utils/i-16-from-hex.d.ts.map +1 -1
  640. package/lib/typescript/module/src/modules/bt-management/utils/le-32-from-hex.d.ts +1 -1
  641. package/lib/typescript/module/src/modules/bt-management/utils/le-32-from-hex.d.ts.map +1 -1
  642. package/lib/typescript/module/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts +3 -0
  643. package/lib/typescript/module/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts.map +1 -0
  644. package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
  645. package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts +2 -2
  646. package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts.map +1 -1
  647. package/lib/typescript/module/src/modules/data-sync/constants.d.ts +3 -1
  648. package/lib/typescript/module/src/modules/data-sync/constants.d.ts.map +1 -1
  649. package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
  650. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  651. package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +2 -2
  652. package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
  653. package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts +4 -7
  654. package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
  655. package/lib/typescript/module/src/modules/data-sync/types/get-data-from-provider-props.d.ts +3 -1
  656. package/lib/typescript/module/src/modules/data-sync/types/get-data-from-provider-props.d.ts.map +1 -1
  657. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -2
  658. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  659. package/lib/typescript/module/src/modules/data-sync/types/health-sync-keys.d.ts +11 -1
  660. package/lib/typescript/module/src/modules/data-sync/types/health-sync-keys.d.ts.map +1 -1
  661. package/lib/typescript/module/src/modules/data-sync/types/health-sync-props.d.ts +1 -1
  662. package/lib/typescript/module/src/modules/data-sync/types/health-sync-props.d.ts.map +1 -1
  663. package/lib/typescript/module/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts +6 -0
  664. package/lib/typescript/module/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts.map +1 -0
  665. package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts +1 -1
  666. package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
  667. package/lib/typescript/module/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
  668. package/lib/typescript/module/src/modules/data-sync/utils/default-health-coding.d.ts +10 -0
  669. package/lib/typescript/module/src/modules/data-sync/utils/default-health-coding.d.ts.map +1 -0
  670. package/lib/typescript/module/src/modules/data-sync/utils/get-records-from-health-connect.d.ts +1 -1
  671. package/lib/typescript/module/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map +1 -1
  672. package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +12 -46
  673. package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
  674. package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
  675. package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
  676. package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts +2 -2
  677. package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
  678. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts +10 -0
  679. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts.map +1 -0
  680. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts +5 -5
  681. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
  682. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-query-options.d.ts +7 -0
  683. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-query-options.d.ts.map +1 -0
  684. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-sample-source.d.ts +8 -0
  685. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-sample-source.d.ts.map +1 -0
  686. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-samples.d.ts +30 -0
  687. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-samples.d.ts.map +1 -0
  688. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts +2 -2
  689. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -1
  690. package/lib/typescript/module/src/modules/data-sync/utils/to-core-health-observations.d.ts +1 -0
  691. package/lib/typescript/module/src/modules/data-sync/utils/to-core-health-observations.d.ts.map +1 -1
  692. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +12 -1
  693. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -1
  694. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +2 -1
  695. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -1
  696. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts +13 -1
  697. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts.map +1 -1
  698. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +20 -0
  699. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  700. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts +1 -1
  701. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts.map +1 -1
  702. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +2 -1
  703. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
  704. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts +3 -2
  705. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts.map +1 -1
  706. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts +19 -1
  707. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts.map +1 -1
  708. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts +33 -1
  709. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts.map +1 -1
  710. package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts +1 -0
  711. package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts.map +1 -1
  712. package/package.json +8 -3
@@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.convertSamplesToObservation = void 0;
7
7
  var _creator = require("@ovok/core/dist/client/observation/services/creator");
8
+ var _next = require("@ovok/core/next");
9
+ var _convertEcgSamplesToObservation = require("./convert-ecg-samples-to-observation.js");
8
10
  var _convertGenericHealthData = require("./convert-generic-health-data.js");
9
- var _healthObservationDevice = require("./health-observation-device.js");
11
+ var _healthkitSampleSource = require("./healthkit-sample-source.js");
10
12
  var _normalizeCoreHealthObservation = require("./normalize-core-health-observation.js");
11
13
  var _toCoreHealthObservations = require("./to-core-health-observations.js");
12
14
  const convertSamplesToObservation = async props => {
@@ -37,6 +39,9 @@ const convertSamplesToObservation = async props => {
37
39
  mode
38
40
  });
39
41
  }
42
+ if (measurementTypeKey === _next.MeasurementTypeKey.ecg) {
43
+ return (0, _convertEcgSamplesToObservation.convertEcgSamplesToObservation)(props);
44
+ }
40
45
  const service = _creator.ObservationServiceCreator.getInstance().getService(measurementTypeKey);
41
46
  const measurement = service.convertSamplesToMeasurement(data);
42
47
  if (!measurement) {
@@ -45,20 +50,7 @@ const convertSamplesToObservation = async props => {
45
50
  const observationBody = await client.measurements.build({
46
51
  measurement
47
52
  });
48
- return (0, _toCoreHealthObservations.toCoreHealthObservations)(observationBody, props, index => {
49
- const sample = data?.[index];
50
- return {
51
- device: sample ? (0, _healthObservationDevice.getHealthObservationDevice)({
52
- manufacturer: sample.device?.manufacturer,
53
- model: sample.device?.model,
54
- sourceApp: sample.sourceRevision?.source?.name
55
- }) : undefined,
56
- timing: {
57
- start: sample?.startDate,
58
- end: sample?.endDate
59
- }
60
- };
61
- });
53
+ return (0, _toCoreHealthObservations.toCoreHealthObservations)(observationBody, props, index => (0, _healthkitSampleSource.getHealthKitSampleSource)(data[index]));
62
54
  };
63
55
  exports.convertSamplesToObservation = convertSamplesToObservation;
64
56
  //# sourceMappingURL=convert-samples-to-observation.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_creator","require","_convertGenericHealthData","_healthObservationDevice","_normalizeCoreHealthObservation","_toCoreHealthObservations","convertSamplesToObservation","props","data","client","measurementTypeKey","mode","convertGenericHealthDataToObservation","length","hasConfiguredNonLoincCoding","isCoreMeasurementTypeKey","service","ObservationServiceCreator","getInstance","getService","measurement","convertSamplesToMeasurement","observationBody","measurements","build","toCoreHealthObservations","index","sample","device","getHealthObservationDevice","manufacturer","model","sourceApp","sourceRevision","source","name","undefined","timing","start","startDate","end","endDate","exports"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/convert-samples-to-observation.ts"],"mappings":";;;;;;AAKA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AACA,IAAAG,+BAAA,GAAAH,OAAA;AACA,IAAAI,yBAAA,GAAAJ,OAAA;AAKO,MAAMK,2BAA2B,GAAG,MACzCC,KAAgC,IACL;EAC3B,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC,kBAAkB;IAAEC,IAAI,GAAG;EAAQ,CAAC,GAAGJ,KAAK;EAElE,IAAII,IAAI,KAAK,OAAO,EAAE;IACpB,OAAO,IAAAC,+DAAqC,EAAC;MAAE,GAAGL,KAAK;MAAEI;IAAK,CAAC,CAAC;EAClE;EAEA,IAAIH,IAAI,CAACK,MAAM,KAAK,CAAC,EAAE;IACrB,OAAO,EAAE;EACX;EAEA,IAAI,IAAAC,2DAA2B,EAACP,KAAK,CAAC,EAAE;IACtC,OAAO,IAAAK,+DAAqC,EAAC;MAAE,GAAGL,KAAK;MAAEI;IAAK,CAAC,CAAC;EAClE;EAEA,IAAI,CAAC,IAAAI,kDAAwB,EAACL,kBAAkB,CAAC,EAAE;IACjD,OAAO,IAAAE,+DAAqC,EAAC;MAAE,GAAGL,KAAK;MAAEI;IAAK,CAAC,CAAC;EAClE;EAEA,MAAMK,OAAO,GAAGC,kCAAyB,CAACC,WAAW,CAAC,CAAC,CAACC,UAAU,CAChET,kBACF,CAAC;EAED,MAAMU,WAAW,GAAGJ,OAAO,CAACK,2BAA2B,CACrDb,IACF,CAAC;EAED,IAAI,CAACY,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EAEA,MAAME,eAAe,GAAG,MAAMb,MAAM,CAACc,YAAY,CAACC,KAAK,CAAC;IACtDJ;EACF,CAAC,CAAC;EAEF,OAAO,IAAAK,kDAAwB,EAACH,eAAe,EAAEf,KAAK,EAAGmB,KAAK,IAAK;IACjE,MAAMC,MAAM,GAAGnB,IAAI,GAAGkB,KAAK,CAA2D;IAEtF,OAAO;MACLE,MAAM,EAAED,MAAM,GACV,IAAAE,mDAA0B,EAAC;QACzBC,YAAY,EAAEH,MAAM,CAACC,MAAM,EAAEE,YAAY;QACzCC,KAAK,EAAEJ,MAAM,CAACC,MAAM,EAAEG,KAAK;QAC3BC,SAAS,EAAEL,MAAM,CAACM,cAAc,EAAEC,MAAM,EAAEC;MAC5C,CAAC,CAAC,GACFC,SAAS;MACbC,MAAM,EAAE;QAAEC,KAAK,EAAEX,MAAM,EAAEY,SAAS;QAAEC,GAAG,EAAEb,MAAM,EAAEc;MAAQ;IAC3D,CAAC;EACH,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAApC,2BAAA,GAAAA,2BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_creator","require","_next","_convertEcgSamplesToObservation","_convertGenericHealthData","_healthkitSampleSource","_normalizeCoreHealthObservation","_toCoreHealthObservations","convertSamplesToObservation","props","data","client","measurementTypeKey","mode","convertGenericHealthDataToObservation","length","hasConfiguredNonLoincCoding","isCoreMeasurementTypeKey","MeasurementTypeKey","ecg","convertEcgSamplesToObservation","service","ObservationServiceCreator","getInstance","getService","measurement","convertSamplesToMeasurement","observationBody","measurements","build","toCoreHealthObservations","index","getHealthKitSampleSource","exports"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/convert-samples-to-observation.ts"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,+BAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AAIA,IAAAK,+BAAA,GAAAL,OAAA;AACA,IAAAM,yBAAA,GAAAN,OAAA;AAKO,MAAMO,2BAA2B,GAAG,MACzCC,KAAgC,IACL;EAC3B,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC,kBAAkB;IAAEC,IAAI,GAAG;EAAQ,CAAC,GAAGJ,KAAK;EAElE,IAAII,IAAI,KAAK,OAAO,EAAE;IACpB,OAAO,IAAAC,+DAAqC,EAAC;MAAE,GAAGL,KAAK;MAAEI;IAAK,CAAC,CAAC;EAClE;EAEA,IAAIH,IAAI,CAACK,MAAM,KAAK,CAAC,EAAE;IACrB,OAAO,EAAE;EACX;EAEA,IAAI,IAAAC,2DAA2B,EAACP,KAAK,CAAC,EAAE;IACtC,OAAO,IAAAK,+DAAqC,EAAC;MAAE,GAAGL,KAAK;MAAEI;IAAK,CAAC,CAAC;EAClE;EAEA,IAAI,CAAC,IAAAI,kDAAwB,EAACL,kBAAkB,CAAC,EAAE;IACjD,OAAO,IAAAE,+DAAqC,EAAC;MAAE,GAAGL,KAAK;MAAEI;IAAK,CAAC,CAAC;EAClE;EAEA,IAAID,kBAAkB,KAAKM,wBAAkB,CAACC,GAAG,EAAE;IACjD,OAAO,IAAAC,8DAA8B,EAACX,KAAK,CAAC;EAC9C;EAEA,MAAMY,OAAO,GAAGC,kCAAyB,CAACC,WAAW,CAAC,CAAC,CAACC,UAAU,CAChEZ,kBACF,CAAC;EAED,MAAMa,WAAW,GAAGJ,OAAO,CAACK,2BAA2B,CACrDhB,IACF,CAAC;EAED,IAAI,CAACe,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EAEA,MAAME,eAAe,GAAG,MAAMhB,MAAM,CAACiB,YAAY,CAACC,KAAK,CAAC;IACtDJ;EACF,CAAC,CAAC;EAEF,OAAO,IAAAK,kDAAwB,EAACH,eAAe,EAAElB,KAAK,EAAGsB,KAAK,IAC5D,IAAAC,+CAAwB,EAACtB,IAAI,CAACqB,KAAK,CAAsC,CAC3E,CAAC;AACH,CAAC;AAACE,OAAA,CAAAzB,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getDefaultHealthCoding = void 0;
7
+ var _next = require("@ovok/core/next");
8
+ var _healthSyncKeys = require("../types/health-sync-keys.js");
9
+ var _fhirSystems = require("./fhir-systems.js");
10
+ var _healthDataCatalog = require("./health-data-catalog.js");
11
+ var _toCoreHealthObservations = require("./to-core-health-observations.js");
12
+ /** The code @ovok/core gives each core measurement, by the Apple Health or Health Connect type it is imported from. */
13
+ const CORE_MEASUREMENT_CODES = {
14
+ HKQuantityTypeIdentifierBloodPressureSystolic: _next.ObservationCode.SYSTOLIC_BLOOD_PRESSURE,
15
+ HKQuantityTypeIdentifierBloodPressureDiastolic: _next.ObservationCode.DIASTOLIC_BLOOD_PRESSURE,
16
+ HKQuantityTypeIdentifierHeartRate: _next.ObservationCode.HEART_RATE,
17
+ HKQuantityTypeIdentifierBloodGlucose: _next.ObservationCode.BLOOD_GLUCOSE,
18
+ HKQuantityTypeIdentifierBodyMass: _next.ObservationCode.BODY_WEIGHT,
19
+ HKQuantityTypeIdentifierOxygenSaturation: _next.ObservationCode.OXYGEN_SATURATION,
20
+ HKQuantityTypeIdentifierRespiratoryRate: _next.ObservationCode.RESPIRATORY_RATE,
21
+ HKQuantityTypeIdentifierBodyTemperature: _next.ObservationCode.BODY_TEMPERATURE,
22
+ HKQuantityTypeIdentifierStepCount: _next.ObservationCode.STEPS,
23
+ HKQuantityTypeIdentifierHeartRateVariabilitySDNN: _next.ObservationCode.HEART_RATE_VARIABILITY,
24
+ HKQuantityTypeIdentifierRestingHeartRate: _next.ObservationCode.RESTING_HEART_RATE,
25
+ HKQuantityTypeIdentifierWalkingHeartRateAverage: _next.ObservationCode.WALKING_HEART_RATE_AVERAGE,
26
+ HKQuantityTypeIdentifierVO2Max: _next.ObservationCode.VO2_MAX,
27
+ HKElectrocardiogramType: _next.ObservationCode.ECG,
28
+ BloodPressure: _next.ObservationCode.SYSTOLIC_BLOOD_PRESSURE,
29
+ HeartRate: _next.ObservationCode.HEART_RATE,
30
+ BloodGlucose: _next.ObservationCode.BLOOD_GLUCOSE,
31
+ Weight: _next.ObservationCode.BODY_WEIGHT,
32
+ OxygenSaturation: _next.ObservationCode.OXYGEN_SATURATION,
33
+ RespiratoryRate: _next.ObservationCode.RESPIRATORY_RATE,
34
+ BodyTemperature: _next.ObservationCode.BODY_TEMPERATURE,
35
+ Steps: _next.ObservationCode.STEPS,
36
+ RestingHeartRate: _next.ObservationCode.RESTING_HEART_RATE,
37
+ Vo2Max: _next.ObservationCode.VO2_MAX
38
+ };
39
+
40
+ /** Health Connect records that feed more than one data type: each type is coded by the record field it reads. */
41
+ const SHARED_RECORD_FIELDS = {
42
+ Nutrition: {
43
+ [_healthSyncKeys.HealthDataType.carbohydrates]: "totalCarbohydrate",
44
+ [_healthSyncKeys.HealthDataType.caloriesEaten]: "energy"
45
+ },
46
+ ExerciseSession: {
47
+ [_healthSyncKeys.HealthDataType.exerciseMinutes]: "duration"
48
+ }
49
+ };
50
+
51
+ /** The coding a type is saved under when the app names none: core's own code for a core measurement, else the catalog's. */
52
+ const getDefaultHealthCoding = (provider, key, identifier, mode) => {
53
+ const coreCode = (0, _toCoreHealthObservations.isCoreMeasurementTypeKey)(key) ? CORE_MEASUREMENT_CODES[identifier] : undefined;
54
+ if (coreCode) {
55
+ return {
56
+ code: coreCode,
57
+ system: _fhirSystems.LOINC_SYSTEM
58
+ };
59
+ }
60
+ const coding = (0, _healthDataCatalog.getHealthDataCoding)(provider, identifier, mode);
61
+ const field = SHARED_RECORD_FIELDS[identifier]?.[key];
62
+ return field ? {
63
+ code: `${coding.code}.${field}`,
64
+ system: coding.system
65
+ } : coding;
66
+ };
67
+ exports.getDefaultHealthCoding = getDefaultHealthCoding;
68
+ //# sourceMappingURL=default-health-coding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_next","require","_healthSyncKeys","_fhirSystems","_healthDataCatalog","_toCoreHealthObservations","CORE_MEASUREMENT_CODES","HKQuantityTypeIdentifierBloodPressureSystolic","ObservationCode","SYSTOLIC_BLOOD_PRESSURE","HKQuantityTypeIdentifierBloodPressureDiastolic","DIASTOLIC_BLOOD_PRESSURE","HKQuantityTypeIdentifierHeartRate","HEART_RATE","HKQuantityTypeIdentifierBloodGlucose","BLOOD_GLUCOSE","HKQuantityTypeIdentifierBodyMass","BODY_WEIGHT","HKQuantityTypeIdentifierOxygenSaturation","OXYGEN_SATURATION","HKQuantityTypeIdentifierRespiratoryRate","RESPIRATORY_RATE","HKQuantityTypeIdentifierBodyTemperature","BODY_TEMPERATURE","HKQuantityTypeIdentifierStepCount","STEPS","HKQuantityTypeIdentifierHeartRateVariabilitySDNN","HEART_RATE_VARIABILITY","HKQuantityTypeIdentifierRestingHeartRate","RESTING_HEART_RATE","HKQuantityTypeIdentifierWalkingHeartRateAverage","WALKING_HEART_RATE_AVERAGE","HKQuantityTypeIdentifierVO2Max","VO2_MAX","HKElectrocardiogramType","ECG","BloodPressure","HeartRate","BloodGlucose","Weight","OxygenSaturation","RespiratoryRate","BodyTemperature","Steps","RestingHeartRate","Vo2Max","SHARED_RECORD_FIELDS","Nutrition","HealthDataType","carbohydrates","caloriesEaten","ExerciseSession","exerciseMinutes","getDefaultHealthCoding","provider","key","identifier","mode","coreCode","isCoreMeasurementTypeKey","undefined","code","system","LOINC_SYSTEM","coding","getHealthDataCoding","field","exports"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/default-health-coding.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,yBAAA,GAAAJ,OAAA;AAEA;AACA,MAAMK,sBAA0E,GAAG;EACjFC,6CAA6C,EAAEC,qBAAe,CAACC,uBAAuB;EACtFC,8CAA8C,EAAEF,qBAAe,CAACG,wBAAwB;EACxFC,iCAAiC,EAAEJ,qBAAe,CAACK,UAAU;EAC7DC,oCAAoC,EAAEN,qBAAe,CAACO,aAAa;EACnEC,gCAAgC,EAAER,qBAAe,CAACS,WAAW;EAC7DC,wCAAwC,EAAEV,qBAAe,CAACW,iBAAiB;EAC3EC,uCAAuC,EAAEZ,qBAAe,CAACa,gBAAgB;EACzEC,uCAAuC,EAAEd,qBAAe,CAACe,gBAAgB;EACzEC,iCAAiC,EAAEhB,qBAAe,CAACiB,KAAK;EACxDC,gDAAgD,EAAElB,qBAAe,CAACmB,sBAAsB;EACxFC,wCAAwC,EAAEpB,qBAAe,CAACqB,kBAAkB;EAC5EC,+CAA+C,EAAEtB,qBAAe,CAACuB,0BAA0B;EAC3FC,8BAA8B,EAAExB,qBAAe,CAACyB,OAAO;EACvDC,uBAAuB,EAAE1B,qBAAe,CAAC2B,GAAG;EAC5CC,aAAa,EAAE5B,qBAAe,CAACC,uBAAuB;EACtD4B,SAAS,EAAE7B,qBAAe,CAACK,UAAU;EACrCyB,YAAY,EAAE9B,qBAAe,CAACO,aAAa;EAC3CwB,MAAM,EAAE/B,qBAAe,CAACS,WAAW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7
7
  var _dateFns = require("date-fns");
8
8
  var _reactNativeHealthConnect = require("react-native-health-connect");
9
9
  var _constants = require("../constants.js");
10
+ var _healthSyncKeys = require("../types/health-sync-keys.js");
10
11
  var _healthConnectSeries = require("./health-connect-series.js");
11
12
  var _isDailyAggregateMode = require("./is-daily-aggregate-mode.js");
12
13
  var _syncWindowStart = require("./sync-window-start.js");
@@ -14,13 +15,14 @@ var _syncWindowStart = require("./sync-window-start.js");
14
15
 
15
16
  const getRecordsFromHealthConnect = async ({
16
17
  typeIdentifier,
18
+ key,
17
19
  startDate: _startDate,
18
20
  chunkSize = _constants.DEFAULT_HEALTH_SYNC_CHUNK_SIZE,
19
21
  anchor,
20
22
  mode = "point"
21
23
  }) => {
22
24
  if ((0, _isDailyAggregateMode.isDailyAggregateMode)(mode)) {
23
- return getDailyAggregates(typeIdentifier, mode, _startDate);
25
+ return getDailyAggregates(typeIdentifier, mode, _startDate, key);
24
26
  }
25
27
  if (mode === "series") {
26
28
  return (0, _healthConnectSeries.getHealthConnectSeries)(typeIdentifier, (0, _syncWindowStart.syncWindowStart)(_startDate));
@@ -138,7 +140,7 @@ const decodeAnchor = anchor => {
138
140
  return undefined;
139
141
  }
140
142
  };
141
- const getDailyAggregates = async (typeIdentifier, mode, _startDate) => {
143
+ const getDailyAggregates = async (typeIdentifier, mode, _startDate, key) => {
142
144
  const aggregateType = typeIdentifier;
143
145
  const startDate = _startDate ? (0, _dateFns.startOfDay)(new Date(_startDate)) : (0, _dateFns.startOfDay)((0, _dateFns.subDays)(new Date(), _constants.DEFAULT_SYNC_LOOKBACK_DAYS));
144
146
  const today = (0, _dateFns.startOfDay)(new Date());
@@ -160,7 +162,7 @@ const getDailyAggregates = async (typeIdentifier, mode, _startDate) => {
160
162
  return [];
161
163
  }
162
164
  const result = group.result;
163
- const measurement = aggregateMeasurement(typeIdentifier, result, mode);
165
+ const measurement = aggregateMeasurement(typeIdentifier, result, mode, key);
164
166
  if (!measurement) {
165
167
  return [];
166
168
  }
@@ -179,7 +181,7 @@ const getDailyAggregates = async (typeIdentifier, mode, _startDate) => {
179
181
  anchor: undefined
180
182
  };
181
183
  };
182
- const aggregateMeasurement = (typeIdentifier, result, mode) => {
184
+ const aggregateMeasurement = (typeIdentifier, result, mode, key) => {
183
185
  if (mode === "daily-summary" && typeIdentifier === "HeartRate") {
184
186
  const average = numberValue(result.BPM_AVG);
185
187
  return average === undefined ? undefined : {
@@ -200,10 +202,24 @@ const aggregateMeasurement = (typeIdentifier, result, mode) => {
200
202
  return value(numberValue(result.FLOORS_CLIMBED_TOTAL), "count");
201
203
  case "ExerciseSession":
202
204
  return value(scale(nestedNumber(result.EXERCISE_DURATION_TOTAL, "inSeconds"), 1 / 60), "min");
205
+ case "Hydration":
206
+ return value(nestedNumber(result.VOLUME_TOTAL, "inMilliliters"), "mL");
207
+ case "Nutrition":
208
+ return nutrientTotal(result, key);
203
209
  default:
204
210
  return undefined;
205
211
  }
206
212
  };
213
+
214
+ /** The nutrient each data type reads from Health Connect's Nutrition record: its daily total and that total's unit. */
215
+ const NUTRIENT_TOTALS = {
216
+ [_healthSyncKeys.HealthDataType.carbohydrates]: ["TOTAL_CARBOHYDRATE_TOTAL", "inGrams", "g"],
217
+ [_healthSyncKeys.HealthDataType.caloriesEaten]: ["ENERGY_TOTAL", "inKilocalories", "kcal"]
218
+ };
219
+ const nutrientTotal = (result, key) => {
220
+ const nutrient = key && NUTRIENT_TOTALS[key];
221
+ return nutrient && value(nestedNumber(result[nutrient[0]], nutrient[1]), nutrient[2]);
222
+ };
207
223
  const value = (measurement, unit) => measurement === undefined ? undefined : {
208
224
  unit,
209
225
  value: measurement
@@ -1 +1 @@
1
- {"version":3,"names":["_dateFns","require","_reactNativeHealthConnect","_constants","_healthConnectSeries","_isDailyAggregateMode","_syncWindowStart","getRecordsFromHealthConnect","typeIdentifier","startDate","_startDate","chunkSize","DEFAULT_HEALTH_SYNC_CHUNK_SIZE","anchor","mode","isDailyAggregateMode","getDailyAggregates","getHealthConnectSeries","syncWindowStart","savedAnchor","decodeAnchor","phase","changes","getChanges","changesToken","recordTypes","changesTokenExpired","data","upsertionChanges","map","record","deletionChanges","length","deletedRecordIds","recordId","hasMore","encodeAnchor","version","nextChangesToken","baseline","readSnapshot","pageToken","undefined","snapshotAnchor","exports","endDate","Date","toISOString","resolvedStartDate","result","readRecords","timeRangeFilter","operator","startTime","endTime","pageSize","nextAnchor","records","Boolean","JSON","stringify","startsWith","parsed","parse","aggregateType","startOfDay","subDays","DEFAULT_SYNC_LOOKBACK_DAYS","today","groups","aggregateGroupByPeriod","recordType","timeRangeSlicer","period","flatMap","group","end","measurement","aggregateMeasurement","dataOrigins","kind","sourceApp","average","numberValue","BPM_AVG","unit","minimum","BPM_MIN","maximum","BPM_MAX","value","COUNT_TOTAL","nestedNumber","DISTANCE","ACTIVE_CALORIES_TOTAL","FLOORS_CLIMBED_TOTAL","scale","EXERCISE_DURATION_TOTAL","Number","isFinite","key","factor"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-records-from-health-connect.ts"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AASA,IAAAE,UAAA,GAAAF,OAAA;AAMA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AApBA;;AA2BO,MAAMM,2BAA2B,GAAG,MAAAA,CAAO;EAChDC,cAAc;EACdC,SAAS,EAAEC,UAAU;EACrBC,SAAS,GAAGC,yCAA8B;EAC1CC,MAAM;EACNC,IAAI,GAAG;AAC6B,CAAC,KAElC;EACH,IAAI,IAAAC,0CAAoB,EAACD,IAAI,CAAC,EAAE;IAC9B,OAAOE,kBAAkB,CAACR,cAAc,EAAEM,IAAI,EAAEJ,UAAU,CAAC;EAC7D;EAEA,IAAII,IAAI,KAAK,QAAQ,EAAE;IACrB,OAAO,IAAAG,2CAAsB,EAACT,cAAc,E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AC,GAAGA,KAAK,GAAGhD,SAAS;AAEzE,MAAMkD,YAAY,GAAGA,CAACF,KAAc,EAAEU,GAAW,KAC/CjB,WAAW,CAAEO,KAAK,GAA2CU,GAAG,CAAC,CAAC;AAEpE,MAAMJ,KAAK,GAAGA,CAACN,KAAyB,EAAEW,MAAc,KACtDX,KAAK,KAAKhD,SAAS,GAAGA,SAAS,GAAGgD,KAAK,GAAGW,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_dateFns","require","_reactNativeHealthConnect","_constants","_healthSyncKeys","_healthConnectSeries","_isDailyAggregateMode","_syncWindowStart","getRecordsFromHealthConnect","typeIdentifier","key","startDate","_startDate","chunkSize","DEFAULT_HEALTH_SYNC_CHUNK_SIZE","anchor","mode","isDailyAggregateMode","getDailyAggregates","getHealthConnectSeries","syncWindowStart","savedAnchor","decodeAnchor","phase","changes","getChanges","changesToken","recordTypes","changesTokenExpired","data","upsertionChanges","map","record","deletionChanges","length","deletedRecordIds","recordId","hasMore","encodeAnchor","version","nextChangesToken","baseline","readSnapshot","pageToken","undefined","snapshotAnchor","exports","endDate","Date","toISOString","resolvedStartDate","result","readRecords","timeRangeFilter","operator","startTime","endTime","pageSize","nextAnchor","records","Boolean","JSON","stringify","startsWith","parsed","parse","aggregateType","startOfDay","subDays","DEFAULT_SYNC_LOOKBACK_DAYS","today","groups","aggregateGroupByPeriod","recordType","timeRangeSlicer","period","flatMap","group","end","measurement","aggregateMeasurement","dataOrigins","kind","sourceApp","average","numberValue","BPM_AVG","unit","minimum","BPM_MIN","maximum","BPM_MAX","value","COUNT_TOTAL","nestedNumber","DISTANCE","ACTIVE_CALORIES_TOTAL","FLOORS_CLIMBED_TOTAL","scale","EXERCISE_DURATION_TOTAL","VOLUME_TOTAL","nutrientTotal","NUTRIENT_TOTALS","HealthDataType","carbohydrates","caloriesEaten","nutrient","Number","isFinite","factor"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-records-from-health-connect.ts"],"mappings":";;;;;;AAEA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AI;EAAEK,KAAK,EAAEb;AAAY,CAAC;AAEtE,MAAMM,WAAW,GAAIO,KAAc,IACjC,OAAOA,KAAK,KAAK,QAAQ,IAAIe,MAAM,CAACC,QAAQ,CAAChB,KAAK,CAAC,GAAGA,KAAK,GAAGhD,SAAS;AAEzE,MAAMkD,YAAY,GAAGA,CAACF,KAAc,EAAElF,GAAW,KAC/C2E,WAAW,CAAEO,KAAK,GAA2ClF,GAAG,CAAC,CAAC;AAEpE,MAAMwF,KAAK,GAAGA,CAACN,KAAyB,EAAEiB,MAAc,KACtDjB,KAAK,KAAKhD,SAAS,GAAGA,SAAS,GAAGgD,KAAK,GAAGiB,MAAM","ignoreList":[]}
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getSamplesFromHealth = void 0;
7
7
  var _reactNativeHealthkit = _interopRequireWildcard(require("@kingstinct/react-native-healthkit"));
8
- var _dateFns = require("date-fns");
9
8
  var _constants = require("../constants.js");
10
9
  var _healthUnits = require("./health-units.js");
10
+ var _healthkitDailyStatistics = require("./healthkit-daily-statistics.js");
11
11
  var _healthkitDataTypes = require("./healthkit-data-types.js");
12
+ var _healthkitQueryOptions = require("./healthkit-query-options.js");
13
+ var _healthkitSamples = require("./healthkit-samples.js");
12
14
  var _healthkitSeries = require("./healthkit-series.js");
13
15
  var _isDailyAggregateMode = require("./is-daily-aggregate-mode.js");
14
16
  var _syncWindowStart = require("./sync-window-start.js");
@@ -26,63 +28,58 @@ const getSamplesFromHealth = async ({
26
28
  if (!(0, _healthkitDataTypes.isQuantityIdentifier)(typeIdentifier)) {
27
29
  throw new _healthkitDataTypes.UnsupportedHealthKitDataError(typeIdentifier, `HealthKit ${mode} mode is only supported for quantity samples.`);
28
30
  }
29
- return mode === "series" ? (0, _healthkitSeries.getHealthKitSeries)(typeIdentifier, startDate) : getDailyStatistics(typeIdentifier, mode, startDate, endDate);
31
+ return mode === "series" ? (0, _healthkitSeries.getHealthKitSeries)(typeIdentifier, startDate) : (0, _healthkitDailyStatistics.getDailyStatistics)(typeIdentifier, mode, startDate, endDate);
30
32
  }
33
+ const filter = (0, _healthkitQueryOptions.strictDateWindow)(startDate, endDate);
31
34
  const options = {
32
- from: startDate,
33
- to: endDate,
34
35
  limit: chunkSize,
35
- anchor
36
+ anchor,
37
+ filter
36
38
  };
37
- if (typeIdentifier === _reactNativeHealthkit.HKWorkoutTypeIdentifier && typeof _reactNativeHealthkit.default.queryWorkoutSamplesWithAnchor === "function") {
38
- const result = await _reactNativeHealthkit.default.queryWorkoutSamplesWithAnchor({
39
+ if (typeIdentifier === _reactNativeHealthkit.WorkoutTypeIdentifier) {
40
+ const result = await _reactNativeHealthkit.default.queryWorkoutSamplesWithAnchor(options);
41
+ return toAnchoredResult(typeIdentifier, result.workouts.map(_healthkitSamples.toWorkoutRecord), result);
42
+ }
43
+ if (typeIdentifier === _reactNativeHealthkit.ElectrocardiogramTypeIdentifier) {
44
+ const limit = Math.min(chunkSize, _constants.ECG_PAGE_SIZE);
45
+ const result = await _reactNativeHealthkit.default.queryElectrocardiogramSamplesWithAnchor({
39
46
  ...options,
40
- energyUnit: _reactNativeHealthkit.UnitOfEnergy.Kilocalories,
41
- distanceUnit: "km"
47
+ limit,
48
+ includeVoltages: true
42
49
  });
43
- if (!result) {
44
- return {
45
- data: [],
46
- anchor: undefined
47
- };
48
- }
49
- return toAnchoredResult(typeIdentifier, result);
50
+ return {
51
+ ...toAnchoredResult(typeIdentifier, result.samples.map(_healthkitSamples.toEcgRecord), result),
52
+ hasMore: result.samples.length >= limit
53
+ };
50
54
  }
51
- if (typeIdentifier === "HKDataTypeIdentifierHeartbeatSeries" && typeof _reactNativeHealthkit.default.queryHeartbeatSeriesSamplesWithAnchor === "function") {
55
+ if (typeIdentifier === "HKDataTypeIdentifierHeartbeatSeries") {
52
56
  const result = await _reactNativeHealthkit.default.queryHeartbeatSeriesSamplesWithAnchor(options);
53
- return toAnchoredResult(typeIdentifier, result);
57
+ return toAnchoredResult(typeIdentifier, result.samples.map(_healthkitSamples.toPlainSample), result);
54
58
  }
55
- if ((0, _healthkitDataTypes.isCategoryIdentifier)(typeIdentifier) && typeof _reactNativeHealthkit.default.queryCategorySamplesWithAnchor === "function") {
59
+ if ((0, _healthkitDataTypes.isCategoryIdentifier)(typeIdentifier)) {
56
60
  const result = await _reactNativeHealthkit.default.queryCategorySamplesWithAnchor(typeIdentifier, options);
57
- if (!result) {
58
- return {
59
- data: [],
60
- anchor: undefined
61
- };
62
- }
63
- return toAnchoredResult(typeIdentifier, result);
61
+ return toAnchoredResult(typeIdentifier, result.samples.map(_healthkitSamples.toPlainSample), result);
64
62
  }
65
63
  if ((0, _healthkitDataTypes.isCorrelationIdentifier)(typeIdentifier)) {
66
- const samples = await _reactNativeHealthkit.default.queryCorrelationSamples(typeIdentifier, {
67
- from: startDate,
68
- to: endDate
64
+ const correlations = await _reactNativeHealthkit.default.queryCorrelationSamples(typeIdentifier, {
65
+ limit: _healthkitQueryOptions.ALL_SAMPLES,
66
+ ascending: true,
67
+ filter
69
68
  });
70
69
  return {
71
- data: [...samples],
70
+ data: correlations.map(_healthkitSamples.toPlainCorrelation),
72
71
  anchor: undefined
73
72
  };
74
73
  }
75
74
  if (typeIdentifier === "HKStateOfMindTypeIdentifier") {
75
+ // State of mind is read by window, not by anchor, so an unlimited page keeps the window from being cut short.
76
76
  const samples = await _reactNativeHealthkit.default.queryStateOfMindSamples({
77
- from: startDate,
78
- to: endDate,
79
- // This wrapper's state-of-mind API is not anchored. A zero limit maps to
80
- // HealthKit's unbounded query and avoids silently truncating the window.
81
- limit: 0,
82
- ascending: false
77
+ limit: _healthkitQueryOptions.ALL_SAMPLES,
78
+ ascending: false,
79
+ filter
83
80
  });
84
81
  return {
85
- data: [...samples],
82
+ data: samples.map(_healthkitSamples.toPlainSample),
86
83
  anchor: undefined
87
84
  };
88
85
  }
@@ -91,13 +88,7 @@ const getSamplesFromHealth = async ({
91
88
  ...options,
92
89
  unit: (0, _healthUnits.healthUnitFor)(typeIdentifier)
93
90
  });
94
- if (!result) {
95
- return {
96
- data: [],
97
- anchor: undefined
98
- };
99
- }
100
- return toAnchoredResult(typeIdentifier, result);
91
+ return toAnchoredResult(typeIdentifier, result.samples.map(_healthkitSamples.toPlainSample), result);
101
92
  }
102
93
  throw new _healthkitDataTypes.UnsupportedHealthKitDataError(typeIdentifier, (0, _healthkitDataTypes.unsupportedHealthKitTypeReason)(typeIdentifier));
103
94
  };
@@ -112,49 +103,15 @@ const deletedRecordIds = samples => {
112
103
  };
113
104
 
114
105
  /** Maps one page of an anchored HealthKit query to the provider result shape. */
115
- const toAnchoredResult = (typeIdentifier, result) => ({
116
- data: [...result.samples],
117
- ...deletedRecordIds(result.deletedSamples),
118
- anchor: result.newAnchor ? {
106
+ const toAnchoredResult = (typeIdentifier, data, {
107
+ deletedSamples,
108
+ newAnchor
109
+ }) => ({
110
+ data,
111
+ ...deletedRecordIds(deletedSamples),
112
+ anchor: newAnchor ? {
119
113
  typeIdentifier,
120
- anchor: result.newAnchor
114
+ anchor: newAnchor
121
115
  } : undefined
122
116
  });
123
- const getDailyStatistics = async (typeIdentifier, mode, startDate, endDate) => {
124
- const firstDay = (0, _dateFns.startOfDay)(startDate);
125
- const today = (0, _dateFns.startOfDay)(endDate);
126
- const options = mode === "daily-total" ? [_reactNativeHealthkit.HKStatisticsOptions.cumulativeSum] : [_reactNativeHealthkit.HKStatisticsOptions.discreteAverage, _reactNativeHealthkit.HKStatisticsOptions.discreteMin, _reactNativeHealthkit.HKStatisticsOptions.discreteMax];
127
- const statistics = await _reactNativeHealthkit.default.queryStatisticsCollectionForQuantity(typeIdentifier, options, (0, _dateFns.startOfDay)(new Date(2001, 0, 1)), {
128
- day: 1
129
- }, firstDay, today, (0, _healthUnits.healthUnitFor)(typeIdentifier));
130
- const data = statistics.flatMap((statistic, index) => {
131
- const dayStart = (0, _dateFns.addDays)(firstDay, index);
132
- const dayEnd = (0, _dateFns.addDays)(dayStart, 1);
133
- const total = statistic.sumQuantity?.quantity;
134
- const average = statistic.averageQuantity?.quantity;
135
- const minimum = statistic.minimumQuantity?.quantity;
136
- const maximum = statistic.maximumQuantity?.quantity;
137
- if (dayEnd > today || (mode === "daily-total" ? total === undefined : average === undefined)) {
138
- return [];
139
- }
140
- return [{
141
- kind: mode,
142
- typeIdentifier,
143
- startDate: dayStart,
144
- endDate: dayEnd,
145
- unit: statistic.sumQuantity?.unit ?? statistic.averageQuantity?.unit ?? (0, _healthUnits.healthUnitFor)(typeIdentifier) ?? "1",
146
- ...(mode === "daily-total" ? {
147
- value: total
148
- } : {
149
- average,
150
- minimum,
151
- maximum
152
- })
153
- }];
154
- });
155
- return {
156
- data,
157
- anchor: undefined
158
- };
159
- };
160
117
  //# sourceMappingURL=get-samples-from-health.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeHealthkit","_interopRequireWildcard","require","_dateFns","_constants","_healthUnits","_healthkitDataTypes","_healthkitSeries","_isDailyAggregateMode","_syncWindowStart","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getSamplesFromHealth","startDate","_startDate","typeIdentifier","anchor","chunkSize","DEFAULT_HEALTH_SYNC_CHUNK_SIZE","mode","syncWindowStart","endDate","Date","isDailyAggregateMode","isQuantityIdentifier","UnsupportedHealthKitDataError","getHealthKitSeries","getDailyStatistics","options","from","to","limit","HKWorkoutTypeIdentifier","Healthkit","queryWorkoutSamplesWithAnchor","result","energyUnit","UnitOfEnergy","Kilocalories","distanceUnit","data","undefined","toAnchoredResult","queryHeartbeatSeriesSamplesWithAnchor","isCategoryIdentifier","queryCategorySamplesWithAnchor","isCorrelationIdentifier","samples","queryCorrelationSamples","queryStateOfMindSamples","ascending","queryQuantitySamplesWithAnchor","unit","healthUnitFor","unsupportedHealthKitTypeReason","exports","deletedRecordIds","recordIds","map","uuid","length","deletedSamples","newAnchor","firstDay","startOfDay","today","HKStatisticsOptions","cumulativeSum","discreteAverage","discreteMin","discreteMax","statistics","queryStatisticsCollectionForQuantity","day","flatMap","statistic","index","dayStart","addDays","dayEnd","total","sumQuantity","quantity","average","averageQuantity","minimum","minimumQuantity","maximum","maximumQuantity","kind","value"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-samples-from-health.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAMA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAOA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AAAsD,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,E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SAAS,GAAG0C,OAAO,KAAK1C,SAAS,CAAC,EACtE;MACA,OAAO,EAAE;IACX;IAEA,OAAO,CACL;MACEgD,IAAI,EAAEtE,IAAI;MACVJ,cAAc;MACdF,SAAS,EAAEgE,QAAQ;MACnBxD,OAAO,EAAE0D,MAAM;MACf3B,IAAI,EACFuB,SAAS,CAACM,WAAW,EAAE7B,IAAI,IAC3BuB,SAAS,CAACS,eAAe,EAAEhC,IAAI,IAC/B,IAAAC,0BAAa,EAACtC,cAAc,CAAC,IAC7B,GAAG;MACL,IAAII,IAAI,KAAK,aAAa,GACtB;QAAEuE,KAAK,EAAEV;MAAM,CAAC,GAChB;QAAEG,OAAO;QAAEE,OAAO;QAAEE;MAAQ,CAAC;IACnC,CAAC,CACF;EACH,CAAC,CAAC;EAEF,OAAO;IAAE/C,IAAI;IAAExB,MAAM,EAAEyB;EAAU,CAAC;AACpC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeHealthkit","_interopRequireWildcard","require","_constants","_healthUnits","_healthkitDailyStatistics","_healthkitDataTypes","_healthkitQueryOptions","_healthkitSamples","_healthkitSeries","_isDailyAggregateMode","_syncWindowStart","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getSamplesFromHealth","startDate","_startDate","typeIdentifier","anchor","chunkSize","DEFAULT_HEALTH_SYNC_CHUNK_SIZE","mode","syncWindowStart","endDate","Date","isDailyAggregateMode","isQuantityIdentifier","UnsupportedHealthKitDataError","getHealthKitSeries","getDailyStatistics","filter","strictDateWindow","options","limit","WorkoutTypeIdentifier","result","Healthkit","queryWorkoutSamplesWithAnchor","toAnchoredResult","workouts","map","toWorkoutRecord","ElectrocardiogramTypeIdentifier","Math","min","ECG_PAGE_SIZE","queryElectrocardiogramSamplesWithAnchor","includeVoltages","samples","toEcgRecord","hasMore","length","queryHeartbeatSeriesSamplesWithAnchor","toPlainSample","isCategoryIdentifier","queryCategorySamplesWithAnchor","isCorrelationIdentifier","correlations","queryCorrelationSamples","ALL_SAMPLES","ascending","data","toPlainCorrelation","undefined","queryStateOfMindSamples","queryQuantitySamplesWithAnchor","unit","healthUnitFor","unsupportedHealthKitTypeReason","exports","deletedRecordIds","recordIds","uuid","deletedSamples","newAnchor"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-samples-from-health.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAIA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAOA,IAAAK,sBAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAMA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,gBAAA,GAAAT,OAAA;AAAsD,SAAAD,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA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AAMjC,gBAAgB,GAAGA,CACvBrB,cAA6C,EAC7C4C,IAAe,EACf;EAAEY,cAAc;EAAEC;AAA6B,CAAC,MAC5C;EACJb,IAAI;EACJ,GAAGS,gBAAgB,CAACG,cAAc,CAAC;EACnCvD,MAAM,EAAEwD,SAAS,GAAG;IAAEzD,cAAc;IAAEC,MAAM,EAAEwD;EAAU,CAAC,GAAGX;AAC9D,CAAC,CAAC","ignoreList":[]}
@@ -8,6 +8,8 @@ var _reactNativeHealthkit = _interopRequireDefault(require("@kingstinct/react-na
8
8
  var _dateFns = require("date-fns");
9
9
  var _getSamplesFromHealth = require("./get-samples-from-health.js");
10
10
  var _healthUnits = require("./health-units.js");
11
+ var _healthkitDataTypes = require("./healthkit-data-types.js");
12
+ var _healthkitQueryOptions = require("./healthkit-query-options.js");
11
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
14
  const getTotalSamplesCount = async props => {
13
15
  const {
@@ -16,7 +18,7 @@ const getTotalSamplesCount = async props => {
16
18
  anchor,
17
19
  mode = "point"
18
20
  } = props;
19
- if (mode !== "point" || !isQuantityIdentifier(typeIdentifier)) {
21
+ if (mode !== "point" || !(0, _healthkitDataTypes.isQuantityIdentifier)(typeIdentifier)) {
20
22
  try {
21
23
  const result = await (0, _getSamplesFromHealth.getSamplesFromHealth)(props);
22
24
  return result.data.length;
@@ -27,10 +29,10 @@ const getTotalSamplesCount = async props => {
27
29
  const startDate = _startDate ? (0, _dateFns.addSeconds)(_startDate, 1) : undefined;
28
30
  try {
29
31
  const result = await _reactNativeHealthkit.default.queryQuantitySamplesWithAnchor(typeIdentifier, {
30
- from: startDate,
31
- to: new Date(),
32
+ limit: _healthkitQueryOptions.ALL_SAMPLES,
32
33
  anchor,
33
- unit: (0, _healthUnits.healthUnitFor)(typeIdentifier)
34
+ unit: (0, _healthUnits.healthUnitFor)(typeIdentifier),
35
+ filter: (0, _healthkitQueryOptions.strictDateWindow)(startDate, new Date())
34
36
  });
35
37
  return result?.samples?.length ?? 0;
36
38
  } catch {
@@ -38,5 +40,4 @@ const getTotalSamplesCount = async props => {
38
40
  }
39
41
  };
40
42
  exports.getTotalSamplesCount = getTotalSamplesCount;
41
- const isQuantityIdentifier = typeIdentifier => typeof typeIdentifier === "string" && typeIdentifier.startsWith("HKQuantityTypeIdentifier");
42
43
  //# sourceMappingURL=get-total-samples-count.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeHealthkit","_interopRequireDefault","require","_dateFns","_getSamplesFromHealth","_healthUnits","e","__esModule","default","getTotalSamplesCount","props","typeIdentifier","startDate","_startDate","anchor","mode","isQuantityIdentifier","result","getSamplesFromHealth","data","length","addSeconds","undefined","Healthkit","queryQuantitySamplesWithAnchor","from","to","Date","unit","healthUnitFor","samples","exports","startsWith"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-total-samples-count.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAA+C,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExC,MAAMG,oBAAoB,GAAG,MAClCC,KAAwD,IACpC;EACpB,MAAM;IAAEC,cAAc;IAAEC,SAAS,EAAEC,UAAU;IAAEC,MAAM;IAAEC,IAAI,GAAG;EAAQ,CAAC,GAAGL,KAAK;EAE/E,IAAIK,IAAI,KAAK,OAAO,IAAI,CAACC,oBAAoB,CAACL,cAAc,CAAC,EAAE;IAC7D,IAAI;MACF,MAAMM,MAAM,GAAG,MAAM,IAAAC,0CAAoB,EAACR,KAAK,CAAC;MAEhD,OAAOO,MAAM,CAACE,IAAI,CAACC,MAAM;IAC3B,CAAC,CAAC,MAAM;MACN,OAAO,CAAC;IACV;EACF;EAEA,MAAMR,SAAS,GAAGC,UAAU,GAAG,IAAAQ,mBAAU,EAACR,UAAU,EAAE,CAAC,CAAC,GAAGS,SAAS;EAEpE,IAAI;IACF,MAAML,MAAM,GAAG,MAAMM,6BAAS,CAACC,8BAA8B,CAC3Db,cAAc,EACd;MACEc,IAAI,EAAEb,SAAS;MACfc,EAAE,EAAE,IAAIC,IAAI,CAAC,CAAC;MACdb,MAAM;MACNc,IAAI,EAAE,IAAAC,0BAAa,EAAClB,cAAc;IACpC,CACF,CAAC;IAED,OAAOM,MAAM,EAAEa,OAAO,EAAEV,MAAM,IAAI,CAAC;EACrC,CAAC,CAAC,MAAM;IACN,OAAO,CAAC;EACV;AACF,CAAC;AAACW,OAAA,CAAAtB,oBAAA,GAAAA,oBAAA;AAEF,MAAMO,oBAAoB,GACxBL,cAA6C,IAE7C,OAAOA,cAAc,KAAK,QAAQ,IAClCA,cAAc,CAACqB,UAAU,CAAC,0BAA0B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeHealthkit","_interopRequireDefault","require","_dateFns","_getSamplesFromHealth","_healthUnits","_healthkitDataTypes","_healthkitQueryOptions","e","__esModule","default","getTotalSamplesCount","props","typeIdentifier","startDate","_startDate","anchor","mode","isQuantityIdentifier","result","getSamplesFromHealth","data","length","addSeconds","undefined","Healthkit","queryQuantitySamplesWithAnchor","limit","ALL_SAMPLES","unit","healthUnitFor","filter","strictDateWindow","Date","samples","exports"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/get-total-samples-count.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AAA0E,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GA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