@kingstinct/react-native-healthkit 13.4.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +3 -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 +18 -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 +2 -115
- 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/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++/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 +44 -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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// QueryOptionsWithAnchorAndStringUnit.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -38,9 +38,9 @@ namespace margelo::nitro::healthkit { struct FilterForSamples; }
|
|
|
38
38
|
namespace margelo::nitro::healthkit {
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* A struct which can be represented as a JavaScript object (
|
|
41
|
+
* A struct which can be represented as a JavaScript object (QueryOptionsWithAnchorAndStringUnit).
|
|
42
42
|
*/
|
|
43
|
-
struct
|
|
43
|
+
struct QueryOptionsWithAnchorAndStringUnit final {
|
|
44
44
|
public:
|
|
45
45
|
std::optional<std::string> unit SWIFT_PRIVATE;
|
|
46
46
|
std::optional<std::string> anchor SWIFT_PRIVATE;
|
|
@@ -48,30 +48,30 @@ namespace margelo::nitro::healthkit {
|
|
|
48
48
|
double limit SWIFT_PRIVATE;
|
|
49
49
|
|
|
50
50
|
public:
|
|
51
|
-
|
|
52
|
-
explicit
|
|
51
|
+
QueryOptionsWithAnchorAndStringUnit() = default;
|
|
52
|
+
explicit QueryOptionsWithAnchorAndStringUnit(std::optional<std::string> unit, std::optional<std::string> anchor, std::optional<FilterForSamples> filter, double limit): unit(unit), anchor(anchor), filter(filter), limit(limit) {}
|
|
53
53
|
|
|
54
54
|
public:
|
|
55
|
-
friend bool operator==(const
|
|
55
|
+
friend bool operator==(const QueryOptionsWithAnchorAndStringUnit& lhs, const QueryOptionsWithAnchorAndStringUnit& rhs) = default;
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
} // namespace margelo::nitro::healthkit
|
|
59
59
|
|
|
60
60
|
namespace margelo::nitro {
|
|
61
61
|
|
|
62
|
-
// C++
|
|
62
|
+
// C++ QueryOptionsWithAnchorAndStringUnit <> JS QueryOptionsWithAnchorAndStringUnit (object)
|
|
63
63
|
template <>
|
|
64
|
-
struct JSIConverter<margelo::nitro::healthkit::
|
|
65
|
-
static inline margelo::nitro::healthkit::
|
|
64
|
+
struct JSIConverter<margelo::nitro::healthkit::QueryOptionsWithAnchorAndStringUnit> final {
|
|
65
|
+
static inline margelo::nitro::healthkit::QueryOptionsWithAnchorAndStringUnit fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
66
|
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
-
return margelo::nitro::healthkit::
|
|
67
|
+
return margelo::nitro::healthkit::QueryOptionsWithAnchorAndStringUnit(
|
|
68
68
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "unit"))),
|
|
69
69
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "anchor"))),
|
|
70
70
|
JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "filter"))),
|
|
71
71
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "limit")))
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::
|
|
74
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithAnchorAndStringUnit& arg) {
|
|
75
75
|
jsi::Object obj(runtime);
|
|
76
76
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "unit"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
|
|
77
77
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "anchor"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.anchor));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// QueryOptionsWithSortOrderAndStringUnit.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -38,9 +38,9 @@ namespace margelo::nitro::healthkit { struct FilterForSamples; }
|
|
|
38
38
|
namespace margelo::nitro::healthkit {
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* A struct which can be represented as a JavaScript object (
|
|
41
|
+
* A struct which can be represented as a JavaScript object (QueryOptionsWithSortOrderAndStringUnit).
|
|
42
42
|
*/
|
|
43
|
-
struct
|
|
43
|
+
struct QueryOptionsWithSortOrderAndStringUnit final {
|
|
44
44
|
public:
|
|
45
45
|
std::optional<std::string> unit SWIFT_PRIVATE;
|
|
46
46
|
std::optional<bool> ascending SWIFT_PRIVATE;
|
|
@@ -48,30 +48,30 @@ namespace margelo::nitro::healthkit {
|
|
|
48
48
|
double limit SWIFT_PRIVATE;
|
|
49
49
|
|
|
50
50
|
public:
|
|
51
|
-
|
|
52
|
-
explicit
|
|
51
|
+
QueryOptionsWithSortOrderAndStringUnit() = default;
|
|
52
|
+
explicit QueryOptionsWithSortOrderAndStringUnit(std::optional<std::string> unit, std::optional<bool> ascending, std::optional<FilterForSamples> filter, double limit): unit(unit), ascending(ascending), filter(filter), limit(limit) {}
|
|
53
53
|
|
|
54
54
|
public:
|
|
55
|
-
friend bool operator==(const
|
|
55
|
+
friend bool operator==(const QueryOptionsWithSortOrderAndStringUnit& lhs, const QueryOptionsWithSortOrderAndStringUnit& rhs) = default;
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
} // namespace margelo::nitro::healthkit
|
|
59
59
|
|
|
60
60
|
namespace margelo::nitro {
|
|
61
61
|
|
|
62
|
-
// C++
|
|
62
|
+
// C++ QueryOptionsWithSortOrderAndStringUnit <> JS QueryOptionsWithSortOrderAndStringUnit (object)
|
|
63
63
|
template <>
|
|
64
|
-
struct JSIConverter<margelo::nitro::healthkit::
|
|
65
|
-
static inline margelo::nitro::healthkit::
|
|
64
|
+
struct JSIConverter<margelo::nitro::healthkit::QueryOptionsWithSortOrderAndStringUnit> final {
|
|
65
|
+
static inline margelo::nitro::healthkit::QueryOptionsWithSortOrderAndStringUnit fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
66
|
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
-
return margelo::nitro::healthkit::
|
|
67
|
+
return margelo::nitro::healthkit::QueryOptionsWithSortOrderAndStringUnit(
|
|
68
68
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "unit"))),
|
|
69
69
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ascending"))),
|
|
70
70
|
JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "filter"))),
|
|
71
71
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "limit")))
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::
|
|
74
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithSortOrderAndStringUnit& arg) {
|
|
75
75
|
jsi::Object obj(runtime);
|
|
76
76
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "unit"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
|
|
77
77
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "ascending"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.ascending));
|
|
@@ -37,10 +37,10 @@ namespace margelo::nitro::healthkit { struct QuantityDateInterval; }
|
|
|
37
37
|
|
|
38
38
|
#include <memory>
|
|
39
39
|
#include "HybridSourceProxySpec.hpp"
|
|
40
|
-
#include
|
|
40
|
+
#include <chrono>
|
|
41
41
|
#include <optional>
|
|
42
|
+
#include "Quantity.hpp"
|
|
42
43
|
#include "QuantityDateInterval.hpp"
|
|
43
|
-
#include <chrono>
|
|
44
44
|
|
|
45
45
|
namespace margelo::nitro::healthkit {
|
|
46
46
|
|
|
@@ -50,6 +50,8 @@ namespace margelo::nitro::healthkit {
|
|
|
50
50
|
struct QueryStatisticsResponseFromSingleSource final {
|
|
51
51
|
public:
|
|
52
52
|
std::shared_ptr<HybridSourceProxySpec> source SWIFT_PRIVATE;
|
|
53
|
+
std::optional<std::chrono::system_clock::time_point> startDate SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::chrono::system_clock::time_point> endDate SWIFT_PRIVATE;
|
|
53
55
|
std::optional<Quantity> duration SWIFT_PRIVATE;
|
|
54
56
|
std::optional<Quantity> averageQuantity SWIFT_PRIVATE;
|
|
55
57
|
std::optional<Quantity> maximumQuantity SWIFT_PRIVATE;
|
|
@@ -57,12 +59,10 @@ namespace margelo::nitro::healthkit {
|
|
|
57
59
|
std::optional<Quantity> sumQuantity SWIFT_PRIVATE;
|
|
58
60
|
std::optional<Quantity> mostRecentQuantity SWIFT_PRIVATE;
|
|
59
61
|
std::optional<QuantityDateInterval> mostRecentQuantityDateInterval SWIFT_PRIVATE;
|
|
60
|
-
std::optional<std::chrono::system_clock::time_point> startDate SWIFT_PRIVATE;
|
|
61
|
-
std::optional<std::chrono::system_clock::time_point> endDate SWIFT_PRIVATE;
|
|
62
62
|
|
|
63
63
|
public:
|
|
64
64
|
QueryStatisticsResponseFromSingleSource() = default;
|
|
65
|
-
explicit QueryStatisticsResponseFromSingleSource(std::shared_ptr<HybridSourceProxySpec> source, std::optional<
|
|
65
|
+
explicit QueryStatisticsResponseFromSingleSource(std::shared_ptr<HybridSourceProxySpec> source, std::optional<std::chrono::system_clock::time_point> startDate, std::optional<std::chrono::system_clock::time_point> endDate, std::optional<Quantity> duration, std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval): source(source), startDate(startDate), endDate(endDate), duration(duration), averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval) {}
|
|
66
66
|
|
|
67
67
|
public:
|
|
68
68
|
friend bool operator==(const QueryStatisticsResponseFromSingleSource& lhs, const QueryStatisticsResponseFromSingleSource& rhs) = default;
|
|
@@ -79,20 +79,22 @@ namespace margelo::nitro {
|
|
|
79
79
|
jsi::Object obj = arg.asObject(runtime);
|
|
80
80
|
return margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource(
|
|
81
81
|
JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "source"))),
|
|
82
|
+
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
83
|
+
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
82
84
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration"))),
|
|
83
85
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "averageQuantity"))),
|
|
84
86
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maximumQuantity"))),
|
|
85
87
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumQuantity"))),
|
|
86
88
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sumQuantity"))),
|
|
87
89
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mostRecentQuantity"))),
|
|
88
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mostRecentQuantityDateInterval")))
|
|
89
|
-
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
90
|
-
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))
|
|
90
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mostRecentQuantityDateInterval")))
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource& arg) {
|
|
94
94
|
jsi::Object obj(runtime);
|
|
95
95
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "source"), JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>::toJSI(runtime, arg.source));
|
|
96
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.startDate));
|
|
97
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.endDate));
|
|
96
98
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "duration"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.duration));
|
|
97
99
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "averageQuantity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.averageQuantity));
|
|
98
100
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maximumQuantity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.maximumQuantity));
|
|
@@ -100,8 +102,6 @@ namespace margelo::nitro {
|
|
|
100
102
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sumQuantity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.sumQuantity));
|
|
101
103
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mostRecentQuantity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.mostRecentQuantity));
|
|
102
104
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mostRecentQuantityDateInterval"), JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::toJSI(runtime, arg.mostRecentQuantityDateInterval));
|
|
103
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.startDate));
|
|
104
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.endDate));
|
|
105
105
|
return obj;
|
|
106
106
|
}
|
|
107
107
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -113,6 +113,8 @@ namespace margelo::nitro {
|
|
|
113
113
|
return false;
|
|
114
114
|
}
|
|
115
115
|
if (!JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "source")))) return false;
|
|
116
|
+
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
117
|
+
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
116
118
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration")))) return false;
|
|
117
119
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "averageQuantity")))) return false;
|
|
118
120
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maximumQuantity")))) return false;
|
|
@@ -120,8 +122,6 @@ namespace margelo::nitro {
|
|
|
120
122
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sumQuantity")))) return false;
|
|
121
123
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mostRecentQuantity")))) return false;
|
|
122
124
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mostRecentQuantityDateInterval")))) return false;
|
|
123
|
-
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
124
|
-
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
125
125
|
return true;
|
|
126
126
|
}
|
|
127
127
|
};
|