@tryvital/vital-core-react-native 1.6.0 → 1.7.0

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 (230) hide show
  1. package/android/.DS_Store +0 -0
  2. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/ReactNativeBloodPressureSample.dex +0 -0
  3. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/ReactNativeQuantitySample.dex +0 -0
  4. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$BloodPressure.dex +0 -0
  5. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$Companion.dex +0 -0
  6. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$Glucose.dex +0 -0
  7. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData.dex +0 -0
  8. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.dex +0 -0
  9. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.dex +0 -0
  10. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.dex +0 -0
  11. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.dex +0 -0
  12. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.dex +0 -0
  13. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.dex +0 -0
  14. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt$moshi$2.dex +0 -0
  15. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.dex +0 -0
  16. package/android/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/debugUnitTest/R.jar +0 -0
  17. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  18. package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
  19. package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/tryvital_vital-core-react-native_debug.kotlin_module +0 -0
  20. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/ReactNativeBloodPressureSample.class +0 -0
  21. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/ReactNativeQuantitySample.class +0 -0
  22. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$BloodPressure.class +0 -0
  23. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$Companion.class +0 -0
  24. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$Glucose.class +0 -0
  25. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData.class +0 -0
  26. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.class +0 -0
  27. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.class +0 -0
  28. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.class +0 -0
  29. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.class +0 -0
  30. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.class +0 -0
  31. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.class +0 -0
  32. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt$moshi$2.class +0 -0
  33. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.class +0 -0
  34. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  59. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  60. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  61. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  62. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  63. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  65. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  68. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  69. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  70. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  71. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  74. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  95. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
  97. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  100. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  106. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  107. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  108. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  109. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  110. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  111. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  112. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  113. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values +0 -0
  114. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  115. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.s +1 -0
  116. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  119. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  120. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  121. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  122. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  123. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  124. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  125. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  126. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  127. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  128. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  129. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  130. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  131. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  132. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  133. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  134. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  135. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  136. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  137. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  138. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  139. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  140. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  141. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  142. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  143. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  144. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  145. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  146. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  147. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  148. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  149. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  150. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  151. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  152. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  153. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  154. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  155. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  156. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  157. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  158. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  159. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  160. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  161. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  162. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  163. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  164. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  165. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  166. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  167. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  168. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  169. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  170. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  171. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  172. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  173. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  174. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  175. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  176. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  177. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  178. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  179. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  180. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  181. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  182. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  183. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/last-build.bin +0 -0
  184. package/android/build/kotlin/compileDebugUnitTestKotlin/local-state/build-history.bin +0 -0
  185. package/android/build/reports/tests/testDebugUnitTest/classes/com.vitalcorereactnative.SerializationTests.html +101 -0
  186. package/android/build/reports/tests/testDebugUnitTest/css/base-style.css +179 -0
  187. package/android/build/reports/tests/testDebugUnitTest/css/style.css +84 -0
  188. package/android/build/reports/tests/testDebugUnitTest/index.html +133 -0
  189. package/android/build/reports/tests/testDebugUnitTest/js/report.js +194 -0
  190. package/android/build/reports/tests/testDebugUnitTest/packages/com.vitalcorereactnative.html +103 -0
  191. package/android/build/test-results/testDebugUnitTest/TEST-com.vitalcorereactnative.SerializationTests.xml +8 -0
  192. package/android/build/test-results/testDebugUnitTest/binary/output.bin +0 -0
  193. package/android/build/test-results/testDebugUnitTest/binary/output.bin.idx +0 -0
  194. package/android/build/test-results/testDebugUnitTest/binary/results.bin +0 -0
  195. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  196. package/android/build/tmp/kotlin-classes/debug/META-INF/tryvital_vital-core-react-native_debug.kotlin_module +0 -0
  197. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/ReactNativeBloodPressureSample.class +0 -0
  198. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/ReactNativeQuantitySample.class +0 -0
  199. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$BloodPressure.class +0 -0
  200. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$Companion.class +0 -0
  201. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData$Glucose.class +0 -0
  202. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/ReactNativeTimeSeriesData.class +0 -0
  203. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.class +0 -0
  204. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.class +0 -0
  205. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.class +0 -0
  206. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.class +0 -0
  207. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.class +0 -0
  208. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.class +0 -0
  209. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt$moshi$2.class +0 -0
  210. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.class +0 -0
  211. package/android/build/tmp/kotlin-classes/debugUnitTest/META-INF/tryvital_vital-core-react-native_debug.kotlin_module +0 -0
  212. package/android/build/tmp/kotlin-classes/debugUnitTest/com/vitalcorereactnative/SerializationTests.class +0 -0
  213. package/android/build.gradle +7 -0
  214. package/android/src/.DS_Store +0 -0
  215. package/android/src/main/java/com/vitalcorereactnative/VitalCoreReactNativeModule.kt +188 -2
  216. package/android/src/main/java/com/vitalcorereactnative/timeSeriesData.kt +55 -0
  217. package/android/src/test/java/com/vitalcorereactnative/SerializationTests.kt +98 -0
  218. package/ios/VitalCoreReactNative.m +11 -0
  219. package/ios/VitalCoreReactNative.swift +67 -5
  220. package/lib/commonjs/index.js +9 -4
  221. package/lib/commonjs/index.js.map +1 -1
  222. package/lib/module/index.js +9 -4
  223. package/lib/module/index.js.map +1 -1
  224. package/lib/typescript/index.d.ts +4 -4
  225. package/lib/typescript/index.d.ts.map +1 -1
  226. package/lib/typescript/models/Provider.d.ts +5 -0
  227. package/lib/typescript/models/Provider.d.ts.map +1 -1
  228. package/package.json +1 -1
  229. package/src/index.ts +17 -4
  230. package/src/models/Provider.ts +6 -0
@@ -0,0 +1,103 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
+ <meta http-equiv="x-ua-compatible" content="IE=edge"/>
6
+ <title>Test results - Package com.vitalcorereactnative</title>
7
+ <link href="../css/base-style.css" rel="stylesheet" type="text/css"/>
8
+ <link href="../css/style.css" rel="stylesheet" type="text/css"/>
9
+ <script src="../js/report.js" type="text/javascript"></script>
10
+ </head>
11
+ <body>
12
+ <div id="content">
13
+ <h1>Package com.vitalcorereactnative</h1>
14
+ <div class="breadcrumbs">
15
+ <a href="../index.html">all</a> &gt; com.vitalcorereactnative</div>
16
+ <div id="summary">
17
+ <table>
18
+ <tr>
19
+ <td>
20
+ <div class="summaryGroup">
21
+ <table>
22
+ <tr>
23
+ <td>
24
+ <div class="infoBox" id="tests">
25
+ <div class="counter">2</div>
26
+ <p>tests</p>
27
+ </div>
28
+ </td>
29
+ <td>
30
+ <div class="infoBox" id="failures">
31
+ <div class="counter">0</div>
32
+ <p>failures</p>
33
+ </div>
34
+ </td>
35
+ <td>
36
+ <div class="infoBox" id="ignored">
37
+ <div class="counter">0</div>
38
+ <p>ignored</p>
39
+ </div>
40
+ </td>
41
+ <td>
42
+ <div class="infoBox" id="duration">
43
+ <div class="counter">0.233s</div>
44
+ <p>duration</p>
45
+ </div>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </div>
50
+ </td>
51
+ <td>
52
+ <div class="infoBox success" id="successRate">
53
+ <div class="percent">100%</div>
54
+ <p>successful</p>
55
+ </div>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+ </div>
60
+ <div id="tabs">
61
+ <ul class="tabLinks">
62
+ <li>
63
+ <a href="#tab0">Classes</a>
64
+ </li>
65
+ </ul>
66
+ <div id="tab0" class="tab">
67
+ <h2>Classes</h2>
68
+ <table>
69
+ <thread>
70
+ <tr>
71
+ <th>Class</th>
72
+ <th>Tests</th>
73
+ <th>Failures</th>
74
+ <th>Ignored</th>
75
+ <th>Duration</th>
76
+ <th>Success rate</th>
77
+ </tr>
78
+ </thread>
79
+ <tr>
80
+ <td class="success">
81
+ <a href="../classes/com.vitalcorereactnative.SerializationTests.html">SerializationTests</a>
82
+ </td>
83
+ <td>2</td>
84
+ <td>0</td>
85
+ <td>0</td>
86
+ <td>0.233s</td>
87
+ <td class="success">100%</td>
88
+ </tr>
89
+ </table>
90
+ </div>
91
+ </div>
92
+ <div id="footer">
93
+ <p>
94
+ <div>
95
+ <label class="hidden" id="label-for-line-wrapping-toggle" for="line-wrapping-toggle">Wrap lines
96
+ <input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
97
+ </label>
98
+ </div>Generated by
99
+ <a href="http://www.gradle.org">Gradle 7.5.1</a> at 17 May 2023, 17:04:37</p>
100
+ </div>
101
+ </div>
102
+ </body>
103
+ </html>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <testsuite name="com.vitalcorereactnative.SerializationTests" tests="2" skipped="0" failures="0" errors="0" timestamp="2023-05-17T16:04:37" hostname="meter.localdomain" time="0.234">
3
+ <properties/>
4
+ <testcase name="canDeserializeGlucoseSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.232"/>
5
+ <testcase name="canDeserializeBloodPressureSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.001"/>
6
+ <system-out><![CDATA[]]></system-out>
7
+ <system-err><![CDATA[]]></system-err>
8
+ </testsuite>
@@ -129,14 +129,21 @@ repositories {
129
129
  }
130
130
 
131
131
  def kotlin_version = getExtOrDefault('kotlinVersion')
132
+ def vital_sdk_version = '1.0.0-beta.16'
132
133
 
133
134
  dependencies {
134
135
  //noinspection GradleDynamicVersion
135
136
  implementation "com.facebook.react:react-native:+"
136
137
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
138
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
137
139
  api "com.squareup.moshi:moshi:1.13.0"
138
140
  api "com.squareup.moshi:moshi-kotlin:1.13.0"
139
141
  api "com.squareup.moshi:moshi-adapters:1.13.0"
142
+
143
+ implementation "com.github.tryVital.vital-android:VitalClient:$vital_sdk_version"
144
+
145
+ testImplementation "junit:junit:4.13.2"
146
+
140
147
  // From node_modules
141
148
  }
142
149
 
Binary file
@@ -4,30 +4,216 @@ import com.facebook.react.bridge.ReactApplicationContext
4
4
  import com.facebook.react.bridge.ReactContextBaseJavaModule
5
5
  import com.facebook.react.bridge.ReactMethod
6
6
  import com.facebook.react.bridge.Promise
7
+ import com.facebook.react.bridge.WritableNativeArray
8
+ import com.facebook.react.bridge.WritableNativeMap
9
+ import com.facebook.react.module.annotations.ReactModule
10
+ import com.squareup.moshi.Moshi
11
+ import com.squareup.moshi.adapter
12
+ import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
13
+ import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
14
+ import io.tryvital.client.*
15
+ import io.tryvital.client.services.data.ManualProviderSlug
16
+ import io.tryvital.client.services.data.ProviderSlug
17
+ import io.tryvital.client.services.data.Source
18
+ import io.tryvital.client.services.data.TimeseriesPayload
19
+ import io.tryvital.client.utils.VitalLogger
20
+ import kotlinx.coroutines.MainScope
21
+ import kotlinx.coroutines.launch
22
+ import java.security.Provider
23
+ import java.time.ZoneId
24
+ import java.util.*
7
25
 
26
+ const val VITAL_CORE_ERROR = "VitalCoreError"
27
+
28
+ internal val moshi by lazy {
29
+ Moshi.Builder()
30
+ .add(ReactNativeTimeSeriesData.adapterFactory())
31
+ .add(Date::class.java, Rfc3339DateJsonAdapter())
32
+ .addLast(KotlinJsonAdapterFactory())
33
+ .build()
34
+ }
35
+
36
+ @ReactModule(name = VitalCoreReactNativeModule.NAME)
8
37
  class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
9
38
  ReactContextBaseJavaModule(reactContext) {
10
39
 
40
+ private val mainScope = MainScope()
41
+ var client: VitalClient? = null
42
+
11
43
  override fun getName(): String {
12
44
  return NAME
13
45
  }
14
46
 
15
47
  @ReactMethod
16
48
  fun setUserId(userId: String, promise: Promise) {
49
+ val client = client ?: return promise.rejectCoreNotConfigured()
50
+ client.setUserId(userId)
17
51
  promise.resolve(null)
18
52
  }
19
53
 
20
54
  @ReactMethod
21
55
  fun configure(apiKey: String, environment: String, region: String, enableLogs: Boolean, promise: Promise) {
22
- promise.resolve(null)
56
+ try {
57
+ VitalLogger.getOrCreate().enabled = enableLogs
58
+
59
+ client = VitalClient(
60
+ reactApplicationContext,
61
+ // TODO: Expose these as enum constants in the RN SDK
62
+ region = Region.valueOf(region.uppercase()),
63
+ environment = Environment.valueOf(environment.lowercase().replaceFirstChar { it.uppercase() }),
64
+ apiKey = apiKey
65
+ )
66
+
67
+ promise.resolve(null)
68
+ } catch (e: IllegalArgumentException) {
69
+ promise.reject(VITAL_CORE_ERROR, e.message, e)
70
+ }
23
71
  }
24
72
 
25
73
  @ReactMethod
26
74
  fun cleanUp(promise: Promise) {
27
- promise.resolve(null)
75
+ val client = client ?: return promise.rejectCoreNotConfigured()
76
+
77
+ mainScope.launch {
78
+ client.cleanUp()
79
+ promise.resolve(null)
80
+ }
81
+ }
82
+
83
+ @ReactMethod
84
+ fun hasUserConnectedTo(provider: String, promise: Promise) {
85
+ val client = client ?: return promise.rejectCoreNotConfigured()
86
+
87
+ val slug = try { ProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
88
+ return promise.reject(VITAL_CORE_ERROR, "Unrecognized provider slug: $provider")
89
+ }
90
+
91
+ promise.resolve(client.hasUserConnectedTo(slug))
92
+ }
93
+
94
+ @ReactMethod
95
+ fun userConnectedSources(promise: Promise) {
96
+ val client = client ?: return promise.rejectCoreNotConfigured()
97
+ val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
98
+
99
+ mainScope.launch {
100
+ try {
101
+ val sources = client.userConnectedSources(userId)
102
+ promise.resolve(
103
+ WritableNativeArray().apply {
104
+ for (source in sources) {
105
+ WritableNativeMap()
106
+ .apply {
107
+ putString("name", source.name)
108
+ putString("slug", source.slug.toString())
109
+ putString("logo", source.logo)
110
+ }
111
+ .let(this::pushMap)
112
+ }
113
+ }
114
+ )
115
+ } catch (e: Throwable) {
116
+ promise.reject(VITAL_CORE_ERROR, "Failed to look up user connected source: ${e.message}", e)
117
+ }
118
+ }
119
+ }
120
+
121
+ @ReactMethod
122
+ fun createConnectedSourceIfNotExist(provider: String, promise: Promise) {
123
+ val client = client ?: return promise.rejectCoreNotConfigured()
124
+ val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
125
+
126
+ val slug = try { ManualProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
127
+ return promise.reject(VITAL_CORE_ERROR, "Unrecognized manual provider: $provider")
128
+ }
129
+
130
+ mainScope.launch {
131
+ try {
132
+ client.createConnectedSourceIfNotExist(slug, userId)
133
+ promise.resolve(null)
134
+ } catch (e: Throwable) {
135
+ promise.reject(VITAL_CORE_ERROR, "Failed to create connected source for $provider: ${e.message}", e)
136
+ }
137
+ }
138
+ }
139
+
140
+ @ReactMethod
141
+ @OptIn(ExperimentalStdlibApi::class)
142
+ fun postTimeSeriesData(jsonString: String, provider: String, timeZoneString: String?, promise: Promise) {
143
+ val client = client ?: return promise.rejectCoreNotConfigured()
144
+ val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
145
+
146
+ val slug = try { ManualProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
147
+ return promise.reject(VITAL_CORE_ERROR, "Unrecognized manual provider: $provider")
148
+ }
149
+
150
+ val timeZone = if (timeZoneString != null) {
151
+ try {
152
+ ZoneId.of(timeZoneString)
153
+ } catch (e: Exception) {
154
+ promise.reject(VITAL_CORE_ERROR, "Unrecognized named time zone: $timeZoneString", e)
155
+ return
156
+ }
157
+ } else {
158
+ ZoneId.systemDefault()
159
+ }
160
+
161
+ val adapter = moshi.adapter<ReactNativeTimeSeriesData>()
162
+
163
+ val data = adapter.fromJson(jsonString)
164
+ if (data == null) {
165
+ promise.reject(VITAL_CORE_ERROR, "Failed to decode the provided JSON String.", null)
166
+ return
167
+ }
168
+
169
+ fun <T> makeTimeseriesPayload(data: T) = TimeseriesPayload(
170
+ stage = "daily",
171
+ provider = slug,
172
+ startDate = null,
173
+ endDate = null,
174
+ timeZoneId = timeZone.id,
175
+ data = data,
176
+ )
177
+
178
+ mainScope.launch {
179
+ try {
180
+ when (data) {
181
+ is ReactNativeTimeSeriesData.Glucose ->
182
+ client.vitalsService.sendGlucose(
183
+ userId = userId,
184
+ glucosePayloads = makeTimeseriesPayload(
185
+ data.samples.map { it.payload }
186
+ )
187
+ )
188
+ is ReactNativeTimeSeriesData.BloodPressure ->
189
+ client.vitalsService.sendBloodPressure(
190
+ userId = userId,
191
+ timeseriesPayload = makeTimeseriesPayload(
192
+ data.samples.map { it.payload }
193
+ )
194
+ )
195
+ }
196
+
197
+ promise.resolve(null)
198
+ } catch (e: Exception) {
199
+ promise.reject(VITAL_CORE_ERROR, "${(e::class.simpleName ?: "")}: ${e.message}", e)
200
+ }
201
+ }
28
202
  }
29
203
 
30
204
  companion object {
31
205
  const val NAME = "VitalCoreReactNative"
32
206
  }
33
207
  }
208
+
209
+ private fun Promise.rejectCoreNotConfigured()
210
+ = reject(VITAL_CORE_ERROR, "VitalCore client has not been configured.")
211
+
212
+ private fun Promise.rejectUserIDNotSet()
213
+ = reject(VITAL_CORE_ERROR, "User ID has not been set.")
214
+
215
+ private fun ManualProviderSlug.Companion.fromJsonName(name: String): ManualProviderSlug
216
+ = jsonAdapter.fromJsonValue(name) ?: throw java.lang.IllegalArgumentException("Unrecognized manual provider slug: $name")
217
+
218
+ private fun ProviderSlug.Companion.fromJsonName(name: String): ProviderSlug
219
+ = jsonAdapter.fromJsonValue(name) ?: throw java.lang.IllegalArgumentException("Unrecognized provider slug: $name")
@@ -0,0 +1,55 @@
1
+ package com.vitalcorereactnative
2
+
3
+ import com.squareup.moshi.adapters.PolymorphicJsonAdapterFactory
4
+ import io.tryvital.client.services.data.BloodPressureSamplePayload
5
+ import io.tryvital.client.services.data.QuantitySamplePayload
6
+ import java.util.*
7
+
8
+
9
+ sealed class ReactNativeTimeSeriesData {
10
+ data class Glucose(val samples: List<ReactNativeQuantitySample>): ReactNativeTimeSeriesData()
11
+ data class BloodPressure(val samples: List<ReactNativeBloodPressureSample>): ReactNativeTimeSeriesData()
12
+
13
+ companion object {
14
+ fun adapterFactory(): PolymorphicJsonAdapterFactory<ReactNativeTimeSeriesData> = PolymorphicJsonAdapterFactory
15
+ .of(ReactNativeTimeSeriesData::class.java, "type")
16
+ .withSubtype(Glucose::class.java, "glucose")
17
+ .withSubtype(BloodPressure::class.java, "blood_pressure")
18
+ }
19
+ }
20
+
21
+ data class ReactNativeQuantitySample(
22
+ val id: String?,
23
+ val value: Double,
24
+ // JS Date is stringified via `Date.toISOString()` - ISO8601
25
+ val startDate: Date,
26
+ val endDate: Date,
27
+ val sourceBundle: String?,
28
+ val productType: String?,
29
+ val type: String?,
30
+ val unit: String,
31
+ ) {
32
+ val payload get() = QuantitySamplePayload(
33
+ id = id,
34
+ value = value,
35
+ startDate = startDate,
36
+ endDate = endDate,
37
+ sourceBundle = sourceBundle,
38
+ deviceModel = productType,
39
+ type = type,
40
+ unit = unit,
41
+ metadata = null
42
+ )
43
+ }
44
+
45
+ data class ReactNativeBloodPressureSample(
46
+ val systolic: ReactNativeQuantitySample,
47
+ val diastolic: ReactNativeQuantitySample,
48
+ val pulse: ReactNativeQuantitySample?,
49
+ ) {
50
+ val payload get() = BloodPressureSamplePayload(
51
+ systolic = systolic.payload,
52
+ diastolic = diastolic.payload,
53
+ pulse = pulse?.payload
54
+ )
55
+ }
@@ -0,0 +1,98 @@
1
+ package com.vitalcorereactnative
2
+
3
+ import com.squareup.moshi.adapter
4
+ import org.junit.Assert.assertEquals
5
+ import org.junit.Test
6
+ import java.time.Instant
7
+ import java.util.*
8
+
9
+
10
+ class SerializationTests {
11
+ @OptIn(ExperimentalStdlibApi::class)
12
+ @Test
13
+ fun canDeserializeGlucoseSamples() {
14
+ val date = "2023-01-23T12:34:56Z"
15
+ val jsonString = """
16
+ {
17
+ "type": "glucose",
18
+ "samples": [
19
+ {
20
+ "id":"id", "value":123.0, "startDate":"$date", "endDate":"$date",
21
+ "sourceBundle":"source", "productType":"product", "type":"fingerprick", "unit":"mmol/L"
22
+ }
23
+ ]
24
+ }
25
+ """.trimIndent()
26
+ val adapter = moshi.adapter<ReactNativeTimeSeriesData>()
27
+
28
+ assertEquals(
29
+ adapter.fromJson(jsonString),
30
+ ReactNativeTimeSeriesData.Glucose(
31
+ listOf(
32
+ ReactNativeQuantitySample(
33
+ id = "id",
34
+ value = 123.0,
35
+ startDate = Date.from(Instant.parse(date)),
36
+ endDate = Date.from(Instant.parse(date)),
37
+ sourceBundle = "source",
38
+ productType = "product",
39
+ type = "fingerprick",
40
+ unit = "mmol/L",
41
+ )
42
+ )
43
+ )
44
+ )
45
+ }
46
+
47
+ @OptIn(ExperimentalStdlibApi::class)
48
+ @Test
49
+ fun canDeserializeBloodPressureSamples() {
50
+ val date = "2023-01-23T12:34:56Z"
51
+ val jsonString = """
52
+ {
53
+ "type": "blood_pressure",
54
+ "samples": [
55
+ {
56
+ "systolic": {
57
+ "id":"id", "value":100.0, "startDate":"$date", "endDate":"$date",
58
+ "sourceBundle":"source", "productType":"product", "type":"cuff", "unit":"mmHg"
59
+ },
60
+ "diastolic": {
61
+ "id":"id", "value":90.0, "startDate":"$date", "endDate":"$date",
62
+ "sourceBundle":"source", "productType":"product", "type":"cuff", "unit":"mmHg"
63
+ },
64
+ "pulse": {
65
+ "id":"id", "value":80.0, "startDate":"$date", "endDate":"$date",
66
+ "sourceBundle":"source", "productType":"product", "type":"cuff", "unit":"bpm"
67
+ }
68
+ }
69
+ ]
70
+ }
71
+ """.trimIndent()
72
+ val adapter = moshi.adapter<ReactNativeTimeSeriesData>()
73
+
74
+ fun makeSample(value: Double, unit: String) = ReactNativeQuantitySample(
75
+ id = "id",
76
+ value = value,
77
+ startDate = Date.from(Instant.parse(date)),
78
+ endDate = Date.from(Instant.parse(date)),
79
+ sourceBundle = "source",
80
+ productType = "product",
81
+ type = "cuff",
82
+ unit = unit,
83
+ )
84
+
85
+ assertEquals(
86
+ adapter.fromJson(jsonString),
87
+ ReactNativeTimeSeriesData.BloodPressure(
88
+ listOf(
89
+ ReactNativeBloodPressureSample(
90
+ systolic = makeSample(value = 100.0, unit = "mmHg"),
91
+ diastolic = makeSample(value = 90.0, unit = "mmHg"),
92
+ pulse = makeSample(value = 80.0, unit = "bpm"),
93
+ )
94
+ )
95
+ )
96
+ )
97
+ }
98
+ }
@@ -13,6 +13,17 @@ RCT_EXTERN_METHOD(configure:(NSString *)apiKey
13
13
  resolver:(RCTPromiseResolveBlock)resolve
14
14
  rejecter:(RCTPromiseRejectBlock)reject)
15
15
 
16
+ RCT_EXTERN_METHOD(hasUserConnectedTo:(NSString *)provider
17
+ resolver:(RCTPromiseResolveBlock)resolve
18
+ rejecter:(RCTPromiseRejectBlock)reject)
19
+
20
+ RCT_EXTERN_METHOD(userConnectedSources:(RCTPromiseResolveBlock)resolve
21
+ rejecter:(RCTPromiseRejectBlock)reject)
22
+
23
+ RCT_EXTERN_METHOD(createConnectedSourceIfNotExist:(NSString *)provider
24
+ resolver:(RCTPromiseResolveBlock)resolve
25
+ rejecter:(RCTPromiseRejectBlock)reject)
26
+
16
27
  RCT_EXTERN_METHOD(postTimeSeriesData:(NSString *)jsonString
17
28
  provider:(NSString *)provider
18
29
  timeZone:(NSString *)timeZone