@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
@@ -32,14 +32,6 @@
32
32
  namespace margelo::nitro::healthkit { enum class QuantityTypeIdentifier; }
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,14 +41,10 @@ namespace margelo::nitro::healthkit { struct Device; }
49
41
  #include <string>
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 "SourceRevision.hpp"
58
46
  #include "Device.hpp"
59
- #include <NitroModules/AnyMap.hpp>
47
+ #include <optional>
60
48
 
61
49
  namespace margelo::nitro::healthkit {
62
50
 
@@ -72,34 +60,14 @@ namespace margelo::nitro::healthkit {
72
60
  std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
73
61
  std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
74
62
  bool hasUndeterminedDuration SWIFT_PRIVATE;
75
- std::optional<WeatherCondition> metadataWeatherCondition SWIFT_PRIVATE;
76
- std::optional<Quantity> metadataWeatherHumidity SWIFT_PRIVATE;
77
- std::optional<Quantity> metadataWeatherTemperature SWIFT_PRIVATE;
78
- std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason SWIFT_PRIVATE;
79
- std::optional<HeartRateMotionContext> metadataHeartRateMotionContext SWIFT_PRIVATE;
63
+ std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
80
64
  std::string uuid SWIFT_PRIVATE;
81
65
  SourceRevision sourceRevision SWIFT_PRIVATE;
82
66
  std::optional<Device> device SWIFT_PRIVATE;
83
- std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
84
- std::optional<std::string> metadataExternalUUID SWIFT_PRIVATE;
85
- std::optional<std::string> metadataTimeZone SWIFT_PRIVATE;
86
- std::optional<bool> metadataWasUserEntered SWIFT_PRIVATE;
87
- std::optional<std::string> metadataDeviceSerialNumber SWIFT_PRIVATE;
88
- std::optional<std::string> metadataUdiDeviceIdentifier SWIFT_PRIVATE;
89
- std::optional<std::string> metadataUdiProductionIdentifier SWIFT_PRIVATE;
90
- std::optional<std::string> metadataDigitalSignature SWIFT_PRIVATE;
91
- std::optional<std::string> metadataDeviceName SWIFT_PRIVATE;
92
- std::optional<std::string> metadataDeviceManufacturerName SWIFT_PRIVATE;
93
- std::optional<std::string> metadataSyncIdentifier SWIFT_PRIVATE;
94
- std::optional<double> metadataSyncVersion SWIFT_PRIVATE;
95
- std::optional<bool> metadataWasTakenInLab SWIFT_PRIVATE;
96
- std::optional<double> metadataReferenceRangeLowerLimit SWIFT_PRIVATE;
97
- std::optional<double> metadataReferenceRangeUpperLimit SWIFT_PRIVATE;
98
- std::optional<double> metadataAlgorithmVersion SWIFT_PRIVATE;
99
67
 
100
68
  public:
101
69
  QuantitySample() = default;
102
- explicit QuantitySample(QuantityTypeIdentifier quantityType, double quantity, std::string unit, 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): quantityType(quantityType), quantity(quantity), unit(unit), 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) {}
70
+ explicit QuantitySample(QuantityTypeIdentifier quantityType, double quantity, std::string unit, 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): quantityType(quantityType), quantity(quantity), unit(unit), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadata(metadata), uuid(uuid), sourceRevision(sourceRevision), device(device) {}
103
71
 
104
72
  public:
105
73
  friend bool operator==(const QuantitySample& lhs, const QuantitySample& rhs) = default;
@@ -122,30 +90,10 @@ namespace margelo::nitro {
122
90
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
123
91
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
124
92
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
125
- JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition"))),
126
- JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"))),
127
- JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"))),
128
- JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"))),
129
- JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"))),
93
+ JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
130
94
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
131
95
  JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
132
- JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
133
- JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
134
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"))),
135
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"))),
136
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"))),
137
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"))),
138
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"))),
139
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"))),
140
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"))),
141
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"))),
142
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"))),
143
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"))),
144
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"))),
145
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"))),
146
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"))),
147
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"))),
148
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))
96
+ JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
149
97
  );
150
98
  }
151
99
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QuantitySample& arg) {
@@ -157,30 +105,10 @@ namespace margelo::nitro {
157
105
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
158
106
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
159
107
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
160
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition"), JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::toJSI(runtime, arg.metadataWeatherCondition));
161
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherHumidity));
162
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherTemperature));
163
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"), JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::toJSI(runtime, arg.metadataInsulinDeliveryReason));
164
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"), JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::toJSI(runtime, arg.metadataHeartRateMotionContext));
108
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
165
109
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
166
110
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
167
111
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
168
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
169
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataExternalUUID));
170
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataTimeZone));
171
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasUserEntered));
172
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceSerialNumber));
173
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiDeviceIdentifier));
174
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiProductionIdentifier));
175
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDigitalSignature));
176
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceName));
177
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceManufacturerName));
178
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataSyncIdentifier));
179
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataSyncVersion));
180
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasTakenInLab));
181
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeLowerLimit));
182
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeUpperLimit));
183
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataAlgorithmVersion));
184
112
  return obj;
185
113
  }
186
114
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -198,30 +126,10 @@ namespace margelo::nitro {
198
126
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
199
127
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
200
128
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
201
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition")))) return false;
202
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity")))) return false;
203
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature")))) return false;
204
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason")))) return false;
205
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext")))) return false;
129
+ if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
206
130
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
207
131
  if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
208
132
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
209
- if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
210
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID")))) return false;
211
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone")))) return false;
212
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered")))) return false;
213
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber")))) return false;
214
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier")))) return false;
215
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier")))) return false;
216
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature")))) return false;
217
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName")))) return false;
218
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName")))) return false;
219
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier")))) return false;
220
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion")))) return false;
221
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab")))) return false;
222
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit")))) return false;
223
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit")))) return false;
224
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))) return false;
225
133
  return true;
226
134
  }
227
135
  };