@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
@@ -33,9 +33,8 @@ namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
33
33
  // Forward declaration of `FilterForSamplesOr` to properly resolve imports.
34
34
  namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
35
35
 
36
- #include <optional>
37
36
  #include <string>
38
- #include <variant>
37
+ #include <optional>
39
38
  #include "PredicateWithUUID.hpp"
40
39
  #include "PredicateWithUUIDs.hpp"
41
40
  #include "PredicateWithMetadataKey.hpp"
@@ -43,6 +42,7 @@ namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
43
42
  #include "PredicateFromWorkout.hpp"
44
43
  #include "FilterForSamplesAnd.hpp"
45
44
  #include "FilterForSamplesOr.hpp"
45
+ #include <variant>
46
46
 
47
47
  namespace margelo::nitro::healthkit {
48
48
 
@@ -64,23 +64,21 @@ namespace margelo::nitro::healthkit {
64
64
 
65
65
  namespace margelo::nitro {
66
66
 
67
- using namespace margelo::nitro::healthkit;
68
-
69
67
  // C++ QueryOptionsWithAnchor <> JS QueryOptionsWithAnchor (object)
70
68
  template <>
71
- struct JSIConverter<QueryOptionsWithAnchor> final {
72
- static inline QueryOptionsWithAnchor fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
69
+ struct JSIConverter<margelo::nitro::healthkit::QueryOptionsWithAnchor> final {
70
+ static inline margelo::nitro::healthkit::QueryOptionsWithAnchor fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
73
71
  jsi::Object obj = arg.asObject(runtime);
74
- return QueryOptionsWithAnchor(
72
+ return margelo::nitro::healthkit::QueryOptionsWithAnchor(
75
73
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
76
- JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
74
+ JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
77
75
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
78
76
  );
79
77
  }
80
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryOptionsWithAnchor& arg) {
78
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithAnchor& arg) {
81
79
  jsi::Object obj(runtime);
82
80
  obj.setProperty(runtime, "anchor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.anchor));
83
- obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
81
+ obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
84
82
  obj.setProperty(runtime, "limit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
85
83
  return obj;
86
84
  }
@@ -90,7 +88,7 @@ namespace margelo::nitro {
90
88
  }
91
89
  jsi::Object obj = value.getObject(runtime);
92
90
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
93
- if (!JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
91
+ if (!JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
94
92
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
95
93
  return true;
96
94
  }
@@ -33,9 +33,8 @@ namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
33
33
  // Forward declaration of `FilterForSamplesOr` to properly resolve imports.
34
34
  namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
35
35
 
36
- #include <optional>
37
36
  #include <string>
38
- #include <variant>
37
+ #include <optional>
39
38
  #include "PredicateWithUUID.hpp"
40
39
  #include "PredicateWithUUIDs.hpp"
41
40
  #include "PredicateWithMetadataKey.hpp"
@@ -43,6 +42,7 @@ namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
43
42
  #include "PredicateFromWorkout.hpp"
44
43
  #include "FilterForSamplesAnd.hpp"
45
44
  #include "FilterForSamplesOr.hpp"
45
+ #include <variant>
46
46
 
47
47
  namespace margelo::nitro::healthkit {
48
48
 
@@ -65,25 +65,23 @@ namespace margelo::nitro::healthkit {
65
65
 
66
66
  namespace margelo::nitro {
67
67
 
68
- using namespace margelo::nitro::healthkit;
69
-
70
68
  // C++ QueryOptionsWithAnchorAndUnit <> JS QueryOptionsWithAnchorAndUnit (object)
71
69
  template <>
72
- struct JSIConverter<QueryOptionsWithAnchorAndUnit> final {
73
- static inline QueryOptionsWithAnchorAndUnit fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
70
+ struct JSIConverter<margelo::nitro::healthkit::QueryOptionsWithAnchorAndUnit> final {
71
+ static inline margelo::nitro::healthkit::QueryOptionsWithAnchorAndUnit fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
74
72
  jsi::Object obj = arg.asObject(runtime);
75
- return QueryOptionsWithAnchorAndUnit(
73
+ return margelo::nitro::healthkit::QueryOptionsWithAnchorAndUnit(
76
74
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
77
75
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
78
- JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
76
+ JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
79
77
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
80
78
  );
81
79
  }
82
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryOptionsWithAnchorAndUnit& arg) {
80
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithAnchorAndUnit& arg) {
83
81
  jsi::Object obj(runtime);
84
82
  obj.setProperty(runtime, "unit", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
85
83
  obj.setProperty(runtime, "anchor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.anchor));
86
- obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
84
+ obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
87
85
  obj.setProperty(runtime, "limit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
88
86
  return obj;
89
87
  }
@@ -94,7 +92,7 @@ namespace margelo::nitro {
94
92
  jsi::Object obj = value.getObject(runtime);
95
93
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
96
94
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
97
- if (!JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
95
+ if (!JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
98
96
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
99
97
  return true;
100
98
  }
@@ -34,7 +34,6 @@ namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
34
34
  namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
35
35
 
36
36
  #include <optional>
37
- #include <variant>
38
37
  #include "PredicateWithUUID.hpp"
39
38
  #include "PredicateWithUUIDs.hpp"
40
39
  #include "PredicateWithMetadataKey.hpp"
@@ -42,6 +41,7 @@ namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
42
41
  #include "PredicateFromWorkout.hpp"
43
42
  #include "FilterForSamplesAnd.hpp"
44
43
  #include "FilterForSamplesOr.hpp"
44
+ #include <variant>
45
45
 
46
46
  namespace margelo::nitro::healthkit {
47
47
 
@@ -63,23 +63,21 @@ namespace margelo::nitro::healthkit {
63
63
 
64
64
  namespace margelo::nitro {
65
65
 
66
- using namespace margelo::nitro::healthkit;
67
-
68
66
  // C++ QueryOptionsWithSortOrder <> JS QueryOptionsWithSortOrder (object)
69
67
  template <>
70
- struct JSIConverter<QueryOptionsWithSortOrder> final {
71
- static inline QueryOptionsWithSortOrder fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
68
+ struct JSIConverter<margelo::nitro::healthkit::QueryOptionsWithSortOrder> final {
69
+ static inline margelo::nitro::healthkit::QueryOptionsWithSortOrder fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
72
70
  jsi::Object obj = arg.asObject(runtime);
73
- return QueryOptionsWithSortOrder(
71
+ return margelo::nitro::healthkit::QueryOptionsWithSortOrder(
74
72
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "ascending")),
75
- JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
73
+ JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
76
74
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
77
75
  );
78
76
  }
79
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryOptionsWithSortOrder& arg) {
77
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithSortOrder& arg) {
80
78
  jsi::Object obj(runtime);
81
79
  obj.setProperty(runtime, "ascending", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.ascending));
82
- obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
80
+ obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
83
81
  obj.setProperty(runtime, "limit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
84
82
  return obj;
85
83
  }
@@ -89,7 +87,7 @@ namespace margelo::nitro {
89
87
  }
90
88
  jsi::Object obj = value.getObject(runtime);
91
89
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "ascending"))) return false;
92
- if (!JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
90
+ if (!JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
93
91
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
94
92
  return true;
95
93
  }
@@ -33,9 +33,8 @@ namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
33
33
  // Forward declaration of `FilterForSamplesOr` to properly resolve imports.
34
34
  namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
35
35
 
36
- #include <optional>
37
36
  #include <string>
38
- #include <variant>
37
+ #include <optional>
39
38
  #include "PredicateWithUUID.hpp"
40
39
  #include "PredicateWithUUIDs.hpp"
41
40
  #include "PredicateWithMetadataKey.hpp"
@@ -43,6 +42,7 @@ namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
43
42
  #include "PredicateFromWorkout.hpp"
44
43
  #include "FilterForSamplesAnd.hpp"
45
44
  #include "FilterForSamplesOr.hpp"
45
+ #include <variant>
46
46
 
47
47
  namespace margelo::nitro::healthkit {
48
48
 
@@ -65,25 +65,23 @@ namespace margelo::nitro::healthkit {
65
65
 
66
66
  namespace margelo::nitro {
67
67
 
68
- using namespace margelo::nitro::healthkit;
69
-
70
68
  // C++ QueryOptionsWithSortOrderAndUnit <> JS QueryOptionsWithSortOrderAndUnit (object)
71
69
  template <>
72
- struct JSIConverter<QueryOptionsWithSortOrderAndUnit> final {
73
- static inline QueryOptionsWithSortOrderAndUnit fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
70
+ struct JSIConverter<margelo::nitro::healthkit::QueryOptionsWithSortOrderAndUnit> final {
71
+ static inline margelo::nitro::healthkit::QueryOptionsWithSortOrderAndUnit fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
74
72
  jsi::Object obj = arg.asObject(runtime);
75
- return QueryOptionsWithSortOrderAndUnit(
73
+ return margelo::nitro::healthkit::QueryOptionsWithSortOrderAndUnit(
76
74
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
77
75
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "ascending")),
78
- JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
76
+ JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
79
77
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
80
78
  );
81
79
  }
82
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryOptionsWithSortOrderAndUnit& arg) {
80
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithSortOrderAndUnit& arg) {
83
81
  jsi::Object obj(runtime);
84
82
  obj.setProperty(runtime, "unit", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
85
83
  obj.setProperty(runtime, "ascending", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.ascending));
86
- obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
84
+ obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
87
85
  obj.setProperty(runtime, "limit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
88
86
  return obj;
89
87
  }
@@ -94,7 +92,7 @@ namespace margelo::nitro {
94
92
  jsi::Object obj = value.getObject(runtime);
95
93
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
96
94
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "ascending"))) return false;
97
- if (!JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
95
+ if (!JSIConverter<std::optional<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
98
96
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
99
97
  return true;
100
98
  }
@@ -23,9 +23,10 @@ namespace margelo::nitro::healthkit { struct Quantity; }
23
23
  // Forward declaration of `QuantityDateInterval` to properly resolve imports.
24
24
  namespace margelo::nitro::healthkit { struct QuantityDateInterval; }
25
25
 
26
- #include <optional>
27
26
  #include "Quantity.hpp"
27
+ #include <optional>
28
28
  #include "QuantityDateInterval.hpp"
29
+ #include <chrono>
29
30
 
30
31
  namespace margelo::nitro::healthkit {
31
32
 
@@ -41,42 +42,46 @@ namespace margelo::nitro::healthkit {
41
42
  std::optional<Quantity> mostRecentQuantity SWIFT_PRIVATE;
42
43
  std::optional<QuantityDateInterval> mostRecentQuantityDateInterval SWIFT_PRIVATE;
43
44
  std::optional<Quantity> duration SWIFT_PRIVATE;
45
+ std::optional<std::chrono::system_clock::time_point> startDate SWIFT_PRIVATE;
46
+ std::optional<std::chrono::system_clock::time_point> endDate SWIFT_PRIVATE;
44
47
 
45
48
  public:
46
49
  QueryStatisticsResponse() = default;
47
- explicit QueryStatisticsResponse(std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval, std::optional<Quantity> duration): averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval), duration(duration) {}
50
+ explicit QueryStatisticsResponse(std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval, std::optional<Quantity> duration, std::optional<std::chrono::system_clock::time_point> startDate, std::optional<std::chrono::system_clock::time_point> endDate): averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval), duration(duration), startDate(startDate), endDate(endDate) {}
48
51
  };
49
52
 
50
53
  } // namespace margelo::nitro::healthkit
51
54
 
52
55
  namespace margelo::nitro {
53
56
 
54
- using namespace margelo::nitro::healthkit;
55
-
56
57
  // C++ QueryStatisticsResponse <> JS QueryStatisticsResponse (object)
57
58
  template <>
58
- struct JSIConverter<QueryStatisticsResponse> final {
59
- static inline QueryStatisticsResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
59
+ struct JSIConverter<margelo::nitro::healthkit::QueryStatisticsResponse> final {
60
+ static inline margelo::nitro::healthkit::QueryStatisticsResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
60
61
  jsi::Object obj = arg.asObject(runtime);
61
- return QueryStatisticsResponse(
62
- JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "averageQuantity")),
63
- JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "maximumQuantity")),
64
- JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "minimumQuantity")),
65
- JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "sumQuantity")),
66
- JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantity")),
67
- JSIConverter<std::optional<QuantityDateInterval>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval")),
68
- JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "duration"))
62
+ return margelo::nitro::healthkit::QueryStatisticsResponse(
63
+ JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "averageQuantity")),
64
+ JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "maximumQuantity")),
65
+ JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "minimumQuantity")),
66
+ JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "sumQuantity")),
67
+ JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantity")),
68
+ JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval")),
69
+ JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "duration")),
70
+ JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
71
+ JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "endDate"))
69
72
  );
70
73
  }
71
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryStatisticsResponse& arg) {
74
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryStatisticsResponse& arg) {
72
75
  jsi::Object obj(runtime);
73
- obj.setProperty(runtime, "averageQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.averageQuantity));
74
- obj.setProperty(runtime, "maximumQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.maximumQuantity));
75
- obj.setProperty(runtime, "minimumQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.minimumQuantity));
76
- obj.setProperty(runtime, "sumQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.sumQuantity));
77
- obj.setProperty(runtime, "mostRecentQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.mostRecentQuantity));
78
- obj.setProperty(runtime, "mostRecentQuantityDateInterval", JSIConverter<std::optional<QuantityDateInterval>>::toJSI(runtime, arg.mostRecentQuantityDateInterval));
79
- obj.setProperty(runtime, "duration", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.duration));
76
+ obj.setProperty(runtime, "averageQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.averageQuantity));
77
+ obj.setProperty(runtime, "maximumQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.maximumQuantity));
78
+ obj.setProperty(runtime, "minimumQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.minimumQuantity));
79
+ obj.setProperty(runtime, "sumQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.sumQuantity));
80
+ obj.setProperty(runtime, "mostRecentQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.mostRecentQuantity));
81
+ obj.setProperty(runtime, "mostRecentQuantityDateInterval", JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::toJSI(runtime, arg.mostRecentQuantityDateInterval));
82
+ obj.setProperty(runtime, "duration", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.duration));
83
+ obj.setProperty(runtime, "startDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.startDate));
84
+ obj.setProperty(runtime, "endDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.endDate));
80
85
  return obj;
81
86
  }
82
87
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -84,13 +89,15 @@ namespace margelo::nitro {
84
89
  return false;
85
90
  }
86
91
  jsi::Object obj = value.getObject(runtime);
87
- if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "averageQuantity"))) return false;
88
- if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "maximumQuantity"))) return false;
89
- if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "minimumQuantity"))) return false;
90
- if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "sumQuantity"))) return false;
91
- if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "mostRecentQuantity"))) return false;
92
- if (!JSIConverter<std::optional<QuantityDateInterval>>::canConvert(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval"))) return false;
93
- if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false;
92
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "averageQuantity"))) return false;
93
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "maximumQuantity"))) return false;
94
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "minimumQuantity"))) return false;
95
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "sumQuantity"))) return false;
96
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "mostRecentQuantity"))) return false;
97
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::canConvert(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval"))) return false;
98
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false;
99
+ if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
100
+ if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
94
101
  return true;
95
102
  }
96
103
  };
@@ -23,9 +23,9 @@ namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
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 <memory>
28
27
  #include "HybridWorkoutProxySpec.hpp"
28
+ #include <vector>
29
29
  #include "DeletedSample.hpp"
30
30
  #include <string>
31
31
 
@@ -36,36 +36,34 @@ namespace margelo::nitro::healthkit {
36
36
  */
37
37
  struct QueryWorkoutSamplesWithAnchorResponse {
38
38
  public:
39
- std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>> workouts SWIFT_PRIVATE;
39
+ std::vector<std::shared_ptr<HybridWorkoutProxySpec>> workouts SWIFT_PRIVATE;
40
40
  std::vector<DeletedSample> deletedSamples SWIFT_PRIVATE;
41
41
  std::string newAnchor SWIFT_PRIVATE;
42
42
 
43
43
  public:
44
44
  QueryWorkoutSamplesWithAnchorResponse() = default;
45
- explicit QueryWorkoutSamplesWithAnchorResponse(std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>> workouts, std::vector<DeletedSample> deletedSamples, std::string newAnchor): workouts(workouts), deletedSamples(deletedSamples), newAnchor(newAnchor) {}
45
+ explicit QueryWorkoutSamplesWithAnchorResponse(std::vector<std::shared_ptr<HybridWorkoutProxySpec>> workouts, std::vector<DeletedSample> deletedSamples, std::string newAnchor): workouts(workouts), deletedSamples(deletedSamples), newAnchor(newAnchor) {}
46
46
  };
47
47
 
48
48
  } // namespace margelo::nitro::healthkit
49
49
 
50
50
  namespace margelo::nitro {
51
51
 
52
- using namespace margelo::nitro::healthkit;
53
-
54
52
  // C++ QueryWorkoutSamplesWithAnchorResponse <> JS QueryWorkoutSamplesWithAnchorResponse (object)
55
53
  template <>
56
- struct JSIConverter<QueryWorkoutSamplesWithAnchorResponse> final {
57
- static inline QueryWorkoutSamplesWithAnchorResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ struct JSIConverter<margelo::nitro::healthkit::QueryWorkoutSamplesWithAnchorResponse> final {
55
+ static inline margelo::nitro::healthkit::QueryWorkoutSamplesWithAnchorResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
56
  jsi::Object obj = arg.asObject(runtime);
59
- return QueryWorkoutSamplesWithAnchorResponse(
57
+ return margelo::nitro::healthkit::QueryWorkoutSamplesWithAnchorResponse(
60
58
  JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::fromJSI(runtime, obj.getProperty(runtime, "workouts")),
61
- JSIConverter<std::vector<DeletedSample>>::fromJSI(runtime, obj.getProperty(runtime, "deletedSamples")),
59
+ JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::fromJSI(runtime, obj.getProperty(runtime, "deletedSamples")),
62
60
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "newAnchor"))
63
61
  );
64
62
  }
65
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryWorkoutSamplesWithAnchorResponse& arg) {
63
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryWorkoutSamplesWithAnchorResponse& arg) {
66
64
  jsi::Object obj(runtime);
67
65
  obj.setProperty(runtime, "workouts", JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::toJSI(runtime, arg.workouts));
68
- obj.setProperty(runtime, "deletedSamples", JSIConverter<std::vector<DeletedSample>>::toJSI(runtime, arg.deletedSamples));
66
+ obj.setProperty(runtime, "deletedSamples", JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::toJSI(runtime, arg.deletedSamples));
69
67
  obj.setProperty(runtime, "newAnchor", JSIConverter<std::string>::toJSI(runtime, arg.newAnchor));
70
68
  return obj;
71
69
  }
@@ -75,7 +73,7 @@ namespace margelo::nitro {
75
73
  }
76
74
  jsi::Object obj = value.getObject(runtime);
77
75
  if (!JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::canConvert(runtime, obj.getProperty(runtime, "workouts"))) return false;
78
- if (!JSIConverter<std::vector<DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
76
+ if (!JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
79
77
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "newAnchor"))) return false;
80
78
  return true;
81
79
  }