@kingstinct/react-native-healthkit 13.3.1 → 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.
- package/ReactNativeHealthkit.podspec +1 -0
- package/app.plugin.ts +40 -2
- package/ios/BackgroundDeliveryManager.swift +196 -0
- package/ios/CategoryTypeModule.swift +1 -1
- package/ios/CoreModule.swift +24 -0
- package/ios/CorrelationTypeModule.swift +2 -35
- package/ios/ElectrocardiogramModule.swift +2 -34
- package/ios/HeartbeatSeriesModule.swift +2 -34
- package/ios/MedicationModule.swift +3 -35
- package/ios/PredicateHelpers.swift +2 -2
- package/ios/QuantityTypeModule.swift +11 -11
- package/ios/Serializers.swift +58 -90
- package/ios/StateOfMindModule.swift +2 -34
- package/ios/WorkoutProxy.swift +4 -149
- package/ios/generated/HealthkitGenerated.swift +52 -0
- package/lib/commonjs/generated/healthkit.generated.js +745 -0
- package/lib/commonjs/healthkit.ios.js +51 -17
- package/lib/commonjs/healthkit.js +120 -34
- package/lib/commonjs/specs/QuantityTypeModule.nitro.js +1 -0
- package/lib/commonjs/type-tests/generated-typing.js +2 -0
- package/lib/commonjs/types/CategoryType.js +19 -99
- package/lib/commonjs/types/Medication.js +2 -0
- package/lib/commonjs/types/MetadataEnums.js +17 -0
- package/lib/commonjs/types/QuantityType.js +4 -15
- package/lib/commonjs/types/WeatherCondition.js +2 -32
- package/lib/commonjs/types/Workouts.js +3 -98
- package/lib/commonjs/types/index.js +2 -0
- package/lib/module/generated/healthkit.generated.js +742 -0
- package/lib/module/healthkit.ios.js +49 -15
- package/lib/module/healthkit.js +94 -20
- package/lib/module/specs/QuantityTypeModule.nitro.js +1 -0
- package/lib/module/type-tests/generated-typing.js +1 -0
- package/lib/module/types/CategoryType.js +2 -98
- package/lib/module/types/Medication.js +1 -0
- package/lib/module/types/MetadataEnums.js +1 -0
- package/lib/module/types/QuantityType.js +2 -14
- package/lib/module/types/WeatherCondition.js +1 -32
- package/lib/module/types/Workouts.js +2 -98
- package/lib/module/types/index.js +2 -0
- package/lib/typescript/generated/healthkit.generated.d.ts +1006 -0
- package/lib/typescript/healthkit.d.ts +39 -36
- package/lib/typescript/healthkit.ios.d.ts +64 -53
- package/lib/typescript/hooks/useMostRecentQuantitySample.d.ts +3 -2
- package/lib/typescript/hooks/useMostRecentWorkout.d.ts +2 -2
- package/lib/typescript/hooks/useQuantitySampleById.d.ts +5 -4
- package/lib/typescript/hooks/useStatisticsForQuantity.d.ts +2 -2
- package/lib/typescript/hooks/useSubscribeToQuantitySamples.d.ts +1 -1
- package/lib/typescript/modules.d.ts +2 -2
- package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +3 -3
- package/lib/typescript/specs/CoreModule.nitro.d.ts +15 -0
- package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +20 -9
- package/lib/typescript/type-tests/generated-typing.d.ts +1 -0
- package/lib/typescript/types/CategoryType.d.ts +10 -104
- package/lib/typescript/types/CategoryTypeIdentifier.d.ts +1 -61
- package/lib/typescript/types/CorrelationType.d.ts +8 -2
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +8 -1
- package/lib/typescript/types/HeartbeatSeries.d.ts +8 -1
- package/lib/typescript/types/InterfaceVerification.d.ts +14 -1
- package/lib/typescript/types/Medication.d.ts +10 -0
- package/lib/typescript/types/MetadataEnums.d.ts +1 -0
- package/lib/typescript/types/QuantitySample.d.ts +9 -1
- package/lib/typescript/types/QuantityType.d.ts +14 -18
- package/lib/typescript/types/QuantityTypeIdentifier.d.ts +1 -671
- package/lib/typescript/types/QueryOptions.d.ts +8 -4
- package/lib/typescript/types/Shared.d.ts +12 -41
- package/lib/typescript/types/StateOfMind.d.ts +8 -1
- package/lib/typescript/types/Subscriptions.d.ts +11 -11
- package/lib/typescript/types/WeatherCondition.d.ts +1 -30
- package/lib/typescript/types/Workouts.d.ts +20 -104
- package/lib/typescript/types/index.d.ts +2 -0
- package/lib/typescript/utils/getMostRecentQuantitySample.d.ts +2 -1
- package/lib/typescript/utils/getMostRecentWorkout.d.ts +2 -1
- package/lib/typescript/utils/getPreferredUnit.d.ts +2 -1
- package/lib/typescript/utils/getQuantitySampleById.d.ts +2 -1
- package/lib/typescript/utils/subscribeToQuantitySamples.d.ts +1 -1
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +55 -109
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +12 -18
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +5 -14
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +18 -2
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +1 -13
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +1 -13
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +2 -14
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +1 -13
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +19 -28
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +2 -14
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +3 -116
- package/nitrogen/generated/ios/swift/CategorySample.swift +4 -329
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +112 -108
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifierWriteable.swift +292 -0
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +4 -347
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +4 -329
- package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +30 -30
- package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +30 -30
- package/nitrogen/generated/ios/swift/GeneralForm.swift +4 -4
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +4 -329
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +38 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +6 -6
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +6 -6
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +1 -27
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +2 -340
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +4 -329
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +492 -492
- package/nitrogen/generated/ios/swift/QuantitySample.swift +4 -329
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +380 -384
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +372 -376
- package/nitrogen/generated/ios/swift/{QueryOptionsWithAnchorAndUnit.swift → QueryOptionsWithAnchorAndStringUnit.swift} +5 -5
- package/nitrogen/generated/ios/swift/{QueryOptionsWithSortOrderAndUnit.swift → QueryOptionsWithSortOrderAndStringUnit.swift} +5 -5
- package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +37 -37
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +492 -492
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +482 -486
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +4 -329
- package/nitrogen/generated/ios/swift/{StatisticsQueryOptions.swift → StatisticsQueryOptionsWithStringUnit.swift} +5 -5
- package/nitrogen/generated/ios/swift/WorkoutEvent.swift +20 -2
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +4 -402
- package/nitrogen/generated/shared/c++/CategorySample.hpp +8 -100
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +153 -149
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifierWriteable.hpp +328 -0
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +9 -105
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +7 -99
- package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +13 -13
- package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +13 -13
- package/nitrogen/generated/shared/c++/GeneralForm.hpp +7 -7
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +8 -100
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +5 -2
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +4 -2
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +15 -15
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +1 -27
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +2 -37
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +7 -99
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +565 -565
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +8 -100
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +407 -411
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +398 -402
- package/nitrogen/generated/shared/c++/{QueryOptionsWithAnchorAndUnit.hpp → QueryOptionsWithAnchorAndStringUnit.hpp} +11 -11
- package/nitrogen/generated/shared/c++/{QueryOptionsWithSortOrderAndUnit.hpp → QueryOptionsWithSortOrderAndStringUnit.hpp} +11 -11
- package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +12 -12
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +559 -559
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +541 -545
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +8 -100
- package/nitrogen/generated/shared/c++/{StatisticsQueryOptions.hpp → StatisticsQueryOptionsWithStringUnit.hpp} +11 -11
- package/nitrogen/generated/shared/c++/WorkoutEvent.hpp +8 -2
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +7 -120
- package/package.json +5 -2
- package/src/generated/healthkit-schema.json +3680 -0
- package/src/generated/healthkit.generated.ts +1307 -0
- package/src/healthkit.ios.ts +225 -19
- package/src/healthkit.ts +181 -55
- package/src/hooks/useMostRecentQuantitySample.ts +6 -5
- package/src/hooks/useMostRecentWorkout.ts +2 -2
- package/src/hooks/useQuantitySampleById.ts +6 -5
- package/src/hooks/useStatisticsForQuantity.ts +2 -1
- package/src/hooks/useSubscribeToQuantitySamples.ts +1 -1
- package/src/modules.ts +7 -2
- package/src/specs/CategoryTypeModule.nitro.ts +8 -5
- package/src/specs/CoreModule.nitro.ts +20 -0
- package/src/specs/QuantityTypeModule.nitro.ts +81 -7
- package/src/test-setup.ts +2 -0
- package/src/type-tests/generated-typing.ts +133 -0
- package/src/types/CategoryType.ts +52 -148
- package/src/types/CategoryTypeIdentifier.ts +5 -134
- package/src/types/CorrelationType.ts +13 -3
- package/src/types/ElectrocardiogramSample.ts +13 -1
- package/src/types/HeartbeatSeries.ts +13 -1
- package/src/types/InterfaceVerification.ts +38 -1
- package/src/types/Medication.ts +19 -0
- package/src/types/MetadataEnums.ts +15 -0
- package/src/types/QuantitySample.ts +14 -2
- package/src/types/QuantityType.ts +22 -122
- package/src/types/QuantityTypeIdentifier.ts +5 -772
- package/src/types/QueryOptions.ts +11 -4
- package/src/types/Shared.ts +22 -49
- package/src/types/StateOfMind.ts +13 -1
- package/src/types/Subscriptions.ts +19 -13
- package/src/types/WeatherCondition.ts +1 -31
- package/src/types/Workouts.ts +46 -108
- package/src/types/index.ts +2 -0
- package/src/utils/getMostRecentQuantitySample.ts +4 -3
- package/src/utils/getMostRecentWorkout.ts +5 -2
- package/src/utils/getPreferredUnit.ts +5 -4
- package/src/utils/getQuantitySampleById.ts +4 -3
- package/src/utils/subscribeToQuantitySamples.ts +5 -3
- package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +0 -44
- package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +0 -40
- package/nitrogen/generated/ios/swift/WeatherCondition.swift +0 -144
- package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +0 -67
- package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +0 -62
- package/nitrogen/generated/shared/c++/WeatherCondition.hpp +0 -88
|
@@ -18,7 +18,7 @@ public extension WorkoutSample {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `WorkoutSample`.
|
|
20
20
|
*/
|
|
21
|
-
init(workoutActivityType: WorkoutActivityType, duration: Quantity, totalEnergyBurned: Quantity?, totalDistance: Quantity?, totalSwimmingStrokeCount: Quantity?, totalFlightsClimbed: Quantity?, events: [WorkoutEvent]?, activities: [WorkoutActivity]?,
|
|
21
|
+
init(workoutActivityType: WorkoutActivityType, duration: Quantity, totalEnergyBurned: Quantity?, totalDistance: Quantity?, totalSwimmingStrokeCount: Quantity?, totalFlightsClimbed: Quantity?, events: [WorkoutEvent]?, activities: [WorkoutActivity]?, metadata: AnyMap, sampleType: SampleType, startDate: Date, endDate: Date, hasUndeterminedDuration: Bool, uuid: String, sourceRevision: SourceRevision, device: Device?) {
|
|
22
22
|
self.init(workoutActivityType, duration, { () -> bridge.std__optional_Quantity_ in
|
|
23
23
|
if let __unwrappedValue = totalEnergyBurned {
|
|
24
24
|
return bridge.create_std__optional_Quantity_(__unwrappedValue)
|
|
@@ -67,168 +67,12 @@ public extension WorkoutSample {
|
|
|
67
67
|
} else {
|
|
68
68
|
return .init()
|
|
69
69
|
}
|
|
70
|
-
}(), { () -> bridge.
|
|
71
|
-
if let __unwrappedValue = metadataAverageMETs {
|
|
72
|
-
return bridge.create_std__optional_Quantity_(__unwrappedValue)
|
|
73
|
-
} else {
|
|
74
|
-
return .init()
|
|
75
|
-
}
|
|
76
|
-
}(), { () -> bridge.std__optional_Quantity_ in
|
|
77
|
-
if let __unwrappedValue = metadataElevationAscended {
|
|
78
|
-
return bridge.create_std__optional_Quantity_(__unwrappedValue)
|
|
79
|
-
} else {
|
|
80
|
-
return .init()
|
|
81
|
-
}
|
|
82
|
-
}(), { () -> bridge.std__optional_Quantity_ in
|
|
83
|
-
if let __unwrappedValue = metadataElevationDescended {
|
|
84
|
-
return bridge.create_std__optional_Quantity_(__unwrappedValue)
|
|
85
|
-
} else {
|
|
86
|
-
return .init()
|
|
87
|
-
}
|
|
88
|
-
}(), { () -> bridge.std__optional_bool_ in
|
|
89
|
-
if let __unwrappedValue = metadataIndoorWorkout {
|
|
90
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
91
|
-
} else {
|
|
92
|
-
return .init()
|
|
93
|
-
}
|
|
94
|
-
}(), { () -> bridge.std__optional_Quantity_ in
|
|
95
|
-
if let __unwrappedValue = metadataAverageSpeed {
|
|
96
|
-
return bridge.create_std__optional_Quantity_(__unwrappedValue)
|
|
97
|
-
} else {
|
|
98
|
-
return .init()
|
|
99
|
-
}
|
|
100
|
-
}(), { () -> bridge.std__optional_Quantity_ in
|
|
101
|
-
if let __unwrappedValue = metadataMaximumSpeed {
|
|
102
|
-
return bridge.create_std__optional_Quantity_(__unwrappedValue)
|
|
103
|
-
} else {
|
|
104
|
-
return .init()
|
|
105
|
-
}
|
|
106
|
-
}(), sampleType, startDate.toCpp(), endDate.toCpp(), hasUndeterminedDuration, { () -> bridge.std__optional_WeatherCondition_ in
|
|
107
|
-
if let __unwrappedValue = metadataWeatherCondition {
|
|
108
|
-
return bridge.create_std__optional_WeatherCondition_(__unwrappedValue)
|
|
109
|
-
} else {
|
|
110
|
-
return .init()
|
|
111
|
-
}
|
|
112
|
-
}(), { () -> bridge.std__optional_Quantity_ in
|
|
113
|
-
if let __unwrappedValue = metadataWeatherHumidity {
|
|
114
|
-
return bridge.create_std__optional_Quantity_(__unwrappedValue)
|
|
115
|
-
} else {
|
|
116
|
-
return .init()
|
|
117
|
-
}
|
|
118
|
-
}(), { () -> bridge.std__optional_Quantity_ in
|
|
119
|
-
if let __unwrappedValue = metadataWeatherTemperature {
|
|
120
|
-
return bridge.create_std__optional_Quantity_(__unwrappedValue)
|
|
121
|
-
} else {
|
|
122
|
-
return .init()
|
|
123
|
-
}
|
|
124
|
-
}(), { () -> bridge.std__optional_InsulinDeliveryReason_ in
|
|
125
|
-
if let __unwrappedValue = metadataInsulinDeliveryReason {
|
|
126
|
-
return bridge.create_std__optional_InsulinDeliveryReason_(__unwrappedValue)
|
|
127
|
-
} else {
|
|
128
|
-
return .init()
|
|
129
|
-
}
|
|
130
|
-
}(), { () -> bridge.std__optional_HeartRateMotionContext_ in
|
|
131
|
-
if let __unwrappedValue = metadataHeartRateMotionContext {
|
|
132
|
-
return bridge.create_std__optional_HeartRateMotionContext_(__unwrappedValue)
|
|
133
|
-
} else {
|
|
134
|
-
return .init()
|
|
135
|
-
}
|
|
136
|
-
}(), std.string(uuid), sourceRevision, { () -> bridge.std__optional_Device_ in
|
|
70
|
+
}(), metadata.cppPart, sampleType, startDate.toCpp(), endDate.toCpp(), hasUndeterminedDuration, std.string(uuid), sourceRevision, { () -> bridge.std__optional_Device_ in
|
|
137
71
|
if let __unwrappedValue = device {
|
|
138
72
|
return bridge.create_std__optional_Device_(__unwrappedValue)
|
|
139
73
|
} else {
|
|
140
74
|
return .init()
|
|
141
75
|
}
|
|
142
|
-
}(), metadata.cppPart, { () -> bridge.std__optional_std__string_ in
|
|
143
|
-
if let __unwrappedValue = metadataExternalUUID {
|
|
144
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
145
|
-
} else {
|
|
146
|
-
return .init()
|
|
147
|
-
}
|
|
148
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
149
|
-
if let __unwrappedValue = metadataTimeZone {
|
|
150
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
151
|
-
} else {
|
|
152
|
-
return .init()
|
|
153
|
-
}
|
|
154
|
-
}(), { () -> bridge.std__optional_bool_ in
|
|
155
|
-
if let __unwrappedValue = metadataWasUserEntered {
|
|
156
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
157
|
-
} else {
|
|
158
|
-
return .init()
|
|
159
|
-
}
|
|
160
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
161
|
-
if let __unwrappedValue = metadataDeviceSerialNumber {
|
|
162
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
163
|
-
} else {
|
|
164
|
-
return .init()
|
|
165
|
-
}
|
|
166
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
167
|
-
if let __unwrappedValue = metadataUdiDeviceIdentifier {
|
|
168
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
169
|
-
} else {
|
|
170
|
-
return .init()
|
|
171
|
-
}
|
|
172
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
173
|
-
if let __unwrappedValue = metadataUdiProductionIdentifier {
|
|
174
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
175
|
-
} else {
|
|
176
|
-
return .init()
|
|
177
|
-
}
|
|
178
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
179
|
-
if let __unwrappedValue = metadataDigitalSignature {
|
|
180
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
181
|
-
} else {
|
|
182
|
-
return .init()
|
|
183
|
-
}
|
|
184
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
185
|
-
if let __unwrappedValue = metadataDeviceName {
|
|
186
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
187
|
-
} else {
|
|
188
|
-
return .init()
|
|
189
|
-
}
|
|
190
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
191
|
-
if let __unwrappedValue = metadataDeviceManufacturerName {
|
|
192
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
193
|
-
} else {
|
|
194
|
-
return .init()
|
|
195
|
-
}
|
|
196
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
197
|
-
if let __unwrappedValue = metadataSyncIdentifier {
|
|
198
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
199
|
-
} else {
|
|
200
|
-
return .init()
|
|
201
|
-
}
|
|
202
|
-
}(), { () -> bridge.std__optional_double_ in
|
|
203
|
-
if let __unwrappedValue = metadataSyncVersion {
|
|
204
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
205
|
-
} else {
|
|
206
|
-
return .init()
|
|
207
|
-
}
|
|
208
|
-
}(), { () -> bridge.std__optional_bool_ in
|
|
209
|
-
if let __unwrappedValue = metadataWasTakenInLab {
|
|
210
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
211
|
-
} else {
|
|
212
|
-
return .init()
|
|
213
|
-
}
|
|
214
|
-
}(), { () -> bridge.std__optional_double_ in
|
|
215
|
-
if let __unwrappedValue = metadataReferenceRangeLowerLimit {
|
|
216
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
217
|
-
} else {
|
|
218
|
-
return .init()
|
|
219
|
-
}
|
|
220
|
-
}(), { () -> bridge.std__optional_double_ in
|
|
221
|
-
if let __unwrappedValue = metadataReferenceRangeUpperLimit {
|
|
222
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
223
|
-
} else {
|
|
224
|
-
return .init()
|
|
225
|
-
}
|
|
226
|
-
}(), { () -> bridge.std__optional_double_ in
|
|
227
|
-
if let __unwrappedValue = metadataAlgorithmVersion {
|
|
228
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
229
|
-
} else {
|
|
230
|
-
return .init()
|
|
231
|
-
}
|
|
232
76
|
}())
|
|
233
77
|
}
|
|
234
78
|
|
|
@@ -287,40 +131,8 @@ public extension WorkoutSample {
|
|
|
287
131
|
}
|
|
288
132
|
|
|
289
133
|
@inline(__always)
|
|
290
|
-
var
|
|
291
|
-
return self.
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
@inline(__always)
|
|
295
|
-
var metadataElevationAscended: Quantity? {
|
|
296
|
-
return self.__metadataElevationAscended.value
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
@inline(__always)
|
|
300
|
-
var metadataElevationDescended: Quantity? {
|
|
301
|
-
return self.__metadataElevationDescended.value
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
@inline(__always)
|
|
305
|
-
var metadataIndoorWorkout: Bool? {
|
|
306
|
-
return { () -> Bool? in
|
|
307
|
-
if bridge.has_value_std__optional_bool_(self.__metadataIndoorWorkout) {
|
|
308
|
-
let __unwrapped = bridge.get_std__optional_bool_(self.__metadataIndoorWorkout)
|
|
309
|
-
return __unwrapped
|
|
310
|
-
} else {
|
|
311
|
-
return nil
|
|
312
|
-
}
|
|
313
|
-
}()
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
@inline(__always)
|
|
317
|
-
var metadataAverageSpeed: Quantity? {
|
|
318
|
-
return self.__metadataAverageSpeed.value
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
@inline(__always)
|
|
322
|
-
var metadataMaximumSpeed: Quantity? {
|
|
323
|
-
return self.__metadataMaximumSpeed.value
|
|
134
|
+
var metadata: AnyMap {
|
|
135
|
+
return AnyMap(withCppPart: self.__metadata)
|
|
324
136
|
}
|
|
325
137
|
|
|
326
138
|
@inline(__always)
|
|
@@ -343,31 +155,6 @@ public extension WorkoutSample {
|
|
|
343
155
|
return self.__hasUndeterminedDuration
|
|
344
156
|
}
|
|
345
157
|
|
|
346
|
-
@inline(__always)
|
|
347
|
-
var metadataWeatherCondition: WeatherCondition? {
|
|
348
|
-
return self.__metadataWeatherCondition.has_value() ? self.__metadataWeatherCondition.pointee : nil
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
@inline(__always)
|
|
352
|
-
var metadataWeatherHumidity: Quantity? {
|
|
353
|
-
return self.__metadataWeatherHumidity.value
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
@inline(__always)
|
|
357
|
-
var metadataWeatherTemperature: Quantity? {
|
|
358
|
-
return self.__metadataWeatherTemperature.value
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
@inline(__always)
|
|
362
|
-
var metadataInsulinDeliveryReason: InsulinDeliveryReason? {
|
|
363
|
-
return self.__metadataInsulinDeliveryReason.has_value() ? self.__metadataInsulinDeliveryReason.pointee : nil
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
@inline(__always)
|
|
367
|
-
var metadataHeartRateMotionContext: HeartRateMotionContext? {
|
|
368
|
-
return self.__metadataHeartRateMotionContext.has_value() ? self.__metadataHeartRateMotionContext.pointee : nil
|
|
369
|
-
}
|
|
370
|
-
|
|
371
158
|
@inline(__always)
|
|
372
159
|
var uuid: String {
|
|
373
160
|
return String(self.__uuid)
|
|
@@ -382,189 +169,4 @@ public extension WorkoutSample {
|
|
|
382
169
|
var device: Device? {
|
|
383
170
|
return self.__device.value
|
|
384
171
|
}
|
|
385
|
-
|
|
386
|
-
@inline(__always)
|
|
387
|
-
var metadata: AnyMap {
|
|
388
|
-
return AnyMap(withCppPart: self.__metadata)
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
@inline(__always)
|
|
392
|
-
var metadataExternalUUID: String? {
|
|
393
|
-
return { () -> String? in
|
|
394
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataExternalUUID) {
|
|
395
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataExternalUUID)
|
|
396
|
-
return String(__unwrapped)
|
|
397
|
-
} else {
|
|
398
|
-
return nil
|
|
399
|
-
}
|
|
400
|
-
}()
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
@inline(__always)
|
|
404
|
-
var metadataTimeZone: String? {
|
|
405
|
-
return { () -> String? in
|
|
406
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataTimeZone) {
|
|
407
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataTimeZone)
|
|
408
|
-
return String(__unwrapped)
|
|
409
|
-
} else {
|
|
410
|
-
return nil
|
|
411
|
-
}
|
|
412
|
-
}()
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
@inline(__always)
|
|
416
|
-
var metadataWasUserEntered: Bool? {
|
|
417
|
-
return { () -> Bool? in
|
|
418
|
-
if bridge.has_value_std__optional_bool_(self.__metadataWasUserEntered) {
|
|
419
|
-
let __unwrapped = bridge.get_std__optional_bool_(self.__metadataWasUserEntered)
|
|
420
|
-
return __unwrapped
|
|
421
|
-
} else {
|
|
422
|
-
return nil
|
|
423
|
-
}
|
|
424
|
-
}()
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
@inline(__always)
|
|
428
|
-
var metadataDeviceSerialNumber: String? {
|
|
429
|
-
return { () -> String? in
|
|
430
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataDeviceSerialNumber) {
|
|
431
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataDeviceSerialNumber)
|
|
432
|
-
return String(__unwrapped)
|
|
433
|
-
} else {
|
|
434
|
-
return nil
|
|
435
|
-
}
|
|
436
|
-
}()
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
@inline(__always)
|
|
440
|
-
var metadataUdiDeviceIdentifier: String? {
|
|
441
|
-
return { () -> String? in
|
|
442
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataUdiDeviceIdentifier) {
|
|
443
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataUdiDeviceIdentifier)
|
|
444
|
-
return String(__unwrapped)
|
|
445
|
-
} else {
|
|
446
|
-
return nil
|
|
447
|
-
}
|
|
448
|
-
}()
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
@inline(__always)
|
|
452
|
-
var metadataUdiProductionIdentifier: String? {
|
|
453
|
-
return { () -> String? in
|
|
454
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataUdiProductionIdentifier) {
|
|
455
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataUdiProductionIdentifier)
|
|
456
|
-
return String(__unwrapped)
|
|
457
|
-
} else {
|
|
458
|
-
return nil
|
|
459
|
-
}
|
|
460
|
-
}()
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
@inline(__always)
|
|
464
|
-
var metadataDigitalSignature: String? {
|
|
465
|
-
return { () -> String? in
|
|
466
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataDigitalSignature) {
|
|
467
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataDigitalSignature)
|
|
468
|
-
return String(__unwrapped)
|
|
469
|
-
} else {
|
|
470
|
-
return nil
|
|
471
|
-
}
|
|
472
|
-
}()
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
@inline(__always)
|
|
476
|
-
var metadataDeviceName: String? {
|
|
477
|
-
return { () -> String? in
|
|
478
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataDeviceName) {
|
|
479
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataDeviceName)
|
|
480
|
-
return String(__unwrapped)
|
|
481
|
-
} else {
|
|
482
|
-
return nil
|
|
483
|
-
}
|
|
484
|
-
}()
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
@inline(__always)
|
|
488
|
-
var metadataDeviceManufacturerName: String? {
|
|
489
|
-
return { () -> String? in
|
|
490
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataDeviceManufacturerName) {
|
|
491
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataDeviceManufacturerName)
|
|
492
|
-
return String(__unwrapped)
|
|
493
|
-
} else {
|
|
494
|
-
return nil
|
|
495
|
-
}
|
|
496
|
-
}()
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
@inline(__always)
|
|
500
|
-
var metadataSyncIdentifier: String? {
|
|
501
|
-
return { () -> String? in
|
|
502
|
-
if bridge.has_value_std__optional_std__string_(self.__metadataSyncIdentifier) {
|
|
503
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__metadataSyncIdentifier)
|
|
504
|
-
return String(__unwrapped)
|
|
505
|
-
} else {
|
|
506
|
-
return nil
|
|
507
|
-
}
|
|
508
|
-
}()
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
@inline(__always)
|
|
512
|
-
var metadataSyncVersion: Double? {
|
|
513
|
-
return { () -> Double? in
|
|
514
|
-
if bridge.has_value_std__optional_double_(self.__metadataSyncVersion) {
|
|
515
|
-
let __unwrapped = bridge.get_std__optional_double_(self.__metadataSyncVersion)
|
|
516
|
-
return __unwrapped
|
|
517
|
-
} else {
|
|
518
|
-
return nil
|
|
519
|
-
}
|
|
520
|
-
}()
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
@inline(__always)
|
|
524
|
-
var metadataWasTakenInLab: Bool? {
|
|
525
|
-
return { () -> Bool? in
|
|
526
|
-
if bridge.has_value_std__optional_bool_(self.__metadataWasTakenInLab) {
|
|
527
|
-
let __unwrapped = bridge.get_std__optional_bool_(self.__metadataWasTakenInLab)
|
|
528
|
-
return __unwrapped
|
|
529
|
-
} else {
|
|
530
|
-
return nil
|
|
531
|
-
}
|
|
532
|
-
}()
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
@inline(__always)
|
|
536
|
-
var metadataReferenceRangeLowerLimit: Double? {
|
|
537
|
-
return { () -> Double? in
|
|
538
|
-
if bridge.has_value_std__optional_double_(self.__metadataReferenceRangeLowerLimit) {
|
|
539
|
-
let __unwrapped = bridge.get_std__optional_double_(self.__metadataReferenceRangeLowerLimit)
|
|
540
|
-
return __unwrapped
|
|
541
|
-
} else {
|
|
542
|
-
return nil
|
|
543
|
-
}
|
|
544
|
-
}()
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
@inline(__always)
|
|
548
|
-
var metadataReferenceRangeUpperLimit: Double? {
|
|
549
|
-
return { () -> Double? in
|
|
550
|
-
if bridge.has_value_std__optional_double_(self.__metadataReferenceRangeUpperLimit) {
|
|
551
|
-
let __unwrapped = bridge.get_std__optional_double_(self.__metadataReferenceRangeUpperLimit)
|
|
552
|
-
return __unwrapped
|
|
553
|
-
} else {
|
|
554
|
-
return nil
|
|
555
|
-
}
|
|
556
|
-
}()
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
@inline(__always)
|
|
560
|
-
var metadataAlgorithmVersion: Double? {
|
|
561
|
-
return { () -> Double? in
|
|
562
|
-
if bridge.has_value_std__optional_double_(self.__metadataAlgorithmVersion) {
|
|
563
|
-
let __unwrapped = bridge.get_std__optional_double_(self.__metadataAlgorithmVersion)
|
|
564
|
-
return __unwrapped
|
|
565
|
-
} else {
|
|
566
|
-
return nil
|
|
567
|
-
}
|
|
568
|
-
}()
|
|
569
|
-
}
|
|
570
172
|
}
|
|
@@ -32,14 +32,6 @@
|
|
|
32
32
|
namespace margelo::nitro::healthkit { enum class CategoryTypeIdentifier; }
|
|
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.
|
|
@@ -48,15 +40,11 @@ namespace margelo::nitro::healthkit { struct Device; }
|
|
|
48
40
|
#include "CategoryTypeIdentifier.hpp"
|
|
49
41
|
#include "SampleType.hpp"
|
|
50
42
|
#include <chrono>
|
|
51
|
-
#include
|
|
52
|
-
#include <optional>
|
|
53
|
-
#include "Quantity.hpp"
|
|
54
|
-
#include "InsulinDeliveryReason.hpp"
|
|
55
|
-
#include "HeartRateMotionContext.hpp"
|
|
43
|
+
#include <NitroModules/AnyMap.hpp>
|
|
56
44
|
#include <string>
|
|
57
45
|
#include "SourceRevision.hpp"
|
|
58
46
|
#include "Device.hpp"
|
|
59
|
-
#include <
|
|
47
|
+
#include <optional>
|
|
60
48
|
|
|
61
49
|
namespace margelo::nitro::healthkit {
|
|
62
50
|
|
|
@@ -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::
|
|
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
|
CategorySample() = default;
|
|
101
|
-
explicit CategorySample(CategoryTypeIdentifier categoryType, double value, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::
|
|
69
|
+
explicit CategorySample(CategoryTypeIdentifier categoryType, double value, 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): categoryType(categoryType), value(value), 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 CategorySample& lhs, const CategorySample& rhs) = default;
|
|
@@ -120,30 +88,10 @@ namespace margelo::nitro {
|
|
|
120
88
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
121
89
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
122
90
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
|
|
123
|
-
JSIConverter<std::
|
|
124
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"))),
|
|
125
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"))),
|
|
126
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"))),
|
|
127
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"))),
|
|
91
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
|
|
128
92
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
|
|
129
93
|
JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
|
|
130
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
|
|
131
|
-
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
|
|
132
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"))),
|
|
133
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"))),
|
|
134
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"))),
|
|
135
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"))),
|
|
136
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"))),
|
|
137
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"))),
|
|
138
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"))),
|
|
139
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"))),
|
|
140
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"))),
|
|
141
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"))),
|
|
142
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"))),
|
|
143
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"))),
|
|
144
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"))),
|
|
145
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"))),
|
|
146
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))
|
|
94
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
|
|
147
95
|
);
|
|
148
96
|
}
|
|
149
97
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::CategorySample& arg) {
|
|
@@ -154,30 +102,10 @@ namespace margelo::nitro {
|
|
|
154
102
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
|
|
155
103
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
|
|
156
104
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
|
|
157
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "
|
|
158
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherHumidity));
|
|
159
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherTemperature));
|
|
160
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"), JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::toJSI(runtime, arg.metadataInsulinDeliveryReason));
|
|
161
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"), JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::toJSI(runtime, arg.metadataHeartRateMotionContext));
|
|
105
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
162
106
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
|
|
163
107
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
|
|
164
108
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
|
|
165
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
166
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataExternalUUID));
|
|
167
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataTimeZone));
|
|
168
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasUserEntered));
|
|
169
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceSerialNumber));
|
|
170
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiDeviceIdentifier));
|
|
171
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiProductionIdentifier));
|
|
172
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDigitalSignature));
|
|
173
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceName));
|
|
174
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceManufacturerName));
|
|
175
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataSyncIdentifier));
|
|
176
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataSyncVersion));
|
|
177
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasTakenInLab));
|
|
178
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeLowerLimit));
|
|
179
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeUpperLimit));
|
|
180
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataAlgorithmVersion));
|
|
181
109
|
return obj;
|
|
182
110
|
}
|
|
183
111
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -194,30 +122,10 @@ namespace margelo::nitro {
|
|
|
194
122
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
195
123
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
196
124
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
|
|
197
|
-
if (!JSIConverter<std::
|
|
198
|
-
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity")))) return false;
|
|
199
|
-
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature")))) return false;
|
|
200
|
-
if (!JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason")))) return false;
|
|
201
|
-
if (!JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext")))) return false;
|
|
125
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
202
126
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
|
|
203
127
|
if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
|
|
204
128
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
|
|
205
|
-
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
206
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID")))) return false;
|
|
207
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone")))) return false;
|
|
208
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered")))) return false;
|
|
209
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber")))) return false;
|
|
210
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier")))) return false;
|
|
211
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier")))) return false;
|
|
212
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature")))) return false;
|
|
213
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName")))) return false;
|
|
214
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName")))) return false;
|
|
215
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier")))) return false;
|
|
216
|
-
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion")))) return false;
|
|
217
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab")))) return false;
|
|
218
|
-
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit")))) return false;
|
|
219
|
-
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit")))) return false;
|
|
220
|
-
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))) return false;
|
|
221
129
|
return true;
|
|
222
130
|
}
|
|
223
131
|
};
|