@kingstinct/react-native-healthkit 15.1.0 → 16.1.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/README.md +22 -3
- package/ReactNativeHealthkit.podspec +17 -6
- package/app.plugin.js +18 -34
- package/app.plugin.ts +25 -50
- package/ios/CategoryTypeModule.swift +1 -0
- package/ios/CharacteristicTypeModule.swift +7 -6
- package/ios/Constants.swift +9 -34
- package/ios/CoreModule.swift +72 -41
- package/ios/CorrelationTypeModule.swift +3 -2
- package/ios/ElectrocardiogramModule.swift +4 -3
- package/ios/HeartbeatSeriesModule.swift +4 -3
- package/ios/Helpers.swift +10 -243
- package/ios/MedicationModule.swift +9 -8
- package/ios/MemoryEstimation.swift +1 -0
- package/ios/PredicateHelpers.swift +16 -86
- package/ios/QuantityTypeModule.swift +3 -2
- package/ios/Serializers.swift +16 -67
- package/ios/SourceProxy.swift +1 -0
- package/ios/StateOfMindModule.swift +3 -2
- package/ios/WorkoutProxy.swift +3 -2
- package/ios/WorkoutsModule.swift +4 -3
- package/lib/commonjs/generated/healthkit.generated.js +3 -0
- package/lib/commonjs/healthkit.ios.js +4 -2
- package/lib/commonjs/healthkit.js +21 -78
- package/lib/commonjs/types/Auth.js +3 -18
- package/lib/commonjs/types/Background.js +2 -10
- package/lib/commonjs/types/QueryOptions.js +2 -17
- package/lib/module/generated/healthkit.generated.js +3 -0
- package/lib/module/healthkit.ios.js +2 -0
- package/lib/module/healthkit.js +20 -77
- package/lib/module/types/Auth.js +1 -18
- package/lib/module/types/Background.js +1 -10
- package/lib/module/types/QueryOptions.js +1 -17
- package/lib/typescript/generated/healthkit.generated.d.ts +6 -2
- package/lib/typescript/healthkit.d.ts +3 -2
- package/lib/typescript/healthkit.ios.d.ts +11 -9
- package/lib/typescript/specs/CoreModule.nitro.d.ts +16 -0
- package/lib/typescript/specs/SourceProxy.nitro.d.ts +2 -4
- package/lib/typescript/types/Auth.d.ts +1 -16
- package/lib/typescript/types/Background.d.ts +1 -9
- package/lib/typescript/types/Device.d.ts +1 -13
- package/lib/typescript/types/QuantityType.d.ts +1 -1
- package/lib/typescript/types/QueryOptions.d.ts +3 -37
- package/lib/typescript/types/Shared.d.ts +2 -25
- package/lib/typescript/types/Source.d.ts +1 -10
- package/lib/typescript/types/Subscriptions.d.ts +2 -3
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +68 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +8 -0
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/swift/CategorySample.swift +8 -8
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +8 -8
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +8 -8
- package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_.swift +54 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +8 -8
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +25 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +8 -8
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +4 -0
- package/nitrogen/generated/ios/swift/QuantitySample.swift +8 -8
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +4 -0
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +4 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +4 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +4 -0
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +8 -8
- package/nitrogen/generated/shared/c++/CategorySample.hpp +7 -7
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +7 -7
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +7 -7
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +7 -7
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +3 -1
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +7 -7
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +49 -45
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +7 -7
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +42 -38
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +42 -38
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +48 -44
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +47 -43
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +7 -7
- package/package.json +4 -1
- package/src/generated/healthkit-schema.json +13 -0
- package/src/generated/healthkit.generated.ts +5 -0
- package/src/healthkit.ios.ts +3 -0
- package/src/healthkit.ts +27 -84
- package/src/specs/CoreModule.nitro.ts +19 -0
- package/src/specs/SourceProxy.nitro.ts +2 -4
- package/src/test-setup.ts +1 -0
- package/src/types/Auth.ts +4 -17
- package/src/types/Background.ts +1 -9
- package/src/types/Device.ts +1 -13
- package/src/types/QuantityType.ts +1 -1
- package/src/types/QueryOptions.ts +7 -65
- package/src/types/Shared.ts +7 -28
- package/src/types/Source.ts +1 -11
- package/src/types/Subscriptions.ts +2 -3
- package/ios/BackgroundDeliveryManager.swift +0 -284
- package/ios/BackgroundLaunchHook.mm +0 -41
- package/ios/Bridge.h +0 -10
- package/ios/ExceptionCatcher.h +0 -5
- package/ios/ExceptionCatcher.mm +0 -32
- package/ios/module.modulemap +0 -5
|
@@ -48,11 +48,11 @@ namespace margelo::nitro::healthkit { struct Device; }
|
|
|
48
48
|
#include <vector>
|
|
49
49
|
#include "SampleType.hpp"
|
|
50
50
|
#include <chrono>
|
|
51
|
-
#include <NitroModules/AnyMap.hpp>
|
|
52
51
|
#include <string>
|
|
53
52
|
#include "SourceRevision.hpp"
|
|
54
53
|
#include "Device.hpp"
|
|
55
54
|
#include <optional>
|
|
55
|
+
#include <NitroModules/AnyMap.hpp>
|
|
56
56
|
|
|
57
57
|
namespace margelo::nitro::healthkit {
|
|
58
58
|
|
|
@@ -67,14 +67,14 @@ namespace margelo::nitro::healthkit {
|
|
|
67
67
|
std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
|
|
68
68
|
std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
|
|
69
69
|
bool hasUndeterminedDuration SWIFT_PRIVATE;
|
|
70
|
-
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
71
70
|
std::string uuid SWIFT_PRIVATE;
|
|
72
71
|
SourceRevision sourceRevision SWIFT_PRIVATE;
|
|
73
72
|
std::optional<Device> device SWIFT_PRIVATE;
|
|
73
|
+
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
74
74
|
|
|
75
75
|
public:
|
|
76
76
|
CorrelationSample() = default;
|
|
77
|
-
explicit CorrelationSample(CorrelationTypeIdentifier correlationType, std::vector<std::variant<CategorySample, QuantitySample>> objects, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::
|
|
77
|
+
explicit CorrelationSample(CorrelationTypeIdentifier correlationType, std::vector<std::variant<CategorySample, QuantitySample>> objects, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata): correlationType(correlationType), objects(objects), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata) {}
|
|
78
78
|
|
|
79
79
|
public:
|
|
80
80
|
friend bool operator==(const CorrelationSample& lhs, const CorrelationSample& rhs) = default;
|
|
@@ -96,10 +96,10 @@ namespace margelo::nitro {
|
|
|
96
96
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
97
97
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
98
98
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
|
|
99
|
-
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
|
|
100
99
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
|
|
101
100
|
JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
|
|
102
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
|
|
101
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
|
|
102
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::CorrelationSample& arg) {
|
|
@@ -110,10 +110,10 @@ namespace margelo::nitro {
|
|
|
110
110
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
|
|
111
111
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
|
|
112
112
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
|
|
113
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
114
113
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
|
|
115
114
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
|
|
116
115
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
|
|
116
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
117
117
|
return obj;
|
|
118
118
|
}
|
|
119
119
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -130,10 +130,10 @@ namespace margelo::nitro {
|
|
|
130
130
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
131
131
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
132
132
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
|
|
133
|
-
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
134
133
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
|
|
135
134
|
if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
|
|
136
135
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
|
|
136
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
137
137
|
return true;
|
|
138
138
|
}
|
|
139
139
|
};
|
|
@@ -48,10 +48,10 @@ namespace margelo::nitro::healthkit { struct Device; }
|
|
|
48
48
|
#include <vector>
|
|
49
49
|
#include "SampleType.hpp"
|
|
50
50
|
#include <chrono>
|
|
51
|
-
#include <NitroModules/AnyMap.hpp>
|
|
52
51
|
#include <string>
|
|
53
52
|
#include "SourceRevision.hpp"
|
|
54
53
|
#include "Device.hpp"
|
|
54
|
+
#include <NitroModules/AnyMap.hpp>
|
|
55
55
|
|
|
56
56
|
namespace margelo::nitro::healthkit {
|
|
57
57
|
|
|
@@ -70,14 +70,14 @@ namespace margelo::nitro::healthkit {
|
|
|
70
70
|
std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
|
|
71
71
|
std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
|
|
72
72
|
bool hasUndeterminedDuration SWIFT_PRIVATE;
|
|
73
|
-
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
74
73
|
std::string uuid SWIFT_PRIVATE;
|
|
75
74
|
SourceRevision sourceRevision SWIFT_PRIVATE;
|
|
76
75
|
std::optional<Device> device SWIFT_PRIVATE;
|
|
76
|
+
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
77
77
|
|
|
78
78
|
public:
|
|
79
79
|
ElectrocardiogramSample() = default;
|
|
80
|
-
explicit ElectrocardiogramSample(ElectrocardiogramClassification classification, ElectrocardiogramSymptomsStatus symptomsStatus, std::optional<double> averageHeartRateBpm, std::optional<double> samplingFrequencyHz, double numberOfVoltageMeasurements, std::optional<std::vector<ElectrocardiogramVoltage>> voltages, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::
|
|
80
|
+
explicit ElectrocardiogramSample(ElectrocardiogramClassification classification, ElectrocardiogramSymptomsStatus symptomsStatus, std::optional<double> averageHeartRateBpm, std::optional<double> samplingFrequencyHz, double numberOfVoltageMeasurements, std::optional<std::vector<ElectrocardiogramVoltage>> voltages, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata): classification(classification), symptomsStatus(symptomsStatus), averageHeartRateBpm(averageHeartRateBpm), samplingFrequencyHz(samplingFrequencyHz), numberOfVoltageMeasurements(numberOfVoltageMeasurements), voltages(voltages), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata) {}
|
|
81
81
|
|
|
82
82
|
public:
|
|
83
83
|
friend bool operator==(const ElectrocardiogramSample& lhs, const ElectrocardiogramSample& rhs) = default;
|
|
@@ -103,10 +103,10 @@ namespace margelo::nitro {
|
|
|
103
103
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
104
104
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
105
105
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
|
|
106
|
-
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
|
|
107
106
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
|
|
108
107
|
JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
|
|
109
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
|
|
108
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
|
|
109
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
112
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::ElectrocardiogramSample& arg) {
|
|
@@ -121,10 +121,10 @@ namespace margelo::nitro {
|
|
|
121
121
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
|
|
122
122
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
|
|
123
123
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
|
|
124
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
125
124
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
|
|
126
125
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
|
|
127
126
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
|
|
127
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
128
128
|
return obj;
|
|
129
129
|
}
|
|
130
130
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -145,10 +145,10 @@ namespace margelo::nitro {
|
|
|
145
145
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
146
146
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
147
147
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
|
|
148
|
-
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
149
148
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
|
|
150
149
|
if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
|
|
151
150
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
|
|
151
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
152
152
|
return true;
|
|
153
153
|
}
|
|
154
154
|
};
|
|
@@ -41,11 +41,11 @@ namespace margelo::nitro::healthkit { struct Device; }
|
|
|
41
41
|
#include <vector>
|
|
42
42
|
#include "SampleType.hpp"
|
|
43
43
|
#include <chrono>
|
|
44
|
-
#include <NitroModules/AnyMap.hpp>
|
|
45
44
|
#include <string>
|
|
46
45
|
#include "SourceRevision.hpp"
|
|
47
46
|
#include "Device.hpp"
|
|
48
47
|
#include <optional>
|
|
48
|
+
#include <NitroModules/AnyMap.hpp>
|
|
49
49
|
|
|
50
50
|
namespace margelo::nitro::healthkit {
|
|
51
51
|
|
|
@@ -59,14 +59,14 @@ namespace margelo::nitro::healthkit {
|
|
|
59
59
|
std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
|
|
60
60
|
std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
|
|
61
61
|
bool hasUndeterminedDuration SWIFT_PRIVATE;
|
|
62
|
-
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
63
62
|
std::string uuid SWIFT_PRIVATE;
|
|
64
63
|
SourceRevision sourceRevision SWIFT_PRIVATE;
|
|
65
64
|
std::optional<Device> device SWIFT_PRIVATE;
|
|
65
|
+
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
66
66
|
|
|
67
67
|
public:
|
|
68
68
|
HeartbeatSeriesSample() = default;
|
|
69
|
-
explicit HeartbeatSeriesSample(std::vector<Heartbeat> heartbeats, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::
|
|
69
|
+
explicit HeartbeatSeriesSample(std::vector<Heartbeat> heartbeats, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata): heartbeats(heartbeats), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata) {}
|
|
70
70
|
|
|
71
71
|
public:
|
|
72
72
|
friend bool operator==(const HeartbeatSeriesSample& lhs, const HeartbeatSeriesSample& rhs) = default;
|
|
@@ -87,10 +87,10 @@ namespace margelo::nitro {
|
|
|
87
87
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
88
88
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
89
89
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
|
|
90
|
-
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
|
|
91
90
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
|
|
92
91
|
JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
|
|
93
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
|
|
92
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
|
|
93
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::HeartbeatSeriesSample& arg) {
|
|
@@ -100,10 +100,10 @@ namespace margelo::nitro {
|
|
|
100
100
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
|
|
101
101
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
|
|
102
102
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
|
|
103
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
104
103
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
|
|
105
104
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
|
|
106
105
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
|
|
106
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
107
107
|
return obj;
|
|
108
108
|
}
|
|
109
109
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -119,10 +119,10 @@ namespace margelo::nitro {
|
|
|
119
119
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
120
120
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
121
121
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
|
|
122
|
-
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
123
122
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
|
|
124
123
|
if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
|
|
125
124
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
|
|
125
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
126
126
|
return true;
|
|
127
127
|
}
|
|
128
128
|
};
|
|
@@ -35,6 +35,7 @@ namespace margelo::nitro::healthkit {
|
|
|
35
35
|
prototype.registerHybridMethod("getRequestStatusForAuthorization", &HybridCoreModuleSpec::getRequestStatusForAuthorization);
|
|
36
36
|
prototype.registerHybridMethod("requestAuthorization", &HybridCoreModuleSpec::requestAuthorization);
|
|
37
37
|
prototype.registerHybridMethod("requestPerObjectReadAuthorization", &HybridCoreModuleSpec::requestPerObjectReadAuthorization);
|
|
38
|
+
prototype.registerHybridMethod("getEarliestAuthorizedSampleDates", &HybridCoreModuleSpec::getEarliestAuthorizedSampleDates);
|
|
38
39
|
prototype.registerHybridMethod("deleteObjects", &HybridCoreModuleSpec::deleteObjects);
|
|
39
40
|
prototype.registerHybridMethod("isObjectTypeAvailable", &HybridCoreModuleSpec::isObjectTypeAvailable);
|
|
40
41
|
prototype.registerHybridMethod("areObjectTypesAvailable", &HybridCoreModuleSpec::areObjectTypesAvailable);
|
|
@@ -58,8 +58,9 @@ namespace margelo::nitro::healthkit { enum class SampleTypeIdentifierWriteable;
|
|
|
58
58
|
#include "AuthorizationRequestStatus.hpp"
|
|
59
59
|
#include "AuthDataTypes.hpp"
|
|
60
60
|
#include "PerObjectTypeIdentifier.hpp"
|
|
61
|
-
#include
|
|
61
|
+
#include <chrono>
|
|
62
62
|
#include <unordered_map>
|
|
63
|
+
#include "SampleTypeIdentifierWriteable.hpp"
|
|
63
64
|
|
|
64
65
|
namespace margelo::nitro::healthkit {
|
|
65
66
|
|
|
@@ -113,6 +114,7 @@ namespace margelo::nitro::healthkit {
|
|
|
113
114
|
virtual std::shared_ptr<Promise<AuthorizationRequestStatus>> getRequestStatusForAuthorization(const AuthDataTypes& toCheck) = 0;
|
|
114
115
|
virtual std::shared_ptr<Promise<bool>> requestAuthorization(const AuthDataTypes& toRequest) = 0;
|
|
115
116
|
virtual std::shared_ptr<Promise<void>> requestPerObjectReadAuthorization(PerObjectTypeIdentifier typeIdentifier) = 0;
|
|
117
|
+
virtual std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>> getEarliestAuthorizedSampleDates(const std::vector<ObjectTypeIdentifier>& objectTypeIdentifiers) = 0;
|
|
116
118
|
virtual std::shared_ptr<Promise<double>> deleteObjects(SampleTypeIdentifierWriteable objectTypeIdentifier, const FilterForSamples& filter) = 0;
|
|
117
119
|
virtual bool isObjectTypeAvailable(ObjectTypeIdentifier objectTypeIdentifier) = 0;
|
|
118
120
|
virtual std::unordered_map<std::string, bool> areObjectTypesAvailable(const std::vector<ObjectTypeIdentifier>& objectTypeIdentifiers) = 0;
|
|
@@ -45,9 +45,9 @@ namespace margelo::nitro::healthkit { struct Device; }
|
|
|
45
45
|
#include <chrono>
|
|
46
46
|
#include "MedicationDoseEventLogStatus.hpp"
|
|
47
47
|
#include "SampleType.hpp"
|
|
48
|
-
#include <NitroModules/AnyMap.hpp>
|
|
49
48
|
#include "SourceRevision.hpp"
|
|
50
49
|
#include "Device.hpp"
|
|
50
|
+
#include <NitroModules/AnyMap.hpp>
|
|
51
51
|
|
|
52
52
|
namespace margelo::nitro::healthkit {
|
|
53
53
|
|
|
@@ -68,14 +68,14 @@ namespace margelo::nitro::healthkit {
|
|
|
68
68
|
std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
|
|
69
69
|
std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
|
|
70
70
|
bool hasUndeterminedDuration SWIFT_PRIVATE;
|
|
71
|
-
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
72
71
|
std::string uuid SWIFT_PRIVATE;
|
|
73
72
|
SourceRevision sourceRevision SWIFT_PRIVATE;
|
|
74
73
|
std::optional<Device> device SWIFT_PRIVATE;
|
|
74
|
+
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
75
75
|
|
|
76
76
|
public:
|
|
77
77
|
MedicationDoseEvent() = default;
|
|
78
|
-
explicit MedicationDoseEvent(MedicationDoseEventScheduleType scheduleType, std::string medicationConceptIdentifier, std::optional<std::string> medicationDisplayText, 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::
|
|
78
|
+
explicit MedicationDoseEvent(MedicationDoseEventScheduleType scheduleType, std::string medicationConceptIdentifier, std::optional<std::string> medicationDisplayText, 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::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata): scheduleType(scheduleType), medicationConceptIdentifier(medicationConceptIdentifier), medicationDisplayText(medicationDisplayText), scheduledDate(scheduledDate), scheduledDoseQuantity(scheduledDoseQuantity), doseQuantity(doseQuantity), logStatus(logStatus), unit(unit), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata) {}
|
|
79
79
|
|
|
80
80
|
public:
|
|
81
81
|
friend bool operator==(const MedicationDoseEvent& lhs, const MedicationDoseEvent& rhs) = default;
|
|
@@ -103,10 +103,10 @@ namespace margelo::nitro {
|
|
|
103
103
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
104
104
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
105
105
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
|
|
106
|
-
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
|
|
107
106
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
|
|
108
107
|
JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
|
|
109
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
|
|
108
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
|
|
109
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
112
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::MedicationDoseEvent& arg) {
|
|
@@ -123,10 +123,10 @@ namespace margelo::nitro {
|
|
|
123
123
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
|
|
124
124
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
|
|
125
125
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
|
|
126
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
127
126
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
|
|
128
127
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
|
|
129
128
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
|
|
129
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
130
130
|
return obj;
|
|
131
131
|
}
|
|
132
132
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -149,10 +149,10 @@ namespace margelo::nitro {
|
|
|
149
149
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
150
150
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
151
151
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
|
|
152
|
-
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
153
152
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
|
|
154
153
|
if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
|
|
155
154
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
|
|
155
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
156
156
|
return true;
|
|
157
157
|
}
|
|
158
158
|
};
|
|
@@ -191,51 +191,52 @@ namespace margelo::nitro::healthkit {
|
|
|
191
191
|
HKQUANTITYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSURE SWIFT_NAME(hkquantitytypeidentifierheadphoneaudioexposure) = 159,
|
|
192
192
|
HKQUANTITYTYPEIDENTIFIERHEARTRATE SWIFT_NAME(hkquantitytypeidentifierheartrate) = 160,
|
|
193
193
|
HKQUANTITYTYPEIDENTIFIERHEARTRATERECOVERYONEMINUTE SWIFT_NAME(hkquantitytypeidentifierheartraterecoveryoneminute) = 161,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
194
|
+
HKQUANTITYTYPEIDENTIFIERHEARTRATEVARIABILITYRMSSD SWIFT_NAME(hkquantitytypeidentifierheartratevariabilityrmssd) = 162,
|
|
195
|
+
HKQUANTITYTYPEIDENTIFIERHEARTRATEVARIABILITYSDNN SWIFT_NAME(hkquantitytypeidentifierheartratevariabilitysdnn) = 163,
|
|
196
|
+
HKQUANTITYTYPEIDENTIFIERHEIGHT SWIFT_NAME(hkquantitytypeidentifierheight) = 164,
|
|
197
|
+
HKQUANTITYTYPEIDENTIFIERINHALERUSAGE SWIFT_NAME(hkquantitytypeidentifierinhalerusage) = 165,
|
|
198
|
+
HKQUANTITYTYPEIDENTIFIERINSULINDELIVERY SWIFT_NAME(hkquantitytypeidentifierinsulindelivery) = 166,
|
|
199
|
+
HKQUANTITYTYPEIDENTIFIERLEANBODYMASS SWIFT_NAME(hkquantitytypeidentifierleanbodymass) = 167,
|
|
200
|
+
HKQUANTITYTYPEIDENTIFIERNIKEFUEL SWIFT_NAME(hkquantitytypeidentifiernikefuel) = 168,
|
|
201
|
+
HKQUANTITYTYPEIDENTIFIERNUMBEROFALCOHOLICBEVERAGES SWIFT_NAME(hkquantitytypeidentifiernumberofalcoholicbeverages) = 169,
|
|
202
|
+
HKQUANTITYTYPEIDENTIFIERNUMBEROFTIMESFALLEN SWIFT_NAME(hkquantitytypeidentifiernumberoftimesfallen) = 170,
|
|
203
|
+
HKQUANTITYTYPEIDENTIFIEROXYGENSATURATION SWIFT_NAME(hkquantitytypeidentifieroxygensaturation) = 171,
|
|
204
|
+
HKQUANTITYTYPEIDENTIFIERPADDLESPORTSSPEED SWIFT_NAME(hkquantitytypeidentifierpaddlesportsspeed) = 172,
|
|
205
|
+
HKQUANTITYTYPEIDENTIFIERPEAKEXPIRATORYFLOWRATE SWIFT_NAME(hkquantitytypeidentifierpeakexpiratoryflowrate) = 173,
|
|
206
|
+
HKQUANTITYTYPEIDENTIFIERPERIPHERALPERFUSIONINDEX SWIFT_NAME(hkquantitytypeidentifierperipheralperfusionindex) = 174,
|
|
207
|
+
HKQUANTITYTYPEIDENTIFIERPHYSICALEFFORT SWIFT_NAME(hkquantitytypeidentifierphysicaleffort) = 175,
|
|
208
|
+
HKQUANTITYTYPEIDENTIFIERPUSHCOUNT SWIFT_NAME(hkquantitytypeidentifierpushcount) = 176,
|
|
209
|
+
HKQUANTITYTYPEIDENTIFIERRESPIRATORYRATE SWIFT_NAME(hkquantitytypeidentifierrespiratoryrate) = 177,
|
|
210
|
+
HKQUANTITYTYPEIDENTIFIERRESTINGHEARTRATE SWIFT_NAME(hkquantitytypeidentifierrestingheartrate) = 178,
|
|
211
|
+
HKQUANTITYTYPEIDENTIFIERROWINGSPEED SWIFT_NAME(hkquantitytypeidentifierrowingspeed) = 179,
|
|
212
|
+
HKQUANTITYTYPEIDENTIFIERRUNNINGGROUNDCONTACTTIME SWIFT_NAME(hkquantitytypeidentifierrunninggroundcontacttime) = 180,
|
|
213
|
+
HKQUANTITYTYPEIDENTIFIERRUNNINGPOWER SWIFT_NAME(hkquantitytypeidentifierrunningpower) = 181,
|
|
214
|
+
HKQUANTITYTYPEIDENTIFIERRUNNINGSPEED SWIFT_NAME(hkquantitytypeidentifierrunningspeed) = 182,
|
|
215
|
+
HKQUANTITYTYPEIDENTIFIERRUNNINGSTRIDELENGTH SWIFT_NAME(hkquantitytypeidentifierrunningstridelength) = 183,
|
|
216
|
+
HKQUANTITYTYPEIDENTIFIERRUNNINGVERTICALOSCILLATION SWIFT_NAME(hkquantitytypeidentifierrunningverticaloscillation) = 184,
|
|
217
|
+
HKQUANTITYTYPEIDENTIFIERSIXMINUTEWALKTESTDISTANCE SWIFT_NAME(hkquantitytypeidentifiersixminutewalktestdistance) = 185,
|
|
218
|
+
HKQUANTITYTYPEIDENTIFIERSTAIRASCENTSPEED SWIFT_NAME(hkquantitytypeidentifierstairascentspeed) = 186,
|
|
219
|
+
HKQUANTITYTYPEIDENTIFIERSTAIRDESCENTSPEED SWIFT_NAME(hkquantitytypeidentifierstairdescentspeed) = 187,
|
|
220
|
+
HKQUANTITYTYPEIDENTIFIERSTEPCOUNT SWIFT_NAME(hkquantitytypeidentifierstepcount) = 188,
|
|
221
|
+
HKQUANTITYTYPEIDENTIFIERSWIMMINGSTROKECOUNT SWIFT_NAME(hkquantitytypeidentifierswimmingstrokecount) = 189,
|
|
222
|
+
HKQUANTITYTYPEIDENTIFIERTIMEINDAYLIGHT SWIFT_NAME(hkquantitytypeidentifiertimeindaylight) = 190,
|
|
223
|
+
HKQUANTITYTYPEIDENTIFIERUNDERWATERDEPTH SWIFT_NAME(hkquantitytypeidentifierunderwaterdepth) = 191,
|
|
224
|
+
HKQUANTITYTYPEIDENTIFIERUVEXPOSURE SWIFT_NAME(hkquantitytypeidentifieruvexposure) = 192,
|
|
225
|
+
HKQUANTITYTYPEIDENTIFIERVO2MAX SWIFT_NAME(hkquantitytypeidentifiervo2max) = 193,
|
|
226
|
+
HKQUANTITYTYPEIDENTIFIERWAISTCIRCUMFERENCE SWIFT_NAME(hkquantitytypeidentifierwaistcircumference) = 194,
|
|
227
|
+
HKQUANTITYTYPEIDENTIFIERWALKINGASYMMETRYPERCENTAGE SWIFT_NAME(hkquantitytypeidentifierwalkingasymmetrypercentage) = 195,
|
|
228
|
+
HKQUANTITYTYPEIDENTIFIERWALKINGDOUBLESUPPORTPERCENTAGE SWIFT_NAME(hkquantitytypeidentifierwalkingdoublesupportpercentage) = 196,
|
|
229
|
+
HKQUANTITYTYPEIDENTIFIERWALKINGSPEED SWIFT_NAME(hkquantitytypeidentifierwalkingspeed) = 197,
|
|
230
|
+
HKQUANTITYTYPEIDENTIFIERWALKINGSTEPLENGTH SWIFT_NAME(hkquantitytypeidentifierwalkingsteplength) = 198,
|
|
231
|
+
HKQUANTITYTYPEIDENTIFIERWATERTEMPERATURE SWIFT_NAME(hkquantitytypeidentifierwatertemperature) = 199,
|
|
232
|
+
HKQUANTITYTYPEIDENTIFIERWORKOUTEFFORTSCORE SWIFT_NAME(hkquantitytypeidentifierworkouteffortscore) = 200,
|
|
233
|
+
HKSTATEOFMINDTYPEIDENTIFIER SWIFT_NAME(hkstateofmindtypeidentifier) = 201,
|
|
234
|
+
HKAUDIOGRAMSAMPLETYPE SWIFT_NAME(hkaudiogramsampletype) = 202,
|
|
235
|
+
HKDATATYPEIDENTIFIERHEARTBEATSERIES SWIFT_NAME(hkdatatypeidentifierheartbeatseries) = 203,
|
|
236
|
+
HKWORKOUTROUTETYPEIDENTIFIER SWIFT_NAME(hkworkoutroutetypeidentifier) = 204,
|
|
237
|
+
HKWORKOUTTYPEIDENTIFIER SWIFT_NAME(hkworkouttypeidentifier) = 205,
|
|
238
|
+
HKELECTROCARDIOGRAMTYPE SWIFT_NAME(hkelectrocardiogramtype) = 206,
|
|
239
|
+
HKACTIVITYSUMMARYTYPEIDENTIFIER SWIFT_NAME(hkactivitysummarytypeidentifier) = 207,
|
|
239
240
|
} CLOSED_ENUM;
|
|
240
241
|
|
|
241
242
|
} // namespace margelo::nitro::healthkit
|
|
@@ -410,6 +411,7 @@ namespace margelo::nitro {
|
|
|
410
411
|
case hashString("HKQuantityTypeIdentifierHeadphoneAudioExposure"): return margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSURE;
|
|
411
412
|
case hashString("HKQuantityTypeIdentifierHeartRate"): return margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEARTRATE;
|
|
412
413
|
case hashString("HKQuantityTypeIdentifierHeartRateRecoveryOneMinute"): return margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEARTRATERECOVERYONEMINUTE;
|
|
414
|
+
case hashString("HKQuantityTypeIdentifierHeartRateVariabilityRMSSD"): return margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEARTRATEVARIABILITYRMSSD;
|
|
413
415
|
case hashString("HKQuantityTypeIdentifierHeartRateVariabilitySDNN"): return margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEARTRATEVARIABILITYSDNN;
|
|
414
416
|
case hashString("HKQuantityTypeIdentifierHeight"): return margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEIGHT;
|
|
415
417
|
case hashString("HKQuantityTypeIdentifierInhalerUsage"): return margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERINHALERUSAGE;
|
|
@@ -623,6 +625,7 @@ namespace margelo::nitro {
|
|
|
623
625
|
case margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSURE: return JSIConverter<std::string>::toJSI(runtime, "HKQuantityTypeIdentifierHeadphoneAudioExposure");
|
|
624
626
|
case margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEARTRATE: return JSIConverter<std::string>::toJSI(runtime, "HKQuantityTypeIdentifierHeartRate");
|
|
625
627
|
case margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEARTRATERECOVERYONEMINUTE: return JSIConverter<std::string>::toJSI(runtime, "HKQuantityTypeIdentifierHeartRateRecoveryOneMinute");
|
|
628
|
+
case margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEARTRATEVARIABILITYRMSSD: return JSIConverter<std::string>::toJSI(runtime, "HKQuantityTypeIdentifierHeartRateVariabilityRMSSD");
|
|
626
629
|
case margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEARTRATEVARIABILITYSDNN: return JSIConverter<std::string>::toJSI(runtime, "HKQuantityTypeIdentifierHeartRateVariabilitySDNN");
|
|
627
630
|
case margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERHEIGHT: return JSIConverter<std::string>::toJSI(runtime, "HKQuantityTypeIdentifierHeight");
|
|
628
631
|
case margelo::nitro::healthkit::ObjectTypeIdentifier::HKQUANTITYTYPEIDENTIFIERINHALERUSAGE: return JSIConverter<std::string>::toJSI(runtime, "HKQuantityTypeIdentifierInhalerUsage");
|
|
@@ -841,6 +844,7 @@ namespace margelo::nitro {
|
|
|
841
844
|
case hashString("HKQuantityTypeIdentifierHeadphoneAudioExposure"):
|
|
842
845
|
case hashString("HKQuantityTypeIdentifierHeartRate"):
|
|
843
846
|
case hashString("HKQuantityTypeIdentifierHeartRateRecoveryOneMinute"):
|
|
847
|
+
case hashString("HKQuantityTypeIdentifierHeartRateVariabilityRMSSD"):
|
|
844
848
|
case hashString("HKQuantityTypeIdentifierHeartRateVariabilitySDNN"):
|
|
845
849
|
case hashString("HKQuantityTypeIdentifierHeight"):
|
|
846
850
|
case hashString("HKQuantityTypeIdentifierInhalerUsage"):
|
|
@@ -41,10 +41,10 @@ namespace margelo::nitro::healthkit { struct Device; }
|
|
|
41
41
|
#include <string>
|
|
42
42
|
#include "SampleType.hpp"
|
|
43
43
|
#include <chrono>
|
|
44
|
-
#include <NitroModules/AnyMap.hpp>
|
|
45
44
|
#include "SourceRevision.hpp"
|
|
46
45
|
#include "Device.hpp"
|
|
47
46
|
#include <optional>
|
|
47
|
+
#include <NitroModules/AnyMap.hpp>
|
|
48
48
|
|
|
49
49
|
namespace margelo::nitro::healthkit {
|
|
50
50
|
|
|
@@ -60,14 +60,14 @@ namespace margelo::nitro::healthkit {
|
|
|
60
60
|
std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
|
|
61
61
|
std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
|
|
62
62
|
bool hasUndeterminedDuration SWIFT_PRIVATE;
|
|
63
|
-
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
64
63
|
std::string uuid SWIFT_PRIVATE;
|
|
65
64
|
SourceRevision sourceRevision SWIFT_PRIVATE;
|
|
66
65
|
std::optional<Device> device SWIFT_PRIVATE;
|
|
66
|
+
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
67
67
|
|
|
68
68
|
public:
|
|
69
69
|
QuantitySample() = default;
|
|
70
|
-
explicit QuantitySample(QuantityTypeIdentifier quantityType, double quantity, std::string unit, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::
|
|
70
|
+
explicit QuantitySample(QuantityTypeIdentifier quantityType, double quantity, std::string unit, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata): quantityType(quantityType), quantity(quantity), unit(unit), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata) {}
|
|
71
71
|
|
|
72
72
|
public:
|
|
73
73
|
friend bool operator==(const QuantitySample& lhs, const QuantitySample& rhs) = default;
|
|
@@ -90,10 +90,10 @@ namespace margelo::nitro {
|
|
|
90
90
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
91
91
|
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
92
92
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
|
|
93
|
-
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
|
|
94
93
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
|
|
95
94
|
JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
|
|
96
|
-
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
|
|
95
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
|
|
96
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QuantitySample& arg) {
|
|
@@ -105,10 +105,10 @@ namespace margelo::nitro {
|
|
|
105
105
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
|
|
106
106
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
|
|
107
107
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
|
|
108
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
109
108
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
|
|
110
109
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
|
|
111
110
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
|
|
111
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
112
112
|
return obj;
|
|
113
113
|
}
|
|
114
114
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -126,10 +126,10 @@ namespace margelo::nitro {
|
|
|
126
126
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
127
127
|
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
128
128
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
|
|
129
|
-
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
130
129
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
|
|
131
130
|
if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
|
|
132
131
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
|
|
132
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
133
133
|
return true;
|
|
134
134
|
}
|
|
135
135
|
};
|