@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
|
@@ -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
|
|
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::
|
|
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::
|
|
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::
|
|
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, "
|
|
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::
|
|
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<
|
|
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<
|
|
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<
|
|
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, "
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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, "
|
|
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<
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
|
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 <
|
|
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::
|
|
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::
|
|
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::
|
|
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, "
|
|
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::
|
|
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
|
};
|