hypertrack-sdk-react-native 11.0.0 → 11.0.1
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/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
4
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
-
## [11.0.
|
|
6
|
+
## [11.0.1] - 2023-09-20
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- Fixed setting wrong object format for `setMetadata()`
|
|
11
|
+
|
|
12
|
+
## [11.0.0] - 2023-09-14
|
|
7
13
|
|
|
8
14
|
### Added
|
|
9
15
|
|
|
@@ -31,27 +31,16 @@ func getDeviceID() -> Result<SuccessResult, FailureResult> {
|
|
|
31
31
|
.success(.dict(serializeDeviceID(HyperTrack.deviceID)))
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
func
|
|
35
|
-
.success(.
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
func setName(_ args: [String: Any]) -> Result<SuccessResult, FailureResult> {
|
|
39
|
-
deserializeName(args).flatMap { (name: String) in
|
|
40
|
-
.success(asVoid(HyperTrack.name = name))
|
|
41
|
-
}
|
|
34
|
+
func getErrors() -> Result<SuccessResult, FailureResult> {
|
|
35
|
+
.success(.array(serializeErrors(HyperTrack.errors)))
|
|
42
36
|
}
|
|
43
37
|
|
|
44
38
|
func getMetadata() -> Result<SuccessResult, FailureResult> {
|
|
45
39
|
.success(.dict(serializeMetadata(HyperTrack.metadata)))
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
func
|
|
49
|
-
|
|
50
|
-
HyperTrack.metadata = metadata
|
|
51
|
-
return .success(.void)
|
|
52
|
-
} else {
|
|
53
|
-
return .failure(.error("Failed to deserialize metadata"))
|
|
54
|
-
}
|
|
42
|
+
func getName() -> Result<SuccessResult, FailureResult> {
|
|
43
|
+
.success(.dict(serializeName(HyperTrack.name)))
|
|
55
44
|
}
|
|
56
45
|
|
|
57
46
|
func getLocation() -> Result<SuccessResult, FailureResult> {
|
|
@@ -80,8 +69,21 @@ func setIsTracking(_ args: [String: Any]) -> Result<SuccessResult, FailureResult
|
|
|
80
69
|
}
|
|
81
70
|
}
|
|
82
71
|
|
|
83
|
-
func
|
|
84
|
-
|
|
72
|
+
func setMetadata(_ args: [String: Any]) -> Result<SuccessResult, FailureResult> {
|
|
73
|
+
deserializeMetadata(args).flatMap { map in
|
|
74
|
+
if let metadata = toJSON(map) {
|
|
75
|
+
HyperTrack.metadata = metadata
|
|
76
|
+
return .success(.void)
|
|
77
|
+
} else {
|
|
78
|
+
return .failure(.error("Failed to deserialize metadata"))
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
func setName(_ args: [String: Any]) -> Result<SuccessResult, FailureResult> {
|
|
84
|
+
deserializeName(args).flatMap { name in
|
|
85
|
+
.success(asVoid(HyperTrack.name = name))
|
|
86
|
+
}
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
func asVoid(_: Void) -> SuccessResult {
|
|
@@ -69,6 +69,16 @@ func deserializeLocation(_ data: [String: Any]) -> Result<HyperTrack.Location, F
|
|
|
69
69
|
return .success(.init(latitude: latitude, longitude: longitude))
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
func deserializeMetadata(_ data: [String: Any]) -> Result<[String: Any], FailureResult> {
|
|
73
|
+
if data[keyType] as? String != typeMetadata {
|
|
74
|
+
return .failure(.fatalError(getParseError(data, key: keyType)))
|
|
75
|
+
}
|
|
76
|
+
guard let value = data[keyValue] as? [String: Any] else {
|
|
77
|
+
return .failure(.fatalError(getParseError(data, key: keyValue)))
|
|
78
|
+
}
|
|
79
|
+
return .success(value)
|
|
80
|
+
}
|
|
81
|
+
|
|
72
82
|
func deserializeName(_ data: [String: Any]) -> Result<String, FailureResult> {
|
|
73
83
|
if data[keyType] as? String != typeName {
|
|
74
84
|
return .failure(.fatalError(getParseError(data, key: keyType)))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hypertrack-sdk-react-native",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "React Native HyperTrack SDK is a wrapper around native iOS and Android SDKs that allows to integrate HyperTrack into React Native apps.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|