@procivis/react-native-one-core 1.26999.0 → 1.41710.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 +71 -40
- package/android/build.gradle +46 -10
- package/android/build.gradle_opensource +121 -0
- package/android/libs/core-reactnative-compatible-2025.0305.1.aar +0 -0
- package/android/src/main/AndroidManifest.xml +5 -2
- package/android/src/main/java/ch/procivis/one/core/Deserialize.kt +10 -6
- package/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +13 -5
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +251 -79
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCorePackage.kt +3 -4
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +13 -1
- package/android/src/main/java/ch/procivis/one/core/Util.kt +42 -10
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadRunner.kt +123 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt +23 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt_opensource +20 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadWrapper.kt +396 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/RegistrationManager.kt +59 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/TokenManager.kt +48 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +256 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt_opensource +51 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/Util.kt +74 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityRequest.kt +9 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityResponse.kt +9 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/RegisterRSEResponse.kt +10 -0
- package/core-sdk.json +6 -6
- package/dist/index.d.ts +10 -8
- package/dist/index.js +31 -25
- package/dist/src/cache.d.ts +8 -0
- package/dist/src/cache.js +9 -0
- package/dist/src/config.d.ts +39 -6
- package/dist/src/config.js +19 -0
- package/dist/src/core.d.ts +24 -8
- package/dist/src/core.js +68 -0
- package/dist/src/credential.d.ts +15 -1
- package/dist/src/credential.js +5 -0
- package/dist/src/credentialSchema.d.ts +5 -2
- package/dist/src/credentialSchema.js +2 -0
- package/dist/src/did.d.ts +9 -5
- package/dist/src/error.d.ts +10 -17
- package/dist/src/error.js +5 -14
- package/dist/src/history.d.ts +19 -5
- package/dist/src/history.js +10 -2
- package/dist/src/key.d.ts +3 -0
- package/dist/src/organisation.d.ts +8 -0
- package/dist/src/organisation.js +1 -0
- package/dist/src/proof.d.ts +29 -2
- package/dist/src/proof.js +13 -0
- package/dist/src/proofSchema.d.ts +2 -0
- package/dist/src/trust.d.ts +85 -19
- package/dist/src/trust.js +28 -7
- package/dist/src/ubiqu.d.ts +49 -0
- package/dist/src/ubiqu.js +69 -0
- package/ios/Deserialize.swift +203 -24
- package/ios/EventEmitter.swift +79 -0
- package/ios/ProcivisOneCoreModule.m +74 -6
- package/ios/ProcivisOneCoreModule.swift +312 -88
- package/ios/ProcivisRNOneCore.xcodeproj/project.pbxproj +28 -26
- package/ios/RSEKeyStorage.swift +587 -0
- package/ios/RSEKeyStorage.swift_opensource +49 -0
- package/ios/RSEPinPad.swift +74 -0
- package/ios/RSEPinPad.swift_opensource +21 -0
- package/ios/RSEPinPadManager.m +19 -0
- package/ios/Serialize.swift +105 -28
- package/ios/UBQKit.xcframework/Info.plist +44 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Assets.car +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFCompatibilityMacros.h +37 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFHTTPSessionManager.h +304 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +216 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworking.h +41 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +16 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFSecurityPolicy.h +156 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLRequestSerialization.h +479 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLResponseSerialization.h +310 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLSessionManager.h +501 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/CardRequestProtocol.h +72 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Constants.h +222 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DeviceBindProtocol.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DomainSecurityModule.h +43 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ErrorDomains.h +68 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/FreeAssetProtocol.h +40 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/GDataXMLNode.h +214 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSDictionary+Utilities.h +23 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSFileManager+Utilities.h +20 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSString+Utilities.h +23 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSURL+Utilities.h +12 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ProtocolBase.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ResetPinProtocol.h +45 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Settings.h +120 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequest.h +58 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +37 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +34 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +28 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +35 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +31 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +34 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit-Swift.h +761 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit.h +56 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQPacket.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Info.plist +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.abi.json +89006 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.private.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/module.modulemap +11 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/UBQKit +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/_CodeSignature/CodeResources +597 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/certs +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/checksums +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/pinning_pub +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/static +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/stream +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Assets.car +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFCompatibilityMacros.h +37 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFHTTPSessionManager.h +304 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +216 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworking.h +41 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +16 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFSecurityPolicy.h +156 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLRequestSerialization.h +479 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLResponseSerialization.h +310 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLSessionManager.h +501 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/CardRequestProtocol.h +72 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Constants.h +222 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DeviceBindProtocol.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DomainSecurityModule.h +43 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ErrorDomains.h +68 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/FreeAssetProtocol.h +40 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/GDataXMLNode.h +214 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSDictionary+Utilities.h +23 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSFileManager+Utilities.h +20 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSString+Utilities.h +23 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSURL+Utilities.h +12 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ProtocolBase.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ResetPinProtocol.h +45 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Settings.h +120 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequest.h +58 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +37 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +34 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +28 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +35 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +31 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +34 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit-Swift.h +1522 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit.h +56 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQPacket.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Info.plist +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.abi.json +89006 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +89006 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/module.modulemap +11 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/UBQKit +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/_CodeSignature/CodeResources +652 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/certs +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/checksums +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/pinning_pub +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/static +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/stream +0 -0
- package/ios/Util.swift +21 -24
- package/package.json +4 -3
- package/react-native-one-core.podspec +4 -5
|
@@ -5,57 +5,44 @@
|
|
|
5
5
|
//
|
|
6
6
|
|
|
7
7
|
import Foundation
|
|
8
|
+
import React
|
|
9
|
+
import ProcivisOneCore
|
|
8
10
|
|
|
9
11
|
@objc(ProcivisOneCoreModule)
|
|
10
|
-
class ProcivisOneCoreModule:
|
|
11
|
-
private static let TAG = "ProcivisOneCoreModule"
|
|
12
|
-
private var core: OneCoreBindingProtocol? = nil
|
|
12
|
+
class ProcivisOneCoreModule: RCTEventEmitter {
|
|
13
|
+
private static let TAG = "ProcivisOneCoreModule"
|
|
14
|
+
private var core: OneCoreBindingProtocol? = nil
|
|
15
|
+
private var rseKeyStorage: NativeKeyStorage? = nil
|
|
13
16
|
|
|
14
|
-
@objc(
|
|
15
|
-
func
|
|
17
|
+
@objc(initialize:resolver:rejecter:)
|
|
18
|
+
func initialize(
|
|
19
|
+
configJson: String,
|
|
16
20
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
17
21
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
18
|
-
|
|
22
|
+
ProcivisOneCoreEventEmitter.shared.eventEmitter = self
|
|
23
|
+
syncCall(resolve, reject) {
|
|
19
24
|
guard let dataDirPath = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).first else {
|
|
20
|
-
throw BindingError.
|
|
25
|
+
throw BindingError.ErrorResponse(data: ErrorResponseBindingDto(code: "BR_0000", message: "invalid DataDir", cause: nil))
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
// create folder if not exists
|
|
24
29
|
try FileManager.default.createDirectory(atPath: dataDirPath, withIntermediateDirectories: true)
|
|
25
30
|
|
|
26
|
-
if (core != nil) {
|
|
27
|
-
throw BindingError.
|
|
31
|
+
if (self.core != nil) {
|
|
32
|
+
throw BindingError.ErrorResponse(data: ErrorResponseBindingDto(code: "BR_0183", message: "core already initialized", cause: nil))
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@objc(initializeVerifier:rejecter:)
|
|
36
|
-
func initializeVerifier(
|
|
37
|
-
resolve: @escaping RCTPromiseResolveBlock,
|
|
38
|
-
reject: @escaping RCTPromiseRejectBlock) {
|
|
39
|
-
asyncCall(resolve, reject) {
|
|
40
|
-
guard let dataDirPath = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).first else {
|
|
41
|
-
throw BindingError.Unknown(message: "invalid DataDir")
|
|
35
|
+
if (RSEKeyStorage.available) {
|
|
36
|
+
rseKeyStorage = RSEKeyStorage()
|
|
42
37
|
}
|
|
43
|
-
|
|
44
|
-
// create folder if not exists
|
|
45
|
-
try FileManager.default.createDirectory(atPath: dataDirPath, withIntermediateDirectories: true)
|
|
46
|
-
|
|
47
|
-
if (core != nil) {
|
|
48
|
-
throw BindingError.Unknown(message: "core already initialized")
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
core = try initializeVerifierCore(dataDirPath: dataDirPath, keyStorage: SecureEnclaveKeyStorage(), bleCentral: IOSBLECentral(), blePeripheral: IOSBLEPeripheral());
|
|
38
|
+
self.core = try initializeCore(configJson: configJson, dataDirPath: dataDirPath, nativeSecureElement: SecureEnclaveKeyStorage(), remoteSecureElement: rseKeyStorage, bleCentral: IOSBLECentral(), blePeripheral: IOSBLEPeripheral());
|
|
52
39
|
return nil as NSDictionary?;
|
|
53
40
|
}
|
|
54
41
|
}
|
|
55
42
|
|
|
56
43
|
private func getCore() throws -> OneCoreBindingProtocol {
|
|
57
44
|
guard let result = core else {
|
|
58
|
-
throw BindingError.
|
|
45
|
+
throw BindingError.ErrorResponse(data: ErrorResponseBindingDto(code: "BR_0184", message: "core not initialized", cause: nil))
|
|
59
46
|
}
|
|
60
47
|
return result
|
|
61
48
|
}
|
|
@@ -64,7 +51,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
64
51
|
func getVersion(
|
|
65
52
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
66
53
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
67
|
-
|
|
54
|
+
syncCall(resolve, reject) {
|
|
68
55
|
let version = try getCore().version();
|
|
69
56
|
return serialize(version: version)
|
|
70
57
|
}
|
|
@@ -75,20 +62,29 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
75
62
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
76
63
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
77
64
|
asyncCall(resolve, reject) {
|
|
78
|
-
let config = try getCore().getConfig();
|
|
65
|
+
let config = try await self.getCore().getConfig();
|
|
79
66
|
return serialize(config: config)
|
|
80
67
|
}
|
|
81
68
|
}
|
|
82
69
|
|
|
83
|
-
|
|
84
|
-
|
|
85
70
|
@objc(createOrganisation:resolver:rejecter:)
|
|
86
71
|
func createOrganisation(
|
|
87
|
-
|
|
72
|
+
request: NSDictionary,
|
|
88
73
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
89
74
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
90
75
|
asyncCall(resolve, reject) {
|
|
91
|
-
return try getCore().createOrganisation(
|
|
76
|
+
return try await self.getCore().createOrganisation(request: deserializeCreateOrganisationRequest(request: request));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@objc(upsertOrganisation:resolver:rejecter:)
|
|
81
|
+
func upsertOrganisation(
|
|
82
|
+
request: NSDictionary,
|
|
83
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
84
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
85
|
+
asyncCall(resolve, reject) {
|
|
86
|
+
try await self.getCore().upsertOrganisation(request: deserializeUpsertOrganisationRequest(request: request));
|
|
87
|
+
return nil as NSDictionary?;
|
|
92
88
|
}
|
|
93
89
|
}
|
|
94
90
|
|
|
@@ -98,7 +94,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
98
94
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
99
95
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
100
96
|
asyncCall(resolve, reject) {
|
|
101
|
-
return try getCore().generateKey(request: deserializeKeyRequest(keyRequest: keyRequest));
|
|
97
|
+
return try await self.getCore().generateKey(request: deserializeKeyRequest(keyRequest: keyRequest));
|
|
102
98
|
}
|
|
103
99
|
}
|
|
104
100
|
|
|
@@ -108,7 +104,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
108
104
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
109
105
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
110
106
|
asyncCall(resolve, reject) {
|
|
111
|
-
return try getCore().createDid(request: deserializeDidRequest(didRequest: didRequest));
|
|
107
|
+
return try await self.getCore().createDid(request: deserializeDidRequest(didRequest: didRequest));
|
|
112
108
|
}
|
|
113
109
|
}
|
|
114
110
|
|
|
@@ -119,7 +115,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
119
115
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
120
116
|
asyncCall(resolve, reject) {
|
|
121
117
|
let listQuery = try deserializeDidListQuery(query);
|
|
122
|
-
let result = try getCore().getDids(query: listQuery);
|
|
118
|
+
let result = try await self.getCore().getDids(query: listQuery);
|
|
123
119
|
return serialize(didList: result)
|
|
124
120
|
}
|
|
125
121
|
}
|
|
@@ -133,20 +129,21 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
133
129
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
134
130
|
asyncCall(resolve, reject) {
|
|
135
131
|
let transport = (transport != nil) ? try deserializeIds(transport!) : nil;
|
|
136
|
-
let result = try getCore().handleInvitation(url: url, organisationId: organisationId, transport: transport);
|
|
132
|
+
let result = try await self.getCore().handleInvitation(url: url, organisationId: organisationId, transport: transport);
|
|
137
133
|
return serialize(invitationResponse: result)
|
|
138
134
|
}
|
|
139
135
|
}
|
|
140
136
|
|
|
141
|
-
@objc(holderAcceptCredential:didId:keyId:resolver:rejecter:)
|
|
137
|
+
@objc(holderAcceptCredential:didId:keyId:txCode:resolver:rejecter:)
|
|
142
138
|
func holderAcceptCredential(
|
|
143
139
|
interactionId: String,
|
|
144
140
|
didId: String,
|
|
145
141
|
keyId: String?,
|
|
142
|
+
txCode: String?,
|
|
146
143
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
147
144
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
148
145
|
asyncCall(resolve, reject) {
|
|
149
|
-
try getCore().holderAcceptCredential(interactionId: interactionId, didId: didId, keyId: keyId);
|
|
146
|
+
try await self.getCore().holderAcceptCredential(interactionId: interactionId, didId: didId, keyId: keyId, txCode: txCode);
|
|
150
147
|
return nil as NSDictionary?;
|
|
151
148
|
}
|
|
152
149
|
}
|
|
@@ -157,7 +154,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
157
154
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
158
155
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
159
156
|
asyncCall(resolve, reject) {
|
|
160
|
-
try getCore().holderRejectCredential(interactionId: interactionId);
|
|
157
|
+
try await self.getCore().holderRejectCredential(interactionId: interactionId);
|
|
161
158
|
return nil as NSDictionary?;
|
|
162
159
|
}
|
|
163
160
|
}
|
|
@@ -168,7 +165,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
168
165
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
169
166
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
170
167
|
asyncCall(resolve, reject) {
|
|
171
|
-
let result = try getCore().getPresentationDefinition(proofId: proofId);
|
|
168
|
+
let result = try await self.getCore().getPresentationDefinition(proofId: proofId);
|
|
172
169
|
return serialize(presentationDefinition: result)
|
|
173
170
|
}
|
|
174
171
|
}
|
|
@@ -179,7 +176,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
179
176
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
180
177
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
181
178
|
asyncCall(resolve, reject) {
|
|
182
|
-
try getCore().holderRejectProof(interactionId: interactionId);
|
|
179
|
+
try await self.getCore().holderRejectProof(interactionId: interactionId);
|
|
183
180
|
return nil as NSDictionary?;
|
|
184
181
|
}
|
|
185
182
|
}
|
|
@@ -200,7 +197,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
200
197
|
submitCredentials[key] = try deserializePresentationSubmitCredentialRequest(entry)
|
|
201
198
|
}
|
|
202
199
|
|
|
203
|
-
try getCore().holderSubmitProof(interactionId: interactionId, submitCredentials: submitCredentials, didId: didId, keyId: keyId);
|
|
200
|
+
try await self.getCore().holderSubmitProof(interactionId: interactionId, submitCredentials: submitCredentials, didId: didId, keyId: keyId);
|
|
204
201
|
return nil as NSDictionary?;
|
|
205
202
|
}
|
|
206
203
|
}
|
|
@@ -212,7 +209,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
212
209
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
213
210
|
asyncCall(resolve, reject) {
|
|
214
211
|
let listQuery = try deserializeCredentialListQuery(query);
|
|
215
|
-
let result = try getCore().getCredentials(query: listQuery);
|
|
212
|
+
let result = try await self.getCore().getCredentials(query: listQuery);
|
|
216
213
|
return serialize(credentialList: result)
|
|
217
214
|
}
|
|
218
215
|
}
|
|
@@ -223,7 +220,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
223
220
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
224
221
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
225
222
|
asyncCall(resolve, reject) {
|
|
226
|
-
let result = try getCore().getCredential(credentialId: credentialId);
|
|
223
|
+
let result = try await self.getCore().getCredential(credentialId: credentialId);
|
|
227
224
|
return serialize(credentialDetail: result)
|
|
228
225
|
}
|
|
229
226
|
}
|
|
@@ -234,7 +231,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
234
231
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
235
232
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
236
233
|
asyncCall(resolve, reject) {
|
|
237
|
-
try getCore().deleteCredential(credentialId: credentialId);
|
|
234
|
+
try await self.getCore().deleteCredential(credentialId: credentialId);
|
|
238
235
|
return nil as NSDictionary?;
|
|
239
236
|
}
|
|
240
237
|
}
|
|
@@ -246,7 +243,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
246
243
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
247
244
|
asyncCall(resolve, reject) {
|
|
248
245
|
let request = try deserializeImportCredentialSchemaRequest(request);
|
|
249
|
-
return try getCore().importCredentialSchema(request: request)
|
|
246
|
+
return try await self.getCore().importCredentialSchema(request: request)
|
|
250
247
|
}
|
|
251
248
|
}
|
|
252
249
|
|
|
@@ -256,7 +253,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
256
253
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
257
254
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
258
255
|
asyncCall(resolve, reject) {
|
|
259
|
-
let result = try getCore().getCredentialSchema(credentialSchemaId: credentialSchemaId);
|
|
256
|
+
let result = try await self.getCore().getCredentialSchema(credentialSchemaId: credentialSchemaId);
|
|
260
257
|
return serialize(credentialSchemaDetail: result)
|
|
261
258
|
}
|
|
262
259
|
}
|
|
@@ -268,7 +265,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
268
265
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
269
266
|
asyncCall(resolve, reject) {
|
|
270
267
|
let listQuery = try deserializeCredentialSchemaListQuery(query)
|
|
271
|
-
let result = try getCore().getCredentialSchemas(query: listQuery);
|
|
268
|
+
let result = try await self.getCore().getCredentialSchemas(query: listQuery);
|
|
272
269
|
return serialize(credentialSchemaList: result)
|
|
273
270
|
}
|
|
274
271
|
}
|
|
@@ -279,7 +276,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
279
276
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
280
277
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
281
278
|
asyncCall(resolve, reject) {
|
|
282
|
-
try getCore().deleteCredentialSchema(credentialSchemaId: credentialSchemaId);
|
|
279
|
+
try await self.getCore().deleteCredentialSchema(credentialSchemaId: credentialSchemaId);
|
|
283
280
|
return nil as NSDictionary?;
|
|
284
281
|
}
|
|
285
282
|
}
|
|
@@ -291,7 +288,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
291
288
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
292
289
|
asyncCall(resolve, reject) {
|
|
293
290
|
let request = try deserializeCreateProofSchemaRequest(request)
|
|
294
|
-
return try getCore().createProofSchema(request: request)
|
|
291
|
+
return try await self.getCore().createProofSchema(request: request)
|
|
295
292
|
}
|
|
296
293
|
}
|
|
297
294
|
|
|
@@ -302,7 +299,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
302
299
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
303
300
|
asyncCall(resolve, reject) {
|
|
304
301
|
let listQuery = try deserializeProofSchemaListQuery(query)
|
|
305
|
-
let result = try getCore().getProofSchemas(
|
|
302
|
+
let result = try await self.getCore().getProofSchemas(filter: listQuery);
|
|
306
303
|
return serialize(proofSchemaList: result)
|
|
307
304
|
}
|
|
308
305
|
}
|
|
@@ -313,7 +310,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
313
310
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
314
311
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
315
312
|
asyncCall(resolve, reject) {
|
|
316
|
-
let result = try getCore().getProofSchema(proofSchemaId: proofSchemaId);
|
|
313
|
+
let result = try await self.getCore().getProofSchema(proofSchemaId: proofSchemaId);
|
|
317
314
|
return serialize(proofSchema: result)
|
|
318
315
|
}
|
|
319
316
|
}
|
|
@@ -324,7 +321,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
324
321
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
325
322
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
326
323
|
asyncCall(resolve, reject) {
|
|
327
|
-
try getCore().deleteProofSchema(proofSchemaId: proofSchemaId);
|
|
324
|
+
try await self.getCore().deleteProofSchema(proofSchemaId: proofSchemaId);
|
|
328
325
|
return nil as NSDictionary?;
|
|
329
326
|
}
|
|
330
327
|
}
|
|
@@ -336,7 +333,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
336
333
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
337
334
|
asyncCall(resolve, reject) {
|
|
338
335
|
let request = try deserializeImportProofSchemaRequest(request);
|
|
339
|
-
return try getCore().importProofSchema(request: request)
|
|
336
|
+
return try await self.getCore().importProofSchema(request: request)
|
|
340
337
|
}
|
|
341
338
|
}
|
|
342
339
|
|
|
@@ -347,7 +344,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
347
344
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
348
345
|
asyncCall(resolve, reject) {
|
|
349
346
|
let request = try deserializeCreateProofRequest(request);
|
|
350
|
-
return try getCore().createProof(request: request)
|
|
347
|
+
return try await self.getCore().createProof(request: request)
|
|
351
348
|
}
|
|
352
349
|
}
|
|
353
350
|
|
|
@@ -357,7 +354,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
357
354
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
358
355
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
359
356
|
asyncCall(resolve, reject) {
|
|
360
|
-
return try getCore().runTask(task: task);
|
|
357
|
+
return try await self.getCore().runTask(task: task);
|
|
361
358
|
}
|
|
362
359
|
}
|
|
363
360
|
|
|
@@ -367,7 +364,20 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
367
364
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
368
365
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
369
366
|
asyncCall(resolve, reject) {
|
|
370
|
-
try getCore().deleteProofClaims(proofId: proofId);
|
|
367
|
+
try await self.getCore().deleteProofClaims(proofId: proofId);
|
|
368
|
+
return nil as NSDictionary?;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
@objc(checkCertificate:certificate:resolver:rejecter:)
|
|
373
|
+
func checkCertificate(
|
|
374
|
+
keyId: String,
|
|
375
|
+
certificate: NSDictionary,
|
|
376
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
377
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
378
|
+
asyncCall(resolve, reject) {
|
|
379
|
+
let certificate = try deserializeKeyCheckCertificateRequest(certificate);
|
|
380
|
+
try await self.getCore().checkCertificate(keyId: keyId, certificate: certificate);
|
|
371
381
|
return nil as NSDictionary?;
|
|
372
382
|
}
|
|
373
383
|
}
|
|
@@ -378,7 +388,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
378
388
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
379
389
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
380
390
|
asyncCall(resolve, reject) {
|
|
381
|
-
let result = try getCore().shareCredentialSchema(credentialSchemaId: credentialSchemaId);
|
|
391
|
+
let result = try await self.getCore().shareCredentialSchema(credentialSchemaId: credentialSchemaId);
|
|
382
392
|
return serialize(credentialSchemaShareResponse: result)
|
|
383
393
|
}
|
|
384
394
|
}
|
|
@@ -389,18 +399,19 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
389
399
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
390
400
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
391
401
|
asyncCall(resolve, reject) {
|
|
392
|
-
let result = try getCore().shareProofSchema(proofSchemaId: proofSchemaId);
|
|
402
|
+
let result = try await self.getCore().shareProofSchema(proofSchemaId: proofSchemaId);
|
|
393
403
|
return serialize(proofSchemaShareResponse: result)
|
|
394
404
|
}
|
|
395
405
|
}
|
|
396
406
|
|
|
397
|
-
@objc(shareProof:resolver:rejecter:)
|
|
407
|
+
@objc(shareProof:request:resolver:rejecter:)
|
|
398
408
|
func shareProof(
|
|
399
409
|
proofId: String,
|
|
410
|
+
request: NSDictionary,
|
|
400
411
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
401
412
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
402
413
|
asyncCall(resolve, reject) {
|
|
403
|
-
let result = try getCore().shareProof(proofId: proofId);
|
|
414
|
+
let result = try await self.getCore().shareProof(proofId: proofId, params: deserializeShareProofRequest(request));
|
|
404
415
|
return serialize(shareProofResponse: result)
|
|
405
416
|
}
|
|
406
417
|
}
|
|
@@ -411,8 +422,8 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
411
422
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
412
423
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
413
424
|
asyncCall(resolve, reject) {
|
|
414
|
-
let result = try getCore().getProof(proofId: proofId);
|
|
415
|
-
return serialize(
|
|
425
|
+
let result = try await self.getCore().getProof(proofId: proofId);
|
|
426
|
+
return serialize(proofResponse: result)
|
|
416
427
|
}
|
|
417
428
|
}
|
|
418
429
|
|
|
@@ -423,18 +434,19 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
423
434
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
424
435
|
asyncCall(resolve, reject) {
|
|
425
436
|
let listQuery = try deserializeProofListQuery(query);
|
|
426
|
-
let result = try getCore().getProofs(query: listQuery);
|
|
437
|
+
let result = try await self.getCore().getProofs(query: listQuery);
|
|
427
438
|
return serialize(proofList: result)
|
|
428
439
|
}
|
|
429
440
|
}
|
|
430
441
|
|
|
431
|
-
@objc(
|
|
432
|
-
func
|
|
442
|
+
@objc(deleteProof:resolver:rejecter:)
|
|
443
|
+
func deleteProof(
|
|
433
444
|
proofId: String,
|
|
434
445
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
435
446
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
436
447
|
asyncCall(resolve, reject) {
|
|
437
|
-
|
|
448
|
+
try await self.getCore().deleteProof(proofId: proofId)
|
|
449
|
+
return nil as NSDictionary?;
|
|
438
450
|
}
|
|
439
451
|
}
|
|
440
452
|
|
|
@@ -445,19 +457,20 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
445
457
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
446
458
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
447
459
|
asyncCall(resolve, reject) {
|
|
448
|
-
let result = try getCore().proposeProof(exchange: exchange, organisationId: organisationId)
|
|
460
|
+
let result = try await self.getCore().proposeProof(exchange: exchange, organisationId: organisationId)
|
|
449
461
|
return serialize(proposeProofResponse: result)
|
|
450
462
|
}
|
|
451
463
|
}
|
|
452
464
|
|
|
453
|
-
@objc(checkRevocation:resolver:rejecter:)
|
|
465
|
+
@objc(checkRevocation:forceRefresh:resolver:rejecter:)
|
|
454
466
|
func checkRevocation(
|
|
455
467
|
credentialIds: NSArray,
|
|
468
|
+
forceRefresh: Bool,
|
|
456
469
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
457
470
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
458
471
|
asyncCall(resolve, reject) {
|
|
459
472
|
let ids = try deserializeIds(credentialIds);
|
|
460
|
-
let result = try getCore().checkRevocation(credentialIds: ids);
|
|
473
|
+
let result = try await self.getCore().checkRevocation(credentialIds: ids, forceRefresh: forceRefresh);
|
|
461
474
|
return result.map {
|
|
462
475
|
serialize(credentialRevocationCheckResponse: $0)
|
|
463
476
|
}
|
|
@@ -471,7 +484,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
471
484
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
472
485
|
asyncCall(resolve, reject) {
|
|
473
486
|
let listQuery = try deserializeHistoryListQuery(query)
|
|
474
|
-
let result = try getCore().getHistoryList(query: listQuery);
|
|
487
|
+
let result = try await self.getCore().getHistoryList(query: listQuery);
|
|
475
488
|
return serialize(historyList: result)
|
|
476
489
|
}
|
|
477
490
|
}
|
|
@@ -482,7 +495,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
482
495
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
483
496
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
484
497
|
asyncCall(resolve, reject) {
|
|
485
|
-
let result = try getCore().getHistoryEntry(historyId: historyId);
|
|
498
|
+
let result = try await self.getCore().getHistoryEntry(historyId: historyId);
|
|
486
499
|
return serialize(historyListItem: result)
|
|
487
500
|
}
|
|
488
501
|
}
|
|
@@ -494,7 +507,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
494
507
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
495
508
|
asyncCall(resolve, reject) {
|
|
496
509
|
let request = try deserializeCreateTrustAnchorRequest(request);
|
|
497
|
-
return try getCore().createTrustAnchor(anchor: request)
|
|
510
|
+
return try await self.getCore().createTrustAnchor(anchor: request)
|
|
498
511
|
}
|
|
499
512
|
}
|
|
500
513
|
|
|
@@ -504,7 +517,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
504
517
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
505
518
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
506
519
|
asyncCall(resolve, reject) {
|
|
507
|
-
let trustAnchor = try getCore().getTrustAnchor(
|
|
520
|
+
let trustAnchor = try await self.getCore().getTrustAnchor(trustAnchorId: trustAnchorId);
|
|
508
521
|
return serialize(trustAnchor: trustAnchor)
|
|
509
522
|
}
|
|
510
523
|
}
|
|
@@ -516,11 +529,101 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
516
529
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
517
530
|
asyncCall(resolve, reject) {
|
|
518
531
|
let listQuery = try deserializeTrustAnchorListQuery(query)
|
|
519
|
-
let result = try getCore().listTrustAnchors(filters: listQuery);
|
|
532
|
+
let result = try await self.getCore().listTrustAnchors(filters: listQuery);
|
|
520
533
|
return serialize(trustAnchorList: result)
|
|
521
534
|
}
|
|
522
535
|
}
|
|
523
536
|
|
|
537
|
+
@objc(deleteTrustAnchor:resolver:rejecter:)
|
|
538
|
+
func deleteTrustAnchor(
|
|
539
|
+
trustAnchorId: String,
|
|
540
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
541
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
542
|
+
asyncCall(resolve, reject) {
|
|
543
|
+
try await self.getCore().deleteTrustAnchor(anchorId: trustAnchorId);
|
|
544
|
+
return nil as NSDictionary?;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
@objc(createTrustEntity:resolver:rejecter:)
|
|
549
|
+
func createTrustEntity(
|
|
550
|
+
request: NSDictionary,
|
|
551
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
552
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
553
|
+
asyncCall(resolve, reject) {
|
|
554
|
+
let request = try deserializeCreateTrustEntityRequest(request);
|
|
555
|
+
return try await self.getCore().createTrustEntity(request: request)
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
@objc(getTrustEntities:resolver:rejecter:)
|
|
560
|
+
func getTrustEntities(
|
|
561
|
+
query: NSDictionary,
|
|
562
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
563
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
564
|
+
asyncCall(resolve, reject) {
|
|
565
|
+
let listQuery = try deserializeTrustEntityListQuery(query)
|
|
566
|
+
let result = try await self.getCore().listTrustEntities(filters: listQuery);
|
|
567
|
+
return serialize(trustEntityList: result)
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
@objc(getTrustEntity:resolver:rejecter:)
|
|
572
|
+
func getTrustEntity(
|
|
573
|
+
trustEntityId: String,
|
|
574
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
575
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
576
|
+
asyncCall(resolve, reject) {
|
|
577
|
+
let trustEntity = try await self.getCore().getTrustEntity(trustEntityId: trustEntityId);
|
|
578
|
+
return serialize(trustEntity: trustEntity)
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
@objc(getTrustEntityByDid:resolver:rejecter:)
|
|
583
|
+
func getTrustEntityByDid(
|
|
584
|
+
didId: String,
|
|
585
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
586
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
587
|
+
asyncCall(resolve, reject) {
|
|
588
|
+
let trustEntity = try await self.getCore().getTrustEntityByDid(didId: didId);
|
|
589
|
+
return serialize(trustEntity: trustEntity)
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
@objc(createRemoteTrustEntity:resolver:rejecter:)
|
|
594
|
+
func createRemoteTrustEntity(
|
|
595
|
+
request: NSDictionary,
|
|
596
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
597
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
598
|
+
asyncCall(resolve, reject) {
|
|
599
|
+
let request = try deserializeCreateRemoteTrustEntityRequest(request);
|
|
600
|
+
return try await self.getCore().createRemoteTrustEntity(request: request)
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
@objc(getRemoteTrustEntity:resolver:rejecter:)
|
|
605
|
+
func getRemoteTrustEntity(
|
|
606
|
+
didId: String,
|
|
607
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
608
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
609
|
+
asyncCall(resolve, reject) {
|
|
610
|
+
let trustEntity = try await self.getCore().getRemoteTrustEntity(didId: didId);
|
|
611
|
+
return serialize(trustEntity: trustEntity)
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
@objc(updateRemoteTrustEntity:resolver:rejecter:)
|
|
616
|
+
func updateRemoteTrustEntity(
|
|
617
|
+
request: NSDictionary,
|
|
618
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
619
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
620
|
+
asyncCall(resolve, reject) {
|
|
621
|
+
let request = try deserializeUpdateRemoteTrustEntityRequest(request);
|
|
622
|
+
return try await self.getCore().updateRemoteTrustEntity(request: request)
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
|
|
524
627
|
@objc(createBackup:outputPath:resolver:rejecter:)
|
|
525
628
|
func createBackup(
|
|
526
629
|
password: String,
|
|
@@ -528,7 +631,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
528
631
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
529
632
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
530
633
|
asyncCall(resolve, reject) {
|
|
531
|
-
let result = try getCore().createBackup(password: password, outputPath: outputPath);
|
|
634
|
+
let result = try await self.getCore().createBackup(password: password, outputPath: outputPath);
|
|
532
635
|
return serialize(backupCreate: result)
|
|
533
636
|
}
|
|
534
637
|
}
|
|
@@ -538,7 +641,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
538
641
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
539
642
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
540
643
|
asyncCall(resolve, reject) {
|
|
541
|
-
let result = try getCore().backupInfo();
|
|
644
|
+
let result = try await self.getCore().backupInfo();
|
|
542
645
|
return serialize(unexportableEntities: result)
|
|
543
646
|
}
|
|
544
647
|
}
|
|
@@ -550,7 +653,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
550
653
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
551
654
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
552
655
|
asyncCall(resolve, reject) {
|
|
553
|
-
let result = try getCore().unpackBackup(password: password, inputPath: inputPath);
|
|
656
|
+
let result = try await self.getCore().unpackBackup(password: password, inputPath: inputPath);
|
|
554
657
|
return serialize(importBackupMetadata: result)
|
|
555
658
|
}
|
|
556
659
|
}
|
|
@@ -560,7 +663,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
560
663
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
561
664
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
562
665
|
asyncCall(resolve, reject) {
|
|
563
|
-
try getCore().finalizeImport();
|
|
666
|
+
try await self.getCore().finalizeImport();
|
|
564
667
|
return nil as NSDictionary?;
|
|
565
668
|
}
|
|
566
669
|
}
|
|
@@ -570,7 +673,7 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
570
673
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
571
674
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
572
675
|
asyncCall(resolve, reject) {
|
|
573
|
-
try getCore().rollbackImport();
|
|
676
|
+
try await self.getCore().rollbackImport();
|
|
574
677
|
return nil as NSDictionary?;
|
|
575
678
|
}
|
|
576
679
|
}
|
|
@@ -581,20 +684,141 @@ class ProcivisOneCoreModule: NSObject {
|
|
|
581
684
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
582
685
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
583
686
|
asyncCall(resolve, reject) {
|
|
584
|
-
let result = try getCore().resolveJsonldContext(url: url);
|
|
687
|
+
let result = try await self.getCore().resolveJsonldContext(url: url);
|
|
585
688
|
return serialize(resolveJsonLdContextResponse: result)
|
|
586
689
|
}
|
|
587
690
|
}
|
|
588
691
|
|
|
692
|
+
@objc(deleteCache:resolver:rejecter:)
|
|
693
|
+
func deleteCache(
|
|
694
|
+
types: NSArray?,
|
|
695
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
696
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
697
|
+
asyncCall(resolve, reject) {
|
|
698
|
+
let types = try deserializeCacheTypes(types: types);
|
|
699
|
+
try await self.getCore().deleteCache(types: types);
|
|
700
|
+
return nil as NSDictionary?;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
589
704
|
@objc(uninitialize:resolver:rejecter:)
|
|
590
705
|
func uninitialize(
|
|
591
706
|
deleteData: Bool,
|
|
592
707
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
593
708
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
594
709
|
asyncCall(resolve, reject) {
|
|
595
|
-
try getCore().uninitialize(deleteData: deleteData);
|
|
596
|
-
core = nil
|
|
710
|
+
try await self.getCore().uninitialize(deleteData: deleteData);
|
|
711
|
+
self.core = nil
|
|
712
|
+
if deleteData, let rseKeyStorage = self.rseKeyStorage as? RSEKeyStorage {
|
|
713
|
+
try await rseKeyStorage.delete()
|
|
714
|
+
}
|
|
715
|
+
return nil as NSDictionary?;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// MARK: Ubiqu specific methods
|
|
720
|
+
|
|
721
|
+
@objc(changeRSEPin:rejecter:)
|
|
722
|
+
func changeRSEPin(
|
|
723
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
724
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
725
|
+
asyncCall(resolve, reject) {
|
|
726
|
+
guard let rseKeyStorage = self.rseKeyStorage as? RSEKeyStorage else {
|
|
727
|
+
throw BindingError.ErrorResponse(data: ErrorResponseBindingDto(code: "BR_0184", message: "ubiqu not initialized", cause: nil))
|
|
728
|
+
}
|
|
729
|
+
try await rseKeyStorage.changePin()
|
|
730
|
+
return nil as NSDictionary?;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
@objc(areRSEBiometricsSupported:rejecter:)
|
|
735
|
+
func areRSEBiometricsSupported(
|
|
736
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
737
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
738
|
+
asyncCall(resolve, reject) {
|
|
739
|
+
guard let rseKeyStorage = self.rseKeyStorage as? RSEKeyStorage else {
|
|
740
|
+
throw BindingError.ErrorResponse(data: ErrorResponseBindingDto(code: "BR_0184", message: "ubiqu not initialized", cause: nil))
|
|
741
|
+
}
|
|
742
|
+
return rseKeyStorage.areBiometricsSupported
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
@objc(areRSEBiometricsEnabled:rejecter:)
|
|
747
|
+
func areRSEBiometricsEnabled(
|
|
748
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
749
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
750
|
+
asyncCall(resolve, reject) {
|
|
751
|
+
guard let rseKeyStorage = self.rseKeyStorage as? RSEKeyStorage else {
|
|
752
|
+
throw BindingError.ErrorResponse(data: ErrorResponseBindingDto(code: "BR_0184", message: "ubiqu not initialized", cause: nil))
|
|
753
|
+
}
|
|
754
|
+
return rseKeyStorage.areBiometricsEnabled
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
@objc(setRSEBiometrics:resolver:rejecter:)
|
|
759
|
+
func setRSEBiometrics(
|
|
760
|
+
enabled: Bool,
|
|
761
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
762
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
763
|
+
asyncCall(resolve, reject) {
|
|
764
|
+
guard let rseKeyStorage = self.rseKeyStorage as? RSEKeyStorage else {
|
|
765
|
+
throw BindingError.ErrorResponse(data: ErrorResponseBindingDto(code: "BR_0184", message: "ubiqu not initialized", cause: nil))
|
|
766
|
+
}
|
|
767
|
+
if (enabled) {
|
|
768
|
+
try await rseKeyStorage.enableBiometrics()
|
|
769
|
+
} else {
|
|
770
|
+
try rseKeyStorage.disableBiometrics()
|
|
771
|
+
}
|
|
772
|
+
return nil as NSDictionary?;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
@objc(resetRSE:rejecter:)
|
|
777
|
+
func resetRSE(
|
|
778
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
779
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
780
|
+
asyncCall(resolve, reject) {
|
|
781
|
+
if let rseKeyStorage = self.rseKeyStorage as? RSEKeyStorage {
|
|
782
|
+
try await rseKeyStorage.delete()
|
|
783
|
+
}
|
|
784
|
+
return nil as NSDictionary?;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
@objc(resetRSEPinFlow:rejecter:)
|
|
789
|
+
func resetRSEPinFlow(
|
|
790
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
791
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
792
|
+
asyncCall(resolve, reject) {
|
|
793
|
+
guard let rseKeyStorage = self.rseKeyStorage as? RSEKeyStorage else {
|
|
794
|
+
throw BindingError.ErrorResponse(data: ErrorResponseBindingDto(code: "BR_0184", message: "ubiqu not initialized", cause: nil))
|
|
795
|
+
}
|
|
796
|
+
try await rseKeyStorage.resetPinFlow()
|
|
597
797
|
return nil as NSDictionary?;
|
|
598
798
|
}
|
|
599
799
|
}
|
|
600
800
|
}
|
|
801
|
+
|
|
802
|
+
// MARK: RCTEventEmitter
|
|
803
|
+
|
|
804
|
+
extension ProcivisOneCoreModule {
|
|
805
|
+
|
|
806
|
+
override func supportedEvents() -> [String]! {
|
|
807
|
+
return ProcivisOneCoreEventEmitter.supportedEvents
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
override func startObserving() {
|
|
811
|
+
ProcivisOneCoreEventEmitter.hasListeners = true
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
override func stopObserving() {
|
|
815
|
+
ProcivisOneCoreEventEmitter.hasListeners = false
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
override func sendEvent(withName name: String!, body: Any!) {
|
|
819
|
+
guard ProcivisOneCoreEventEmitter.hasListeners else {
|
|
820
|
+
return
|
|
821
|
+
}
|
|
822
|
+
super.sendEvent(withName: name, body: body)
|
|
823
|
+
}
|
|
824
|
+
}
|