@kingstinct/react-native-healthkit 13.4.0 → 14.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 (189) hide show
  1. package/ReactNativeHealthkit.podspec +1 -0
  2. package/app.plugin.ts +40 -2
  3. package/ios/BackgroundDeliveryManager.swift +196 -0
  4. package/ios/CategoryTypeModule.swift +1 -1
  5. package/ios/CoreModule.swift +24 -0
  6. package/ios/CorrelationTypeModule.swift +2 -35
  7. package/ios/ElectrocardiogramModule.swift +2 -34
  8. package/ios/HeartbeatSeriesModule.swift +2 -34
  9. package/ios/MedicationModule.swift +3 -35
  10. package/ios/PredicateHelpers.swift +2 -2
  11. package/ios/QuantityTypeModule.swift +11 -11
  12. package/ios/Serializers.swift +58 -90
  13. package/ios/StateOfMindModule.swift +2 -34
  14. package/ios/WorkoutProxy.swift +3 -149
  15. package/ios/generated/HealthkitGenerated.swift +52 -0
  16. package/lib/commonjs/generated/healthkit.generated.js +745 -0
  17. package/lib/commonjs/healthkit.ios.js +51 -17
  18. package/lib/commonjs/healthkit.js +120 -34
  19. package/lib/commonjs/specs/QuantityTypeModule.nitro.js +1 -0
  20. package/lib/commonjs/type-tests/generated-typing.js +2 -0
  21. package/lib/commonjs/types/CategoryType.js +19 -99
  22. package/lib/commonjs/types/Medication.js +2 -0
  23. package/lib/commonjs/types/MetadataEnums.js +17 -0
  24. package/lib/commonjs/types/QuantityType.js +4 -15
  25. package/lib/commonjs/types/WeatherCondition.js +2 -32
  26. package/lib/commonjs/types/Workouts.js +3 -98
  27. package/lib/commonjs/types/index.js +2 -0
  28. package/lib/module/generated/healthkit.generated.js +742 -0
  29. package/lib/module/healthkit.ios.js +49 -15
  30. package/lib/module/healthkit.js +94 -20
  31. package/lib/module/specs/QuantityTypeModule.nitro.js +1 -0
  32. package/lib/module/type-tests/generated-typing.js +1 -0
  33. package/lib/module/types/CategoryType.js +2 -98
  34. package/lib/module/types/Medication.js +1 -0
  35. package/lib/module/types/MetadataEnums.js +1 -0
  36. package/lib/module/types/QuantityType.js +2 -14
  37. package/lib/module/types/WeatherCondition.js +1 -32
  38. package/lib/module/types/Workouts.js +2 -98
  39. package/lib/module/types/index.js +2 -0
  40. package/lib/typescript/generated/healthkit.generated.d.ts +1006 -0
  41. package/lib/typescript/healthkit.d.ts +39 -36
  42. package/lib/typescript/healthkit.ios.d.ts +64 -53
  43. package/lib/typescript/hooks/useMostRecentQuantitySample.d.ts +3 -2
  44. package/lib/typescript/hooks/useMostRecentWorkout.d.ts +2 -2
  45. package/lib/typescript/hooks/useQuantitySampleById.d.ts +5 -4
  46. package/lib/typescript/hooks/useStatisticsForQuantity.d.ts +2 -2
  47. package/lib/typescript/hooks/useSubscribeToQuantitySamples.d.ts +1 -1
  48. package/lib/typescript/modules.d.ts +2 -2
  49. package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +3 -3
  50. package/lib/typescript/specs/CoreModule.nitro.d.ts +15 -0
  51. package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +20 -9
  52. package/lib/typescript/type-tests/generated-typing.d.ts +1 -0
  53. package/lib/typescript/types/CategoryType.d.ts +10 -104
  54. package/lib/typescript/types/CategoryTypeIdentifier.d.ts +1 -61
  55. package/lib/typescript/types/CorrelationType.d.ts +8 -2
  56. package/lib/typescript/types/ElectrocardiogramSample.d.ts +8 -1
  57. package/lib/typescript/types/HeartbeatSeries.d.ts +8 -1
  58. package/lib/typescript/types/InterfaceVerification.d.ts +14 -1
  59. package/lib/typescript/types/Medication.d.ts +10 -0
  60. package/lib/typescript/types/MetadataEnums.d.ts +1 -0
  61. package/lib/typescript/types/QuantitySample.d.ts +9 -1
  62. package/lib/typescript/types/QuantityType.d.ts +14 -18
  63. package/lib/typescript/types/QuantityTypeIdentifier.d.ts +1 -671
  64. package/lib/typescript/types/QueryOptions.d.ts +8 -4
  65. package/lib/typescript/types/Shared.d.ts +12 -41
  66. package/lib/typescript/types/StateOfMind.d.ts +8 -1
  67. package/lib/typescript/types/Subscriptions.d.ts +11 -11
  68. package/lib/typescript/types/WeatherCondition.d.ts +1 -30
  69. package/lib/typescript/types/Workouts.d.ts +18 -104
  70. package/lib/typescript/types/index.d.ts +2 -0
  71. package/lib/typescript/utils/getMostRecentQuantitySample.d.ts +2 -1
  72. package/lib/typescript/utils/getMostRecentWorkout.d.ts +2 -1
  73. package/lib/typescript/utils/getPreferredUnit.d.ts +2 -1
  74. package/lib/typescript/utils/getQuantitySampleById.d.ts +2 -1
  75. package/lib/typescript/utils/subscribeToQuantitySamples.d.ts +1 -1
  76. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +55 -109
  77. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +12 -18
  78. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +5 -14
  79. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +18 -2
  80. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +1 -13
  81. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +1 -13
  82. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +2 -14
  83. package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +1 -13
  84. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +19 -28
  85. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +2 -14
  86. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +2 -115
  87. package/nitrogen/generated/ios/swift/CategorySample.swift +4 -329
  88. package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +112 -108
  89. package/nitrogen/generated/ios/swift/CategoryTypeIdentifierWriteable.swift +292 -0
  90. package/nitrogen/generated/ios/swift/CorrelationSample.swift +4 -347
  91. package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +4 -329
  92. package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +30 -30
  93. package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +30 -30
  94. package/nitrogen/generated/ios/swift/GeneralForm.swift +4 -4
  95. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +4 -329
  96. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
  97. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +1 -1
  98. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -0
  99. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +38 -0
  100. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +6 -6
  101. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +6 -6
  102. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +1 -27
  103. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +2 -340
  104. package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +4 -329
  105. package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +492 -492
  106. package/nitrogen/generated/ios/swift/QuantitySample.swift +4 -329
  107. package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +380 -384
  108. package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +372 -376
  109. package/nitrogen/generated/ios/swift/{QueryOptionsWithAnchorAndUnit.swift → QueryOptionsWithAnchorAndStringUnit.swift} +5 -5
  110. package/nitrogen/generated/ios/swift/{QueryOptionsWithSortOrderAndUnit.swift → QueryOptionsWithSortOrderAndStringUnit.swift} +5 -5
  111. package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +37 -37
  112. package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +492 -492
  113. package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +482 -486
  114. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +4 -329
  115. package/nitrogen/generated/ios/swift/{StatisticsQueryOptions.swift → StatisticsQueryOptionsWithStringUnit.swift} +5 -5
  116. package/nitrogen/generated/ios/swift/WorkoutSample.swift +4 -402
  117. package/nitrogen/generated/shared/c++/CategorySample.hpp +8 -100
  118. package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +153 -149
  119. package/nitrogen/generated/shared/c++/CategoryTypeIdentifierWriteable.hpp +328 -0
  120. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +9 -105
  121. package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +7 -99
  122. package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +13 -13
  123. package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +13 -13
  124. package/nitrogen/generated/shared/c++/GeneralForm.hpp +7 -7
  125. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +8 -100
  126. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +5 -2
  127. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +2 -0
  128. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +4 -2
  129. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +15 -15
  130. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +1 -27
  131. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +2 -37
  132. package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +7 -99
  133. package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +565 -565
  134. package/nitrogen/generated/shared/c++/QuantitySample.hpp +8 -100
  135. package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +407 -411
  136. package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +398 -402
  137. package/nitrogen/generated/shared/c++/{QueryOptionsWithAnchorAndUnit.hpp → QueryOptionsWithAnchorAndStringUnit.hpp} +11 -11
  138. package/nitrogen/generated/shared/c++/{QueryOptionsWithSortOrderAndUnit.hpp → QueryOptionsWithSortOrderAndStringUnit.hpp} +11 -11
  139. package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +12 -12
  140. package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +559 -559
  141. package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +541 -545
  142. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +8 -100
  143. package/nitrogen/generated/shared/c++/{StatisticsQueryOptions.hpp → StatisticsQueryOptionsWithStringUnit.hpp} +11 -11
  144. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +7 -120
  145. package/package.json +5 -2
  146. package/src/generated/healthkit-schema.json +3680 -0
  147. package/src/generated/healthkit.generated.ts +1307 -0
  148. package/src/healthkit.ios.ts +225 -19
  149. package/src/healthkit.ts +181 -55
  150. package/src/hooks/useMostRecentQuantitySample.ts +6 -5
  151. package/src/hooks/useMostRecentWorkout.ts +2 -2
  152. package/src/hooks/useQuantitySampleById.ts +6 -5
  153. package/src/hooks/useStatisticsForQuantity.ts +2 -1
  154. package/src/hooks/useSubscribeToQuantitySamples.ts +1 -1
  155. package/src/modules.ts +7 -2
  156. package/src/specs/CategoryTypeModule.nitro.ts +8 -5
  157. package/src/specs/CoreModule.nitro.ts +20 -0
  158. package/src/specs/QuantityTypeModule.nitro.ts +81 -7
  159. package/src/test-setup.ts +2 -0
  160. package/src/type-tests/generated-typing.ts +133 -0
  161. package/src/types/CategoryType.ts +52 -148
  162. package/src/types/CategoryTypeIdentifier.ts +5 -134
  163. package/src/types/CorrelationType.ts +13 -3
  164. package/src/types/ElectrocardiogramSample.ts +13 -1
  165. package/src/types/HeartbeatSeries.ts +13 -1
  166. package/src/types/InterfaceVerification.ts +38 -1
  167. package/src/types/Medication.ts +19 -0
  168. package/src/types/MetadataEnums.ts +15 -0
  169. package/src/types/QuantitySample.ts +14 -2
  170. package/src/types/QuantityType.ts +22 -122
  171. package/src/types/QuantityTypeIdentifier.ts +5 -772
  172. package/src/types/QueryOptions.ts +11 -4
  173. package/src/types/Shared.ts +22 -49
  174. package/src/types/StateOfMind.ts +13 -1
  175. package/src/types/Subscriptions.ts +19 -13
  176. package/src/types/WeatherCondition.ts +1 -31
  177. package/src/types/Workouts.ts +44 -108
  178. package/src/types/index.ts +2 -0
  179. package/src/utils/getMostRecentQuantitySample.ts +4 -3
  180. package/src/utils/getMostRecentWorkout.ts +5 -2
  181. package/src/utils/getPreferredUnit.ts +5 -4
  182. package/src/utils/getQuantitySampleById.ts +4 -3
  183. package/src/utils/subscribeToQuantitySamples.ts +5 -3
  184. package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +0 -44
  185. package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +0 -40
  186. package/nitrogen/generated/ios/swift/WeatherCondition.swift +0 -144
  187. package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +0 -67
  188. package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +0 -62
  189. package/nitrogen/generated/shared/c++/WeatherCondition.hpp +0 -88
@@ -36,14 +36,6 @@ namespace margelo::nitro::healthkit { enum class ElectrocardiogramSymptomsStatus
36
36
  namespace margelo::nitro::healthkit { struct ElectrocardiogramVoltage; }
37
37
  // Forward declaration of `SampleType` to properly resolve imports.
38
38
  namespace margelo::nitro::healthkit { struct SampleType; }
39
- // Forward declaration of `WeatherCondition` to properly resolve imports.
40
- namespace margelo::nitro::healthkit { enum class WeatherCondition; }
41
- // Forward declaration of `Quantity` to properly resolve imports.
42
- namespace margelo::nitro::healthkit { struct Quantity; }
43
- // Forward declaration of `InsulinDeliveryReason` to properly resolve imports.
44
- namespace margelo::nitro::healthkit { enum class InsulinDeliveryReason; }
45
- // Forward declaration of `HeartRateMotionContext` to properly resolve imports.
46
- namespace margelo::nitro::healthkit { enum class HeartRateMotionContext; }
47
39
  // Forward declaration of `SourceRevision` to properly resolve imports.
48
40
  namespace margelo::nitro::healthkit { struct SourceRevision; }
49
41
  // Forward declaration of `Device` to properly resolve imports.
@@ -56,14 +48,10 @@ namespace margelo::nitro::healthkit { struct Device; }
56
48
  #include <vector>
57
49
  #include "SampleType.hpp"
58
50
  #include <chrono>
59
- #include "WeatherCondition.hpp"
60
- #include "Quantity.hpp"
61
- #include "InsulinDeliveryReason.hpp"
62
- #include "HeartRateMotionContext.hpp"
51
+ #include <NitroModules/AnyMap.hpp>
63
52
  #include <string>
64
53
  #include "SourceRevision.hpp"
65
54
  #include "Device.hpp"
66
- #include <NitroModules/AnyMap.hpp>
67
55
 
68
56
  namespace margelo::nitro::healthkit {
69
57
 
@@ -82,34 +70,14 @@ namespace margelo::nitro::healthkit {
82
70
  std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
83
71
  std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
84
72
  bool hasUndeterminedDuration SWIFT_PRIVATE;
85
- std::optional<WeatherCondition> metadataWeatherCondition SWIFT_PRIVATE;
86
- std::optional<Quantity> metadataWeatherHumidity SWIFT_PRIVATE;
87
- std::optional<Quantity> metadataWeatherTemperature SWIFT_PRIVATE;
88
- std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason SWIFT_PRIVATE;
89
- std::optional<HeartRateMotionContext> metadataHeartRateMotionContext SWIFT_PRIVATE;
73
+ std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
90
74
  std::string uuid SWIFT_PRIVATE;
91
75
  SourceRevision sourceRevision SWIFT_PRIVATE;
92
76
  std::optional<Device> device SWIFT_PRIVATE;
93
- std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
94
- std::optional<std::string> metadataExternalUUID SWIFT_PRIVATE;
95
- std::optional<std::string> metadataTimeZone SWIFT_PRIVATE;
96
- std::optional<bool> metadataWasUserEntered SWIFT_PRIVATE;
97
- std::optional<std::string> metadataDeviceSerialNumber SWIFT_PRIVATE;
98
- std::optional<std::string> metadataUdiDeviceIdentifier SWIFT_PRIVATE;
99
- std::optional<std::string> metadataUdiProductionIdentifier SWIFT_PRIVATE;
100
- std::optional<std::string> metadataDigitalSignature SWIFT_PRIVATE;
101
- std::optional<std::string> metadataDeviceName SWIFT_PRIVATE;
102
- std::optional<std::string> metadataDeviceManufacturerName SWIFT_PRIVATE;
103
- std::optional<std::string> metadataSyncIdentifier SWIFT_PRIVATE;
104
- std::optional<double> metadataSyncVersion SWIFT_PRIVATE;
105
- std::optional<bool> metadataWasTakenInLab SWIFT_PRIVATE;
106
- std::optional<double> metadataReferenceRangeLowerLimit SWIFT_PRIVATE;
107
- std::optional<double> metadataReferenceRangeUpperLimit SWIFT_PRIVATE;
108
- std::optional<double> metadataAlgorithmVersion SWIFT_PRIVATE;
109
77
 
110
78
  public:
111
79
  ElectrocardiogramSample() = default;
112
- explicit ElectrocardiogramSample(ElectrocardiogramClassification classification, ElectrocardiogramSymptomsStatus symptomsStatus, std::optional<double> averageHeartRateBpm, std::optional<double> samplingFrequencyHz, double numberOfVoltageMeasurements, std::optional<std::vector<ElectrocardiogramVoltage>> voltages, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::optional<WeatherCondition> metadataWeatherCondition, std::optional<Quantity> metadataWeatherHumidity, std::optional<Quantity> metadataWeatherTemperature, std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason, std::optional<HeartRateMotionContext> metadataHeartRateMotionContext, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata, std::optional<std::string> metadataExternalUUID, std::optional<std::string> metadataTimeZone, std::optional<bool> metadataWasUserEntered, std::optional<std::string> metadataDeviceSerialNumber, std::optional<std::string> metadataUdiDeviceIdentifier, std::optional<std::string> metadataUdiProductionIdentifier, std::optional<std::string> metadataDigitalSignature, std::optional<std::string> metadataDeviceName, std::optional<std::string> metadataDeviceManufacturerName, std::optional<std::string> metadataSyncIdentifier, std::optional<double> metadataSyncVersion, std::optional<bool> metadataWasTakenInLab, std::optional<double> metadataReferenceRangeLowerLimit, std::optional<double> metadataReferenceRangeUpperLimit, std::optional<double> metadataAlgorithmVersion): classification(classification), symptomsStatus(symptomsStatus), averageHeartRateBpm(averageHeartRateBpm), samplingFrequencyHz(samplingFrequencyHz), numberOfVoltageMeasurements(numberOfVoltageMeasurements), voltages(voltages), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadataWeatherCondition(metadataWeatherCondition), metadataWeatherHumidity(metadataWeatherHumidity), metadataWeatherTemperature(metadataWeatherTemperature), metadataInsulinDeliveryReason(metadataInsulinDeliveryReason), metadataHeartRateMotionContext(metadataHeartRateMotionContext), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata), metadataExternalUUID(metadataExternalUUID), metadataTimeZone(metadataTimeZone), metadataWasUserEntered(metadataWasUserEntered), metadataDeviceSerialNumber(metadataDeviceSerialNumber), metadataUdiDeviceIdentifier(metadataUdiDeviceIdentifier), metadataUdiProductionIdentifier(metadataUdiProductionIdentifier), metadataDigitalSignature(metadataDigitalSignature), metadataDeviceName(metadataDeviceName), metadataDeviceManufacturerName(metadataDeviceManufacturerName), metadataSyncIdentifier(metadataSyncIdentifier), metadataSyncVersion(metadataSyncVersion), metadataWasTakenInLab(metadataWasTakenInLab), metadataReferenceRangeLowerLimit(metadataReferenceRangeLowerLimit), metadataReferenceRangeUpperLimit(metadataReferenceRangeUpperLimit), metadataAlgorithmVersion(metadataAlgorithmVersion) {}
80
+ explicit ElectrocardiogramSample(ElectrocardiogramClassification classification, ElectrocardiogramSymptomsStatus symptomsStatus, std::optional<double> averageHeartRateBpm, std::optional<double> samplingFrequencyHz, double numberOfVoltageMeasurements, std::optional<std::vector<ElectrocardiogramVoltage>> voltages, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::shared_ptr<AnyMap> metadata, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device): classification(classification), symptomsStatus(symptomsStatus), averageHeartRateBpm(averageHeartRateBpm), samplingFrequencyHz(samplingFrequencyHz), numberOfVoltageMeasurements(numberOfVoltageMeasurements), voltages(voltages), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadata(metadata), uuid(uuid), sourceRevision(sourceRevision), device(device) {}
113
81
 
114
82
  public:
115
83
  friend bool operator==(const ElectrocardiogramSample& lhs, const ElectrocardiogramSample& rhs) = default;
@@ -135,30 +103,10 @@ namespace margelo::nitro {
135
103
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
136
104
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
137
105
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
138
- JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition"))),
139
- JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"))),
140
- JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"))),
141
- JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"))),
142
- JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"))),
106
+ JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
143
107
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
144
108
  JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
145
- JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
146
- JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
147
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"))),
148
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"))),
149
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"))),
150
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"))),
151
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"))),
152
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"))),
153
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"))),
154
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"))),
155
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"))),
156
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"))),
157
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"))),
158
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"))),
159
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"))),
160
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"))),
161
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))
109
+ JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
162
110
  );
163
111
  }
164
112
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::ElectrocardiogramSample& arg) {
@@ -173,30 +121,10 @@ namespace margelo::nitro {
173
121
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
174
122
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
175
123
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
176
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition"), JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::toJSI(runtime, arg.metadataWeatherCondition));
177
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherHumidity));
178
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherTemperature));
179
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"), JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::toJSI(runtime, arg.metadataInsulinDeliveryReason));
180
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"), JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::toJSI(runtime, arg.metadataHeartRateMotionContext));
124
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
181
125
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
182
126
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
183
127
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
184
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
185
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataExternalUUID));
186
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataTimeZone));
187
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasUserEntered));
188
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceSerialNumber));
189
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiDeviceIdentifier));
190
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiProductionIdentifier));
191
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDigitalSignature));
192
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceName));
193
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceManufacturerName));
194
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataSyncIdentifier));
195
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataSyncVersion));
196
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasTakenInLab));
197
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeLowerLimit));
198
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeUpperLimit));
199
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataAlgorithmVersion));
200
128
  return obj;
201
129
  }
202
130
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -217,30 +145,10 @@ namespace margelo::nitro {
217
145
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
218
146
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
219
147
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
220
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition")))) return false;
221
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity")))) return false;
222
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature")))) return false;
223
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason")))) return false;
224
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext")))) return false;
148
+ if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
225
149
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
226
150
  if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
227
151
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
228
- if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
229
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID")))) return false;
230
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone")))) return false;
231
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered")))) return false;
232
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber")))) return false;
233
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier")))) return false;
234
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier")))) return false;
235
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature")))) return false;
236
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName")))) return false;
237
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName")))) return false;
238
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier")))) return false;
239
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion")))) return false;
240
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab")))) return false;
241
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit")))) return false;
242
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit")))) return false;
243
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))) return false;
244
152
  return true;
245
153
  }
246
154
  };
@@ -34,10 +34,10 @@ namespace margelo::nitro::healthkit { struct FilterForWorkoutsBase; }
34
34
  namespace margelo::nitro::healthkit { enum class WorkoutActivityType; }
35
35
  // Forward declaration of `WorkoutDurationPredicate` to properly resolve imports.
36
36
  namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
37
- // Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
38
- namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
39
37
  // Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
40
38
  namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
39
+ // Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
40
+ namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
41
41
  // Forward declaration of `DateFilter` to properly resolve imports.
42
42
  namespace margelo::nitro::healthkit { struct DateFilter; }
43
43
 
@@ -46,10 +46,10 @@ namespace margelo::nitro::healthkit { struct DateFilter; }
46
46
  #include <optional>
47
47
  #include "WorkoutActivityType.hpp"
48
48
  #include "WorkoutDurationPredicate.hpp"
49
+ #include "PredicateWithMetadataKey.hpp"
50
+ #include <string>
49
51
  #include <memory>
50
52
  #include "HybridSourceProxySpec.hpp"
51
- #include <string>
52
- #include "PredicateWithMetadataKey.hpp"
53
53
  #include "DateFilter.hpp"
54
54
 
55
55
  namespace margelo::nitro::healthkit {
@@ -64,15 +64,15 @@ namespace margelo::nitro::healthkit {
64
64
  std::optional<std::vector<FilterForWorkoutsBase>> AND SWIFT_PRIVATE;
65
65
  std::optional<WorkoutActivityType> workoutActivityType SWIFT_PRIVATE;
66
66
  std::optional<WorkoutDurationPredicate> duration SWIFT_PRIVATE;
67
- std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources SWIFT_PRIVATE;
67
+ std::optional<PredicateWithMetadataKey> metadata SWIFT_PRIVATE;
68
68
  std::optional<std::string> uuid SWIFT_PRIVATE;
69
+ std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources SWIFT_PRIVATE;
69
70
  std::optional<std::vector<std::string>> uuids SWIFT_PRIVATE;
70
- std::optional<PredicateWithMetadataKey> metadata SWIFT_PRIVATE;
71
71
  std::optional<DateFilter> date SWIFT_PRIVATE;
72
72
 
73
73
  public:
74
74
  FilterForWorkouts() = default;
75
- explicit FilterForWorkouts(std::optional<std::vector<FilterForWorkoutsBase>> OR, std::optional<std::vector<FilterForWorkoutsBase>> NOT, std::optional<std::vector<FilterForWorkoutsBase>> AND, std::optional<WorkoutActivityType> workoutActivityType, std::optional<WorkoutDurationPredicate> duration, std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources, std::optional<std::string> uuid, std::optional<std::vector<std::string>> uuids, std::optional<PredicateWithMetadataKey> metadata, std::optional<DateFilter> date): OR(OR), NOT(NOT), AND(AND), workoutActivityType(workoutActivityType), duration(duration), sources(sources), uuid(uuid), uuids(uuids), metadata(metadata), date(date) {}
75
+ explicit FilterForWorkouts(std::optional<std::vector<FilterForWorkoutsBase>> OR, std::optional<std::vector<FilterForWorkoutsBase>> NOT, std::optional<std::vector<FilterForWorkoutsBase>> AND, std::optional<WorkoutActivityType> workoutActivityType, std::optional<WorkoutDurationPredicate> duration, std::optional<PredicateWithMetadataKey> metadata, std::optional<std::string> uuid, std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources, std::optional<std::vector<std::string>> uuids, std::optional<DateFilter> date): OR(OR), NOT(NOT), AND(AND), workoutActivityType(workoutActivityType), duration(duration), metadata(metadata), uuid(uuid), sources(sources), uuids(uuids), date(date) {}
76
76
 
77
77
  public:
78
78
  friend bool operator==(const FilterForWorkouts& lhs, const FilterForWorkouts& rhs) = default;
@@ -93,10 +93,10 @@ namespace margelo::nitro {
93
93
  JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AND"))),
94
94
  JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "workoutActivityType"))),
95
95
  JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration"))),
96
- JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources"))),
96
+ JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
97
97
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
98
+ JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources"))),
98
99
  JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuids"))),
99
- JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
100
100
  JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "date")))
101
101
  );
102
102
  }
@@ -107,10 +107,10 @@ namespace margelo::nitro {
107
107
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "AND"), JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::toJSI(runtime, arg.AND));
108
108
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "workoutActivityType"), JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::toJSI(runtime, arg.workoutActivityType));
109
109
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "duration"), JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::toJSI(runtime, arg.duration));
110
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "sources"), JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::toJSI(runtime, arg.sources));
110
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::toJSI(runtime, arg.metadata));
111
111
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.uuid));
112
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "sources"), JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::toJSI(runtime, arg.sources));
112
113
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuids"), JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.uuids));
113
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::toJSI(runtime, arg.metadata));
114
114
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "date"), JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::toJSI(runtime, arg.date));
115
115
  return obj;
116
116
  }
@@ -127,10 +127,10 @@ namespace margelo::nitro {
127
127
  if (!JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AND")))) return false;
128
128
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "workoutActivityType")))) return false;
129
129
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration")))) return false;
130
- if (!JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources")))) return false;
130
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
131
131
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
132
+ if (!JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources")))) return false;
132
133
  if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuids")))) return false;
133
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
134
134
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "date")))) return false;
135
135
  return true;
136
136
  }
@@ -32,21 +32,21 @@
32
32
  namespace margelo::nitro::healthkit { enum class WorkoutActivityType; }
33
33
  // Forward declaration of `WorkoutDurationPredicate` to properly resolve imports.
34
34
  namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
35
- // Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
36
- namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
37
35
  // Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
38
36
  namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
37
+ // Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
38
+ namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
39
39
  // Forward declaration of `DateFilter` to properly resolve imports.
40
40
  namespace margelo::nitro::healthkit { struct DateFilter; }
41
41
 
42
42
  #include "WorkoutActivityType.hpp"
43
43
  #include <optional>
44
44
  #include "WorkoutDurationPredicate.hpp"
45
+ #include "PredicateWithMetadataKey.hpp"
46
+ #include <string>
45
47
  #include <memory>
46
48
  #include "HybridSourceProxySpec.hpp"
47
49
  #include <vector>
48
- #include <string>
49
- #include "PredicateWithMetadataKey.hpp"
50
50
  #include "DateFilter.hpp"
51
51
 
52
52
  namespace margelo::nitro::healthkit {
@@ -58,15 +58,15 @@ namespace margelo::nitro::healthkit {
58
58
  public:
59
59
  std::optional<WorkoutActivityType> workoutActivityType SWIFT_PRIVATE;
60
60
  std::optional<WorkoutDurationPredicate> duration SWIFT_PRIVATE;
61
- std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources SWIFT_PRIVATE;
61
+ std::optional<PredicateWithMetadataKey> metadata SWIFT_PRIVATE;
62
62
  std::optional<std::string> uuid SWIFT_PRIVATE;
63
+ std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources SWIFT_PRIVATE;
63
64
  std::optional<std::vector<std::string>> uuids SWIFT_PRIVATE;
64
- std::optional<PredicateWithMetadataKey> metadata SWIFT_PRIVATE;
65
65
  std::optional<DateFilter> date SWIFT_PRIVATE;
66
66
 
67
67
  public:
68
68
  FilterForWorkoutsBase() = default;
69
- explicit FilterForWorkoutsBase(std::optional<WorkoutActivityType> workoutActivityType, std::optional<WorkoutDurationPredicate> duration, std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources, std::optional<std::string> uuid, std::optional<std::vector<std::string>> uuids, std::optional<PredicateWithMetadataKey> metadata, std::optional<DateFilter> date): workoutActivityType(workoutActivityType), duration(duration), sources(sources), uuid(uuid), uuids(uuids), metadata(metadata), date(date) {}
69
+ explicit FilterForWorkoutsBase(std::optional<WorkoutActivityType> workoutActivityType, std::optional<WorkoutDurationPredicate> duration, std::optional<PredicateWithMetadataKey> metadata, std::optional<std::string> uuid, std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources, std::optional<std::vector<std::string>> uuids, std::optional<DateFilter> date): workoutActivityType(workoutActivityType), duration(duration), metadata(metadata), uuid(uuid), sources(sources), uuids(uuids), date(date) {}
70
70
 
71
71
  public:
72
72
  friend bool operator==(const FilterForWorkoutsBase& lhs, const FilterForWorkoutsBase& rhs) = default;
@@ -84,10 +84,10 @@ namespace margelo::nitro {
84
84
  return margelo::nitro::healthkit::FilterForWorkoutsBase(
85
85
  JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "workoutActivityType"))),
86
86
  JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration"))),
87
- JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources"))),
87
+ JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
88
88
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
89
+ JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources"))),
89
90
  JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuids"))),
90
- JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
91
91
  JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "date")))
92
92
  );
93
93
  }
@@ -95,10 +95,10 @@ namespace margelo::nitro {
95
95
  jsi::Object obj(runtime);
96
96
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "workoutActivityType"), JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::toJSI(runtime, arg.workoutActivityType));
97
97
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "duration"), JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::toJSI(runtime, arg.duration));
98
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "sources"), JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::toJSI(runtime, arg.sources));
98
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::toJSI(runtime, arg.metadata));
99
99
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.uuid));
100
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "sources"), JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::toJSI(runtime, arg.sources));
100
101
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuids"), JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.uuids));
101
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::toJSI(runtime, arg.metadata));
102
102
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "date"), JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::toJSI(runtime, arg.date));
103
103
  return obj;
104
104
  }
@@ -112,10 +112,10 @@ namespace margelo::nitro {
112
112
  }
113
113
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "workoutActivityType")))) return false;
114
114
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration")))) return false;
115
- if (!JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources")))) return false;
115
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
116
116
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
117
+ if (!JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources")))) return false;
117
118
  if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuids")))) return false;
118
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
119
119
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "date")))) return false;
120
120
  return true;
121
121
  }
@@ -29,10 +29,10 @@ namespace margelo::nitro::healthkit {
29
29
  * An enum which can be represented as a JavaScript union (GeneralForm).
30
30
  */
31
31
  enum class GeneralForm {
32
- UNKNOWN SWIFT_NAME(unknown) = 0,
33
- CAPSULE SWIFT_NAME(capsule) = 1,
34
- CREAM SWIFT_NAME(cream) = 2,
35
- DEVICE SWIFT_NAME(device) = 3,
32
+ DEVICE SWIFT_NAME(device) = 0,
33
+ UNKNOWN SWIFT_NAME(unknown) = 1,
34
+ CAPSULE SWIFT_NAME(capsule) = 2,
35
+ CREAM SWIFT_NAME(cream) = 3,
36
36
  DROPS SWIFT_NAME(drops) = 4,
37
37
  FOAM SWIFT_NAME(foam) = 5,
38
38
  GEL SWIFT_NAME(gel) = 6,
@@ -59,10 +59,10 @@ namespace margelo::nitro {
59
59
  static inline margelo::nitro::healthkit::GeneralForm fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
60
60
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
61
61
  switch (hashString(unionValue.c_str(), unionValue.size())) {
62
+ case hashString("device"): return margelo::nitro::healthkit::GeneralForm::DEVICE;
62
63
  case hashString("unknown"): return margelo::nitro::healthkit::GeneralForm::UNKNOWN;
63
64
  case hashString("capsule"): return margelo::nitro::healthkit::GeneralForm::CAPSULE;
64
65
  case hashString("cream"): return margelo::nitro::healthkit::GeneralForm::CREAM;
65
- case hashString("device"): return margelo::nitro::healthkit::GeneralForm::DEVICE;
66
66
  case hashString("drops"): return margelo::nitro::healthkit::GeneralForm::DROPS;
67
67
  case hashString("foam"): return margelo::nitro::healthkit::GeneralForm::FOAM;
68
68
  case hashString("gel"): return margelo::nitro::healthkit::GeneralForm::GEL;
@@ -83,10 +83,10 @@ namespace margelo::nitro {
83
83
  }
84
84
  static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::GeneralForm arg) {
85
85
  switch (arg) {
86
+ case margelo::nitro::healthkit::GeneralForm::DEVICE: return JSIConverter<std::string>::toJSI(runtime, "device");
86
87
  case margelo::nitro::healthkit::GeneralForm::UNKNOWN: return JSIConverter<std::string>::toJSI(runtime, "unknown");
87
88
  case margelo::nitro::healthkit::GeneralForm::CAPSULE: return JSIConverter<std::string>::toJSI(runtime, "capsule");
88
89
  case margelo::nitro::healthkit::GeneralForm::CREAM: return JSIConverter<std::string>::toJSI(runtime, "cream");
89
- case margelo::nitro::healthkit::GeneralForm::DEVICE: return JSIConverter<std::string>::toJSI(runtime, "device");
90
90
  case margelo::nitro::healthkit::GeneralForm::DROPS: return JSIConverter<std::string>::toJSI(runtime, "drops");
91
91
  case margelo::nitro::healthkit::GeneralForm::FOAM: return JSIConverter<std::string>::toJSI(runtime, "foam");
92
92
  case margelo::nitro::healthkit::GeneralForm::GEL: return JSIConverter<std::string>::toJSI(runtime, "gel");
@@ -112,10 +112,10 @@ namespace margelo::nitro {
112
112
  }
113
113
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
114
114
  switch (hashString(unionValue.c_str(), unionValue.size())) {
115
+ case hashString("device"):
115
116
  case hashString("unknown"):
116
117
  case hashString("capsule"):
117
118
  case hashString("cream"):
118
- case hashString("device"):
119
119
  case hashString("drops"):
120
120
  case hashString("foam"):
121
121
  case hashString("gel"):
@@ -32,14 +32,6 @@
32
32
  namespace margelo::nitro::healthkit { struct Heartbeat; }
33
33
  // Forward declaration of `SampleType` to properly resolve imports.
34
34
  namespace margelo::nitro::healthkit { struct SampleType; }
35
- // Forward declaration of `WeatherCondition` to properly resolve imports.
36
- namespace margelo::nitro::healthkit { enum class WeatherCondition; }
37
- // Forward declaration of `Quantity` to properly resolve imports.
38
- namespace margelo::nitro::healthkit { struct Quantity; }
39
- // Forward declaration of `InsulinDeliveryReason` to properly resolve imports.
40
- namespace margelo::nitro::healthkit { enum class InsulinDeliveryReason; }
41
- // Forward declaration of `HeartRateMotionContext` to properly resolve imports.
42
- namespace margelo::nitro::healthkit { enum class HeartRateMotionContext; }
43
35
  // Forward declaration of `SourceRevision` to properly resolve imports.
44
36
  namespace margelo::nitro::healthkit { struct SourceRevision; }
45
37
  // Forward declaration of `Device` to properly resolve imports.
@@ -49,15 +41,11 @@ namespace margelo::nitro::healthkit { struct Device; }
49
41
  #include <vector>
50
42
  #include "SampleType.hpp"
51
43
  #include <chrono>
52
- #include "WeatherCondition.hpp"
53
- #include <optional>
54
- #include "Quantity.hpp"
55
- #include "InsulinDeliveryReason.hpp"
56
- #include "HeartRateMotionContext.hpp"
44
+ #include <NitroModules/AnyMap.hpp>
57
45
  #include <string>
58
46
  #include "SourceRevision.hpp"
59
47
  #include "Device.hpp"
60
- #include <NitroModules/AnyMap.hpp>
48
+ #include <optional>
61
49
 
62
50
  namespace margelo::nitro::healthkit {
63
51
 
@@ -71,34 +59,14 @@ namespace margelo::nitro::healthkit {
71
59
  std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
72
60
  std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
73
61
  bool hasUndeterminedDuration SWIFT_PRIVATE;
74
- std::optional<WeatherCondition> metadataWeatherCondition SWIFT_PRIVATE;
75
- std::optional<Quantity> metadataWeatherHumidity SWIFT_PRIVATE;
76
- std::optional<Quantity> metadataWeatherTemperature SWIFT_PRIVATE;
77
- std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason SWIFT_PRIVATE;
78
- std::optional<HeartRateMotionContext> metadataHeartRateMotionContext SWIFT_PRIVATE;
62
+ std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
79
63
  std::string uuid SWIFT_PRIVATE;
80
64
  SourceRevision sourceRevision SWIFT_PRIVATE;
81
65
  std::optional<Device> device SWIFT_PRIVATE;
82
- std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
83
- std::optional<std::string> metadataExternalUUID SWIFT_PRIVATE;
84
- std::optional<std::string> metadataTimeZone SWIFT_PRIVATE;
85
- std::optional<bool> metadataWasUserEntered SWIFT_PRIVATE;
86
- std::optional<std::string> metadataDeviceSerialNumber SWIFT_PRIVATE;
87
- std::optional<std::string> metadataUdiDeviceIdentifier SWIFT_PRIVATE;
88
- std::optional<std::string> metadataUdiProductionIdentifier SWIFT_PRIVATE;
89
- std::optional<std::string> metadataDigitalSignature SWIFT_PRIVATE;
90
- std::optional<std::string> metadataDeviceName SWIFT_PRIVATE;
91
- std::optional<std::string> metadataDeviceManufacturerName SWIFT_PRIVATE;
92
- std::optional<std::string> metadataSyncIdentifier SWIFT_PRIVATE;
93
- std::optional<double> metadataSyncVersion SWIFT_PRIVATE;
94
- std::optional<bool> metadataWasTakenInLab SWIFT_PRIVATE;
95
- std::optional<double> metadataReferenceRangeLowerLimit SWIFT_PRIVATE;
96
- std::optional<double> metadataReferenceRangeUpperLimit SWIFT_PRIVATE;
97
- std::optional<double> metadataAlgorithmVersion SWIFT_PRIVATE;
98
66
 
99
67
  public:
100
68
  HeartbeatSeriesSample() = default;
101
- explicit HeartbeatSeriesSample(std::vector<Heartbeat> heartbeats, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::optional<WeatherCondition> metadataWeatherCondition, std::optional<Quantity> metadataWeatherHumidity, std::optional<Quantity> metadataWeatherTemperature, std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason, std::optional<HeartRateMotionContext> metadataHeartRateMotionContext, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata, std::optional<std::string> metadataExternalUUID, std::optional<std::string> metadataTimeZone, std::optional<bool> metadataWasUserEntered, std::optional<std::string> metadataDeviceSerialNumber, std::optional<std::string> metadataUdiDeviceIdentifier, std::optional<std::string> metadataUdiProductionIdentifier, std::optional<std::string> metadataDigitalSignature, std::optional<std::string> metadataDeviceName, std::optional<std::string> metadataDeviceManufacturerName, std::optional<std::string> metadataSyncIdentifier, std::optional<double> metadataSyncVersion, std::optional<bool> metadataWasTakenInLab, std::optional<double> metadataReferenceRangeLowerLimit, std::optional<double> metadataReferenceRangeUpperLimit, std::optional<double> metadataAlgorithmVersion): heartbeats(heartbeats), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadataWeatherCondition(metadataWeatherCondition), metadataWeatherHumidity(metadataWeatherHumidity), metadataWeatherTemperature(metadataWeatherTemperature), metadataInsulinDeliveryReason(metadataInsulinDeliveryReason), metadataHeartRateMotionContext(metadataHeartRateMotionContext), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata), metadataExternalUUID(metadataExternalUUID), metadataTimeZone(metadataTimeZone), metadataWasUserEntered(metadataWasUserEntered), metadataDeviceSerialNumber(metadataDeviceSerialNumber), metadataUdiDeviceIdentifier(metadataUdiDeviceIdentifier), metadataUdiProductionIdentifier(metadataUdiProductionIdentifier), metadataDigitalSignature(metadataDigitalSignature), metadataDeviceName(metadataDeviceName), metadataDeviceManufacturerName(metadataDeviceManufacturerName), metadataSyncIdentifier(metadataSyncIdentifier), metadataSyncVersion(metadataSyncVersion), metadataWasTakenInLab(metadataWasTakenInLab), metadataReferenceRangeLowerLimit(metadataReferenceRangeLowerLimit), metadataReferenceRangeUpperLimit(metadataReferenceRangeUpperLimit), metadataAlgorithmVersion(metadataAlgorithmVersion) {}
69
+ explicit HeartbeatSeriesSample(std::vector<Heartbeat> heartbeats, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::shared_ptr<AnyMap> metadata, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device): heartbeats(heartbeats), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadata(metadata), uuid(uuid), sourceRevision(sourceRevision), device(device) {}
102
70
 
103
71
  public:
104
72
  friend bool operator==(const HeartbeatSeriesSample& lhs, const HeartbeatSeriesSample& rhs) = default;
@@ -119,30 +87,10 @@ namespace margelo::nitro {
119
87
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
120
88
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
121
89
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
122
- JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition"))),
123
- JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"))),
124
- JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"))),
125
- JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"))),
126
- JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"))),
90
+ JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
127
91
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
128
92
  JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
129
- JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
130
- JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
131
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"))),
132
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"))),
133
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"))),
134
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"))),
135
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"))),
136
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"))),
137
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"))),
138
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"))),
139
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"))),
140
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"))),
141
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"))),
142
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"))),
143
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"))),
144
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"))),
145
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))
93
+ JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
146
94
  );
147
95
  }
148
96
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::HeartbeatSeriesSample& arg) {
@@ -152,30 +100,10 @@ namespace margelo::nitro {
152
100
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
153
101
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
154
102
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
155
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition"), JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::toJSI(runtime, arg.metadataWeatherCondition));
156
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherHumidity));
157
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherTemperature));
158
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"), JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::toJSI(runtime, arg.metadataInsulinDeliveryReason));
159
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"), JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::toJSI(runtime, arg.metadataHeartRateMotionContext));
103
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
160
104
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
161
105
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
162
106
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
163
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
164
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataExternalUUID));
165
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataTimeZone));
166
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasUserEntered));
167
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceSerialNumber));
168
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiDeviceIdentifier));
169
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiProductionIdentifier));
170
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDigitalSignature));
171
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceName));
172
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceManufacturerName));
173
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataSyncIdentifier));
174
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataSyncVersion));
175
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasTakenInLab));
176
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeLowerLimit));
177
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeUpperLimit));
178
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataAlgorithmVersion));
179
107
  return obj;
180
108
  }
181
109
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -191,30 +119,10 @@ namespace margelo::nitro {
191
119
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
192
120
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
193
121
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
194
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition")))) return false;
195
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity")))) return false;
196
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature")))) return false;
197
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason")))) return false;
198
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext")))) return false;
122
+ if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
199
123
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
200
124
  if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
201
125
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
202
- if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
203
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID")))) return false;
204
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone")))) return false;
205
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered")))) return false;
206
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber")))) return false;
207
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier")))) return false;
208
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier")))) return false;
209
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature")))) return false;
210
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName")))) return false;
211
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName")))) return false;
212
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier")))) return false;
213
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion")))) return false;
214
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab")))) return false;
215
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit")))) return false;
216
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit")))) return false;
217
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))) return false;
218
126
  return true;
219
127
  }
220
128
  };