@kingstinct/react-native-healthkit 12.1.2 → 12.2.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/ios/CategoryTypeModule.swift +49 -97
- package/ios/CharacteristicTypeModule.swift +77 -63
- package/ios/CoreModule.swift +324 -280
- package/ios/CorrelationTypeModule.swift +192 -144
- package/ios/ElectrocardiogramModule.swift +185 -194
- package/ios/HeartbeatSeriesModule.swift +123 -171
- package/ios/Helpers.swift +312 -571
- package/ios/MedicationModule.swift +259 -0
- package/ios/PredicateHelpers.swift +334 -0
- package/ios/QuantityTypeModule.swift +297 -378
- package/ios/Serializers.swift +273 -210
- package/ios/SourceProxy.swift +2 -2
- package/ios/StateOfMindModule.swift +179 -125
- package/ios/WorkoutProxy.swift +235 -112
- package/ios/WorkoutsModule.swift +214 -262
- package/lib/commonjs/healthkit.ios.js +22 -2
- package/lib/commonjs/healthkit.js +35 -5
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/commonjs/hooks/useSubscribeToCategorySamples.js +20 -0
- package/lib/commonjs/modules.js +2 -1
- package/lib/commonjs/specs/MedicationModule.nitro.js +27 -0
- package/lib/commonjs/types/Constants.js +2 -1
- package/lib/commonjs/types/QuantityType.js +8 -1
- package/lib/commonjs/types/QueryOptions.js +18 -0
- package/lib/commonjs/types/WeatherCondition.js +32 -32
- package/lib/commonjs/types/Workouts.js +1 -50
- package/lib/commonjs/utils/getCategorySampleById.js +1 -1
- package/lib/commonjs/utils/getQuantitySampleById.js +1 -1
- package/lib/commonjs/utils/getWorkoutById.js +1 -1
- package/lib/commonjs/utils/subscribeToCategorySamples.js +29 -0
- package/lib/commonjs/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/module/healthkit.ios.js +20 -2
- package/lib/module/healthkit.js +32 -2
- package/lib/module/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/module/hooks/useSubscribeToCategorySamples.js +17 -0
- package/lib/module/modules.js +1 -0
- package/lib/module/specs/MedicationModule.nitro.js +26 -0
- package/lib/module/types/Constants.js +1 -0
- package/lib/module/types/QuantityType.js +7 -0
- package/lib/module/types/QueryOptions.js +17 -1
- package/lib/module/types/WeatherCondition.js +31 -31
- package/lib/module/types/Workouts.js +0 -49
- package/lib/module/utils/getCategorySampleById.js +1 -1
- package/lib/module/utils/getQuantitySampleById.js +1 -1
- package/lib/module/utils/getWorkoutById.js +1 -1
- package/lib/module/utils/subscribeToCategorySamples.js +26 -0
- package/lib/module/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/typescript/healthkit.d.ts +18 -9
- package/lib/typescript/healthkit.ios.d.ts +33 -15
- package/lib/typescript/hooks/useSubscribeToCategorySamples.d.ts +3 -0
- package/lib/typescript/modules.d.ts +2 -0
- package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +2 -2
- package/lib/typescript/specs/CoreModule.nitro.d.ts +2 -1
- package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +4 -2
- package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/HeartbeatSeriesModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/MedicationModule.nitro.d.ts +56 -0
- package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +4 -4
- package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +4 -3
- package/lib/typescript/types/CategoryType.d.ts +10 -20
- package/lib/typescript/types/Constants.d.ts +1 -0
- package/lib/typescript/types/CorrelationType.d.ts +8 -10
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +2 -12
- package/lib/typescript/types/HeartbeatSeries.d.ts +2 -14
- package/lib/typescript/types/QuantitySample.d.ts +2 -8
- package/lib/typescript/types/QuantityType.d.ts +7 -8
- package/lib/typescript/types/QuantityTypeIdentifier.d.ts +23 -23
- package/lib/typescript/types/QueryOptions.d.ts +43 -28
- package/lib/typescript/types/Shared.d.ts +52 -7
- package/lib/typescript/types/StateOfMind.d.ts +7 -10
- package/lib/typescript/types/Subscriptions.d.ts +12 -3
- package/lib/typescript/types/WeatherCondition.d.ts +1 -1
- package/lib/typescript/types/Workouts.d.ts +28 -81
- package/lib/typescript/utils/subscribeToCategorySamples.d.ts +5 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +57 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +592 -389
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +65 -30
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +15 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +32 -26
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +36 -37
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +55 -2
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +36 -30
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +35 -29
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +181 -0
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +48 -42
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +59 -36
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +150 -29
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +13 -28
- package/nitrogen/generated/ios/swift/AggregationStyle.swift +48 -0
- package/nitrogen/generated/ios/swift/CategorySample.swift +571 -24
- package/nitrogen/generated/ios/swift/ComparisonPredicateOperator.swift +2 -2
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +640 -17
- package/nitrogen/generated/ios/swift/{PredicateWithStartAndEnd.swift → DateFilter.swift} +5 -5
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +570 -72
- package/nitrogen/generated/ios/swift/FilterForSamples.swift +349 -12
- package/nitrogen/generated/ios/swift/FilterForSamplesBase.swift +234 -0
- package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +366 -0
- package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +240 -0
- package/nitrogen/generated/ios/swift/Func_void_MedicationDoseEventsWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryCorrelationSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_StateOfMindSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MedicationDoseEvent_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_UserAnnotatedMedication_.swift +47 -0
- package/nitrogen/generated/ios/swift/GeneralForm.swift +104 -0
- package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +44 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +565 -37
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +19 -31
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec_cxx.swift +208 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +9 -43
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +34 -6
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +376 -36
- package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationConcept.swift +80 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +781 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventLogStatus.swift +56 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventScheduleType.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventsWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +7 -7
- package/nitrogen/generated/ios/swift/QuantitySample.swift +574 -27
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/QueryCorrelationSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/RelatedCoding.swift +76 -0
- package/nitrogen/generated/ios/swift/SampleType.swift +68 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +0 -16
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +586 -58
- package/nitrogen/generated/ios/swift/StateOfMindSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +7 -75
- package/nitrogen/generated/ios/swift/UserAnnotatedMedication.swift +87 -0
- package/nitrogen/generated/ios/swift/WeatherCondition.swift +144 -0
- package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +751 -78
- package/nitrogen/generated/shared/c++/AggregationStyle.hpp +64 -0
- package/nitrogen/generated/shared/c++/CategorySample.hpp +126 -23
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +134 -12
- package/nitrogen/generated/shared/c++/{PredicateWithStartAndEnd.hpp → DateFilter.hpp} +10 -10
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +135 -36
- package/nitrogen/generated/shared/c++/FilterForSamples.hpp +124 -0
- package/nitrogen/generated/shared/c++/FilterForSamplesBase.hpp +109 -0
- package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +131 -0
- package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +116 -0
- package/nitrogen/generated/shared/c++/GeneralForm.hpp +140 -0
- package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +67 -0
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +131 -28
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +10 -28
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +11 -1
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +6 -25
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +9 -2
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +33 -5
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +56 -16
- package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationConcept.hpp +93 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +240 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventLogStatus.hpp +66 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventScheduleType.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventsWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +8 -8
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +130 -27
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/QueryCorrelationSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/RelatedCoding.hpp +84 -0
- package/nitrogen/generated/shared/c++/SampleType.hpp +87 -0
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +105 -121
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +139 -36
- package/nitrogen/generated/shared/c++/StateOfMindSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +8 -27
- package/nitrogen/generated/shared/c++/UserAnnotatedMedication.hpp +90 -0
- package/nitrogen/generated/shared/c++/WeatherCondition.hpp +88 -0
- package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +159 -35
- package/package.json +1 -1
- package/src/healthkit.ios.ts +30 -0
- package/src/healthkit.ts +68 -3
- package/src/hooks/useStatisticsForQuantity.ts +1 -1
- package/src/hooks/useSubscribeToCategorySamples.ts +31 -0
- package/src/modules.ts +4 -0
- package/src/specs/CategoryTypeModule.nitro.ts +2 -2
- package/src/specs/CoreModule.nitro.ts +3 -0
- package/src/specs/CorrelationTypeModule.nitro.ts +11 -3
- package/src/specs/ElectrocardiogramModule.nitro.ts +1 -1
- package/src/specs/HeartbeatSeriesModule.nitro.ts +1 -1
- package/src/specs/MedicationModule.nitro.ts +140 -0
- package/src/specs/QuantityTypeModule.nitro.ts +4 -7
- package/src/specs/StateOfMindModule.nitro.ts +10 -2
- package/src/types/CategoryType.ts +15 -22
- package/src/types/Constants.ts +3 -0
- package/src/types/CorrelationType.ts +10 -15
- package/src/types/ElectrocardiogramSample.ts +2 -14
- package/src/types/HeartbeatSeries.ts +2 -15
- package/src/types/QuantitySample.ts +2 -8
- package/src/types/QuantityType.ts +8 -17
- package/src/types/QuantityTypeIdentifier.ts +25 -25
- package/src/types/QueryOptions.ts +54 -43
- package/src/types/Shared.ts +74 -17
- package/src/types/StateOfMind.ts +8 -10
- package/src/types/Subscriptions.ts +19 -3
- package/src/types/WeatherCondition.ts +1 -1
- package/src/types/Workouts.ts +28 -91
- package/src/utils/getCategorySampleById.ts +1 -1
- package/src/utils/getQuantitySampleById.ts +1 -1
- package/src/utils/getWorkoutById.ts +1 -2
- package/src/utils/subscribeToCategorySamples.ts +38 -0
- package/src/utils/subscribeToQuantitySamples.ts +12 -37
- package/nitrogen/generated/ios/swift/FilterForSamplesAnd.swift +0 -94
- package/nitrogen/generated/ios/swift/FilterForSamplesOr.swift +0 -94
- package/nitrogen/generated/ios/swift/PredicateForSamples.swift +0 -21
- package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +0 -23
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsAnd.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsOr.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +0 -45
- package/nitrogen/generated/ios/swift/PredicateWithMetadataOperator.swift +0 -48
- package/nitrogen/generated/ios/swift/PredicateWithUUID.swift +0 -35
- package/nitrogen/generated/ios/swift/PredicateWithUUIDs.swift +0 -47
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +0 -23
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +0 -25
- package/nitrogen/generated/ios/swift/WorkoutActivityTypePredicate.swift +0 -35
- package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +0 -90
- package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +0 -90
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +0 -77
- package/nitrogen/generated/shared/c++/PredicateWithMetadataOperator.hpp +0 -84
- package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +0 -75
- package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +0 -76
- package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +0 -76
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
namespace margelo::nitro::healthkit { struct StateOfMindSample; }
|
|
18
18
|
// Forward declaration of `QueryOptionsWithSortOrder` to properly resolve imports.
|
|
19
19
|
namespace margelo::nitro::healthkit { struct QueryOptionsWithSortOrder; }
|
|
20
|
+
// Forward declaration of `StateOfMindSamplesWithAnchorResponse` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::healthkit { struct StateOfMindSamplesWithAnchorResponse; }
|
|
22
|
+
// Forward declaration of `QueryOptionsWithAnchor` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::healthkit { struct QueryOptionsWithAnchor; }
|
|
20
24
|
// Forward declaration of `StateOfMindKind` to properly resolve imports.
|
|
21
25
|
namespace margelo::nitro::healthkit { enum class StateOfMindKind; }
|
|
22
26
|
// Forward declaration of `StateOfMindLabel` to properly resolve imports.
|
|
@@ -28,12 +32,14 @@ namespace margelo::nitro::healthkit { enum class StateOfMindAssociation; }
|
|
|
28
32
|
#include <vector>
|
|
29
33
|
#include <NitroModules/Promise.hpp>
|
|
30
34
|
#include "QueryOptionsWithSortOrder.hpp"
|
|
31
|
-
#include
|
|
35
|
+
#include "StateOfMindSamplesWithAnchorResponse.hpp"
|
|
36
|
+
#include "QueryOptionsWithAnchor.hpp"
|
|
32
37
|
#include <chrono>
|
|
33
38
|
#include "StateOfMindKind.hpp"
|
|
34
39
|
#include "StateOfMindLabel.hpp"
|
|
35
40
|
#include "StateOfMindAssociation.hpp"
|
|
36
41
|
#include <NitroModules/AnyMap.hpp>
|
|
42
|
+
#include <optional>
|
|
37
43
|
|
|
38
44
|
namespace margelo::nitro::healthkit {
|
|
39
45
|
|
|
@@ -66,7 +72,8 @@ namespace margelo::nitro::healthkit {
|
|
|
66
72
|
|
|
67
73
|
public:
|
|
68
74
|
// Methods
|
|
69
|
-
virtual std::shared_ptr<Promise<std::vector<StateOfMindSample>>> queryStateOfMindSamples(const
|
|
75
|
+
virtual std::shared_ptr<Promise<std::vector<StateOfMindSample>>> queryStateOfMindSamples(const QueryOptionsWithSortOrder& options) = 0;
|
|
76
|
+
virtual std::shared_ptr<Promise<StateOfMindSamplesWithAnchorResponse>> queryStateOfMindSamplesWithAnchor(const QueryOptionsWithAnchor& options) = 0;
|
|
70
77
|
virtual std::shared_ptr<Promise<bool>> saveStateOfMindSample(std::chrono::system_clock::time_point date, StateOfMindKind kind, double valence, const std::vector<StateOfMindLabel>& labels, const std::vector<StateOfMindAssociation>& associations, const std::optional<std::shared_ptr<AnyMap>>& metadata) = 0;
|
|
71
78
|
|
|
72
79
|
protected:
|
|
@@ -14,16 +14,44 @@ namespace margelo::nitro::healthkit {
|
|
|
14
14
|
HybridObject::loadHybridMethods();
|
|
15
15
|
// load custom methods/properties
|
|
16
16
|
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
-
prototype.registerHybridGetter("uuid", &HybridWorkoutProxySpec::getUuid);
|
|
18
|
-
prototype.registerHybridGetter("device", &HybridWorkoutProxySpec::getDevice);
|
|
19
17
|
prototype.registerHybridGetter("workoutActivityType", &HybridWorkoutProxySpec::getWorkoutActivityType);
|
|
20
18
|
prototype.registerHybridGetter("duration", &HybridWorkoutProxySpec::getDuration);
|
|
19
|
+
prototype.registerHybridGetter("events", &HybridWorkoutProxySpec::getEvents);
|
|
20
|
+
prototype.registerHybridGetter("activities", &HybridWorkoutProxySpec::getActivities);
|
|
21
|
+
prototype.registerHybridGetter("metadataAverageMETs", &HybridWorkoutProxySpec::getMetadataAverageMETs);
|
|
22
|
+
prototype.registerHybridGetter("metadataElevationAscended", &HybridWorkoutProxySpec::getMetadataElevationAscended);
|
|
23
|
+
prototype.registerHybridGetter("metadataElevationDescended", &HybridWorkoutProxySpec::getMetadataElevationDescended);
|
|
24
|
+
prototype.registerHybridGetter("metadataIndoorWorkout", &HybridWorkoutProxySpec::getMetadataIndoorWorkout);
|
|
25
|
+
prototype.registerHybridGetter("metadataAverageSpeed", &HybridWorkoutProxySpec::getMetadataAverageSpeed);
|
|
26
|
+
prototype.registerHybridGetter("metadataMaximumSpeed", &HybridWorkoutProxySpec::getMetadataMaximumSpeed);
|
|
27
|
+
prototype.registerHybridGetter("sampleType", &HybridWorkoutProxySpec::getSampleType);
|
|
21
28
|
prototype.registerHybridGetter("startDate", &HybridWorkoutProxySpec::getStartDate);
|
|
22
29
|
prototype.registerHybridGetter("endDate", &HybridWorkoutProxySpec::getEndDate);
|
|
23
|
-
prototype.registerHybridGetter("
|
|
30
|
+
prototype.registerHybridGetter("hasUndeterminedDuration", &HybridWorkoutProxySpec::getHasUndeterminedDuration);
|
|
31
|
+
prototype.registerHybridGetter("metadataWeatherCondition", &HybridWorkoutProxySpec::getMetadataWeatherCondition);
|
|
32
|
+
prototype.registerHybridGetter("metadataWeatherHumidity", &HybridWorkoutProxySpec::getMetadataWeatherHumidity);
|
|
33
|
+
prototype.registerHybridGetter("metadataWeatherTemperature", &HybridWorkoutProxySpec::getMetadataWeatherTemperature);
|
|
34
|
+
prototype.registerHybridGetter("metadataInsulinDeliveryReason", &HybridWorkoutProxySpec::getMetadataInsulinDeliveryReason);
|
|
35
|
+
prototype.registerHybridGetter("metadataHeartRateMotionContext", &HybridWorkoutProxySpec::getMetadataHeartRateMotionContext);
|
|
36
|
+
prototype.registerHybridGetter("uuid", &HybridWorkoutProxySpec::getUuid);
|
|
24
37
|
prototype.registerHybridGetter("sourceRevision", &HybridWorkoutProxySpec::getSourceRevision);
|
|
25
|
-
prototype.registerHybridGetter("
|
|
26
|
-
prototype.registerHybridGetter("
|
|
38
|
+
prototype.registerHybridGetter("device", &HybridWorkoutProxySpec::getDevice);
|
|
39
|
+
prototype.registerHybridGetter("metadata", &HybridWorkoutProxySpec::getMetadata);
|
|
40
|
+
prototype.registerHybridGetter("metadataExternalUUID", &HybridWorkoutProxySpec::getMetadataExternalUUID);
|
|
41
|
+
prototype.registerHybridGetter("metadataTimeZone", &HybridWorkoutProxySpec::getMetadataTimeZone);
|
|
42
|
+
prototype.registerHybridGetter("metadataWasUserEntered", &HybridWorkoutProxySpec::getMetadataWasUserEntered);
|
|
43
|
+
prototype.registerHybridGetter("metadataDeviceSerialNumber", &HybridWorkoutProxySpec::getMetadataDeviceSerialNumber);
|
|
44
|
+
prototype.registerHybridGetter("metadataUdiDeviceIdentifier", &HybridWorkoutProxySpec::getMetadataUdiDeviceIdentifier);
|
|
45
|
+
prototype.registerHybridGetter("metadataUdiProductionIdentifier", &HybridWorkoutProxySpec::getMetadataUdiProductionIdentifier);
|
|
46
|
+
prototype.registerHybridGetter("metadataDigitalSignature", &HybridWorkoutProxySpec::getMetadataDigitalSignature);
|
|
47
|
+
prototype.registerHybridGetter("metadataDeviceName", &HybridWorkoutProxySpec::getMetadataDeviceName);
|
|
48
|
+
prototype.registerHybridGetter("metadataDeviceManufacturerName", &HybridWorkoutProxySpec::getMetadataDeviceManufacturerName);
|
|
49
|
+
prototype.registerHybridGetter("metadataSyncIdentifier", &HybridWorkoutProxySpec::getMetadataSyncIdentifier);
|
|
50
|
+
prototype.registerHybridGetter("metadataSyncVersion", &HybridWorkoutProxySpec::getMetadataSyncVersion);
|
|
51
|
+
prototype.registerHybridGetter("metadataWasTakenInLab", &HybridWorkoutProxySpec::getMetadataWasTakenInLab);
|
|
52
|
+
prototype.registerHybridGetter("metadataReferenceRangeLowerLimit", &HybridWorkoutProxySpec::getMetadataReferenceRangeLowerLimit);
|
|
53
|
+
prototype.registerHybridGetter("metadataReferenceRangeUpperLimit", &HybridWorkoutProxySpec::getMetadataReferenceRangeUpperLimit);
|
|
54
|
+
prototype.registerHybridGetter("metadataAlgorithmVersion", &HybridWorkoutProxySpec::getMetadataAlgorithmVersion);
|
|
27
55
|
prototype.registerHybridMethod("toJSON", &HybridWorkoutProxySpec::toJSON);
|
|
28
56
|
prototype.registerHybridMethod("saveWorkoutRoute", &HybridWorkoutProxySpec::saveWorkoutRoute);
|
|
29
57
|
prototype.registerHybridMethod("getWorkoutPlan", &HybridWorkoutProxySpec::getWorkoutPlan);
|
|
@@ -13,18 +13,26 @@
|
|
|
13
13
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
|
-
// Forward declaration of `Device` to properly resolve imports.
|
|
17
|
-
namespace margelo::nitro::healthkit { struct Device; }
|
|
18
16
|
// Forward declaration of `WorkoutActivityType` to properly resolve imports.
|
|
19
17
|
namespace margelo::nitro::healthkit { enum class WorkoutActivityType; }
|
|
20
18
|
// Forward declaration of `Quantity` to properly resolve imports.
|
|
21
19
|
namespace margelo::nitro::healthkit { struct Quantity; }
|
|
22
|
-
// Forward declaration of `SourceRevision` to properly resolve imports.
|
|
23
|
-
namespace margelo::nitro::healthkit { struct SourceRevision; }
|
|
24
20
|
// Forward declaration of `WorkoutEvent` to properly resolve imports.
|
|
25
21
|
namespace margelo::nitro::healthkit { struct WorkoutEvent; }
|
|
26
22
|
// Forward declaration of `WorkoutActivity` to properly resolve imports.
|
|
27
23
|
namespace margelo::nitro::healthkit { struct WorkoutActivity; }
|
|
24
|
+
// Forward declaration of `SampleType` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::healthkit { struct SampleType; }
|
|
26
|
+
// Forward declaration of `WeatherCondition` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { enum class WeatherCondition; }
|
|
28
|
+
// Forward declaration of `InsulinDeliveryReason` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { enum class InsulinDeliveryReason; }
|
|
30
|
+
// Forward declaration of `HeartRateMotionContext` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::healthkit { enum class HeartRateMotionContext; }
|
|
32
|
+
// Forward declaration of `SourceRevision` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::healthkit { struct SourceRevision; }
|
|
34
|
+
// Forward declaration of `Device` to properly resolve imports.
|
|
35
|
+
namespace margelo::nitro::healthkit { struct Device; }
|
|
28
36
|
// Forward declaration of `WorkoutSample` to properly resolve imports.
|
|
29
37
|
namespace margelo::nitro::healthkit { struct WorkoutSample; }
|
|
30
38
|
// Forward declaration of `LocationForSaving` to properly resolve imports.
|
|
@@ -38,17 +46,21 @@ namespace margelo::nitro::healthkit { struct QueryStatisticsResponse; }
|
|
|
38
46
|
// Forward declaration of `QuantityTypeIdentifier` to properly resolve imports.
|
|
39
47
|
namespace margelo::nitro::healthkit { enum class QuantityTypeIdentifier; }
|
|
40
48
|
|
|
41
|
-
#include <string>
|
|
42
|
-
#include "Device.hpp"
|
|
43
|
-
#include <optional>
|
|
44
49
|
#include "WorkoutActivityType.hpp"
|
|
45
50
|
#include "Quantity.hpp"
|
|
46
|
-
#include <chrono>
|
|
47
|
-
#include <NitroModules/AnyMap.hpp>
|
|
48
|
-
#include "SourceRevision.hpp"
|
|
49
51
|
#include "WorkoutEvent.hpp"
|
|
50
52
|
#include <vector>
|
|
53
|
+
#include <optional>
|
|
51
54
|
#include "WorkoutActivity.hpp"
|
|
55
|
+
#include "SampleType.hpp"
|
|
56
|
+
#include <chrono>
|
|
57
|
+
#include "WeatherCondition.hpp"
|
|
58
|
+
#include "InsulinDeliveryReason.hpp"
|
|
59
|
+
#include "HeartRateMotionContext.hpp"
|
|
60
|
+
#include <string>
|
|
61
|
+
#include "SourceRevision.hpp"
|
|
62
|
+
#include "Device.hpp"
|
|
63
|
+
#include <NitroModules/AnyMap.hpp>
|
|
52
64
|
#include "WorkoutSample.hpp"
|
|
53
65
|
#include <NitroModules/Promise.hpp>
|
|
54
66
|
#include "LocationForSaving.hpp"
|
|
@@ -85,16 +97,44 @@ namespace margelo::nitro::healthkit {
|
|
|
85
97
|
|
|
86
98
|
public:
|
|
87
99
|
// Properties
|
|
88
|
-
virtual std::string getUuid() = 0;
|
|
89
|
-
virtual std::optional<Device> getDevice() = 0;
|
|
90
100
|
virtual WorkoutActivityType getWorkoutActivityType() = 0;
|
|
91
101
|
virtual Quantity getDuration() = 0;
|
|
92
|
-
virtual std::chrono::system_clock::time_point getStartDate() = 0;
|
|
93
|
-
virtual std::chrono::system_clock::time_point getEndDate() = 0;
|
|
94
|
-
virtual std::optional<std::shared_ptr<AnyMap>> getMetadata() = 0;
|
|
95
|
-
virtual std::optional<SourceRevision> getSourceRevision() = 0;
|
|
96
102
|
virtual std::optional<std::vector<WorkoutEvent>> getEvents() = 0;
|
|
97
103
|
virtual std::optional<std::vector<WorkoutActivity>> getActivities() = 0;
|
|
104
|
+
virtual std::optional<Quantity> getMetadataAverageMETs() = 0;
|
|
105
|
+
virtual std::optional<Quantity> getMetadataElevationAscended() = 0;
|
|
106
|
+
virtual std::optional<Quantity> getMetadataElevationDescended() = 0;
|
|
107
|
+
virtual std::optional<bool> getMetadataIndoorWorkout() = 0;
|
|
108
|
+
virtual std::optional<Quantity> getMetadataAverageSpeed() = 0;
|
|
109
|
+
virtual std::optional<Quantity> getMetadataMaximumSpeed() = 0;
|
|
110
|
+
virtual SampleType getSampleType() = 0;
|
|
111
|
+
virtual std::chrono::system_clock::time_point getStartDate() = 0;
|
|
112
|
+
virtual std::chrono::system_clock::time_point getEndDate() = 0;
|
|
113
|
+
virtual bool getHasUndeterminedDuration() = 0;
|
|
114
|
+
virtual std::optional<WeatherCondition> getMetadataWeatherCondition() = 0;
|
|
115
|
+
virtual std::optional<Quantity> getMetadataWeatherHumidity() = 0;
|
|
116
|
+
virtual std::optional<Quantity> getMetadataWeatherTemperature() = 0;
|
|
117
|
+
virtual std::optional<InsulinDeliveryReason> getMetadataInsulinDeliveryReason() = 0;
|
|
118
|
+
virtual std::optional<HeartRateMotionContext> getMetadataHeartRateMotionContext() = 0;
|
|
119
|
+
virtual std::string getUuid() = 0;
|
|
120
|
+
virtual SourceRevision getSourceRevision() = 0;
|
|
121
|
+
virtual std::optional<Device> getDevice() = 0;
|
|
122
|
+
virtual std::shared_ptr<AnyMap> getMetadata() = 0;
|
|
123
|
+
virtual std::optional<std::string> getMetadataExternalUUID() = 0;
|
|
124
|
+
virtual std::optional<std::string> getMetadataTimeZone() = 0;
|
|
125
|
+
virtual std::optional<bool> getMetadataWasUserEntered() = 0;
|
|
126
|
+
virtual std::optional<std::string> getMetadataDeviceSerialNumber() = 0;
|
|
127
|
+
virtual std::optional<std::string> getMetadataUdiDeviceIdentifier() = 0;
|
|
128
|
+
virtual std::optional<std::string> getMetadataUdiProductionIdentifier() = 0;
|
|
129
|
+
virtual std::optional<std::string> getMetadataDigitalSignature() = 0;
|
|
130
|
+
virtual std::optional<std::string> getMetadataDeviceName() = 0;
|
|
131
|
+
virtual std::optional<std::string> getMetadataDeviceManufacturerName() = 0;
|
|
132
|
+
virtual std::optional<std::string> getMetadataSyncIdentifier() = 0;
|
|
133
|
+
virtual std::optional<double> getMetadataSyncVersion() = 0;
|
|
134
|
+
virtual std::optional<bool> getMetadataWasTakenInLab() = 0;
|
|
135
|
+
virtual std::optional<double> getMetadataReferenceRangeLowerLimit() = 0;
|
|
136
|
+
virtual std::optional<double> getMetadataReferenceRangeUpperLimit() = 0;
|
|
137
|
+
virtual std::optional<double> getMetadataAlgorithmVersion() = 0;
|
|
98
138
|
|
|
99
139
|
public:
|
|
100
140
|
// Methods
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// InsulinDeliveryReason.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::healthkit {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An enum which can be represented as a JavaScript enum (InsulinDeliveryReason).
|
|
25
|
+
*/
|
|
26
|
+
enum class InsulinDeliveryReason {
|
|
27
|
+
BASAL SWIFT_NAME(basal) = 1,
|
|
28
|
+
BOLUS SWIFT_NAME(bolus) = 2,
|
|
29
|
+
} CLOSED_ENUM;
|
|
30
|
+
|
|
31
|
+
} // namespace margelo::nitro::healthkit
|
|
32
|
+
|
|
33
|
+
namespace margelo::nitro {
|
|
34
|
+
|
|
35
|
+
// C++ InsulinDeliveryReason <> JS InsulinDeliveryReason (enum)
|
|
36
|
+
template <>
|
|
37
|
+
struct JSIConverter<margelo::nitro::healthkit::InsulinDeliveryReason> final {
|
|
38
|
+
static inline margelo::nitro::healthkit::InsulinDeliveryReason fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
39
|
+
int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
|
|
40
|
+
return static_cast<margelo::nitro::healthkit::InsulinDeliveryReason>(enumValue);
|
|
41
|
+
}
|
|
42
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::InsulinDeliveryReason arg) {
|
|
43
|
+
int enumValue = static_cast<int>(arg);
|
|
44
|
+
return JSIConverter<int>::toJSI(runtime, enumValue);
|
|
45
|
+
}
|
|
46
|
+
static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
|
|
47
|
+
if (!value.isNumber()) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
double number = value.getNumber();
|
|
51
|
+
int integer = static_cast<int>(number);
|
|
52
|
+
if (number != integer) {
|
|
53
|
+
// The integer is not the same value as the double - we truncated floating points.
|
|
54
|
+
// Enums are all integers, so the input floating point number is obviously invalid.
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
// Check if we are within the bounds of the enum.
|
|
58
|
+
return integer >= 1 && integer <= 2;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MedicationConcept.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `GeneralForm` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { enum class GeneralForm; }
|
|
28
|
+
// Forward declaration of `RelatedCoding` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { struct RelatedCoding; }
|
|
30
|
+
|
|
31
|
+
#include <string>
|
|
32
|
+
#include "GeneralForm.hpp"
|
|
33
|
+
#include "RelatedCoding.hpp"
|
|
34
|
+
#include <vector>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::healthkit {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (MedicationConcept).
|
|
40
|
+
*/
|
|
41
|
+
struct MedicationConcept {
|
|
42
|
+
public:
|
|
43
|
+
std::string identifier SWIFT_PRIVATE;
|
|
44
|
+
std::string displayText SWIFT_PRIVATE;
|
|
45
|
+
GeneralForm generalForm SWIFT_PRIVATE;
|
|
46
|
+
std::vector<RelatedCoding> relatedCodings SWIFT_PRIVATE;
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
MedicationConcept() = default;
|
|
50
|
+
explicit MedicationConcept(std::string identifier, std::string displayText, GeneralForm generalForm, std::vector<RelatedCoding> relatedCodings): identifier(identifier), displayText(displayText), generalForm(generalForm), relatedCodings(relatedCodings) {}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
} // namespace margelo::nitro::healthkit
|
|
54
|
+
|
|
55
|
+
namespace margelo::nitro {
|
|
56
|
+
|
|
57
|
+
// C++ MedicationConcept <> JS MedicationConcept (object)
|
|
58
|
+
template <>
|
|
59
|
+
struct JSIConverter<margelo::nitro::healthkit::MedicationConcept> final {
|
|
60
|
+
static inline margelo::nitro::healthkit::MedicationConcept fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
62
|
+
return margelo::nitro::healthkit::MedicationConcept(
|
|
63
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "identifier")),
|
|
64
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "displayText")),
|
|
65
|
+
JSIConverter<margelo::nitro::healthkit::GeneralForm>::fromJSI(runtime, obj.getProperty(runtime, "generalForm")),
|
|
66
|
+
JSIConverter<std::vector<margelo::nitro::healthkit::RelatedCoding>>::fromJSI(runtime, obj.getProperty(runtime, "relatedCodings"))
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::MedicationConcept& arg) {
|
|
70
|
+
jsi::Object obj(runtime);
|
|
71
|
+
obj.setProperty(runtime, "identifier", JSIConverter<std::string>::toJSI(runtime, arg.identifier));
|
|
72
|
+
obj.setProperty(runtime, "displayText", JSIConverter<std::string>::toJSI(runtime, arg.displayText));
|
|
73
|
+
obj.setProperty(runtime, "generalForm", JSIConverter<margelo::nitro::healthkit::GeneralForm>::toJSI(runtime, arg.generalForm));
|
|
74
|
+
obj.setProperty(runtime, "relatedCodings", JSIConverter<std::vector<margelo::nitro::healthkit::RelatedCoding>>::toJSI(runtime, arg.relatedCodings));
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
78
|
+
if (!value.isObject()) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
jsi::Object obj = value.getObject(runtime);
|
|
82
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "identifier"))) return false;
|
|
86
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "displayText"))) return false;
|
|
87
|
+
if (!JSIConverter<margelo::nitro::healthkit::GeneralForm>::canConvert(runtime, obj.getProperty(runtime, "generalForm"))) return false;
|
|
88
|
+
if (!JSIConverter<std::vector<margelo::nitro::healthkit::RelatedCoding>>::canConvert(runtime, obj.getProperty(runtime, "relatedCodings"))) return false;
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MedicationDoseEvent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `MedicationDoseEventScheduleType` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { enum class MedicationDoseEventScheduleType; }
|
|
28
|
+
// Forward declaration of `MedicationDoseEventLogStatus` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { enum class MedicationDoseEventLogStatus; }
|
|
30
|
+
// Forward declaration of `SampleType` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::healthkit { struct SampleType; }
|
|
32
|
+
// Forward declaration of `WeatherCondition` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::healthkit { enum class WeatherCondition; }
|
|
34
|
+
// Forward declaration of `Quantity` to properly resolve imports.
|
|
35
|
+
namespace margelo::nitro::healthkit { struct Quantity; }
|
|
36
|
+
// Forward declaration of `InsulinDeliveryReason` to properly resolve imports.
|
|
37
|
+
namespace margelo::nitro::healthkit { enum class InsulinDeliveryReason; }
|
|
38
|
+
// Forward declaration of `HeartRateMotionContext` to properly resolve imports.
|
|
39
|
+
namespace margelo::nitro::healthkit { enum class HeartRateMotionContext; }
|
|
40
|
+
// Forward declaration of `SourceRevision` to properly resolve imports.
|
|
41
|
+
namespace margelo::nitro::healthkit { struct SourceRevision; }
|
|
42
|
+
// Forward declaration of `Device` to properly resolve imports.
|
|
43
|
+
namespace margelo::nitro::healthkit { struct Device; }
|
|
44
|
+
|
|
45
|
+
#include "MedicationDoseEventScheduleType.hpp"
|
|
46
|
+
#include <string>
|
|
47
|
+
#include <chrono>
|
|
48
|
+
#include <optional>
|
|
49
|
+
#include "MedicationDoseEventLogStatus.hpp"
|
|
50
|
+
#include "SampleType.hpp"
|
|
51
|
+
#include "WeatherCondition.hpp"
|
|
52
|
+
#include "Quantity.hpp"
|
|
53
|
+
#include "InsulinDeliveryReason.hpp"
|
|
54
|
+
#include "HeartRateMotionContext.hpp"
|
|
55
|
+
#include "SourceRevision.hpp"
|
|
56
|
+
#include "Device.hpp"
|
|
57
|
+
#include <NitroModules/AnyMap.hpp>
|
|
58
|
+
|
|
59
|
+
namespace margelo::nitro::healthkit {
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A struct which can be represented as a JavaScript object (MedicationDoseEvent).
|
|
63
|
+
*/
|
|
64
|
+
struct MedicationDoseEvent {
|
|
65
|
+
public:
|
|
66
|
+
MedicationDoseEventScheduleType scheduleType SWIFT_PRIVATE;
|
|
67
|
+
std::string medicationConceptIdentifier SWIFT_PRIVATE;
|
|
68
|
+
std::optional<std::chrono::system_clock::time_point> scheduledDate SWIFT_PRIVATE;
|
|
69
|
+
std::optional<double> scheduledDoseQuantity SWIFT_PRIVATE;
|
|
70
|
+
std::optional<double> doseQuantity SWIFT_PRIVATE;
|
|
71
|
+
MedicationDoseEventLogStatus logStatus SWIFT_PRIVATE;
|
|
72
|
+
std::string unit SWIFT_PRIVATE;
|
|
73
|
+
SampleType sampleType SWIFT_PRIVATE;
|
|
74
|
+
std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
|
|
75
|
+
std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
|
|
76
|
+
bool hasUndeterminedDuration SWIFT_PRIVATE;
|
|
77
|
+
std::optional<WeatherCondition> metadataWeatherCondition SWIFT_PRIVATE;
|
|
78
|
+
std::optional<Quantity> metadataWeatherHumidity SWIFT_PRIVATE;
|
|
79
|
+
std::optional<Quantity> metadataWeatherTemperature SWIFT_PRIVATE;
|
|
80
|
+
std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason SWIFT_PRIVATE;
|
|
81
|
+
std::optional<HeartRateMotionContext> metadataHeartRateMotionContext SWIFT_PRIVATE;
|
|
82
|
+
std::string uuid SWIFT_PRIVATE;
|
|
83
|
+
SourceRevision sourceRevision SWIFT_PRIVATE;
|
|
84
|
+
std::optional<Device> device SWIFT_PRIVATE;
|
|
85
|
+
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
86
|
+
std::optional<std::string> metadataExternalUUID SWIFT_PRIVATE;
|
|
87
|
+
std::optional<std::string> metadataTimeZone SWIFT_PRIVATE;
|
|
88
|
+
std::optional<bool> metadataWasUserEntered SWIFT_PRIVATE;
|
|
89
|
+
std::optional<std::string> metadataDeviceSerialNumber SWIFT_PRIVATE;
|
|
90
|
+
std::optional<std::string> metadataUdiDeviceIdentifier SWIFT_PRIVATE;
|
|
91
|
+
std::optional<std::string> metadataUdiProductionIdentifier SWIFT_PRIVATE;
|
|
92
|
+
std::optional<std::string> metadataDigitalSignature SWIFT_PRIVATE;
|
|
93
|
+
std::optional<std::string> metadataDeviceName SWIFT_PRIVATE;
|
|
94
|
+
std::optional<std::string> metadataDeviceManufacturerName SWIFT_PRIVATE;
|
|
95
|
+
std::optional<std::string> metadataSyncIdentifier SWIFT_PRIVATE;
|
|
96
|
+
std::optional<double> metadataSyncVersion SWIFT_PRIVATE;
|
|
97
|
+
std::optional<bool> metadataWasTakenInLab SWIFT_PRIVATE;
|
|
98
|
+
std::optional<double> metadataReferenceRangeLowerLimit SWIFT_PRIVATE;
|
|
99
|
+
std::optional<double> metadataReferenceRangeUpperLimit SWIFT_PRIVATE;
|
|
100
|
+
std::optional<double> metadataAlgorithmVersion SWIFT_PRIVATE;
|
|
101
|
+
|
|
102
|
+
public:
|
|
103
|
+
MedicationDoseEvent() = default;
|
|
104
|
+
explicit MedicationDoseEvent(MedicationDoseEventScheduleType scheduleType, std::string medicationConceptIdentifier, std::optional<std::chrono::system_clock::time_point> scheduledDate, std::optional<double> scheduledDoseQuantity, std::optional<double> doseQuantity, MedicationDoseEventLogStatus logStatus, std::string unit, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::optional<WeatherCondition> metadataWeatherCondition, std::optional<Quantity> metadataWeatherHumidity, std::optional<Quantity> metadataWeatherTemperature, std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason, std::optional<HeartRateMotionContext> metadataHeartRateMotionContext, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata, std::optional<std::string> metadataExternalUUID, std::optional<std::string> metadataTimeZone, std::optional<bool> metadataWasUserEntered, std::optional<std::string> metadataDeviceSerialNumber, std::optional<std::string> metadataUdiDeviceIdentifier, std::optional<std::string> metadataUdiProductionIdentifier, std::optional<std::string> metadataDigitalSignature, std::optional<std::string> metadataDeviceName, std::optional<std::string> metadataDeviceManufacturerName, std::optional<std::string> metadataSyncIdentifier, std::optional<double> metadataSyncVersion, std::optional<bool> metadataWasTakenInLab, std::optional<double> metadataReferenceRangeLowerLimit, std::optional<double> metadataReferenceRangeUpperLimit, std::optional<double> metadataAlgorithmVersion): scheduleType(scheduleType), medicationConceptIdentifier(medicationConceptIdentifier), scheduledDate(scheduledDate), scheduledDoseQuantity(scheduledDoseQuantity), doseQuantity(doseQuantity), logStatus(logStatus), unit(unit), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadataWeatherCondition(metadataWeatherCondition), metadataWeatherHumidity(metadataWeatherHumidity), metadataWeatherTemperature(metadataWeatherTemperature), metadataInsulinDeliveryReason(metadataInsulinDeliveryReason), metadataHeartRateMotionContext(metadataHeartRateMotionContext), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata), metadataExternalUUID(metadataExternalUUID), metadataTimeZone(metadataTimeZone), metadataWasUserEntered(metadataWasUserEntered), metadataDeviceSerialNumber(metadataDeviceSerialNumber), metadataUdiDeviceIdentifier(metadataUdiDeviceIdentifier), metadataUdiProductionIdentifier(metadataUdiProductionIdentifier), metadataDigitalSignature(metadataDigitalSignature), metadataDeviceName(metadataDeviceName), metadataDeviceManufacturerName(metadataDeviceManufacturerName), metadataSyncIdentifier(metadataSyncIdentifier), metadataSyncVersion(metadataSyncVersion), metadataWasTakenInLab(metadataWasTakenInLab), metadataReferenceRangeLowerLimit(metadataReferenceRangeLowerLimit), metadataReferenceRangeUpperLimit(metadataReferenceRangeUpperLimit), metadataAlgorithmVersion(metadataAlgorithmVersion) {}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
} // namespace margelo::nitro::healthkit
|
|
108
|
+
|
|
109
|
+
namespace margelo::nitro {
|
|
110
|
+
|
|
111
|
+
// C++ MedicationDoseEvent <> JS MedicationDoseEvent (object)
|
|
112
|
+
template <>
|
|
113
|
+
struct JSIConverter<margelo::nitro::healthkit::MedicationDoseEvent> final {
|
|
114
|
+
static inline margelo::nitro::healthkit::MedicationDoseEvent fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
115
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
116
|
+
return margelo::nitro::healthkit::MedicationDoseEvent(
|
|
117
|
+
JSIConverter<margelo::nitro::healthkit::MedicationDoseEventScheduleType>::fromJSI(runtime, obj.getProperty(runtime, "scheduleType")),
|
|
118
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "medicationConceptIdentifier")),
|
|
119
|
+
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "scheduledDate")),
|
|
120
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "scheduledDoseQuantity")),
|
|
121
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "doseQuantity")),
|
|
122
|
+
JSIConverter<margelo::nitro::healthkit::MedicationDoseEventLogStatus>::fromJSI(runtime, obj.getProperty(runtime, "logStatus")),
|
|
123
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
|
|
124
|
+
JSIConverter<margelo::nitro::healthkit::SampleType>::fromJSI(runtime, obj.getProperty(runtime, "sampleType")),
|
|
125
|
+
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
|
|
126
|
+
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "endDate")),
|
|
127
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "hasUndeterminedDuration")),
|
|
128
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::fromJSI(runtime, obj.getProperty(runtime, "metadataWeatherCondition")),
|
|
129
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "metadataWeatherHumidity")),
|
|
130
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "metadataWeatherTemperature")),
|
|
131
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::fromJSI(runtime, obj.getProperty(runtime, "metadataInsulinDeliveryReason")),
|
|
132
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::fromJSI(runtime, obj.getProperty(runtime, "metadataHeartRateMotionContext")),
|
|
133
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "uuid")),
|
|
134
|
+
JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, "sourceRevision")),
|
|
135
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, "device")),
|
|
136
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
|
|
137
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataExternalUUID")),
|
|
138
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataTimeZone")),
|
|
139
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "metadataWasUserEntered")),
|
|
140
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataDeviceSerialNumber")),
|
|
141
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataUdiDeviceIdentifier")),
|
|
142
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataUdiProductionIdentifier")),
|
|
143
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataDigitalSignature")),
|
|
144
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataDeviceName")),
|
|
145
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataDeviceManufacturerName")),
|
|
146
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "metadataSyncIdentifier")),
|
|
147
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "metadataSyncVersion")),
|
|
148
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "metadataWasTakenInLab")),
|
|
149
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "metadataReferenceRangeLowerLimit")),
|
|
150
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "metadataReferenceRangeUpperLimit")),
|
|
151
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "metadataAlgorithmVersion"))
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::MedicationDoseEvent& arg) {
|
|
155
|
+
jsi::Object obj(runtime);
|
|
156
|
+
obj.setProperty(runtime, "scheduleType", JSIConverter<margelo::nitro::healthkit::MedicationDoseEventScheduleType>::toJSI(runtime, arg.scheduleType));
|
|
157
|
+
obj.setProperty(runtime, "medicationConceptIdentifier", JSIConverter<std::string>::toJSI(runtime, arg.medicationConceptIdentifier));
|
|
158
|
+
obj.setProperty(runtime, "scheduledDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.scheduledDate));
|
|
159
|
+
obj.setProperty(runtime, "scheduledDoseQuantity", JSIConverter<std::optional<double>>::toJSI(runtime, arg.scheduledDoseQuantity));
|
|
160
|
+
obj.setProperty(runtime, "doseQuantity", JSIConverter<std::optional<double>>::toJSI(runtime, arg.doseQuantity));
|
|
161
|
+
obj.setProperty(runtime, "logStatus", JSIConverter<margelo::nitro::healthkit::MedicationDoseEventLogStatus>::toJSI(runtime, arg.logStatus));
|
|
162
|
+
obj.setProperty(runtime, "unit", JSIConverter<std::string>::toJSI(runtime, arg.unit));
|
|
163
|
+
obj.setProperty(runtime, "sampleType", JSIConverter<margelo::nitro::healthkit::SampleType>::toJSI(runtime, arg.sampleType));
|
|
164
|
+
obj.setProperty(runtime, "startDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
|
|
165
|
+
obj.setProperty(runtime, "endDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
|
|
166
|
+
obj.setProperty(runtime, "hasUndeterminedDuration", JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
|
|
167
|
+
obj.setProperty(runtime, "metadataWeatherCondition", JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::toJSI(runtime, arg.metadataWeatherCondition));
|
|
168
|
+
obj.setProperty(runtime, "metadataWeatherHumidity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherHumidity));
|
|
169
|
+
obj.setProperty(runtime, "metadataWeatherTemperature", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherTemperature));
|
|
170
|
+
obj.setProperty(runtime, "metadataInsulinDeliveryReason", JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::toJSI(runtime, arg.metadataInsulinDeliveryReason));
|
|
171
|
+
obj.setProperty(runtime, "metadataHeartRateMotionContext", JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::toJSI(runtime, arg.metadataHeartRateMotionContext));
|
|
172
|
+
obj.setProperty(runtime, "uuid", JSIConverter<std::string>::toJSI(runtime, arg.uuid));
|
|
173
|
+
obj.setProperty(runtime, "sourceRevision", JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
|
|
174
|
+
obj.setProperty(runtime, "device", JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
|
|
175
|
+
obj.setProperty(runtime, "metadata", JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
176
|
+
obj.setProperty(runtime, "metadataExternalUUID", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataExternalUUID));
|
|
177
|
+
obj.setProperty(runtime, "metadataTimeZone", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataTimeZone));
|
|
178
|
+
obj.setProperty(runtime, "metadataWasUserEntered", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasUserEntered));
|
|
179
|
+
obj.setProperty(runtime, "metadataDeviceSerialNumber", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceSerialNumber));
|
|
180
|
+
obj.setProperty(runtime, "metadataUdiDeviceIdentifier", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiDeviceIdentifier));
|
|
181
|
+
obj.setProperty(runtime, "metadataUdiProductionIdentifier", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiProductionIdentifier));
|
|
182
|
+
obj.setProperty(runtime, "metadataDigitalSignature", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDigitalSignature));
|
|
183
|
+
obj.setProperty(runtime, "metadataDeviceName", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceName));
|
|
184
|
+
obj.setProperty(runtime, "metadataDeviceManufacturerName", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceManufacturerName));
|
|
185
|
+
obj.setProperty(runtime, "metadataSyncIdentifier", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataSyncIdentifier));
|
|
186
|
+
obj.setProperty(runtime, "metadataSyncVersion", JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataSyncVersion));
|
|
187
|
+
obj.setProperty(runtime, "metadataWasTakenInLab", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasTakenInLab));
|
|
188
|
+
obj.setProperty(runtime, "metadataReferenceRangeLowerLimit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeLowerLimit));
|
|
189
|
+
obj.setProperty(runtime, "metadataReferenceRangeUpperLimit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeUpperLimit));
|
|
190
|
+
obj.setProperty(runtime, "metadataAlgorithmVersion", JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataAlgorithmVersion));
|
|
191
|
+
return obj;
|
|
192
|
+
}
|
|
193
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
194
|
+
if (!value.isObject()) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
jsi::Object obj = value.getObject(runtime);
|
|
198
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
if (!JSIConverter<margelo::nitro::healthkit::MedicationDoseEventScheduleType>::canConvert(runtime, obj.getProperty(runtime, "scheduleType"))) return false;
|
|
202
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "medicationConceptIdentifier"))) return false;
|
|
203
|
+
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "scheduledDate"))) return false;
|
|
204
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "scheduledDoseQuantity"))) return false;
|
|
205
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "doseQuantity"))) return false;
|
|
206
|
+
if (!JSIConverter<margelo::nitro::healthkit::MedicationDoseEventLogStatus>::canConvert(runtime, obj.getProperty(runtime, "logStatus"))) return false;
|
|
207
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
|
|
208
|
+
if (!JSIConverter<margelo::nitro::healthkit::SampleType>::canConvert(runtime, obj.getProperty(runtime, "sampleType"))) return false;
|
|
209
|
+
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
|
|
210
|
+
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
|
|
211
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "hasUndeterminedDuration"))) return false;
|
|
212
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::canConvert(runtime, obj.getProperty(runtime, "metadataWeatherCondition"))) return false;
|
|
213
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "metadataWeatherHumidity"))) return false;
|
|
214
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "metadataWeatherTemperature"))) return false;
|
|
215
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::canConvert(runtime, obj.getProperty(runtime, "metadataInsulinDeliveryReason"))) return false;
|
|
216
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::canConvert(runtime, obj.getProperty(runtime, "metadataHeartRateMotionContext"))) return false;
|
|
217
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "uuid"))) return false;
|
|
218
|
+
if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, "sourceRevision"))) return false;
|
|
219
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, "device"))) return false;
|
|
220
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
|
|
221
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataExternalUUID"))) return false;
|
|
222
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataTimeZone"))) return false;
|
|
223
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "metadataWasUserEntered"))) return false;
|
|
224
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataDeviceSerialNumber"))) return false;
|
|
225
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataUdiDeviceIdentifier"))) return false;
|
|
226
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataUdiProductionIdentifier"))) return false;
|
|
227
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataDigitalSignature"))) return false;
|
|
228
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataDeviceName"))) return false;
|
|
229
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataDeviceManufacturerName"))) return false;
|
|
230
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "metadataSyncIdentifier"))) return false;
|
|
231
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "metadataSyncVersion"))) return false;
|
|
232
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "metadataWasTakenInLab"))) return false;
|
|
233
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "metadataReferenceRangeLowerLimit"))) return false;
|
|
234
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "metadataReferenceRangeUpperLimit"))) return false;
|
|
235
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "metadataAlgorithmVersion"))) return false;
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
} // namespace margelo::nitro
|