@kingstinct/react-native-healthkit 10.0.0 → 11.0.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 (220) hide show
  1. package/ios/CoreModule.swift +5 -15
  2. package/ios/CorrelationTypeModule.swift +8 -2
  3. package/ios/Helpers.swift +50 -6
  4. package/ios/QuantityTypeModule.swift +72 -112
  5. package/ios/Serializers.swift +39 -66
  6. package/ios/WorkoutProxy.swift +38 -20
  7. package/ios/WorkoutsModule.swift +7 -18
  8. package/lib/commonjs/healthkit.js +1 -1
  9. package/lib/commonjs/hooks/useMostRecentWorkout.js +2 -9
  10. package/lib/commonjs/hooks/useWorkoutById.js +1 -4
  11. package/lib/commonjs/utils/getMostRecentWorkout.js +1 -3
  12. package/lib/commonjs/utils/getWorkoutById.js +1 -3
  13. package/lib/module/healthkit.js +1 -1
  14. package/lib/module/hooks/useMostRecentWorkout.js +3 -10
  15. package/lib/module/hooks/useWorkoutById.js +1 -4
  16. package/lib/module/utils/getMostRecentWorkout.js +1 -3
  17. package/lib/module/utils/getWorkoutById.js +1 -3
  18. package/lib/typescript/healthkit.d.ts +5 -5
  19. package/lib/typescript/healthkit.ios.d.ts +1 -1
  20. package/lib/typescript/hooks/useMostRecentWorkout.d.ts +1 -4
  21. package/lib/typescript/specs/WorkoutProxy.nitro.d.ts +11 -0
  22. package/lib/typescript/types/CorrelationType.d.ts +1 -0
  23. package/lib/typescript/types/QuantityType.d.ts +2 -0
  24. package/lib/typescript/types/QueryOptions.d.ts +4 -0
  25. package/lib/typescript/types/Workouts.d.ts +0 -8
  26. package/lib/typescript/utils/getMostRecentWorkout.d.ts +1 -2
  27. package/lib/typescript/utils/getWorkoutById.d.ts +1 -2
  28. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +103 -87
  29. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +798 -481
  30. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +3 -0
  31. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -8
  32. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +16 -16
  33. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +9 -4
  34. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +4 -2
  35. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +10 -5
  36. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +6 -4
  37. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +10 -5
  38. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +7 -2
  39. package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.hpp +3 -1
  40. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +10 -5
  41. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +50 -22
  42. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +12 -7
  43. package/nitrogen/generated/ios/swift/CategorySample.swift +4 -2
  44. package/nitrogen/generated/ios/swift/CategorySampleForSaving.swift +2 -1
  45. package/nitrogen/generated/ios/swift/CorrelationObject.swift +2 -0
  46. package/nitrogen/generated/ios/swift/CorrelationSample.swift +13 -2
  47. package/nitrogen/generated/ios/swift/DeletedSample.swift +2 -1
  48. package/nitrogen/generated/ios/swift/Device.swift +16 -8
  49. package/nitrogen/generated/ios/swift/FilterForSamples.swift +2 -0
  50. package/nitrogen/generated/ios/swift/Func_void_AuthorizationRequestStatus.swift +1 -0
  51. package/nitrogen/generated/ios/swift/Func_void_BiologicalSex.swift +1 -0
  52. package/nitrogen/generated/ios/swift/Func_void_BloodType.swift +1 -0
  53. package/nitrogen/generated/ios/swift/Func_void_CategorySamplesWithAnchorResponse.swift +1 -0
  54. package/nitrogen/generated/ios/swift/Func_void_FitzpatrickSkinType.swift +1 -0
  55. package/nitrogen/generated/ios/swift/Func_void_HeartbeatSeriesSamplesWithAnchorResponse.swift +1 -0
  56. package/nitrogen/generated/ios/swift/Func_void_OnChangeCallbackArgs.swift +1 -0
  57. package/nitrogen/generated/ios/swift/Func_void_QuantitySamplesWithAnchorResponse.swift +1 -0
  58. package/nitrogen/generated/ios/swift/Func_void_QueryStatisticsResponse.swift +1 -0
  59. package/nitrogen/generated/ios/swift/Func_void_QueryWorkoutSamplesWithAnchorResponse.swift +1 -0
  60. package/nitrogen/generated/ios/swift/Func_void_WheelchairUse.swift +1 -0
  61. package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -0
  62. package/nitrogen/generated/ios/swift/Func_void_double.swift +1 -0
  63. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -0
  64. package/nitrogen/generated/ios/swift/Func_void_std__optional_QueryStatisticsResponse_.swift +54 -0
  65. package/nitrogen/generated/ios/swift/Func_void_std__optional_WorkoutPlan_.swift +3 -1
  66. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__chrono__system_clock__time_point_.swift +3 -1
  67. package/nitrogen/generated/ios/swift/{Func_void_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec_.swift → Func_void_std__shared_ptr_HybridWorkoutProxySpec_.swift} +9 -8
  68. package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__QueryStatisticsResponse_.swift +55 -0
  69. package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__bool_.swift +2 -1
  70. package/nitrogen/generated/ios/swift/Func_void_std__vector_CategorySample_.swift +1 -0
  71. package/nitrogen/generated/ios/swift/Func_void_std__vector_CorrelationSample_.swift +1 -0
  72. package/nitrogen/generated/ios/swift/Func_void_std__vector_HeartbeatSeriesSample_.swift +1 -0
  73. package/nitrogen/generated/ios/swift/Func_void_std__vector_IdentifierWithUnit_.swift +1 -0
  74. package/nitrogen/generated/ios/swift/Func_void_std__vector_QuantitySample_.swift +1 -0
  75. package/nitrogen/generated/ios/swift/Func_void_std__vector_QueryStatisticsResponse_.swift +1 -0
  76. package/nitrogen/generated/ios/swift/Func_void_std__vector_StateOfMindSample_.swift +1 -0
  77. package/nitrogen/generated/ios/swift/Func_void_std__vector_WorkoutRoute_.swift +1 -0
  78. package/nitrogen/generated/ios/swift/{Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridSourceProxySpec__.swift → Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__.swift} +9 -8
  79. package/nitrogen/generated/ios/swift/{Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec__.swift → Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__.swift} +9 -8
  80. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +6 -3
  81. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +2 -1
  82. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +17 -7
  83. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +2 -1
  84. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +15 -6
  85. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -1
  86. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +24 -15
  87. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +2 -1
  88. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +15 -6
  89. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +2 -1
  90. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +17 -7
  91. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +2 -1
  92. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +21 -9
  93. package/nitrogen/generated/ios/swift/HybridSourceProxySpec.swift +2 -1
  94. package/nitrogen/generated/ios/swift/HybridSourceProxySpec_cxx.swift +17 -7
  95. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +2 -1
  96. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +19 -8
  97. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +8 -5
  98. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +108 -41
  99. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec.swift +2 -1
  100. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec_cxx.swift +31 -22
  101. package/nitrogen/generated/ios/swift/OnChangeCallbackArgs.swift +2 -1
  102. package/nitrogen/generated/ios/swift/PredicateForSamples.swift +2 -0
  103. package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +2 -0
  104. package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +3 -3
  105. package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +95 -2
  106. package/nitrogen/generated/ios/swift/PredicateWithMetadataOperator.swift +48 -0
  107. package/nitrogen/generated/ios/swift/PredicateWithStartAndEnd.swift +4 -2
  108. package/nitrogen/generated/ios/swift/QuantitySample.swift +4 -2
  109. package/nitrogen/generated/ios/swift/QuantitySampleForSaving.swift +2 -1
  110. package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +4 -2
  111. package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +6 -3
  112. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +2 -1
  113. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +4 -2
  114. package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +75 -8
  115. package/nitrogen/generated/ios/swift/QueryWorkoutSamplesWithAnchorResponse.swift +7 -7
  116. package/nitrogen/generated/ios/swift/SampleForSaving.swift +2 -0
  117. package/nitrogen/generated/ios/swift/SourceRevision.swift +13 -9
  118. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +6 -3
  119. package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +4 -2
  120. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +2 -0
  121. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +2 -0
  122. package/nitrogen/generated/ios/swift/Variant_String_Double_Bool_Date.swift +20 -0
  123. package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +4 -61
  124. package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +6 -62
  125. package/nitrogen/generated/ios/swift/WorkoutRoute.swift +2 -1
  126. package/nitrogen/generated/ios/swift/WorkoutSample.swift +12 -123
  127. package/nitrogen/generated/shared/c++/AuthorizationRequestStatus.hpp +9 -11
  128. package/nitrogen/generated/shared/c++/AuthorizationStatus.hpp +9 -11
  129. package/nitrogen/generated/shared/c++/BiologicalSex.hpp +9 -11
  130. package/nitrogen/generated/shared/c++/BloodType.hpp +9 -11
  131. package/nitrogen/generated/shared/c++/CategorySample.hpp +14 -16
  132. package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +11 -13
  133. package/nitrogen/generated/shared/c++/CategorySamplesWithAnchorResponse.hpp +11 -13
  134. package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +131 -133
  135. package/nitrogen/generated/shared/c++/ComparisonPredicateOperator.hpp +26 -13
  136. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +18 -15
  137. package/nitrogen/generated/shared/c++/CorrelationTypeIdentifier.hpp +7 -9
  138. package/nitrogen/generated/shared/c++/DeletedSample.hpp +5 -7
  139. package/nitrogen/generated/shared/c++/Device.hpp +5 -7
  140. package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +9 -11
  141. package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +9 -11
  142. package/nitrogen/generated/shared/c++/FitzpatrickSkinType.hpp +9 -11
  143. package/nitrogen/generated/shared/c++/Heartbeat.hpp +4 -6
  144. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +15 -17
  145. package/nitrogen/generated/shared/c++/HeartbeatSeriesSamplesWithAnchorResponse.hpp +11 -13
  146. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +2 -2
  147. package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.hpp +1 -1
  148. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +4 -4
  149. package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +2 -2
  150. package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +3 -3
  151. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +3 -3
  152. package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +3 -3
  153. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +6 -4
  154. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +18 -9
  155. package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.hpp +4 -4
  156. package/nitrogen/generated/shared/c++/IdentifierWithUnit.hpp +4 -6
  157. package/nitrogen/generated/shared/c++/IntervalComponents.hpp +4 -6
  158. package/nitrogen/generated/shared/c++/LocationForSaving.hpp +4 -6
  159. package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +397 -399
  160. package/nitrogen/generated/shared/c++/OnChangeCallbackArgs.hpp +8 -10
  161. package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +9 -11
  162. package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +9 -11
  163. package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +6 -8
  164. package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +20 -9
  165. package/nitrogen/generated/shared/c++/PredicateWithMetadataOperator.hpp +84 -0
  166. package/nitrogen/generated/shared/c++/PredicateWithStartAndEnd.hpp +5 -7
  167. package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +4 -6
  168. package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +5 -7
  169. package/nitrogen/generated/shared/c++/Quantity.hpp +4 -6
  170. package/nitrogen/generated/shared/c++/QuantityDateInterval.hpp +4 -6
  171. package/nitrogen/generated/shared/c++/QuantitySample.hpp +14 -16
  172. package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +11 -13
  173. package/nitrogen/generated/shared/c++/QuantitySamplesWithAnchorResponse.hpp +11 -13
  174. package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +241 -243
  175. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +9 -11
  176. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +9 -11
  177. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +8 -10
  178. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +9 -11
  179. package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +36 -29
  180. package/nitrogen/generated/shared/c++/QueryWorkoutSamplesWithAnchorResponse.hpp +10 -12
  181. package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +383 -385
  182. package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +373 -375
  183. package/nitrogen/generated/shared/c++/Source.hpp +4 -6
  184. package/nitrogen/generated/shared/c++/SourceRevision.hpp +7 -9
  185. package/nitrogen/generated/shared/c++/StateOfMindAssociation.hpp +10 -12
  186. package/nitrogen/generated/shared/c++/StateOfMindKind.hpp +14 -13
  187. package/nitrogen/generated/shared/c++/StateOfMindLabel.hpp +10 -12
  188. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +24 -26
  189. package/nitrogen/generated/shared/c++/StateOfMindValenceClassification.hpp +10 -12
  190. package/nitrogen/generated/shared/c++/StatisticsOptions.hpp +17 -19
  191. package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +9 -11
  192. package/nitrogen/generated/shared/c++/UpdateFrequency.hpp +10 -12
  193. package/nitrogen/generated/shared/c++/WheelchairUse.hpp +9 -11
  194. package/nitrogen/generated/shared/c++/WorkoutActivity.hpp +4 -6
  195. package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +96 -13
  196. package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +7 -9
  197. package/nitrogen/generated/shared/c++/WorkoutConfiguration.hpp +11 -13
  198. package/nitrogen/generated/shared/c++/WorkoutDurationPredicate.hpp +7 -9
  199. package/nitrogen/generated/shared/c++/WorkoutEvent.hpp +7 -9
  200. package/nitrogen/generated/shared/c++/WorkoutEventType.hpp +10 -12
  201. package/nitrogen/generated/shared/c++/WorkoutPlan.hpp +7 -9
  202. package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +10 -21
  203. package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +11 -21
  204. package/nitrogen/generated/shared/c++/WorkoutRoute.hpp +9 -11
  205. package/nitrogen/generated/shared/c++/WorkoutRouteLocation.hpp +4 -6
  206. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +25 -43
  207. package/nitrogen/generated/shared/c++/WorkoutSessionLocationType.hpp +10 -12
  208. package/nitrogen/generated/shared/c++/WorkoutTotals.hpp +4 -6
  209. package/package.json +11 -11
  210. package/src/healthkit.ts +5 -1
  211. package/src/hooks/queryStatisticsForQuantity.test.ts +32 -0
  212. package/src/hooks/useMostRecentWorkout.ts +3 -17
  213. package/src/hooks/useWorkoutById.ts +1 -4
  214. package/src/specs/WorkoutProxy.nitro.ts +18 -1
  215. package/src/types/CorrelationType.ts +1 -0
  216. package/src/types/QuantityType.ts +2 -0
  217. package/src/types/QueryOptions.ts +10 -0
  218. package/src/types/Workouts.ts +0 -8
  219. package/src/utils/getMostRecentWorkout.ts +1 -6
  220. package/src/utils/getWorkoutById.ts +1 -6
@@ -28,8 +28,8 @@ namespace margelo::nitro::healthkit { struct SourceRevision; }
28
28
  #include <chrono>
29
29
  #include "CategoryTypeIdentifier.hpp"
30
30
  #include <NitroModules/AnyMap.hpp>
31
- #include <optional>
32
31
  #include "SourceRevision.hpp"
32
+ #include <optional>
33
33
 
34
34
  namespace margelo::nitro::healthkit {
35
35
 
@@ -54,30 +54,28 @@ namespace margelo::nitro::healthkit {
54
54
 
55
55
  namespace margelo::nitro {
56
56
 
57
- using namespace margelo::nitro::healthkit;
58
-
59
57
  // C++ CategorySampleForSaving <> JS CategorySampleForSaving (object)
60
58
  template <>
61
- struct JSIConverter<CategorySampleForSaving> final {
62
- static inline CategorySampleForSaving fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
59
+ struct JSIConverter<margelo::nitro::healthkit::CategorySampleForSaving> final {
60
+ static inline margelo::nitro::healthkit::CategorySampleForSaving fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
61
  jsi::Object obj = arg.asObject(runtime);
64
- return CategorySampleForSaving(
62
+ return margelo::nitro::healthkit::CategorySampleForSaving(
65
63
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "start")),
66
64
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "end")),
67
- JSIConverter<CategoryTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "categoryType")),
65
+ JSIConverter<margelo::nitro::healthkit::CategoryTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "categoryType")),
68
66
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "value")),
69
67
  JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
70
- JSIConverter<std::optional<SourceRevision>>::fromJSI(runtime, obj.getProperty(runtime, "sourceRevision"))
68
+ JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::fromJSI(runtime, obj.getProperty(runtime, "sourceRevision"))
71
69
  );
72
70
  }
73
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const CategorySampleForSaving& arg) {
71
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::CategorySampleForSaving& arg) {
74
72
  jsi::Object obj(runtime);
75
73
  obj.setProperty(runtime, "start", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.start));
76
74
  obj.setProperty(runtime, "end", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.end));
77
- obj.setProperty(runtime, "categoryType", JSIConverter<CategoryTypeIdentifier>::toJSI(runtime, arg.categoryType));
75
+ obj.setProperty(runtime, "categoryType", JSIConverter<margelo::nitro::healthkit::CategoryTypeIdentifier>::toJSI(runtime, arg.categoryType));
78
76
  obj.setProperty(runtime, "value", JSIConverter<double>::toJSI(runtime, arg.value));
79
77
  obj.setProperty(runtime, "metadata", JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
80
- obj.setProperty(runtime, "sourceRevision", JSIConverter<std::optional<SourceRevision>>::toJSI(runtime, arg.sourceRevision));
78
+ obj.setProperty(runtime, "sourceRevision", JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::toJSI(runtime, arg.sourceRevision));
81
79
  return obj;
82
80
  }
83
81
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -87,10 +85,10 @@ namespace margelo::nitro {
87
85
  jsi::Object obj = value.getObject(runtime);
88
86
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "start"))) return false;
89
87
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "end"))) return false;
90
- if (!JSIConverter<CategoryTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "categoryType"))) return false;
88
+ if (!JSIConverter<margelo::nitro::healthkit::CategoryTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "categoryType"))) return false;
91
89
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "value"))) return false;
92
90
  if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
93
- if (!JSIConverter<std::optional<SourceRevision>>::canConvert(runtime, obj.getProperty(runtime, "sourceRevision"))) return false;
91
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::canConvert(runtime, obj.getProperty(runtime, "sourceRevision"))) return false;
94
92
  return true;
95
93
  }
96
94
  };
@@ -23,8 +23,8 @@ namespace margelo::nitro::healthkit { struct CategorySample; }
23
23
  // Forward declaration of `DeletedSample` to properly resolve imports.
24
24
  namespace margelo::nitro::healthkit { struct DeletedSample; }
25
25
 
26
- #include <vector>
27
26
  #include "CategorySample.hpp"
27
+ #include <vector>
28
28
  #include "DeletedSample.hpp"
29
29
  #include <string>
30
30
 
@@ -48,23 +48,21 @@ namespace margelo::nitro::healthkit {
48
48
 
49
49
  namespace margelo::nitro {
50
50
 
51
- using namespace margelo::nitro::healthkit;
52
-
53
51
  // C++ CategorySamplesWithAnchorResponse <> JS CategorySamplesWithAnchorResponse (object)
54
52
  template <>
55
- struct JSIConverter<CategorySamplesWithAnchorResponse> final {
56
- static inline CategorySamplesWithAnchorResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ struct JSIConverter<margelo::nitro::healthkit::CategorySamplesWithAnchorResponse> final {
54
+ static inline margelo::nitro::healthkit::CategorySamplesWithAnchorResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
57
55
  jsi::Object obj = arg.asObject(runtime);
58
- return CategorySamplesWithAnchorResponse(
59
- JSIConverter<std::vector<CategorySample>>::fromJSI(runtime, obj.getProperty(runtime, "samples")),
60
- JSIConverter<std::vector<DeletedSample>>::fromJSI(runtime, obj.getProperty(runtime, "deletedSamples")),
56
+ return margelo::nitro::healthkit::CategorySamplesWithAnchorResponse(
57
+ JSIConverter<std::vector<margelo::nitro::healthkit::CategorySample>>::fromJSI(runtime, obj.getProperty(runtime, "samples")),
58
+ JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::fromJSI(runtime, obj.getProperty(runtime, "deletedSamples")),
61
59
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "newAnchor"))
62
60
  );
63
61
  }
64
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const CategorySamplesWithAnchorResponse& arg) {
62
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::CategorySamplesWithAnchorResponse& arg) {
65
63
  jsi::Object obj(runtime);
66
- obj.setProperty(runtime, "samples", JSIConverter<std::vector<CategorySample>>::toJSI(runtime, arg.samples));
67
- obj.setProperty(runtime, "deletedSamples", JSIConverter<std::vector<DeletedSample>>::toJSI(runtime, arg.deletedSamples));
64
+ obj.setProperty(runtime, "samples", JSIConverter<std::vector<margelo::nitro::healthkit::CategorySample>>::toJSI(runtime, arg.samples));
65
+ obj.setProperty(runtime, "deletedSamples", JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::toJSI(runtime, arg.deletedSamples));
68
66
  obj.setProperty(runtime, "newAnchor", JSIConverter<std::string>::toJSI(runtime, arg.newAnchor));
69
67
  return obj;
70
68
  }
@@ -73,8 +71,8 @@ namespace margelo::nitro {
73
71
  return false;
74
72
  }
75
73
  jsi::Object obj = value.getObject(runtime);
76
- if (!JSIConverter<std::vector<CategorySample>>::canConvert(runtime, obj.getProperty(runtime, "samples"))) return false;
77
- if (!JSIConverter<std::vector<DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
74
+ if (!JSIConverter<std::vector<margelo::nitro::healthkit::CategorySample>>::canConvert(runtime, obj.getProperty(runtime, "samples"))) return false;
75
+ if (!JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
78
76
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "newAnchor"))) return false;
79
77
  return true;
80
78
  }
@@ -99,148 +99,146 @@ namespace margelo::nitro::healthkit {
99
99
 
100
100
  namespace margelo::nitro {
101
101
 
102
- using namespace margelo::nitro::healthkit;
103
-
104
102
  // C++ CategoryTypeIdentifier <> JS CategoryTypeIdentifier (union)
105
103
  template <>
106
- struct JSIConverter<CategoryTypeIdentifier> final {
107
- static inline CategoryTypeIdentifier fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
104
+ struct JSIConverter<margelo::nitro::healthkit::CategoryTypeIdentifier> final {
105
+ static inline margelo::nitro::healthkit::CategoryTypeIdentifier fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
108
106
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
109
107
  switch (hashString(unionValue.c_str(), unionValue.size())) {
110
- case hashString("HKCategoryTypeIdentifierAppleStandHour"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLESTANDHOUR;
111
- case hashString("HKCategoryTypeIdentifierHighHeartRateEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHIGHHEARTRATEEVENT;
112
- case hashString("HKCategoryTypeIdentifierLowHeartRateEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWHEARTRATEEVENT;
113
- case hashString("HKCategoryTypeIdentifierHeadphoneAudioExposureEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSUREEVENT;
114
- case hashString("HKCategoryTypeIdentifierSleepAnalysis"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS;
115
- case hashString("HKCategoryTypeIdentifierCervicalMucusQuality"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY;
116
- case hashString("HKCategoryTypeIdentifierOvulationTestResult"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT;
117
- case hashString("HKCategoryTypeIdentifierMenstrualFlow"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW;
118
- case hashString("HKCategoryTypeIdentifierIntermenstrualBleeding"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING;
119
- case hashString("HKCategoryTypeIdentifierSexualActivity"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY;
120
- case hashString("HKCategoryTypeIdentifierMindfulSession"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMINDFULSESSION;
121
- case hashString("HKCategoryTypeIdentifierIrregularHeartRhythmEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT;
122
- case hashString("HKCategoryTypeIdentifierAudioExposureEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT;
123
- case hashString("HKCategoryTypeIdentifierToothbrushingEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT;
124
- case hashString("HKCategoryTypeIdentifierLowCardioFitnessEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT;
125
- case hashString("HKCategoryTypeIdentifierContraceptive"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE;
126
- case hashString("HKCategoryTypeIdentifierLactation"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLACTATION;
127
- case hashString("HKCategoryTypeIdentifierPregnancy"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCY;
128
- case hashString("HKCategoryTypeIdentifierPregnancyTestResult"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT;
129
- case hashString("HKCategoryTypeIdentifierProgesteroneTestResult"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT;
130
- case hashString("HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT;
131
- case hashString("HKCategoryTypeIdentifierAppleWalkingSteadinessEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT;
132
- case hashString("HKCategoryTypeIdentifierHandwashingEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT;
133
- case hashString("HKCategoryTypeIdentifierAbdominalCramps"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS;
134
- case hashString("HKCategoryTypeIdentifierAcne"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERACNE;
135
- case hashString("HKCategoryTypeIdentifierAppetiteChanges"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES;
136
- case hashString("HKCategoryTypeIdentifierBladderIncontinence"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE;
137
- case hashString("HKCategoryTypeIdentifierBloating"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLOATING;
138
- case hashString("HKCategoryTypeIdentifierBreastPain"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBREASTPAIN;
139
- case hashString("HKCategoryTypeIdentifierChestTightnessOrPain"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN;
140
- case hashString("HKCategoryTypeIdentifierChills"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHILLS;
141
- case hashString("HKCategoryTypeIdentifierConstipation"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONSTIPATION;
142
- case hashString("HKCategoryTypeIdentifierCoughing"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCOUGHING;
143
- case hashString("HKCategoryTypeIdentifierDiarrhea"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIARRHEA;
144
- case hashString("HKCategoryTypeIdentifierDizziness"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIZZINESS;
145
- case hashString("HKCategoryTypeIdentifierDrySkin"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDRYSKIN;
146
- case hashString("HKCategoryTypeIdentifierFainting"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFAINTING;
147
- case hashString("HKCategoryTypeIdentifierFatigue"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFATIGUE;
148
- case hashString("HKCategoryTypeIdentifierFever"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFEVER;
149
- case hashString("HKCategoryTypeIdentifierGeneralizedBodyAche"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE;
150
- case hashString("HKCategoryTypeIdentifierHairLoss"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHAIRLOSS;
151
- case hashString("HKCategoryTypeIdentifierHeadache"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADACHE;
152
- case hashString("HKCategoryTypeIdentifierHeartburn"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEARTBURN;
153
- case hashString("HKCategoryTypeIdentifierHotFlashes"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHOTFLASHES;
154
- case hashString("HKCategoryTypeIdentifierLossOfSmell"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL;
155
- case hashString("HKCategoryTypeIdentifierLossOfTaste"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE;
156
- case hashString("HKCategoryTypeIdentifierLowerBackPain"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN;
157
- case hashString("HKCategoryTypeIdentifierMemoryLapse"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE;
158
- case hashString("HKCategoryTypeIdentifierMoodChanges"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMOODCHANGES;
159
- case hashString("HKCategoryTypeIdentifierNausea"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNAUSEA;
160
- case hashString("HKCategoryTypeIdentifierNightSweats"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS;
161
- case hashString("HKCategoryTypeIdentifierPelvicPain"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPELVICPAIN;
162
- case hashString("HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT;
163
- case hashString("HKCategoryTypeIdentifierRunnyNose"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRUNNYNOSE;
164
- case hashString("HKCategoryTypeIdentifierShortnessOfBreath"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH;
165
- case hashString("HKCategoryTypeIdentifierSinusCongestion"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION;
166
- case hashString("HKCategoryTypeIdentifierSkippedHeartbeat"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT;
167
- case hashString("HKCategoryTypeIdentifierSleepChanges"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES;
168
- case hashString("HKCategoryTypeIdentifierSoreThroat"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSORETHROAT;
169
- case hashString("HKCategoryTypeIdentifierVaginalDryness"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS;
170
- case hashString("HKCategoryTypeIdentifierVomiting"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVOMITING;
171
- case hashString("HKCategoryTypeIdentifierWheezing"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERWHEEZING;
172
- case hashString("HKCategoryTypeIdentifierBleedingAfterPregnancy"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY;
173
- case hashString("HKCategoryTypeIdentifierBleedingDuringPregnancy"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY;
108
+ case hashString("HKCategoryTypeIdentifierAppleStandHour"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLESTANDHOUR;
109
+ case hashString("HKCategoryTypeIdentifierHighHeartRateEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHIGHHEARTRATEEVENT;
110
+ case hashString("HKCategoryTypeIdentifierLowHeartRateEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWHEARTRATEEVENT;
111
+ case hashString("HKCategoryTypeIdentifierHeadphoneAudioExposureEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSUREEVENT;
112
+ case hashString("HKCategoryTypeIdentifierSleepAnalysis"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS;
113
+ case hashString("HKCategoryTypeIdentifierCervicalMucusQuality"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY;
114
+ case hashString("HKCategoryTypeIdentifierOvulationTestResult"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT;
115
+ case hashString("HKCategoryTypeIdentifierMenstrualFlow"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW;
116
+ case hashString("HKCategoryTypeIdentifierIntermenstrualBleeding"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING;
117
+ case hashString("HKCategoryTypeIdentifierSexualActivity"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY;
118
+ case hashString("HKCategoryTypeIdentifierMindfulSession"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMINDFULSESSION;
119
+ case hashString("HKCategoryTypeIdentifierIrregularHeartRhythmEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT;
120
+ case hashString("HKCategoryTypeIdentifierAudioExposureEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT;
121
+ case hashString("HKCategoryTypeIdentifierToothbrushingEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT;
122
+ case hashString("HKCategoryTypeIdentifierLowCardioFitnessEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT;
123
+ case hashString("HKCategoryTypeIdentifierContraceptive"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE;
124
+ case hashString("HKCategoryTypeIdentifierLactation"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLACTATION;
125
+ case hashString("HKCategoryTypeIdentifierPregnancy"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCY;
126
+ case hashString("HKCategoryTypeIdentifierPregnancyTestResult"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT;
127
+ case hashString("HKCategoryTypeIdentifierProgesteroneTestResult"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT;
128
+ case hashString("HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT;
129
+ case hashString("HKCategoryTypeIdentifierAppleWalkingSteadinessEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT;
130
+ case hashString("HKCategoryTypeIdentifierHandwashingEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT;
131
+ case hashString("HKCategoryTypeIdentifierAbdominalCramps"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS;
132
+ case hashString("HKCategoryTypeIdentifierAcne"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERACNE;
133
+ case hashString("HKCategoryTypeIdentifierAppetiteChanges"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES;
134
+ case hashString("HKCategoryTypeIdentifierBladderIncontinence"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE;
135
+ case hashString("HKCategoryTypeIdentifierBloating"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLOATING;
136
+ case hashString("HKCategoryTypeIdentifierBreastPain"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBREASTPAIN;
137
+ case hashString("HKCategoryTypeIdentifierChestTightnessOrPain"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN;
138
+ case hashString("HKCategoryTypeIdentifierChills"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHILLS;
139
+ case hashString("HKCategoryTypeIdentifierConstipation"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONSTIPATION;
140
+ case hashString("HKCategoryTypeIdentifierCoughing"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCOUGHING;
141
+ case hashString("HKCategoryTypeIdentifierDiarrhea"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIARRHEA;
142
+ case hashString("HKCategoryTypeIdentifierDizziness"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIZZINESS;
143
+ case hashString("HKCategoryTypeIdentifierDrySkin"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDRYSKIN;
144
+ case hashString("HKCategoryTypeIdentifierFainting"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFAINTING;
145
+ case hashString("HKCategoryTypeIdentifierFatigue"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFATIGUE;
146
+ case hashString("HKCategoryTypeIdentifierFever"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFEVER;
147
+ case hashString("HKCategoryTypeIdentifierGeneralizedBodyAche"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE;
148
+ case hashString("HKCategoryTypeIdentifierHairLoss"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHAIRLOSS;
149
+ case hashString("HKCategoryTypeIdentifierHeadache"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADACHE;
150
+ case hashString("HKCategoryTypeIdentifierHeartburn"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEARTBURN;
151
+ case hashString("HKCategoryTypeIdentifierHotFlashes"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHOTFLASHES;
152
+ case hashString("HKCategoryTypeIdentifierLossOfSmell"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL;
153
+ case hashString("HKCategoryTypeIdentifierLossOfTaste"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE;
154
+ case hashString("HKCategoryTypeIdentifierLowerBackPain"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN;
155
+ case hashString("HKCategoryTypeIdentifierMemoryLapse"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE;
156
+ case hashString("HKCategoryTypeIdentifierMoodChanges"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMOODCHANGES;
157
+ case hashString("HKCategoryTypeIdentifierNausea"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNAUSEA;
158
+ case hashString("HKCategoryTypeIdentifierNightSweats"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS;
159
+ case hashString("HKCategoryTypeIdentifierPelvicPain"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPELVICPAIN;
160
+ case hashString("HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT;
161
+ case hashString("HKCategoryTypeIdentifierRunnyNose"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRUNNYNOSE;
162
+ case hashString("HKCategoryTypeIdentifierShortnessOfBreath"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH;
163
+ case hashString("HKCategoryTypeIdentifierSinusCongestion"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION;
164
+ case hashString("HKCategoryTypeIdentifierSkippedHeartbeat"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT;
165
+ case hashString("HKCategoryTypeIdentifierSleepChanges"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES;
166
+ case hashString("HKCategoryTypeIdentifierSoreThroat"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSORETHROAT;
167
+ case hashString("HKCategoryTypeIdentifierVaginalDryness"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS;
168
+ case hashString("HKCategoryTypeIdentifierVomiting"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVOMITING;
169
+ case hashString("HKCategoryTypeIdentifierWheezing"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERWHEEZING;
170
+ case hashString("HKCategoryTypeIdentifierBleedingAfterPregnancy"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY;
171
+ case hashString("HKCategoryTypeIdentifierBleedingDuringPregnancy"): return margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY;
174
172
  default: [[unlikely]]
175
173
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum CategoryTypeIdentifier - invalid value!");
176
174
  }
177
175
  }
178
- static inline jsi::Value toJSI(jsi::Runtime& runtime, CategoryTypeIdentifier arg) {
176
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::CategoryTypeIdentifier arg) {
179
177
  switch (arg) {
180
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLESTANDHOUR: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppleStandHour");
181
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHIGHHEARTRATEEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHighHeartRateEvent");
182
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWHEARTRATEEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowHeartRateEvent");
183
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeadphoneAudioExposureEvent");
184
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepAnalysis");
185
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierCervicalMucusQuality");
186
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierOvulationTestResult");
187
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMenstrualFlow");
188
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIntermenstrualBleeding");
189
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSexualActivity");
190
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMINDFULSESSION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMindfulSession");
191
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIrregularHeartRhythmEvent");
192
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAudioExposureEvent");
193
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierToothbrushingEvent");
194
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowCardioFitnessEvent");
195
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierContraceptive");
196
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLACTATION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLactation");
197
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPregnancy");
198
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPregnancyTestResult");
199
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierProgesteroneTestResult");
200
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent");
201
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppleWalkingSteadinessEvent");
202
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHandwashingEvent");
203
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAbdominalCramps");
204
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERACNE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAcne");
205
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppetiteChanges");
206
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBladderIncontinence");
207
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLOATING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBloating");
208
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBREASTPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBreastPain");
209
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierChestTightnessOrPain");
210
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHILLS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierChills");
211
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONSTIPATION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierConstipation");
212
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCOUGHING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierCoughing");
213
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIARRHEA: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDiarrhea");
214
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIZZINESS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDizziness");
215
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDRYSKIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDrySkin");
216
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFAINTING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFainting");
217
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFATIGUE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFatigue");
218
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFEVER: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFever");
219
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierGeneralizedBodyAche");
220
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHAIRLOSS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHairLoss");
221
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADACHE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeadache");
222
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEARTBURN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeartburn");
223
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHOTFLASHES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHotFlashes");
224
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLossOfSmell");
225
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLossOfTaste");
226
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowerBackPain");
227
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMemoryLapse");
228
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMOODCHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMoodChanges");
229
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNAUSEA: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierNausea");
230
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierNightSweats");
231
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPELVICPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPelvicPain");
232
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat");
233
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRUNNYNOSE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierRunnyNose");
234
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierShortnessOfBreath");
235
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSinusCongestion");
236
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSkippedHeartbeat");
237
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepChanges");
238
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSORETHROAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSoreThroat");
239
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierVaginalDryness");
240
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVOMITING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierVomiting");
241
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERWHEEZING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierWheezing");
242
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBleedingAfterPregnancy");
243
- case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBleedingDuringPregnancy");
178
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLESTANDHOUR: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppleStandHour");
179
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHIGHHEARTRATEEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHighHeartRateEvent");
180
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWHEARTRATEEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowHeartRateEvent");
181
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeadphoneAudioExposureEvent");
182
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepAnalysis");
183
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierCervicalMucusQuality");
184
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierOvulationTestResult");
185
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMenstrualFlow");
186
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIntermenstrualBleeding");
187
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSexualActivity");
188
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMINDFULSESSION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMindfulSession");
189
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIrregularHeartRhythmEvent");
190
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAudioExposureEvent");
191
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierToothbrushingEvent");
192
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowCardioFitnessEvent");
193
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierContraceptive");
194
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLACTATION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLactation");
195
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPregnancy");
196
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPregnancyTestResult");
197
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierProgesteroneTestResult");
198
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent");
199
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppleWalkingSteadinessEvent");
200
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHandwashingEvent");
201
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAbdominalCramps");
202
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERACNE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAcne");
203
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppetiteChanges");
204
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBladderIncontinence");
205
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLOATING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBloating");
206
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBREASTPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBreastPain");
207
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierChestTightnessOrPain");
208
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHILLS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierChills");
209
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONSTIPATION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierConstipation");
210
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCOUGHING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierCoughing");
211
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIARRHEA: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDiarrhea");
212
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIZZINESS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDizziness");
213
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDRYSKIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDrySkin");
214
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFAINTING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFainting");
215
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFATIGUE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFatigue");
216
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFEVER: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFever");
217
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierGeneralizedBodyAche");
218
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHAIRLOSS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHairLoss");
219
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADACHE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeadache");
220
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEARTBURN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeartburn");
221
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHOTFLASHES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHotFlashes");
222
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLossOfSmell");
223
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLossOfTaste");
224
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowerBackPain");
225
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMemoryLapse");
226
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMOODCHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMoodChanges");
227
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNAUSEA: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierNausea");
228
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierNightSweats");
229
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPELVICPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPelvicPain");
230
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat");
231
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRUNNYNOSE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierRunnyNose");
232
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierShortnessOfBreath");
233
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSinusCongestion");
234
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSkippedHeartbeat");
235
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepChanges");
236
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSORETHROAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSoreThroat");
237
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierVaginalDryness");
238
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVOMITING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierVomiting");
239
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERWHEEZING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierWheezing");
240
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBleedingAfterPregnancy");
241
+ case margelo::nitro::healthkit::CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBleedingDuringPregnancy");
244
242
  default: [[unlikely]]
245
243
  throw std::invalid_argument("Cannot convert CategoryTypeIdentifier to JS - invalid value: "
246
244
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -7,7 +7,6 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #include <cmath>
11
10
  #if __has_include(<NitroModules/JSIConverter.hpp>)
12
11
  #include <NitroModules/JSIConverter.hpp>
13
12
  #else
@@ -45,16 +44,14 @@ namespace margelo::nitro::healthkit {
45
44
 
46
45
  namespace margelo::nitro {
47
46
 
48
- using namespace margelo::nitro::healthkit;
49
-
50
47
  // C++ ComparisonPredicateOperator <> JS ComparisonPredicateOperator (enum)
51
48
  template <>
52
- struct JSIConverter<ComparisonPredicateOperator> final {
53
- static inline ComparisonPredicateOperator fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ struct JSIConverter<margelo::nitro::healthkit::ComparisonPredicateOperator> final {
50
+ static inline margelo::nitro::healthkit::ComparisonPredicateOperator fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
51
  int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
55
- return static_cast<ComparisonPredicateOperator>(enumValue);
52
+ return static_cast<margelo::nitro::healthkit::ComparisonPredicateOperator>(enumValue);
56
53
  }
57
- static inline jsi::Value toJSI(jsi::Runtime& runtime, ComparisonPredicateOperator arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::ComparisonPredicateOperator arg) {
58
55
  int enumValue = static_cast<int>(arg);
59
56
  return JSIConverter<int>::toJSI(runtime, enumValue);
60
57
  }
@@ -62,14 +59,30 @@ namespace margelo::nitro {
62
59
  if (!value.isNumber()) {
63
60
  return false;
64
61
  }
65
- double integer;
66
- double fraction = modf(value.getNumber(), &integer);
67
- if (fraction != 0.0) {
68
- // It is some kind of floating point number - our enums are ints.
62
+ double number = value.getNumber();
63
+ int integer = static_cast<int>(number);
64
+ if (number != integer) {
65
+ // The integer is not the same value as the double - we truncated floating points.
66
+ // Enums are all integers, so the input floating point number is obviously invalid.
69
67
  return false;
70
68
  }
71
- // Check if we are within the bounds of the enum.
72
- return integer >= 0 && integer <= 13;
69
+ switch (integer) {
70
+ case 0 /* LESSTHAN */: return true;
71
+ case 1 /* LESSTHANOREQUALTO */: return true;
72
+ case 2 /* GREATERTHAN */: return true;
73
+ case 3 /* GREATERTHANOREQUALTO */: return true;
74
+ case 4 /* EQUALTO */: return true;
75
+ case 5 /* NOTEQUALTO */: return true;
76
+ case 6 /* MATCHES */: return true;
77
+ case 7 /* LIKE */: return true;
78
+ case 8 /* BEGINSWITH */: return true;
79
+ case 9 /* ENDSWITH */: return true;
80
+ case 10 /* IN */: return true;
81
+ case 11 /* CUSTOMSELECTOR */: return true;
82
+ case 99 /* CONTAINS */: return true;
83
+ case 100 /* BETWEEN */: return true;
84
+ default: return false;
85
+ }
73
86
  }
74
87
  };
75
88
 
@@ -27,11 +27,12 @@ namespace margelo::nitro::healthkit { struct QuantitySample; }
27
27
  // Forward declaration of `AnyMap` to properly resolve imports.
28
28
  namespace NitroModules { class AnyMap; }
29
29
 
30
+ #include <string>
30
31
  #include "CorrelationTypeIdentifier.hpp"
31
- #include <vector>
32
- #include <variant>
33
32
  #include "CategorySample.hpp"
34
33
  #include "QuantitySample.hpp"
34
+ #include <variant>
35
+ #include <vector>
35
36
  #include <NitroModules/AnyMap.hpp>
36
37
  #include <chrono>
37
38
 
@@ -42,6 +43,7 @@ namespace margelo::nitro::healthkit {
42
43
  */
43
44
  struct CorrelationSample {
44
45
  public:
46
+ std::string uuid SWIFT_PRIVATE;
45
47
  CorrelationTypeIdentifier correlationType SWIFT_PRIVATE;
46
48
  std::vector<std::variant<CategorySample, QuantitySample>> objects SWIFT_PRIVATE;
47
49
  std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
@@ -50,32 +52,32 @@ namespace margelo::nitro::healthkit {
50
52
 
51
53
  public:
52
54
  CorrelationSample() = default;
53
- explicit CorrelationSample(CorrelationTypeIdentifier correlationType, std::vector<std::variant<CategorySample, QuantitySample>> objects, std::shared_ptr<AnyMap> metadata, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate): correlationType(correlationType), objects(objects), metadata(metadata), startDate(startDate), endDate(endDate) {}
55
+ explicit CorrelationSample(std::string uuid, CorrelationTypeIdentifier correlationType, std::vector<std::variant<CategorySample, QuantitySample>> objects, std::shared_ptr<AnyMap> metadata, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate): uuid(uuid), correlationType(correlationType), objects(objects), metadata(metadata), startDate(startDate), endDate(endDate) {}
54
56
  };
55
57
 
56
58
  } // namespace margelo::nitro::healthkit
57
59
 
58
60
  namespace margelo::nitro {
59
61
 
60
- using namespace margelo::nitro::healthkit;
61
-
62
62
  // C++ CorrelationSample <> JS CorrelationSample (object)
63
63
  template <>
64
- struct JSIConverter<CorrelationSample> final {
65
- static inline CorrelationSample fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
64
+ struct JSIConverter<margelo::nitro::healthkit::CorrelationSample> final {
65
+ static inline margelo::nitro::healthkit::CorrelationSample fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
66
66
  jsi::Object obj = arg.asObject(runtime);
67
- return CorrelationSample(
68
- JSIConverter<CorrelationTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "correlationType")),
69
- JSIConverter<std::vector<std::variant<CategorySample, QuantitySample>>>::fromJSI(runtime, obj.getProperty(runtime, "objects")),
67
+ return margelo::nitro::healthkit::CorrelationSample(
68
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "uuid")),
69
+ JSIConverter<margelo::nitro::healthkit::CorrelationTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "correlationType")),
70
+ JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::CategorySample, margelo::nitro::healthkit::QuantitySample>>>::fromJSI(runtime, obj.getProperty(runtime, "objects")),
70
71
  JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
71
72
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
72
73
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "endDate"))
73
74
  );
74
75
  }
75
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const CorrelationSample& arg) {
76
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::CorrelationSample& arg) {
76
77
  jsi::Object obj(runtime);
77
- obj.setProperty(runtime, "correlationType", JSIConverter<CorrelationTypeIdentifier>::toJSI(runtime, arg.correlationType));
78
- obj.setProperty(runtime, "objects", JSIConverter<std::vector<std::variant<CategorySample, QuantitySample>>>::toJSI(runtime, arg.objects));
78
+ obj.setProperty(runtime, "uuid", JSIConverter<std::string>::toJSI(runtime, arg.uuid));
79
+ obj.setProperty(runtime, "correlationType", JSIConverter<margelo::nitro::healthkit::CorrelationTypeIdentifier>::toJSI(runtime, arg.correlationType));
80
+ obj.setProperty(runtime, "objects", JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::CategorySample, margelo::nitro::healthkit::QuantitySample>>>::toJSI(runtime, arg.objects));
79
81
  obj.setProperty(runtime, "metadata", JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
80
82
  obj.setProperty(runtime, "startDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
81
83
  obj.setProperty(runtime, "endDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
@@ -86,8 +88,9 @@ namespace margelo::nitro {
86
88
  return false;
87
89
  }
88
90
  jsi::Object obj = value.getObject(runtime);
89
- if (!JSIConverter<CorrelationTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "correlationType"))) return false;
90
- if (!JSIConverter<std::vector<std::variant<CategorySample, QuantitySample>>>::canConvert(runtime, obj.getProperty(runtime, "objects"))) return false;
91
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "uuid"))) return false;
92
+ if (!JSIConverter<margelo::nitro::healthkit::CorrelationTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "correlationType"))) return false;
93
+ if (!JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::CategorySample, margelo::nitro::healthkit::QuantitySample>>>::canConvert(runtime, obj.getProperty(runtime, "objects"))) return false;
91
94
  if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
92
95
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
93
96
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;