@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
|
@@ -1,66 +1,77 @@
|
|
|
1
1
|
package ch.procivis.one.core
|
|
2
2
|
|
|
3
3
|
import ch.procivis.one.core.Deserialize.construct
|
|
4
|
+
import ch.procivis.one.core.DeserializeSpecific.enumList
|
|
4
5
|
import ch.procivis.one.core.Serialize.convertToRN
|
|
5
6
|
import ch.procivis.one.core.Util.asyncCall
|
|
7
|
+
import ch.procivis.one.core.Util.syncCall
|
|
8
|
+
import ch.procivis.one.core.ubiqu.UbiquKeyStorage
|
|
6
9
|
import com.facebook.react.bridge.Promise
|
|
7
10
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
8
11
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
9
12
|
import com.facebook.react.bridge.ReactMethod
|
|
10
13
|
import com.facebook.react.bridge.ReadableArray
|
|
11
14
|
import com.facebook.react.bridge.ReadableMap
|
|
15
|
+
import kotlinx.coroutines.CoroutineScope
|
|
16
|
+
import kotlin.coroutines.EmptyCoroutineContext
|
|
12
17
|
|
|
13
18
|
class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
14
19
|
ReactContextBaseJavaModule(reactContext) {
|
|
15
20
|
override fun getName() = "ProcivisOneCoreModule"
|
|
16
21
|
|
|
17
22
|
private var oneCore: OneCoreBindingInterface? = null
|
|
23
|
+
private val scope = CoroutineScope(EmptyCoroutineContext)
|
|
18
24
|
|
|
19
25
|
private fun getCore(): OneCoreBindingInterface {
|
|
20
|
-
return oneCore ?: throw BindingException.
|
|
26
|
+
return oneCore ?: throw BindingException.ErrorResponse(
|
|
27
|
+
ErrorResponseBindingDto(
|
|
28
|
+
"BR_0184",
|
|
29
|
+
"core not initialized",
|
|
30
|
+
null
|
|
31
|
+
)
|
|
32
|
+
)
|
|
21
33
|
}
|
|
22
34
|
|
|
23
|
-
|
|
24
|
-
fun
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
AndroidBLEPeripheral(this.reactApplicationContext)
|
|
33
|
-
)
|
|
34
|
-
return@asyncCall null
|
|
35
|
-
}
|
|
35
|
+
private var ubiqu: UbiquKeyStorage? = null
|
|
36
|
+
private fun getUbiqu(): UbiquKeyStorage {
|
|
37
|
+
return ubiqu ?: throw BindingException.ErrorResponse(
|
|
38
|
+
ErrorResponseBindingDto(
|
|
39
|
+
"BR_0184",
|
|
40
|
+
"ubiqu not initialized",
|
|
41
|
+
null
|
|
42
|
+
)
|
|
43
|
+
)
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
@ReactMethod
|
|
39
|
-
fun
|
|
40
|
-
|
|
47
|
+
fun initialize(configJson: String, promise: Promise) {
|
|
48
|
+
syncCall(promise) {
|
|
41
49
|
val dataDirPath = this.reactApplicationContext.filesDir.absolutePath
|
|
50
|
+
ubiqu = ubiqu ?: UbiquKeyStorage(this.reactApplicationContext)
|
|
42
51
|
oneCore =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
initializeCore(
|
|
53
|
+
configJson = configJson,
|
|
54
|
+
dataDirPath = dataDirPath,
|
|
55
|
+
nativeSecureElement = AndroidKeyStoreKeyStorage(this.reactApplicationContext),
|
|
56
|
+
remoteSecureElement = ubiqu,
|
|
57
|
+
bleCentral = AndroidBLECentral(this.reactApplicationContext),
|
|
58
|
+
blePeripheral = AndroidBLEPeripheral(this.reactApplicationContext)
|
|
48
59
|
)
|
|
49
|
-
return@
|
|
60
|
+
return@syncCall null
|
|
50
61
|
}
|
|
51
62
|
}
|
|
52
63
|
|
|
53
64
|
@ReactMethod
|
|
54
65
|
fun getVersion(promise: Promise) {
|
|
55
|
-
|
|
66
|
+
syncCall(promise) {
|
|
56
67
|
val version = getCore().version()
|
|
57
|
-
return@
|
|
68
|
+
return@syncCall convertToRN(version)
|
|
58
69
|
}
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
@ReactMethod
|
|
62
73
|
fun getConfig(promise: Promise) {
|
|
63
|
-
asyncCall(promise) {
|
|
74
|
+
asyncCall(promise, scope) {
|
|
64
75
|
val config = getCore().getConfig()
|
|
65
76
|
return@asyncCall convertToRN(config)
|
|
66
77
|
}
|
|
@@ -68,22 +79,30 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
68
79
|
|
|
69
80
|
@ReactMethod
|
|
70
81
|
fun runTask(task: String, promise: Promise) {
|
|
71
|
-
asyncCall(promise) {
|
|
82
|
+
asyncCall(promise, scope) {
|
|
72
83
|
return@asyncCall getCore().runTask(task)
|
|
73
84
|
}
|
|
74
85
|
}
|
|
75
86
|
|
|
76
87
|
@ReactMethod
|
|
77
88
|
fun deleteProofClaims(proofId: String, promise: Promise) {
|
|
78
|
-
asyncCall(promise) {
|
|
89
|
+
asyncCall(promise, scope) {
|
|
79
90
|
getCore().deleteProofClaims(proofId)
|
|
80
91
|
return@asyncCall null
|
|
81
92
|
}
|
|
82
93
|
}
|
|
83
94
|
|
|
95
|
+
@ReactMethod
|
|
96
|
+
fun checkCertificate(keyId: String, certificate: ReadableMap, promise: Promise) {
|
|
97
|
+
asyncCall(promise, scope) {
|
|
98
|
+
getCore().checkCertificate(keyId, construct(certificate))
|
|
99
|
+
return@asyncCall null
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
84
103
|
@ReactMethod
|
|
85
104
|
fun shareCredentialSchema(credentialSchemaId: String, promise: Promise) {
|
|
86
|
-
asyncCall(promise) {
|
|
105
|
+
asyncCall(promise, scope) {
|
|
87
106
|
val result = getCore().shareCredentialSchema(credentialSchemaId)
|
|
88
107
|
return@asyncCall convertToRN(result)
|
|
89
108
|
}
|
|
@@ -91,36 +110,44 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
91
110
|
|
|
92
111
|
@ReactMethod
|
|
93
112
|
fun shareProofSchema(proofSchemaId: String, promise: Promise) {
|
|
94
|
-
asyncCall(promise) {
|
|
113
|
+
asyncCall(promise, scope) {
|
|
95
114
|
val result = getCore().shareProofSchema(proofSchemaId)
|
|
96
115
|
return@asyncCall convertToRN(result)
|
|
97
116
|
}
|
|
98
117
|
}
|
|
99
118
|
|
|
100
119
|
@ReactMethod
|
|
101
|
-
fun createOrganisation(
|
|
102
|
-
asyncCall(promise) {
|
|
103
|
-
return@asyncCall getCore().createOrganisation(
|
|
120
|
+
fun createOrganisation(request: ReadableMap, promise: Promise) {
|
|
121
|
+
asyncCall(promise, scope) {
|
|
122
|
+
return@asyncCall getCore().createOrganisation(construct(request))
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@ReactMethod
|
|
127
|
+
fun upsertOrganisation(request: ReadableMap, promise: Promise) {
|
|
128
|
+
asyncCall(promise, scope) {
|
|
129
|
+
getCore().upsertOrganisation(construct(request))
|
|
130
|
+
return@asyncCall null
|
|
104
131
|
}
|
|
105
132
|
}
|
|
106
133
|
|
|
107
134
|
@ReactMethod
|
|
108
135
|
fun generateKey(keyRequest: ReadableMap, promise: Promise) {
|
|
109
|
-
asyncCall(promise) {
|
|
136
|
+
asyncCall(promise, scope) {
|
|
110
137
|
return@asyncCall getCore().generateKey(construct(keyRequest))
|
|
111
138
|
}
|
|
112
139
|
}
|
|
113
140
|
|
|
114
141
|
@ReactMethod
|
|
115
142
|
fun createDid(didRequest: ReadableMap, promise: Promise) {
|
|
116
|
-
asyncCall(promise) {
|
|
143
|
+
asyncCall(promise, scope) {
|
|
117
144
|
return@asyncCall getCore().createDid(construct(didRequest))
|
|
118
145
|
}
|
|
119
146
|
}
|
|
120
147
|
|
|
121
148
|
@ReactMethod
|
|
122
149
|
fun getDids(query: ReadableMap, promise: Promise) {
|
|
123
|
-
asyncCall(promise) {
|
|
150
|
+
asyncCall(promise, scope) {
|
|
124
151
|
val dids = getCore().getDids(construct(query))
|
|
125
152
|
return@asyncCall convertToRN(dids)
|
|
126
153
|
}
|
|
@@ -133,7 +160,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
133
160
|
transport: ReadableArray?,
|
|
134
161
|
promise: Promise
|
|
135
162
|
) {
|
|
136
|
-
asyncCall(promise) {
|
|
163
|
+
asyncCall(promise, scope) {
|
|
137
164
|
val transportList = transport?.let { DeserializeSpecific.ids(it) }
|
|
138
165
|
val invitationResult = getCore().handleInvitation(url, organisationId, transportList)
|
|
139
166
|
return@asyncCall convertToRN(invitationResult)
|
|
@@ -145,17 +172,18 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
145
172
|
interactionId: String,
|
|
146
173
|
didId: String,
|
|
147
174
|
keyId: String?,
|
|
175
|
+
txCode: String?,
|
|
148
176
|
promise: Promise
|
|
149
177
|
) {
|
|
150
|
-
asyncCall(promise) {
|
|
151
|
-
getCore().holderAcceptCredential(interactionId, didId, keyId)
|
|
178
|
+
asyncCall(promise, scope) {
|
|
179
|
+
getCore().holderAcceptCredential(interactionId, didId, keyId, txCode)
|
|
152
180
|
return@asyncCall null
|
|
153
181
|
}
|
|
154
182
|
}
|
|
155
183
|
|
|
156
184
|
@ReactMethod
|
|
157
185
|
fun holderRejectCredential(interactionId: String, promise: Promise) {
|
|
158
|
-
asyncCall(promise) {
|
|
186
|
+
asyncCall(promise, scope) {
|
|
159
187
|
getCore().holderRejectCredential(interactionId)
|
|
160
188
|
return@asyncCall null
|
|
161
189
|
}
|
|
@@ -163,7 +191,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
163
191
|
|
|
164
192
|
@ReactMethod
|
|
165
193
|
fun getPresentationDefinition(proofId: String, promise: Promise) {
|
|
166
|
-
asyncCall(promise) {
|
|
194
|
+
asyncCall(promise, scope) {
|
|
167
195
|
val presentationDefinition = getCore().getPresentationDefinition(proofId)
|
|
168
196
|
return@asyncCall convertToRN(presentationDefinition)
|
|
169
197
|
}
|
|
@@ -171,7 +199,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
171
199
|
|
|
172
200
|
@ReactMethod
|
|
173
201
|
fun holderRejectProof(interactionId: String, promise: Promise) {
|
|
174
|
-
asyncCall(promise) {
|
|
202
|
+
asyncCall(promise, scope) {
|
|
175
203
|
getCore().holderRejectProof(interactionId)
|
|
176
204
|
return@asyncCall null
|
|
177
205
|
}
|
|
@@ -185,7 +213,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
185
213
|
keyId: String?,
|
|
186
214
|
promise: Promise
|
|
187
215
|
) {
|
|
188
|
-
asyncCall(promise) {
|
|
216
|
+
asyncCall(promise, scope) {
|
|
189
217
|
val submitCredentials =
|
|
190
218
|
mutableMapOf<String, PresentationSubmitCredentialRequestBindingDto>()
|
|
191
219
|
for (entry in credentials.entryIterator) {
|
|
@@ -199,7 +227,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
199
227
|
|
|
200
228
|
@ReactMethod
|
|
201
229
|
fun getCredentials(query: ReadableMap, promise: Promise) {
|
|
202
|
-
asyncCall(promise) {
|
|
230
|
+
asyncCall(promise, scope) {
|
|
203
231
|
val credentials = getCore().getCredentials(construct(query))
|
|
204
232
|
return@asyncCall convertToRN(credentials)
|
|
205
233
|
}
|
|
@@ -207,7 +235,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
207
235
|
|
|
208
236
|
@ReactMethod
|
|
209
237
|
fun getCredential(credentialId: String, promise: Promise) {
|
|
210
|
-
asyncCall(promise) {
|
|
238
|
+
asyncCall(promise, scope) {
|
|
211
239
|
val credential = getCore().getCredential(credentialId)
|
|
212
240
|
return@asyncCall convertToRN(credential)
|
|
213
241
|
}
|
|
@@ -215,7 +243,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
215
243
|
|
|
216
244
|
@ReactMethod
|
|
217
245
|
fun deleteCredential(credentialId: String, promise: Promise) {
|
|
218
|
-
asyncCall(promise) {
|
|
246
|
+
asyncCall(promise, scope) {
|
|
219
247
|
getCore().deleteCredential(credentialId)
|
|
220
248
|
return@asyncCall null
|
|
221
249
|
}
|
|
@@ -223,14 +251,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
223
251
|
|
|
224
252
|
@ReactMethod
|
|
225
253
|
fun importCredentialSchema(request: ReadableMap, promise: Promise) {
|
|
226
|
-
asyncCall(promise) {
|
|
254
|
+
asyncCall(promise, scope) {
|
|
227
255
|
return@asyncCall getCore().importCredentialSchema(construct(request))
|
|
228
256
|
}
|
|
229
257
|
}
|
|
230
258
|
|
|
231
259
|
@ReactMethod
|
|
232
260
|
fun getCredentialSchema(credentialSchemaId: String, promise: Promise) {
|
|
233
|
-
asyncCall(promise) {
|
|
261
|
+
asyncCall(promise, scope) {
|
|
234
262
|
val schema = getCore().getCredentialSchema(credentialSchemaId)
|
|
235
263
|
return@asyncCall convertToRN(schema)
|
|
236
264
|
}
|
|
@@ -238,7 +266,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
238
266
|
|
|
239
267
|
@ReactMethod
|
|
240
268
|
fun getCredentialSchemas(query: ReadableMap, promise: Promise) {
|
|
241
|
-
asyncCall(promise) {
|
|
269
|
+
asyncCall(promise, scope) {
|
|
242
270
|
val schemas = getCore().getCredentialSchemas(construct(query))
|
|
243
271
|
return@asyncCall convertToRN(schemas)
|
|
244
272
|
}
|
|
@@ -246,7 +274,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
246
274
|
|
|
247
275
|
@ReactMethod
|
|
248
276
|
fun deleteCredentialSchema(credentialSchemaId: String, promise: Promise) {
|
|
249
|
-
asyncCall(promise) {
|
|
277
|
+
asyncCall(promise, scope) {
|
|
250
278
|
getCore().deleteCredentialSchema(credentialSchemaId)
|
|
251
279
|
return@asyncCall null
|
|
252
280
|
}
|
|
@@ -254,22 +282,22 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
254
282
|
|
|
255
283
|
@ReactMethod
|
|
256
284
|
fun createProof(request: ReadableMap, promise: Promise) {
|
|
257
|
-
asyncCall(promise) {
|
|
285
|
+
asyncCall(promise, scope) {
|
|
258
286
|
return@asyncCall getCore().createProof(construct(request))
|
|
259
287
|
}
|
|
260
288
|
}
|
|
261
289
|
|
|
262
290
|
@ReactMethod
|
|
263
|
-
fun shareProof(proofId: String, promise: Promise) {
|
|
264
|
-
asyncCall(promise) {
|
|
265
|
-
val shareProof = getCore().shareProof(proofId)
|
|
291
|
+
fun shareProof(proofId: String, request: ReadableMap, promise: Promise) {
|
|
292
|
+
asyncCall(promise, scope) {
|
|
293
|
+
val shareProof = getCore().shareProof(proofId, construct(request))
|
|
266
294
|
return@asyncCall convertToRN(shareProof)
|
|
267
295
|
}
|
|
268
296
|
}
|
|
269
297
|
|
|
270
298
|
@ReactMethod
|
|
271
299
|
fun getProof(proofId: String, promise: Promise) {
|
|
272
|
-
asyncCall(promise) {
|
|
300
|
+
asyncCall(promise, scope) {
|
|
273
301
|
val proof = getCore().getProof(proofId)
|
|
274
302
|
return@asyncCall convertToRN(proof)
|
|
275
303
|
}
|
|
@@ -277,22 +305,23 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
277
305
|
|
|
278
306
|
@ReactMethod
|
|
279
307
|
fun getProofs(query: ReadableMap, promise: Promise) {
|
|
280
|
-
asyncCall(promise) {
|
|
308
|
+
asyncCall(promise, scope) {
|
|
281
309
|
val proofs = getCore().getProofs(construct(query))
|
|
282
310
|
return@asyncCall convertToRN(proofs)
|
|
283
311
|
}
|
|
284
312
|
}
|
|
285
313
|
|
|
286
314
|
@ReactMethod
|
|
287
|
-
fun
|
|
288
|
-
asyncCall(promise) {
|
|
289
|
-
|
|
315
|
+
fun deleteProof(proofId: String, promise: Promise) {
|
|
316
|
+
asyncCall(promise, scope) {
|
|
317
|
+
getCore().deleteProof(proofId)
|
|
318
|
+
return@asyncCall null
|
|
290
319
|
}
|
|
291
320
|
}
|
|
292
321
|
|
|
293
322
|
@ReactMethod
|
|
294
323
|
fun proposeProof(exchange: String, organisationId: String, promise: Promise) {
|
|
295
|
-
asyncCall(promise) {
|
|
324
|
+
asyncCall(promise, scope) {
|
|
296
325
|
val result = getCore().proposeProof(exchange, organisationId)
|
|
297
326
|
return@asyncCall convertToRN(result)
|
|
298
327
|
}
|
|
@@ -300,14 +329,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
300
329
|
|
|
301
330
|
@ReactMethod
|
|
302
331
|
fun createProofSchema(request: ReadableMap, promise: Promise) {
|
|
303
|
-
asyncCall(promise) {
|
|
332
|
+
asyncCall(promise, scope) {
|
|
304
333
|
return@asyncCall getCore().createProofSchema(construct(request))
|
|
305
334
|
}
|
|
306
335
|
}
|
|
307
336
|
|
|
308
337
|
@ReactMethod
|
|
309
338
|
fun getProofSchemas(query: ReadableMap, promise: Promise) {
|
|
310
|
-
asyncCall(promise) {
|
|
339
|
+
asyncCall(promise, scope) {
|
|
311
340
|
val schemas = getCore().getProofSchemas(construct(query))
|
|
312
341
|
return@asyncCall convertToRN(schemas)
|
|
313
342
|
}
|
|
@@ -315,7 +344,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
315
344
|
|
|
316
345
|
@ReactMethod
|
|
317
346
|
fun getProofSchema(proofSchemaId: String, promise: Promise) {
|
|
318
|
-
asyncCall(promise) {
|
|
347
|
+
asyncCall(promise, scope) {
|
|
319
348
|
val schema = getCore().getProofSchema(proofSchemaId)
|
|
320
349
|
return@asyncCall convertToRN(schema)
|
|
321
350
|
}
|
|
@@ -323,7 +352,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
323
352
|
|
|
324
353
|
@ReactMethod
|
|
325
354
|
fun deleteProofSchema(proofSchemaId: String, promise: Promise) {
|
|
326
|
-
asyncCall(promise) {
|
|
355
|
+
asyncCall(promise, scope) {
|
|
327
356
|
getCore().deleteProofSchema(proofSchemaId)
|
|
328
357
|
return@asyncCall null
|
|
329
358
|
}
|
|
@@ -331,23 +360,27 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
331
360
|
|
|
332
361
|
@ReactMethod
|
|
333
362
|
fun importProofSchema(request: ReadableMap, promise: Promise) {
|
|
334
|
-
asyncCall(promise) {
|
|
363
|
+
asyncCall(promise, scope) {
|
|
335
364
|
return@asyncCall getCore().importProofSchema(construct(request))
|
|
336
365
|
}
|
|
337
366
|
}
|
|
338
367
|
|
|
339
368
|
@ReactMethod
|
|
340
|
-
fun checkRevocation(
|
|
341
|
-
|
|
369
|
+
fun checkRevocation(
|
|
370
|
+
credentialIds: ReadableArray,
|
|
371
|
+
forceRefresh: Boolean,
|
|
372
|
+
promise: Promise
|
|
373
|
+
) {
|
|
374
|
+
asyncCall(promise, scope) {
|
|
342
375
|
val ids = DeserializeSpecific.ids(credentialIds)
|
|
343
|
-
val results = getCore().checkRevocation(ids)
|
|
376
|
+
val results = getCore().checkRevocation(ids, forceRefresh)
|
|
344
377
|
return@asyncCall convertToRN(results)
|
|
345
378
|
}
|
|
346
379
|
}
|
|
347
380
|
|
|
348
381
|
@ReactMethod
|
|
349
382
|
fun getHistory(query: ReadableMap, promise: Promise) {
|
|
350
|
-
asyncCall(promise) {
|
|
383
|
+
asyncCall(promise, scope) {
|
|
351
384
|
val listQuery = DeserializeSpecific.historyListQuery(query)
|
|
352
385
|
val history = getCore().getHistoryList(listQuery)
|
|
353
386
|
return@asyncCall convertToRN(history)
|
|
@@ -356,7 +389,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
356
389
|
|
|
357
390
|
@ReactMethod
|
|
358
391
|
fun getHistoryEntry(historyId: String, promise: Promise) {
|
|
359
|
-
asyncCall(promise) {
|
|
392
|
+
asyncCall(promise, scope) {
|
|
360
393
|
val result = getCore().getHistoryEntry(historyId)
|
|
361
394
|
return@asyncCall convertToRN(result)
|
|
362
395
|
}
|
|
@@ -364,14 +397,21 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
364
397
|
|
|
365
398
|
@ReactMethod
|
|
366
399
|
fun createTrustAnchor(request: ReadableMap, promise: Promise) {
|
|
367
|
-
asyncCall(promise) {
|
|
400
|
+
asyncCall(promise, scope) {
|
|
368
401
|
return@asyncCall getCore().createTrustAnchor(construct(request))
|
|
369
402
|
}
|
|
370
403
|
}
|
|
371
404
|
|
|
405
|
+
@ReactMethod
|
|
406
|
+
fun deleteTrustAnchor(trustAnchorId: String, promise: Promise) {
|
|
407
|
+
asyncCall(promise, scope) {
|
|
408
|
+
return@asyncCall getCore().deleteTrustAnchor(trustAnchorId)
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
372
412
|
@ReactMethod
|
|
373
413
|
fun getTrustAnchor(trustAnchorId: String, promise: Promise) {
|
|
374
|
-
asyncCall(promise) {
|
|
414
|
+
asyncCall(promise, scope) {
|
|
375
415
|
val trustAnchor = getCore().getTrustAnchor(trustAnchorId)
|
|
376
416
|
return@asyncCall convertToRN(trustAnchor)
|
|
377
417
|
}
|
|
@@ -379,15 +419,70 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
379
419
|
|
|
380
420
|
@ReactMethod
|
|
381
421
|
fun getTrustAnchors(query: ReadableMap, promise: Promise) {
|
|
382
|
-
asyncCall(promise) {
|
|
422
|
+
asyncCall(promise, scope) {
|
|
383
423
|
val trustAnchors = getCore().listTrustAnchors(construct(query))
|
|
384
424
|
return@asyncCall convertToRN(trustAnchors)
|
|
385
425
|
}
|
|
386
426
|
}
|
|
387
427
|
|
|
428
|
+
@ReactMethod
|
|
429
|
+
fun createTrustEntity(request: ReadableMap, promise: Promise) {
|
|
430
|
+
asyncCall(promise, scope) {
|
|
431
|
+
return@asyncCall getCore().createTrustEntity(construct(request))
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
@ReactMethod
|
|
436
|
+
fun getTrustEntity(trustEntityId: String, promise: Promise) {
|
|
437
|
+
asyncCall(promise, scope) {
|
|
438
|
+
val trustEntity = getCore().getTrustEntity(trustEntityId)
|
|
439
|
+
return@asyncCall convertToRN(trustEntity)
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
@ReactMethod
|
|
444
|
+
fun getTrustEntities(query: ReadableMap, promise: Promise) {
|
|
445
|
+
asyncCall(promise, scope) {
|
|
446
|
+
val trustEntity = getCore().listTrustEntities(construct(query))
|
|
447
|
+
return@asyncCall convertToRN(trustEntity)
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
@ReactMethod
|
|
453
|
+
fun getTrustEntityByDid(didId: String, promise: Promise) {
|
|
454
|
+
asyncCall(promise, scope) {
|
|
455
|
+
val trustEntity = getCore().getTrustEntityByDid(didId)
|
|
456
|
+
return@asyncCall convertToRN(trustEntity)
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
@ReactMethod
|
|
461
|
+
fun createRemoteTrustEntity(request: ReadableMap, promise: Promise) {
|
|
462
|
+
asyncCall(promise, scope) {
|
|
463
|
+
return@asyncCall getCore().createRemoteTrustEntity(construct(request))
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
@ReactMethod
|
|
468
|
+
fun updateRemoteTrustEntity(request: ReadableMap, promise: Promise) {
|
|
469
|
+
asyncCall(promise, scope) {
|
|
470
|
+
getCore().updateRemoteTrustEntity(construct(request))
|
|
471
|
+
return@asyncCall null
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
@ReactMethod
|
|
476
|
+
fun getRemoteTrustEntity(didId: String, promise: Promise) {
|
|
477
|
+
asyncCall(promise, scope) {
|
|
478
|
+
val trustEntity = getCore().getRemoteTrustEntity(didId)
|
|
479
|
+
return@asyncCall convertToRN(trustEntity)
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
388
483
|
@ReactMethod
|
|
389
484
|
fun createBackup(password: String, outputPath: String, promise: Promise) {
|
|
390
|
-
asyncCall(promise) {
|
|
485
|
+
asyncCall(promise, scope) {
|
|
391
486
|
val result = getCore().createBackup(password, outputPath)
|
|
392
487
|
return@asyncCall convertToRN(result)
|
|
393
488
|
}
|
|
@@ -395,7 +490,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
395
490
|
|
|
396
491
|
@ReactMethod
|
|
397
492
|
fun backupInfo(promise: Promise) {
|
|
398
|
-
asyncCall(promise) {
|
|
493
|
+
asyncCall(promise, scope) {
|
|
399
494
|
val backupInfo = getCore().backupInfo()
|
|
400
495
|
return@asyncCall convertToRN(backupInfo)
|
|
401
496
|
}
|
|
@@ -403,7 +498,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
403
498
|
|
|
404
499
|
@ReactMethod
|
|
405
500
|
fun unpackBackup(password: String, inputPath: String, promise: Promise) {
|
|
406
|
-
asyncCall(promise) {
|
|
501
|
+
asyncCall(promise, scope) {
|
|
407
502
|
val result = getCore().unpackBackup(password, inputPath)
|
|
408
503
|
return@asyncCall convertToRN(result)
|
|
409
504
|
}
|
|
@@ -411,7 +506,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
411
506
|
|
|
412
507
|
@ReactMethod
|
|
413
508
|
fun finalizeImport(promise: Promise) {
|
|
414
|
-
asyncCall(promise) {
|
|
509
|
+
asyncCall(promise, scope) {
|
|
415
510
|
getCore().finalizeImport()
|
|
416
511
|
return@asyncCall null
|
|
417
512
|
}
|
|
@@ -419,7 +514,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
419
514
|
|
|
420
515
|
@ReactMethod
|
|
421
516
|
fun rollbackImport(promise: Promise) {
|
|
422
|
-
asyncCall(promise) {
|
|
517
|
+
asyncCall(promise, scope) {
|
|
423
518
|
getCore().rollbackImport()
|
|
424
519
|
return@asyncCall null
|
|
425
520
|
}
|
|
@@ -427,18 +522,95 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
427
522
|
|
|
428
523
|
@ReactMethod
|
|
429
524
|
fun resolveJsonldContext(url: String, promise: Promise) {
|
|
430
|
-
asyncCall(promise) {
|
|
525
|
+
asyncCall(promise, scope) {
|
|
431
526
|
val result = getCore().resolveJsonldContext(url)
|
|
432
527
|
return@asyncCall convertToRN(result)
|
|
433
528
|
}
|
|
434
529
|
}
|
|
435
530
|
|
|
531
|
+
@ReactMethod
|
|
532
|
+
fun deleteCache(types: ReadableArray?, promise: Promise) {
|
|
533
|
+
asyncCall(promise, scope) {
|
|
534
|
+
var cacheTypeList: List<CacheTypeBindingDto>? = null;
|
|
535
|
+
if (types != null) {
|
|
536
|
+
cacheTypeList = enumList(types, CacheTypeBindingDto::valueOf)
|
|
537
|
+
}
|
|
538
|
+
getCore().deleteCache(cacheTypeList)
|
|
539
|
+
return@asyncCall null
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
436
543
|
@ReactMethod
|
|
437
544
|
fun uninitialize(deleteData: Boolean, promise: Promise) {
|
|
438
|
-
asyncCall(promise) {
|
|
545
|
+
asyncCall(promise, scope) {
|
|
439
546
|
getCore().uninitialize(deleteData)
|
|
440
547
|
oneCore = null
|
|
548
|
+
if (deleteData) {
|
|
549
|
+
ubiqu?.reset()
|
|
550
|
+
}
|
|
551
|
+
return@asyncCall null
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// ===== Ubiqu specific methods
|
|
556
|
+
@ReactMethod
|
|
557
|
+
fun changeRSEPin(promise: Promise) {
|
|
558
|
+
asyncCall(promise, scope) {
|
|
559
|
+
getUbiqu().changePin()
|
|
560
|
+
return@asyncCall null
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
@ReactMethod
|
|
565
|
+
fun areRSEBiometricsSupported(promise: Promise) {
|
|
566
|
+
asyncCall(promise, scope) {
|
|
567
|
+
return@asyncCall getUbiqu().getBiometricsSupported()
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
@ReactMethod
|
|
572
|
+
fun areRSEBiometricsEnabled(promise: Promise) {
|
|
573
|
+
asyncCall(promise, scope) {
|
|
574
|
+
return@asyncCall getUbiqu().getBiometricsEnabled()
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
@ReactMethod
|
|
579
|
+
fun setRSEBiometrics(enabled: Boolean, promise: Promise) {
|
|
580
|
+
asyncCall(promise, scope) {
|
|
581
|
+
if (enabled) {
|
|
582
|
+
getUbiqu().enableBiometrics(true)
|
|
583
|
+
} else {
|
|
584
|
+
getUbiqu().disableBiometrics()
|
|
585
|
+
}
|
|
586
|
+
return@asyncCall null
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
@ReactMethod
|
|
591
|
+
fun resetRSE(promise: Promise) {
|
|
592
|
+
asyncCall(promise, scope) {
|
|
593
|
+
ubiqu?.reset()
|
|
594
|
+
return@asyncCall null
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
@ReactMethod
|
|
599
|
+
fun resetRSEPinFlow(promise: Promise) {
|
|
600
|
+
asyncCall(promise, scope) {
|
|
601
|
+
ubiqu?.resetPinFlow()
|
|
441
602
|
return@asyncCall null
|
|
442
603
|
}
|
|
443
604
|
}
|
|
605
|
+
|
|
606
|
+
// handling RN event emitter
|
|
607
|
+
@ReactMethod
|
|
608
|
+
fun addListener(eventName: String) {
|
|
609
|
+
UbiquKeyStorage.listenerCount++
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
@ReactMethod
|
|
613
|
+
fun removeListeners(count: Int) {
|
|
614
|
+
UbiquKeyStorage.listenerCount -= count
|
|
615
|
+
}
|
|
444
616
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
package ch.procivis.one.core
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ch.procivis.one.core.ubiqu.PinPadViewManager
|
|
4
4
|
import com.facebook.react.ReactPackage
|
|
5
5
|
import com.facebook.react.bridge.NativeModule
|
|
6
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
-
import com.facebook.react.uimanager.ReactShadowNode
|
|
8
7
|
import com.facebook.react.uimanager.ViewManager
|
|
9
8
|
|
|
10
9
|
class ProcivisOneCorePackage : ReactPackage {
|
|
11
10
|
|
|
12
11
|
override fun createViewManagers(
|
|
13
12
|
reactContext: ReactApplicationContext
|
|
14
|
-
): MutableList<ViewManager
|
|
13
|
+
): MutableList<ViewManager<*, *>> = mutableListOf(PinPadViewManager(reactContext))
|
|
15
14
|
|
|
16
15
|
override fun createNativeModules(
|
|
17
16
|
reactContext: ReactApplicationContext
|
|
18
|
-
): MutableList<NativeModule> =
|
|
17
|
+
): MutableList<NativeModule> = mutableListOf(ProcivisOneCoreModule(reactContext))
|
|
19
18
|
}
|