@procivis/react-native-one-core 1.41710.0 → 1.43299.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/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +1 -1
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +37 -4
- package/android/src/main/java/ch/procivis/one/core/Serialize.kt +3 -1
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +13 -0
- package/core-sdk.json +6 -6
- package/dist/src/config.d.ts +3 -1
- package/dist/src/core.d.ts +9 -3
- package/dist/src/core.js +5 -0
- package/dist/src/credential.d.ts +6 -2
- package/dist/src/history.d.ts +5 -2
- package/dist/src/history.js +3 -0
- package/dist/src/identifier.d.ts +132 -0
- package/dist/src/identifier.js +29 -0
- package/dist/src/proof.d.ts +9 -4
- package/ios/Deserialize.swift +140 -813
- package/ios/EventEmitter.swift +84 -72
- package/ios/ProcivisOneCoreModule.m +19 -1
- package/ios/ProcivisOneCoreModule.swift +986 -806
- package/ios/ProcivisRNOneCore.xcodeproj/project.pbxproj +9 -1
- package/ios/RNDecoder/RNDecoder.swift +191 -0
- package/ios/RNDecoder/RNDecodingStorage.swift +33 -0
- package/ios/RNDecoder/RNKeyedDecodingContainer.swift +133 -0
- package/ios/RNDecoder/RNUnkeyedDecodingContainer.swift +175 -0
- package/ios/RNEncoder/RNAnyCodingKey.swift +31 -0
- package/ios/RNEncoder/RNEncoder.swift +95 -0
- package/ios/RNEncoder/RNKeyedEncodingContainer.swift +81 -0
- package/ios/RNEncoder/RNSingleValueEncodingContainer.swift +78 -0
- package/ios/RNEncoder/RNUnkeyedEncodingContainer.swift +84 -0
- package/ios/Serialize.swift +43 -613
- package/ios/Util.swift +35 -25
- package/package.json +2 -2
package/ios/Util.swift
CHANGED
|
@@ -9,36 +9,46 @@ import Foundation
|
|
|
9
9
|
import ProcivisOneCore
|
|
10
10
|
|
|
11
11
|
// Error handling
|
|
12
|
-
func syncCall<Result>(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
func syncCall<Result>(
|
|
13
|
+
_ resolve: @escaping RCTPromiseResolveBlock,
|
|
14
|
+
_ reject: @escaping RCTPromiseRejectBlock,
|
|
15
|
+
_ function: () throws -> Result
|
|
16
|
+
) {
|
|
17
|
+
do {
|
|
18
|
+
resolve(try function())
|
|
19
|
+
} catch {
|
|
20
|
+
handleError(error: error, reject)
|
|
21
|
+
}
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
func asyncCall<Result>(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
func asyncCall<Result>(
|
|
25
|
+
_ resolve: @escaping RCTPromiseResolveBlock,
|
|
26
|
+
_ reject: @escaping RCTPromiseRejectBlock,
|
|
27
|
+
_ function: @escaping () async throws -> Result
|
|
28
|
+
) {
|
|
29
|
+
Task {
|
|
30
|
+
do {
|
|
31
|
+
resolve(try await function())
|
|
32
|
+
} catch {
|
|
33
|
+
handleError(error: error, reject)
|
|
29
34
|
}
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
private func handleError(error: Error, _ reject: @escaping RCTPromiseRejectBlock) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
reject(errorResponse.code, errorResponse.message, NSError(domain: "one-core", code: 1, userInfo: userInfo))
|
|
40
|
-
return
|
|
39
|
+
if case BindingError.ErrorResponse(data: let errorResponse) = error {
|
|
40
|
+
var userInfo: [String: Any] = [NSUnderlyingErrorKey: error]
|
|
41
|
+
if let cause = errorResponse.cause?.message {
|
|
42
|
+
userInfo["cause"] = cause
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
reject(
|
|
44
|
+
|
|
45
|
+
reject(
|
|
46
|
+
errorResponse.code,
|
|
47
|
+
errorResponse.message,
|
|
48
|
+
NSError(domain: "one-core", code: 1, userInfo: userInfo)
|
|
49
|
+
)
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
reject("UnknownError", String(describing: error), error)
|
|
44
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procivis/react-native-one-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43299.1",
|
|
4
4
|
"author": "Procivis AG (https://procivis.ch)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "ONE core bindings for React Native",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.21.0",
|
|
33
33
|
"@babel/preset-env": "^7.20.2",
|
|
34
|
-
"react-native": "0.72.17",
|
|
35
34
|
"babel-jest": "^29.5.0",
|
|
36
35
|
"husky": "^7.0.4",
|
|
37
36
|
"jest": "^29.5.0",
|
|
37
|
+
"react-native": "0.72.17",
|
|
38
38
|
"typescript": "^5.1.6"
|
|
39
39
|
},
|
|
40
40
|
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
|