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

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 (244) 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/services/custom/compile-custom-lepu.js +3 -2
  25. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
  26. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +64 -44
  27. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
  28. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js +98 -0
  29. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js.map +1 -0
  30. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js +127 -0
  31. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js.map +1 -0
  32. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js +12 -7
  33. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
  34. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js +16 -1
  35. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js.map +1 -1
  36. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +10 -2
  37. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  38. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js +2 -7
  39. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -1
  40. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +2 -2
  41. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  42. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
  43. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +74 -17
  44. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
  45. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +4 -4
  46. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
  47. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js +3 -7
  48. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js.map +1 -1
  49. package/lib/commonjs/modules/bt-management/utils/calculate-crc-16-modbus.js +23 -0
  50. package/lib/commonjs/modules/bt-management/utils/calculate-crc-16-modbus.js.map +1 -0
  51. package/lib/commonjs/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js +13 -0
  52. package/lib/commonjs/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js.map +1 -0
  53. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +7 -7
  54. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
  55. package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js +8 -3
  56. package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
  57. package/lib/commonjs/modules/data-sync/utils/default-health-coding.js +47 -0
  58. package/lib/commonjs/modules/data-sync/utils/default-health-coding.js.map +1 -0
  59. package/lib/commonjs/modules/data-sync/utils/health-units.js +6 -1
  60. package/lib/commonjs/modules/data-sync/utils/health-units.js.map +1 -1
  61. package/lib/module/modules/auth/google-return-page/index.js +21 -0
  62. package/lib/module/modules/auth/google-return-page/index.js.map +1 -0
  63. package/lib/module/modules/auth/hooks/use-social-sign-in.web.js +10 -0
  64. package/lib/module/modules/auth/hooks/use-social-sign-in.web.js.map +1 -0
  65. package/lib/module/modules/auth/index.js +2 -1
  66. package/lib/module/modules/auth/index.js.map +1 -1
  67. package/lib/module/modules/auth/session/logout-session.js +1 -1
  68. package/lib/module/modules/auth/session/logout-session.js.map +1 -1
  69. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.web.js +67 -0
  70. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.web.js.map +1 -0
  71. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login.js +1 -1
  72. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login.js.map +1 -1
  73. package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.web.js +68 -0
  74. package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.web.js.map +1 -0
  75. package/lib/module/modules/auth/sign-in/components/social-logins/google-login.js +1 -1
  76. package/lib/module/modules/auth/sign-in/components/social-logins/google-login.js.map +1 -1
  77. package/lib/module/modules/auth/sign-in/index.js +2 -0
  78. package/lib/module/modules/auth/sign-in/index.js.map +1 -1
  79. package/lib/module/modules/auth/sign-in/utils/apple-web-sign-in.js +84 -0
  80. package/lib/module/modules/auth/sign-in/utils/apple-web-sign-in.js.map +1 -0
  81. package/lib/module/modules/auth/sign-in/utils/google-redirect-sign-in.js +84 -0
  82. package/lib/module/modules/auth/sign-in/utils/google-redirect-sign-in.js.map +1 -0
  83. package/lib/module/modules/auth/sign-in/utils/jwt-claims.js +17 -0
  84. package/lib/module/modules/auth/sign-in/utils/jwt-claims.js.map +1 -0
  85. package/lib/module/modules/auth/utils/sign-out-google.web.js +5 -0
  86. package/lib/module/modules/auth/utils/sign-out-google.web.js.map +1 -0
  87. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +3 -2
  88. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
  89. package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +64 -44
  90. package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
  91. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js +91 -0
  92. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js.map +1 -0
  93. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js +123 -0
  94. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js.map +1 -0
  95. package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js +12 -7
  96. package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
  97. package/lib/module/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js +16 -1
  98. package/lib/module/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js.map +1 -1
  99. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +10 -2
  100. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  101. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js +2 -7
  102. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -1
  103. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +2 -2
  104. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  105. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
  106. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +74 -17
  107. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
  108. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +4 -4
  109. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
  110. package/lib/module/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js +3 -7
  111. package/lib/module/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js.map +1 -1
  112. package/lib/module/modules/bt-management/utils/calculate-crc-16-modbus.js +18 -0
  113. package/lib/module/modules/bt-management/utils/calculate-crc-16-modbus.js.map +1 -0
  114. package/lib/module/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js +8 -0
  115. package/lib/module/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js.map +1 -0
  116. package/lib/module/modules/data-sync/services/managers/data-processor.js +7 -7
  117. package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
  118. package/lib/module/modules/data-sync/utils/convert-generic-health-data.js +8 -3
  119. package/lib/module/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
  120. package/lib/module/modules/data-sync/utils/default-health-coding.js +44 -0
  121. package/lib/module/modules/data-sync/utils/default-health-coding.js.map +1 -0
  122. package/lib/module/modules/data-sync/utils/health-units.js +6 -1
  123. package/lib/module/modules/data-sync/utils/health-units.js.map +1 -1
  124. package/lib/typescript/commonjs/src/modules/auth/google-return-page/index.d.ts +8 -0
  125. package/lib/typescript/commonjs/src/modules/auth/google-return-page/index.d.ts.map +1 -0
  126. package/lib/typescript/commonjs/src/modules/auth/hooks/use-social-sign-in.web.d.ts +7 -0
  127. package/lib/typescript/commonjs/src/modules/auth/hooks/use-social-sign-in.web.d.ts.map +1 -0
  128. package/lib/typescript/commonjs/src/modules/auth/index.d.ts +1 -0
  129. package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
  130. package/lib/typescript/commonjs/src/modules/auth/register/components/register.d.ts +2 -2
  131. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +2 -2
  132. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts +5 -0
  133. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login.d.ts +1 -1
  135. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts +5 -0
  136. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login.d.ts +1 -1
  138. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/social-logins.d.ts +2 -2
  139. package/lib/typescript/commonjs/src/modules/auth/sign-in/index.d.ts +2 -0
  140. package/lib/typescript/commonjs/src/modules/auth/sign-in/index.d.ts.map +1 -1
  141. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/apple-login-props.d.ts +13 -0
  142. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/apple-login-props.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/google-login-props.d.ts +13 -0
  144. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/google-login-props.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts +17 -0
  146. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts +14 -0
  148. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts.map +1 -0
  149. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/jwt-claims.d.ts +9 -0
  150. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/jwt-claims.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/src/modules/auth/utils/sign-out-google.web.d.ts +3 -0
  152. package/lib/typescript/commonjs/src/modules/auth/utils/sign-out-google.web.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts +34 -0
  156. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts +32 -0
  158. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts +7 -1
  161. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +2 -0
  163. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  166. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +2 -1
  167. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
  168. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +9 -3
  169. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
  170. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +5 -2
  172. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts +3 -0
  174. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts +3 -0
  176. package/lib/typescript/commonjs/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-props.d.ts +1 -1
  179. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-props.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
  181. package/lib/typescript/commonjs/src/modules/data-sync/utils/default-health-coding.d.ts +10 -0
  182. package/lib/typescript/commonjs/src/modules/data-sync/utils/default-health-coding.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
  184. package/lib/typescript/module/src/modules/auth/google-return-page/index.d.ts +8 -0
  185. package/lib/typescript/module/src/modules/auth/google-return-page/index.d.ts.map +1 -0
  186. package/lib/typescript/module/src/modules/auth/hooks/use-social-sign-in.web.d.ts +7 -0
  187. package/lib/typescript/module/src/modules/auth/hooks/use-social-sign-in.web.d.ts.map +1 -0
  188. package/lib/typescript/module/src/modules/auth/index.d.ts +1 -0
  189. package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
  190. package/lib/typescript/module/src/modules/auth/register/components/register.d.ts +2 -2
  191. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +2 -2
  192. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts +5 -0
  193. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts.map +1 -0
  194. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login.d.ts +1 -1
  195. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts +5 -0
  196. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts.map +1 -0
  197. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login.d.ts +1 -1
  198. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/social-logins.d.ts +2 -2
  199. package/lib/typescript/module/src/modules/auth/sign-in/index.d.ts +2 -0
  200. package/lib/typescript/module/src/modules/auth/sign-in/index.d.ts.map +1 -1
  201. package/lib/typescript/module/src/modules/auth/sign-in/types/apple-login-props.d.ts +13 -0
  202. package/lib/typescript/module/src/modules/auth/sign-in/types/apple-login-props.d.ts.map +1 -1
  203. package/lib/typescript/module/src/modules/auth/sign-in/types/google-login-props.d.ts +13 -0
  204. package/lib/typescript/module/src/modules/auth/sign-in/types/google-login-props.d.ts.map +1 -1
  205. package/lib/typescript/module/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts +17 -0
  206. package/lib/typescript/module/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts.map +1 -0
  207. package/lib/typescript/module/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts +14 -0
  208. package/lib/typescript/module/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts.map +1 -0
  209. package/lib/typescript/module/src/modules/auth/sign-in/utils/jwt-claims.d.ts +9 -0
  210. package/lib/typescript/module/src/modules/auth/sign-in/utils/jwt-claims.d.ts.map +1 -0
  211. package/lib/typescript/module/src/modules/auth/utils/sign-out-google.web.d.ts +3 -0
  212. package/lib/typescript/module/src/modules/auth/utils/sign-out-google.web.d.ts.map +1 -0
  213. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -1
  214. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -1
  215. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts +34 -0
  216. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts.map +1 -0
  217. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts +32 -0
  218. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts.map +1 -0
  219. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts.map +1 -1
  220. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts +7 -1
  221. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts.map +1 -1
  222. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +2 -0
  223. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  224. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -1
  225. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  226. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +2 -1
  227. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
  228. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +9 -3
  229. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
  230. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.d.ts.map +1 -1
  231. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +5 -2
  232. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
  233. package/lib/typescript/module/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts +3 -0
  234. package/lib/typescript/module/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts.map +1 -0
  235. package/lib/typescript/module/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts +3 -0
  236. package/lib/typescript/module/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts.map +1 -0
  237. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  238. package/lib/typescript/module/src/modules/data-sync/types/health-sync-props.d.ts +1 -1
  239. package/lib/typescript/module/src/modules/data-sync/types/health-sync-props.d.ts.map +1 -1
  240. package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
  241. package/lib/typescript/module/src/modules/data-sync/utils/default-health-coding.d.ts +10 -0
  242. package/lib/typescript/module/src/modules/data-sync/utils/default-health-coding.d.ts.map +1 -0
  243. package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
  244. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ import { useOvok } from "@ovok/core/next/react";
4
+ import * as React from "react";
5
+ import { useAppTheme } from "../../../../theme/index.js";
6
+ import { parseSignInError } from "../../../utils/sign-in-error.js";
7
+ import { startGoogleSignIn, takeGoogleIdToken } from "../../utils/google-redirect-sign-in.js";
8
+ import { SocialLoginButton } from "./social-login-button.js";
9
+
10
+ /** Google's sign-in page in this tab; back on the sign-in screen, the ID token it sent signs the user in. */
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ export const GoogleLoginButton = ({
13
+ googleIosClientId: _googleIosClientId,
14
+ googleWebClientId,
15
+ googleRedirectUri,
16
+ internalId,
17
+ onSuccess,
18
+ onError,
19
+ testID,
20
+ style,
21
+ disabled,
22
+ children,
23
+ ...props
24
+ }) => {
25
+ const theme = useAppTheme();
26
+ const client = useOvok();
27
+ const [isLoading, setIsLoading] = React.useState(false);
28
+ const signInWithIdToken = React.useCallback(async idToken => {
29
+ try {
30
+ setIsLoading(true);
31
+ const loginResponse = await client.auth.socialLogin("google", {
32
+ idToken,
33
+ internalId
34
+ });
35
+ onSuccess?.(loginResponse);
36
+ } catch (error) {
37
+ onError?.(parseSignInError(error).error);
38
+ } finally {
39
+ setIsLoading(false);
40
+ }
41
+ }, [client, internalId, onError, onSuccess]);
42
+ const handleGoogleSignIn = React.useCallback(() => {
43
+ try {
44
+ startGoogleSignIn({
45
+ clientId: googleWebClientId,
46
+ redirectUri: googleRedirectUri
47
+ });
48
+ } catch (error) {
49
+ onError?.(parseSignInError(error).error);
50
+ }
51
+ }, [googleRedirectUri, googleWebClientId, onError]);
52
+ React.useEffect(() => {
53
+ const idToken = takeGoogleIdToken();
54
+ if (idToken) {
55
+ void signInWithIdToken(idToken);
56
+ }
57
+ }, [signInWithIdToken]);
58
+ return /*#__PURE__*/_jsx(SocialLoginButton, {
59
+ ...props,
60
+ backgroundColor: theme.dark ? "#000" : "#fff",
61
+ style: style,
62
+ disabled: isLoading || disabled,
63
+ onPress: handleGoogleSignIn,
64
+ testID: testID,
65
+ children: children
66
+ });
67
+ };
68
+ //# sourceMappingURL=google-login-button.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useOvok","React","useAppTheme","parseSignInError","startGoogleSignIn","takeGoogleIdToken","SocialLoginButton","jsx","_jsx","GoogleLoginButton","googleIosClientId","_googleIosClientId","googleWebClientId","googleRedirectUri","internalId","onSuccess","onError","testID","style","disabled","children","props","theme","client","isLoading","setIsLoading","useState","signInWithIdToken","useCallback","idToken","loginResponse","auth","socialLogin","error","handleGoogleSignIn","clientId","redirectUri","useEffect","backgroundColor","dark","onPress"],"sourceRoot":"../../../../../../../src","sources":["modules/auth/sign-in/components/social-logins/google-login-button.web.tsx"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,uBAAuB;AAC/C,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,WAAW,QAAQ,4BAAmB;AAC/C,SAASC,gBAAgB,QAAQ,iCAA8B;AAE/D,SACEC,iBAAiB,EACjBC,iBAAiB,QACZ,wCAAqC;AAE5C,SAASC,iBAAiB,QAAQ,0BAAuB;;AAEzD;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAAC;EAChCC,iBAAiB,EAAEC,kBAAkB;EACrCC,iBAAiB;EACjBC,iBAAiB;EACjBC,UAAU;EACVC,SAAS;EACTC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACR,GAAGC;AACsC,CAAC,KAAK;EAC/C,MAAMC,KAAK,GAAGpB,WAAW,CAAC,CAAC;EAC3B,MAAMqB,MAAM,GAAGvB,OAAO,CAAC,CAAC;EAExB,MAAM,CAACwB,SAAS,EAAEC,YAAY,CAAC,GAAGxB,KAAK,CAACyB,QAAQ,CAAC,KAA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bC,QAAQ,EAAEK,SAAS,IAAIL,QAAS;IAChCqB,OAAO,EAAEN,kBAAmB;IAC5BjB,MAAM,EAAEA,MAAO;IAAAG,QAAA,EAEdA;EAAQ,CACQ,CAAC;AAExB,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { GoogleIcon } from "./google-icon.js";
4
- import { GoogleLoginButton } from "./google-login-button.js";
4
+ import { GoogleLoginButton } from "./google-login-button";
5
5
  import { GoogleLoginText } from "./google-login-text.js";
6
6
 
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["GoogleIcon","GoogleLoginButton","GoogleLoginText","GoogleLogin","Object","assign","Icon","Text"],"sourceRoot":"../../../../../../../src","sources":["modules/auth/sign-in/components/social-logins/google-login.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,kBAAe;AAC1C,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,eAAe,QAAQ,wBAAqB;;AAErD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACJ,iBAAiB,EAAE;EAC1D;EACAK,IAAI,EAAEN,UAAU;EAEhB;EACAO,IAAI,EAAEL;AACR,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["GoogleIcon","GoogleLoginButton","GoogleLoginText","GoogleLogin","Object","assign","Icon","Text"],"sourceRoot":"../../../../../../../src","sources":["modules/auth/sign-in/components/social-logins/google-login.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,kBAAe;AAC1C,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,eAAe,QAAQ,wBAAqB;;AAErD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACJ,iBAAiB,EAAE;EAC1D;EACAK,IAAI,EAAEN,UAAU;EAEhB;EACAO,IAAI,EAAEL;AACR,CAAC,CAAC","ignoreList":[]}
@@ -9,5 +9,7 @@ export * from "./types/spacing-props.js";
9
9
  export * from "./types/signin-form-forgot-password-props.js";
10
10
  export * from "./types/login-with-separator-props.js";
11
11
  export * from "./types/social-logins-props.js";
12
+ export * from "./types/google-login-props.js";
13
+ export * from "./types/apple-login-props.js";
12
14
  export * from "./types/footer-props.js";
13
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SignIn"],"sourceRoot":"../../../../../src","sources":["modules/auth/sign-in/index.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,yBAAsB;AAE7C,cAAc,0BAAuB;AACrC,cAAc,iCAA8B;AAC5C,cAAc,6BAA0B;AACxC,cAAc,gCAA6B;AAC3C,cAAc,0BAAuB;AACrC,cAAc,8CAA2C;AACzD,cAAc,uCAAoC;AAClD,cAAc,gCAA6B;AAC3C,cAAc,yBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["SignIn"],"sourceRoot":"../../../../../src","sources":["modules/auth/sign-in/index.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,yBAAsB;AAE7C,cAAc,0BAAuB;AACrC,cAAc,iCAA8B;AAC5C,cAAc,6BAA0B;AACxC,cAAc,gCAA6B;AAC3C,cAAc,0BAAuB;AACrC,cAAc,8CAA2C;AACzD,cAAc,uCAAoC;AAClD,cAAc,gCAA6B;AAC3C,cAAc,+BAA4B;AAC1C,cAAc,8BAA2B;AACzC,cAAc,yBAAsB","ignoreList":[]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ import { jwtClaims } from "./jwt-claims.js";
4
+ const APPLE_SCRIPT_URL = "https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js";
5
+ const APPLE_CANCEL_ERRORS = new Set(["popup_closed_by_user", "user_cancelled_authorize"]);
6
+ const APPLE_REAL_USER_STATUS_UNKNOWN = 1;
7
+
8
+ /** The Apple credentials Ovok takes, without the `internalId` of the sign-in entry. */
9
+
10
+ /** The Services ID Apple signs the user in for, and the return URL registered for it. */
11
+
12
+ const browser = () => globalThis;
13
+ let appleScript;
14
+
15
+ /** Loads Sign in with Apple JS once; a failed load is tried again on the next call. */
16
+ const loadAppleScript = () => {
17
+ appleScript ??= new Promise((resolve, reject) => {
18
+ const {
19
+ document
20
+ } = browser();
21
+ const script = document.createElement("script");
22
+ script.src = APPLE_SCRIPT_URL;
23
+ script.async = true;
24
+ script.onload = () => resolve();
25
+ script.onerror = () => {
26
+ appleScript = undefined;
27
+ reject(new Error("Sign in with Apple could not be loaded"));
28
+ };
29
+ document.head.append(script);
30
+ });
31
+ return appleScript;
32
+ };
33
+ const appleId = () => {
34
+ const {
35
+ AppleID
36
+ } = browser();
37
+ if (!AppleID) {
38
+ throw new Error("Sign in with Apple is not available");
39
+ }
40
+ return AppleID;
41
+ };
42
+
43
+ // Apple sends the name only the first time the user signs in.
44
+ const appleFullName = name => name ? {
45
+ givenName: name.firstName ?? null,
46
+ familyName: name.lastName ?? null,
47
+ middleName: null,
48
+ namePrefix: null,
49
+ nameSuffix: null,
50
+ nickname: null
51
+ } : null;
52
+ const appleCredentials = ({
53
+ authorization,
54
+ user
55
+ }) => ({
56
+ identityToken: authorization.id_token,
57
+ authorizationCode: authorization.code,
58
+ state: authorization.state ?? null,
59
+ user: jwtClaims(authorization.id_token).sub ?? "",
60
+ email: user?.email ?? "",
61
+ fullName: appleFullName(user?.name),
62
+ realUserStatus: APPLE_REAL_USER_STATUS_UNKNOWN
63
+ });
64
+
65
+ /** Opens Apple's sign-in popup; it must run from a user gesture such as a tap. */
66
+ const signInWithApple = async ({
67
+ servicesId,
68
+ redirectUri
69
+ }) => {
70
+ await loadAppleScript();
71
+ const apple = appleId();
72
+ apple.auth.init({
73
+ clientId: servicesId,
74
+ scope: "name email",
75
+ redirectURI: redirectUri ?? browser().location.origin,
76
+ usePopup: true
77
+ });
78
+ return appleCredentials(await apple.auth.signIn());
79
+ };
80
+
81
+ /** Whether the user closed Apple's popup or declined, which is not an error to report. */
82
+ const isAppleCancel = cause => typeof cause === "object" && cause !== null && APPLE_CANCEL_ERRORS.has(cause.error ?? "");
83
+ export { isAppleCancel, loadAppleScript, signInWithApple };
84
+ //# sourceMappingURL=apple-web-sign-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["jwtClaims","APPLE_SCRIPT_URL","APPLE_CANCEL_ERRORS","Set","APPLE_REAL_USER_STATUS_UNKNOWN","browser","globalThis","appleScript","loadAppleScript","Promise","resolve","reject","document","script","createElement","src","async","onload","onerror","undefined","Error","head","append","appleId","AppleID","appleFullName","name","givenName","firstName","familyName","lastName","middleName","namePrefix","nameSuffix","nickname","appleCredentials","authorization","user","identityToken","id_token","authorizationCode","code","state","sub","email","fullName","realUserStatus","signInWithApple","servicesId","redirectUri","apple","auth","init","clientId","scope","redirectURI","location","origin","usePopup","signIn","isAppleCancel","cause","has","error"],"sourceRoot":"../../../../../../src","sources":["modules/auth/sign-in/utils/apple-web-sign-in.ts"],"mappings":";;AAEA,SAASA,SAAS,QAAQ,iBAAc;AAExC,MAAMC,gBAAgB,GACpB,sFAAsF;AAExF,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAC,CAAC,sBAAsB,EAAE,0BAA0B,CAAC,CAAC;AACzF,MAAMC,8BAA8B,GAAG,CAAC;;AAExC;;AAGA;;AAsCA,MAAMC,OAAO,GAAGA,CAAA,KAAMC,UAAuC;AAE7D,IAAIC,WAAsC;;AAE1C;AACA,MAAMC,eAAe,GAAGA,CAAA,KAAqB;EAC3CD,WAAW,KAAK,IAAIE,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;IACrD,MAAM;MAAEC;IAAS,CAAC,GAAGP,OAAO,CAAC,CAAC;IAC9B,MAAMQ,MAAM,GAAGD,QAAQ,CAACE,aAAa,CAAC,QAAQ,CAAC;IAE/CD,MAAM,CAACE,GAAG,GAAGd,gBAAgB;IAC7BY,MAAM,CAACG,KAAK,GAAG,IAAI;IACnBH,MAAM,CAACI,MAAM,GAAG,MAAM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MAAAA,CAAO;EAC7BC,UAAU;EACVC;AACe,CAAC,KAAmC;EACnD,MAAMzC,eAAe,CAAC,CAAC;EAEvB,MAAM0C,KAAK,GAAG3B,OAAO,CAAC,CAAC;EAEvB2B,KAAK,CAACC,IAAI,CAACC,IAAI,CAAC;IACdC,QAAQ,EAAEL,UAAU;IACpBM,KAAK,EAAE,YAAY;IACnBC,WAAW,EAAEN,WAAW,IAAI5C,OAAO,CAAC,CAAC,CAACmD,QAAQ,CAACC,MAAM;IACrDC,QAAQ,EAAE;EACZ,CAAC,CAAC;EAEF,OAAOvB,gBAAgB,CAAC,MAAMe,KAAK,CAACC,IAAI,CAACQ,MAAM,CAAC,CAAC,CAAC;AACpD,CAAC;;AAED;AACA,MAAMC,aAAa,GAAIC,KAAc,IACnC,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACd3D,mBAAmB,CAAC4D,GAAG,CAAED,KAAK,CAAwBE,KAAK,IAAI,EAAE,CAAC;AAEpE,SACEH,aAAa,EACbpD,eAAe,EACfuC,eAAe","ignoreList":[]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ import { jwtClaims } from "./jwt-claims.js";
4
+ const GOOGLE_AUTHORIZE_URL = "https://accounts.google.com/o/oauth2/v2/auth";
5
+ const GOOGLE_RETURN_PATH = "/oauth/google.html";
6
+ const GOOGLE_REQUEST_KEY = "ovok.google-sign-in";
7
+ const GOOGLE_ANSWER_KEY = "ovok.google-sign-in.answer";
8
+
9
+ /** What this tab asked Google for, kept until the answer comes back. */
10
+
11
+ /** Where the tab goes for the ID token, and which address Google returns it to. */
12
+
13
+ const browser = () => globalThis;
14
+ const authorizeUrl = ({
15
+ clientId,
16
+ redirectUri
17
+ }, {
18
+ state,
19
+ nonce
20
+ }) => {
21
+ const query = new URLSearchParams({
22
+ client_id: clientId,
23
+ redirect_uri: redirectUri,
24
+ response_type: "id_token",
25
+ scope: "openid email profile",
26
+ prompt: "select_account",
27
+ state,
28
+ nonce
29
+ });
30
+ return `${GOOGLE_AUTHORIZE_URL}?${query.toString()}`;
31
+ };
32
+
33
+ /** Sends this tab to Google's sign-in page, remembering the request its answer must match. */
34
+ const startGoogleSignIn = ({
35
+ clientId,
36
+ redirectUri
37
+ }) => {
38
+ const {
39
+ sessionStorage,
40
+ location,
41
+ crypto
42
+ } = browser();
43
+ const request = {
44
+ state: crypto.randomUUID(),
45
+ nonce: crypto.randomUUID(),
46
+ returnTo: `${location.pathname}${location.search}`
47
+ };
48
+ sessionStorage.setItem(GOOGLE_REQUEST_KEY, JSON.stringify(request));
49
+ location.assign(authorizeUrl({
50
+ clientId,
51
+ redirectUri: redirectUri ?? `${location.origin}${GOOGLE_RETURN_PATH}`
52
+ }, request));
53
+ };
54
+ const parseRequest = stored => {
55
+ try {
56
+ return JSON.parse(stored ?? "null") ?? undefined;
57
+ } catch {
58
+ return undefined;
59
+ }
60
+ };
61
+ const answeredIdToken = (answer, request) => {
62
+ const idToken = answer.get("id_token");
63
+ if (!request || !idToken || answer.get("state") !== request.state) {
64
+ return undefined;
65
+ }
66
+ return jwtClaims(idToken).nonce === request.nonce ? idToken : undefined;
67
+ };
68
+
69
+ /** The ID token Google sent back for this tab's own request; the request and the answer are forgotten either way. */
70
+ const takeGoogleIdToken = () => {
71
+ const {
72
+ sessionStorage
73
+ } = browser();
74
+ const answer = sessionStorage.getItem(GOOGLE_ANSWER_KEY);
75
+ if (answer === null) {
76
+ return undefined;
77
+ }
78
+ const request = parseRequest(sessionStorage.getItem(GOOGLE_REQUEST_KEY));
79
+ sessionStorage.removeItem(GOOGLE_ANSWER_KEY);
80
+ sessionStorage.removeItem(GOOGLE_REQUEST_KEY);
81
+ return answeredIdToken(new URLSearchParams(answer), request);
82
+ };
83
+ export { GOOGLE_ANSWER_KEY, GOOGLE_REQUEST_KEY, startGoogleSignIn, takeGoogleIdToken };
84
+ //# sourceMappingURL=google-redirect-sign-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["jwtClaims","GOOGLE_AUTHORIZE_URL","GOOGLE_RETURN_PATH","GOOGLE_REQUEST_KEY","GOOGLE_ANSWER_KEY","browser","globalThis","authorizeUrl","clientId","redirectUri","state","nonce","query","URLSearchParams","client_id","redirect_uri","response_type","scope","prompt","toString","startGoogleSignIn","sessionStorage","location","crypto","request","randomUUID","returnTo","pathname","search","setItem","JSON","stringify","assign","origin","parseRequest","stored","parse","undefined","answeredIdToken","answer","idToken","get","takeGoogleIdToken","getItem","removeItem"],"sourceRoot":"../../../../../../src","sources":["modules/auth/sign-in/utils/google-redirect-sign-in.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,iBAAc;AAExC,MAAMC,oBAAoB,GAAG,8CAA8C;AAC3E,MAAMC,kBAAkB,GAAG,oBAAoB;AAC/C,MAAMC,kBAAkB,GAAG,qBAAqB;AAChD,MAAMC,iBAAiB,GAAG,4BAA4B;;AAEtD;;AASA;;AAuBA,MAAMC,OAAO,GAAGA,CAAA,KAAMC,UAAuC;AAE7D,MAAMC,YAAY,GAAGA,CACnB;EAAEC,QAAQ;EAAEC;AAA6C,CAAC,EAC1D;EAAEC,KAAK;EAAEC;AAAqB,CAAC,KAC5B;EACH,MAAMC,KAAK,GAAG,IAAIC,eAAe,CAAC;IAChCC,SAAS,EAAEN,QAAQ;IACnBO,YAAY,EAAEN,WAAW;IACzBO,aAAa,EAAE,UAAU;IACzBC,KAAK,EAAE,sBAAsB;IAC7BC,MAAM,EAAE,gBAAgB;IACxBR,KAAK;IACLC;EACF,CAAC,CAAC;EAEF,OAAO,GAAGV,oBAAoB,IAAIW,KAAK,CAACO,QAAQ,CAAC,CAAC,EAAE;AACtD,CAAC;;AAED;AACA,MAAMC,iBAAiB,GAAGA,CAAC;EAAEZ,QAAQ;EAAEC;AAAmC,CAAC,KAAW;EACpF,MAAM;IAAEY,cAAc;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGlB,OAAO,CAAC,CAAC;EAEtD,MAAMmB,OAAsB,GAAG;IAC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M,KAAK,IAAI,EAAE;IACnB,OAAOF,SAAS;EAClB;EAEA,MAAMb,OAAO,GAAGU,YAAY,CAACb,cAAc,CAACsB,OAAO,CAACxC,kBAAkB,CAAC,CAAC;EAExEkB,cAAc,CAACuB,UAAU,CAACxC,iBAAiB,CAAC;EAC5CiB,cAAc,CAACuB,UAAU,CAACzC,kBAAkB,CAAC;EAE7C,OAAOmC,eAAe,CAAC,IAAIzB,eAAe,CAAC0B,MAAM,CAAC,EAAEf,OAAO,CAAC;AAC9D,CAAC;AAED,SACEpB,iBAAiB,EACjBD,kBAAkB,EAClBiB,iBAAiB,EACjBsB,iBAAiB","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ /** The claims web sign-in reads from a provider's JWT. */
4
+
5
+ const asClaims = value => typeof value === "object" && value !== null ? value : {};
6
+
7
+ /** A JWT's claims, read without checking the signature; Ovok verifies the token itself. */
8
+ const jwtClaims = jwt => {
9
+ try {
10
+ const payload = (jwt.split(".")[1] ?? "").replace(/-/g, "+").replace(/_/g, "/");
11
+ return asClaims(JSON.parse(atob(payload)));
12
+ } catch {
13
+ return {};
14
+ }
15
+ };
16
+ export { jwtClaims };
17
+ //# sourceMappingURL=jwt-claims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["asClaims","value","jwtClaims","jwt","payload","split","replace","JSON","parse","atob"],"sourceRoot":"../../../../../../src","sources":["modules/auth/sign-in/utils/jwt-claims.ts"],"mappings":";;AAAA;;AAMA,MAAMA,QAAQ,GAAIC,KAAc,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,GAAIA,KAAK,GAAiB,CAAC,CAAC;;AAEzE;AACA,MAAMC,SAAS,GAAIC,GAAW,IAAgB;EAC5C,IAAI;IACF,MAAMC,OAAO,GAAG,CAACD,GAAG,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAEC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAACA,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;IAE/E,OAAON,QAAQ,CAACO,IAAI,CAACC,KAAK,CAACC,IAAI,CAACL,OAAO,CAAC,CAAC,CAAC;EAC5C,CAAC,CAAC,MAAM;IACN,OAAO,CAAC,CAAC;EACX;AACF,CAAC;AAED,SAASF,SAAS","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ /** The web keeps no Google account in the app, so there is nothing to clear. */
4
+ export const signOutGoogleIfNeeded = async () => undefined;
5
+ //# sourceMappingURL=sign-out-google.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["signOutGoogleIfNeeded","undefined"],"sourceRoot":"../../../../../src","sources":["modules/auth/utils/sign-out-google.web.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,qBAAqB,GAAG,MAAAA,CAAA,KAA2BC,SAAS","ignoreList":[]}
@@ -9,6 +9,7 @@ const HEX_BYTE = /^[0-9a-f]{2}$/;
9
9
  const MAX_OPCODE = 0xff;
10
10
  const MAX_DEVICE_TYPE = 0xffff;
11
11
  const MAX_POLL_INTERVAL_MS = 6_000_000;
12
+ const ECG_FILE_DECODERS = ["viatom-compressed", "raw-int16"];
12
13
  const assertFileTransfer = (id, fileTransfer) => {
13
14
  if (fileTransfer === undefined) {
14
15
  return undefined;
@@ -105,8 +106,8 @@ export const compileCustomLepu = (id, spec, serviceUuids) => {
105
106
  const pollIntervalMs = assertPollInterval(id, lepu.pollIntervalMs);
106
107
  const fileTransfer = assertFileTransfer(id, lepu.fileTransfer);
107
108
  const ecgFileDecoder = lepu.ecgFileDecoder;
108
- if (ecgFileDecoder !== undefined && ecgFileDecoder !== "raw-int16") {
109
- throw customDeviceError(id, "lepu.ecgFileDecoder", `is "${String(ecgFileDecoder)}"; expected "raw-int16"`);
109
+ if (ecgFileDecoder !== undefined && !ECG_FILE_DECODERS.includes(ecgFileDecoder)) {
110
+ throw customDeviceError(id, "lepu.ecgFileDecoder", `is "${String(ecgFileDecoder)}"; expected "viatom-compressed"`);
110
111
  }
111
112
  const requestStartByte = lepu.requestStartByte ?? startBytes[0];
112
113
  if (!requestStartByte || !HEX_BYTE.test(requestStartByte.toLowerCase())) {
@@ -1 +1 @@
1
- {"version":3,"names":["assertIntegerInRange","customDeviceError","normalizeBleUuid","HEX_BYTE","MAX_OPCODE","MAX_DEVICE_TYPE","MAX_POLL_INTERVAL_MS","assertFileTransfer","id","fileTransfer","undefined","String","assertProtocol","protocol","assertClockSyncProtocol","assertStartBytes","startBytes","Array","isArray","length","map","byte","index","normalized","toLowerCase","test","assertDeviceTypes","deviceTypes","deviceType","Number","isInteger","assertPollCommand","lepu","pollCommand","assertPollInterval","interval","compileCustomLepu","spec","serviceUuids","services","some","service","write","clockSyncProtocol","expectedDeviceTypes","pollIntervalMs","ecgFileDecoder","requestStartByte","serviceUuid","includes","rejectEncryptionAtBytes","writeWithoutResponse","Boolean","setClockBeforeInfo","manufacturerDataProtocol","characteristicUuid"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-lepu.ts"],"mappings":";;AAAA;;AAKA,SAASA,oBAAoB,QAAQ,8BAA2B;AAChE,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,gBAAgB,QAAQ,yBAAsB;AAEvD,MAAMC,QAAQ,GAAG,eAAe;AAChC,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,eAAe,GAAG,MAAM;AAC9B,MAAMC,oBAAoB,GAAG,SAAS;AAEtC,MAAMC,kBAAkB,GAAGA,CACzBC,EAAU,EACVC,YAAqB,KACiB;EACtC,IAAIA,YAAY,KAAKC,SAAS,EAAE;IAC9B,OAAOA,SAAS;EAClB;EAEA,IACED,YAAY,KAAK,KAAK,IACtBA,YAAY,KAAK,KAAK,IACtBA,YAAY,KAAK,KAAK,EACtB;IACA,MAAMR,iBAAiB,CACrBO,EAAE,EACF,mBAAmB,EACnB,OAAOG,MAAM,CAACF,YAAY,CAAC,mC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C,cAAc,KAAKpC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAEoC;IAAe,CAAC,CAAC;IAE3D9B,UAAU;IACV+B,gBAAgB,EAAEA,gBAAgB,CAACvB,WAAW,CAAC,CAAC;IAChDoB,mBAAmB;IACnB,IAAIX,WAAW,KAAKvB,SAAS,GAAG,CAAC,CAAC,GAAG;MAAEuB;IAAY,CAAC,CAAC;IACrD,IAAIY,cAAc,KAAKnC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAEmC;IAAe,CAAC,CAAC;IAC3D,IAAIb,IAAI,CAACmB,oBAAoB,KAAKzC,SAAS,GACvC,CAAC,CAAC,GACF;MAAEyC,oBAAoB,EAAEC,OAAO,CAACpB,IAAI,CAACmB,oBAAoB;IAAE,CAAC,CAAC;IACjE,IAAInB,IAAI,CAACqB,kBAAkB,KAAK3C,SAAS,GACrC,CAAC,CAAC,GACF;MAAE2C,kBAAkB,EAAED,OAAO,CAACpB,IAAI,CAACqB,kBAAkB;IAAE,CAAC,CAAC;IAC7D,IAAIrB,IAAI,CAACsB,wBAAwB,KAAK5C,SAAS,GAC3C,CAAC,CAAC,GACF;MAAE4C,wBAAwB,EAAEtB,IAAI,CAACsB;IAAyB,CAAC,CAAC;IAChE,IAAIJ,uBAAuB,KAAKxC,SAAS,GACrC,CAAC,CAAC,GACF;MAAEwC,uBAAuB,EAAE,CAAC,GAAGA,uBAAuB;IAAE,CAAC,CAAC;IAC9DR,KAAK,EAAE;MACLM,WAAW;MACXO,kBAAkB,EAAErD,gBAAgB,CAClCM,EAAE,EACF,+BAA+B,EAC/BwB,IAAI,CAACU,KAAK,EAAEa,kBACd;IACF;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["assertIntegerInRange","customDeviceError","normalizeBleUuid","HEX_BYTE","MAX_OPCODE","MAX_DEVICE_TYPE","MAX_POLL_INTERVAL_MS","ECG_FILE_DECODERS","assertFileTransfer","id","fileTransfer","undefined","String","assertProtocol","protocol","assertClockSyncProtocol","assertStartBytes","startBytes","Array","isArray","length","map","byte","index","normalized","toLowerCase","test","assertDeviceTypes","deviceTypes","deviceType","Number","isInteger","assertPollCommand","lepu","pollCommand","assertPollInterval","interval","compileCustomLepu","spec","serviceUuids","services","some","service","write","clockSyncProtocol","expectedDeviceTypes","pollIntervalMs","ecgFileDecoder","includes","requestStartByte","serviceUuid","rejectEncryptionAtBytes","writeWithoutResponse","Boolean","setClockBeforeInfo","manufacturerDataProtocol","characteristicUuid"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-lepu.ts"],"mappings":";;AAAA;;AAKA,SAASA,oBAAoB,QAAQ,8BAA2B;AAChE,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,gBAAgB,QAAQ,yBAAsB;AAEvD,MAAMC,QAAQ,GAAG,eAAe;AAChC,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,eAAe,GAAG,MAAM;AAC9B,MAAMC,oBAAoB,GAAG,SAAS;AAEtC,MAAMC,iBAAqC,GAAG,CAAC,mBAAmB,EAAE,WAAW,CAAC;AAEhF,MAAMC,kBAAkB,GAAGA,CACzBC,EAAU,EACVC,YAAqB,KACiB;EACtC,IAAIA,YAAY,KAAKC,SAAS,EAAE;IAC9B,OAAOA,SAAS;EAClB;EAEA,IACED,YAAY,KAAK,KAAK,IACtBA,YAAY,KAAK,KAAK,IACtBA,YAAY,KAAK,KAAK,EACtB;IACA,MAAMT,iBAAiB,CACrBQ,EAAE,EACF,mBAAmB,EACnB,OAAOG,MAAM,CAACF,YAAY,CAAC,mCAC7B,CAAC;EACH;EAEA,OAAOA,YAAY;AACrB,CAAC;AAED,MAAMG,cAAc,GAAGA,CACrBJ,EAAU,EACVK,QAAiB,KACsB;EACvC,IAAIA,QAAQ,KAAKH,SAAS,EAAE;IAC1B,OAAOA,SAAS;EAClB;EAEA,IAAIG,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,eAAe,EAAE;IACrD,MAAMb,iB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GAAG;MAAEuB;IAAY,CAAC,CAAC;IACrD,IAAIY,cAAc,KAAKnC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAEmC;IAAe,CAAC,CAAC;IAC3D,IAAIb,IAAI,CAACmB,oBAAoB,KAAKzC,SAAS,GACvC,CAAC,CAAC,GACF;MAAEyC,oBAAoB,EAAEC,OAAO,CAACpB,IAAI,CAACmB,oBAAoB;IAAE,CAAC,CAAC;IACjE,IAAInB,IAAI,CAACqB,kBAAkB,KAAK3C,SAAS,GACrC,CAAC,CAAC,GACF;MAAE2C,kBAAkB,EAAED,OAAO,CAACpB,IAAI,CAACqB,kBAAkB;IAAE,CAAC,CAAC;IAC7D,IAAIrB,IAAI,CAACsB,wBAAwB,KAAK5C,SAAS,GAC3C,CAAC,CAAC,GACF;MAAE4C,wBAAwB,EAAEtB,IAAI,CAACsB;IAAyB,CAAC,CAAC;IAChE,IAAIJ,uBAAuB,KAAKxC,SAAS,GACrC,CAAC,CAAC,GACF;MAAEwC,uBAAuB,EAAE,CAAC,GAAGA,uBAAuB;IAAE,CAAC,CAAC;IAC9DR,KAAK,EAAE;MACLO,WAAW;MACXM,kBAAkB,EAAEtD,gBAAgB,CAClCO,EAAE,EACF,+BAA+B,EAC/BwB,IAAI,CAACU,KAAK,EAAEa,kBACd;IACF;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,54 +1,64 @@
1
1
  "use strict";
2
2
 
3
3
  import { MeasurementTypeKey } from "@ovok/core/next";
4
+ import { NO_PARSING_CASES } from "../../../constants/no-parsing-cases.js";
4
5
  import { CaseType } from "../../../types/case-type.js";
5
6
  import { IntegratedDevices } from "../../../types/integrated-devices.js";
6
- import { hexToByte } from "../../../utils/hex-to-byte.js";
7
7
  import { BTManagedDevice } from "../bt-managed-device.js";
8
8
  import { TAIDOC, TAIDOC_CHARACTERISTIC, TAIDOC_SERVICE, taidocCommand } from "../taidoc/taidoc.protocol.js";
9
9
  import { isPatientGlucoseRecord } from "../taidoc/taidoc.records.js";
10
- const BGM_SERVICE = "0003cdd0-0000-1000-8000-00805f9b0131";
11
- const BGM_CHARACTERISTIC = "0003cdd1-0000-1000-8000-00805f9b0131";
10
+ import { TELEBGM_NOTIFY, TELEBGM_SERVICE, TELEBGM_WRITE, TeleBgmFrameReader } from "./telebgm.protocol.js";
11
+ import { TeleBgmSequencer } from "./telebgm.sequencer.js";
12
12
  const GLUCOSE_REQUEST = taidocCommand(TAIDOC.readingResult).join("");
13
- const servicesFor = device => {
14
- const isBgm = device === IntegratedDevices.BGM;
15
- return [{
16
- uuid: isBgm ? BGM_SERVICE : TAIDOC_SERVICE,
17
- monitorUuids: [{
18
- uuid: isBgm ? BGM_CHARACTERISTIC : TAIDOC_CHARACTERISTIC,
19
- parsingModel: {
20
- caseValuePosition: [isBgm ? 9 : 1],
21
- cases: [...(isBgm ? ["00", "0b", "10", "11", "18", "22", "33", "55"] : ["46", ...(device === IntegratedDevices.GLUCOCHECK ? ["50"] : [])]).map(caseValue => ({
22
- caseType: CaseType.OTHER,
23
- caseValue,
24
- parseDefinitions: []
25
- })), {
26
- measurementTypeKey: MeasurementTypeKey.bloodGlucose,
27
- caseType: CaseType.RESULT,
28
- caseValue: isBgm ? "44" : "26",
29
- parseDefinitions: [{
30
- name: "bloodGlucose",
31
- parseType: "custom",
32
- byteIndexes: isBgm ? [10, 11] : [3, 2],
33
- parseReference: 16,
34
- customParserDefinition: value => {
35
- if (isBgm) {
36
- return hexToByte(value.slice(0, 2)) * 100 + hexToByte(value.slice(2, 4));
37
- }
38
- const raw = parseInt(value, 16);
39
- return device === IntegratedDevices.TAIDOC_GLUCOSE ? Number((raw * 18).toFixed(2)) : raw;
40
- }
41
- }]
13
+ const TELEBGM_SERVICES = [{
14
+ uuid: TELEBGM_SERVICE,
15
+ monitorUuids: [{
16
+ uuid: TELEBGM_NOTIFY,
17
+ parsingModel: NO_PARSING_CASES
18
+ }]
19
+ }];
20
+ const taidocServices = device => [{
21
+ uuid: TAIDOC_SERVICE,
22
+ monitorUuids: [{
23
+ uuid: TAIDOC_CHARACTERISTIC,
24
+ parsingModel: {
25
+ caseValuePosition: [1],
26
+ cases: [...["46", ...(device === IntegratedDevices.GLUCOCHECK ? ["50"] : [])].map(caseValue => ({
27
+ caseType: CaseType.OTHER,
28
+ caseValue,
29
+ parseDefinitions: []
30
+ })), {
31
+ measurementTypeKey: MeasurementTypeKey.bloodGlucose,
32
+ caseType: CaseType.RESULT,
33
+ caseValue: "26",
34
+ parseDefinitions: [{
35
+ name: "bloodGlucose",
36
+ parseType: "custom",
37
+ byteIndexes: [3, 2],
38
+ parseReference: 16,
39
+ customParserDefinition: value => {
40
+ const raw = parseInt(value, 16);
41
+ return device === IntegratedDevices.TAIDOC_GLUCOSE ? Number((raw * 18).toFixed(2)) : raw;
42
+ }
42
43
  }]
43
- }
44
- }],
45
- ...(isBgm ? {} : {
46
- writeUuid: {
47
- uuid: TAIDOC_CHARACTERISTIC,
48
- mainCommandUuid: GLUCOSE_REQUEST
49
- }
50
- })
51
- }];
44
+ }]
45
+ }
46
+ }],
47
+ writeUuid: {
48
+ uuid: TAIDOC_CHARACTERISTIC,
49
+ mainCommandUuid: GLUCOSE_REQUEST
50
+ }
51
+ }];
52
+ const writesWithoutResponse = async device => {
53
+ try {
54
+ const characteristics = await device.characteristicsForService(TELEBGM_SERVICE);
55
+ const write = characteristics.find(({
56
+ uuid
57
+ }) => uuid.toLowerCase() === TELEBGM_WRITE);
58
+ return write?.isWritableWithResponse === false && write.isWritableWithoutResponse;
59
+ } catch {
60
+ return false;
61
+ }
52
62
  };
53
63
 
54
64
  /** Decodes the legacy TaiDoc, GlucoCheck Gold and TeleBGM glucose protocols. */
@@ -56,16 +66,26 @@ export class BloodGlucoseDevice extends BTManagedDevice {
56
66
  stuckDataTimeout = 60_000;
57
67
  constructor(device, params) {
58
68
  super(device, params);
59
- this.mainServices = servicesFor(params.deviceName);
69
+ if (params.deviceName !== IntegratedDevices.BGM) {
70
+ this.mainServices = taidocServices(params.deviceName);
71
+ return;
72
+ }
73
+ this.mainServices = TELEBGM_SERVICES;
74
+ this.frameReader = new TeleBgmFrameReader();
75
+ this.createCommandSequencer = () => new TeleBgmSequencer({
76
+ onResult: this.reportResult,
77
+ writesWithoutResponse: () => writesWithoutResponse(device),
78
+ clockSync: params.clockSync
79
+ });
60
80
  }
61
- validatePackage = pkg => pkg.length >= (this.deviceData.name === IntegratedDevices.BGM ? 12 : 8);
81
+ validatePackage = pkg => pkg.length >= 8;
62
82
  handleSuccessResult(result, frame) {
63
83
  if (result.caseType !== CaseType.RESULT || result.bloodGlucose === 0) {
64
84
  return;
65
85
  }
66
86
 
67
87
  // A ketone, cholesterol or control-solution record decodes to a number too; it is not glucose.
68
- if (this.deviceData.name !== IntegratedDevices.BGM && !isPatientGlucoseRecord(frame)) {
88
+ if (!isPatientGlucoseRecord(frame)) {
69
89
  return;
70
90
  }
71
91
  this.onResult?.(result);
@@ -1 +1 @@
1
- {"version":3,"names":["MeasurementTypeKey","CaseType","IntegratedDevices","hexToByte","BTManagedDevice","TAIDOC","TAIDOC_CHARACTERISTIC","TAIDOC_SERVICE","taidocCommand","isPatientGlucoseRecord","BGM_SERVICE","BGM_CHARACTERISTIC","GLUCOSE_REQUEST","readingResult","join","servicesFor","device","isBgm","BGM","uuid","monitorUuids","parsingModel","caseValuePosition","cases","GLUCOCHECK","map","caseValue","caseType","OTHER","parseDefinitions","measurementTypeKey","bloodGlucose","RESULT","name","parseType","byteIndexes","parseReference","customParserDefinition","value","slice","raw","parseInt","TAIDOC_GLUCOSE","Number","toFixed","writeUuid","mainCommandUuid","BloodGlucoseDevice","stuckDataTimeout","constructor","params","mainServices","deviceName","validatePackage","pkg","length","deviceData","handleSuccessResult","result","frame","onResult"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/blood-glucose/blood-glucose.device.ts"],"mappings":";;AAAA,SAAkCA,kBAAkB,QAAQ,iBAAiB;AAG7E,SAASC,QAAQ,QAAQ,6BAA0B;AAGnD,S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,iBAAiB,CAACgB,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;EAE/DuC,mBAAmBA,CAC3BC,MAA2E,EAC3EC,KAAe,EACT;IACN,IAAID,MAAM,CAAC/B,QAAQ,KAAK1B,QAAQ,CAAC+B,MAAM,IAAI0B,MAAM,CAAC3B,YAAY,KAAK,CAAC,EAAE;MACpE;IACF;;IAEA;IACA,IACE,IAAI,CAACyB,UAAU,CAACvB,IAAI,KAAK/B,iBAAiB,CAACgB,GAAG,IAC9C,CAACT,sBAAsB,CAACkD,KAAK,CAAC,EAC9B;MACA;IACF;IAEA,IAAI,CAACC,QAAQ,GAAGF,MAA0D,CAAC;EAC7E;AACF","ignoreList":[]}
1
+ {"version":3,"names":["MeasurementTypeKey","NO_PARSING_CASES","CaseType","IntegratedDevices","BTManagedDevice","TAIDOC","TAIDOC_CHARACTERISTIC","TAIDOC_SERVICE","taidocCommand","isPatientGlucoseRecord","TELEBGM_NOTIFY","TELEBGM_SERVICE","TELEBGM_WRITE","TeleBgmFrameReader","TeleBgmSequencer","GLUCOSE_REQUEST","readingResult","join","TELEBGM_SERVICES","uuid","monitorUuids","parsingModel","taidocServices","device","caseValuePosition","cases","GLUCOCHECK","map","caseValue","caseType","OTHER","parseDefinitions","measurementTypeKey","bloodGlucose","RESULT","name","parseType","byteIndexes","parseReference","customParserDefinition","value","raw","parseInt","TAIDOC_GLUCOSE","Number","toFixed","writeUuid","mainCommandUuid","writesWithoutResponse","characteristics","characteristicsForService","write","find","toLowerCase","isWritableWithResponse","isWritableWithoutResponse","BloodGlucoseDevice","stuckDataTimeout","constructor","params","deviceName","BGM","mainServices","frameReader","createCommandSequencer","onResult","reportResult","clockSync","validatePackage","pkg","length","handleSuccessResult","result","frame"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/blood-glucose/blood-glucose.device.ts"],"mappings":";;AAAA,SAAkCA,kBAAkB,QAAQ,iBAAiB;AAG7E,SAASC,gBAAgB,QAAQ,wCAAqC;AACtE,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