@procivis/react-native-one-core 1.33398.0 → 1.43299.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -26
- package/android/build.gradle +27 -3
- 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 +5 -5
- package/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +4 -3
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +136 -16
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCorePackage.kt +3 -4
- package/android/src/main/java/ch/procivis/one/core/Serialize.kt +3 -1
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +19 -0
- 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 +7 -0
- package/dist/index.js +10 -4
- package/dist/src/cache.d.ts +0 -4
- package/dist/src/cache.js +0 -5
- package/dist/src/config.d.ts +14 -4
- package/dist/src/core.d.ts +16 -6
- package/dist/src/core.js +72 -0
- package/dist/src/credential.d.ts +7 -2
- package/dist/src/credentialSchema.d.ts +5 -2
- package/dist/src/credentialSchema.js +2 -0
- package/dist/src/history.d.ts +23 -5
- package/dist/src/history.js +13 -1
- package/dist/src/identifier.d.ts +132 -0
- package/dist/src/identifier.js +29 -0
- package/dist/src/organisation.d.ts +8 -0
- package/dist/src/organisation.js +1 -0
- package/dist/src/proof.d.ts +26 -6
- package/dist/src/proof.js +13 -5
- package/dist/src/trust.d.ts +1 -1
- package/dist/src/ubiqu.d.ts +49 -0
- package/dist/src/ubiqu.js +69 -0
- package/ios/Deserialize.swift +141 -776
- package/ios/EventEmitter.swift +91 -0
- package/ios/ProcivisOneCoreModule.m +49 -5
- package/ios/ProcivisOneCoreModule.swift +994 -687
- package/ios/ProcivisRNOneCore.xcodeproj/project.pbxproj +37 -27
- package/ios/RNDecoder/RNDecoder.swift +191 -0
- package/ios/RNDecoder/RNDecodingStorage.swift +33 -0
- package/ios/RNDecoder/RNKeyedDecodingContainer.swift +133 -0
- package/ios/RNDecoder/RNUnkeyedDecodingContainer.swift +175 -0
- package/ios/RNEncoder/RNAnyCodingKey.swift +31 -0
- package/ios/RNEncoder/RNEncoder.swift +95 -0
- package/ios/RNEncoder/RNKeyedEncodingContainer.swift +81 -0
- package/ios/RNEncoder/RNSingleValueEncodingContainer.swift +78 -0
- package/ios/RNEncoder/RNUnkeyedEncodingContainer.swift +84 -0
- package/ios/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 +46 -596
- 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 +36 -25
- package/package.json +5 -4
- package/react-native-one-core.podspec +4 -5
package/ios/Serialize.swift
CHANGED
|
@@ -6,64 +6,55 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
+
import ProcivisOneCore
|
|
10
|
+
|
|
11
|
+
func serializeAny<T: Encodable>(_ value: T) throws -> Any {
|
|
12
|
+
let encoder = RNEncoder()
|
|
13
|
+
encoder.userInfo[customEncoderKey] = serializeSpecific as CustomEncoder
|
|
14
|
+
return try encoder.encode(value)
|
|
15
|
+
}
|
|
9
16
|
|
|
10
17
|
// Enum values serialization
|
|
11
18
|
func serializeEnumValue<T>(value: T) -> String {
|
|
12
|
-
|
|
19
|
+
return String(describing: value).snakeCased()
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
private let snakeCaseRegex = try! NSRegularExpression(pattern: "([a-z0-9])([A-Z])", options: [])
|
|
16
23
|
extension String {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
private func
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
func snakeCased() -> String {
|
|
25
|
+
let range = NSRange(location: 0, length: count)
|
|
26
|
+
return snakeCaseRegex.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: "$1_$2").uppercased()
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private func serializeSpecific(_ value: Encodable) throws -> Any? {
|
|
31
|
+
switch value {
|
|
32
|
+
case let data as HistoryMetadataBinding:
|
|
33
|
+
return try serialize(historyMetadata: data)
|
|
34
|
+
case let data as CredentialSchemaTypeBindingEnum:
|
|
35
|
+
return serialize(credentialSchemaType: data)
|
|
36
|
+
case let data as ClaimValueBindingDto:
|
|
37
|
+
return try serialize(claimValue: data)
|
|
38
|
+
case let data as ProofRequestClaimValueBindingDto:
|
|
39
|
+
return try serialize(proofRequestClaimValue: data)
|
|
40
|
+
case let data as HandleInvitationResponseBindingEnum:
|
|
41
|
+
return try serialize(invitationResponse: data)
|
|
42
|
+
|
|
43
|
+
default:
|
|
44
|
+
return nil
|
|
26
45
|
}
|
|
27
|
-
return serialize(value!)
|
|
28
46
|
}
|
|
29
47
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
private func serialize(historyMetadata: HistoryMetadataBinding) throws -> Any {
|
|
49
|
+
switch (historyMetadata) {
|
|
50
|
+
case let .unexportableEntities(value):
|
|
51
|
+
return try serializeAny(value);
|
|
52
|
+
case let .errorMetadata(value):
|
|
53
|
+
return try serializeAny(value);
|
|
35
54
|
}
|
|
36
55
|
}
|
|
37
56
|
|
|
38
|
-
|
|
39
|
-
func serialize(version: VersionBindingDto) -> NSDictionary {
|
|
40
|
-
return [
|
|
41
|
-
"target": version.target,
|
|
42
|
-
"buildTime": version.buildTime,
|
|
43
|
-
"branch": version.branch,
|
|
44
|
-
"tag": version.tag,
|
|
45
|
-
"commit": version.commit,
|
|
46
|
-
"rustVersion": version.rustVersion,
|
|
47
|
-
"pipelineId": version.pipelineId
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
func serialize(config: ConfigBindingDto) -> NSDictionary {
|
|
52
|
-
return [
|
|
53
|
-
"format": config.format,
|
|
54
|
-
"exchange": config.exchange,
|
|
55
|
-
"transport": config.transport,
|
|
56
|
-
"revocation": config.revocation,
|
|
57
|
-
"did": config.did,
|
|
58
|
-
"datatype": config.datatype,
|
|
59
|
-
"keyAlgorithm": config.keyAlgorithm,
|
|
60
|
-
"keyStorage": config.keyStorage,
|
|
61
|
-
"trustManagement": config.trustManagement,
|
|
62
|
-
"cacheEntities": config.cacheEntities,
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
func serialize(credentialSchemaType: CredentialSchemaTypeBindingEnum) -> String {
|
|
57
|
+
private func serialize(credentialSchemaType: CredentialSchemaTypeBindingEnum) -> String {
|
|
67
58
|
switch (credentialSchemaType) {
|
|
68
59
|
case .procivisOneSchema2024:
|
|
69
60
|
return "PROCIVIS_ONE_SCHEMA2024";
|
|
@@ -71,106 +62,14 @@ func serialize(credentialSchemaType: CredentialSchemaTypeBindingEnum) -> String
|
|
|
71
62
|
return "FALLBACK_SCHEMA2024";
|
|
72
63
|
case .mdoc:
|
|
73
64
|
return "MDOC";
|
|
65
|
+
case .sdJwtVc:
|
|
66
|
+
return "SD_JWT_VC";
|
|
74
67
|
case let .other(value):
|
|
75
68
|
return value;
|
|
76
69
|
}
|
|
77
70
|
}
|
|
78
71
|
|
|
79
|
-
func serialize(
|
|
80
|
-
var result: [String: Any] = [
|
|
81
|
-
"id": credentialSchema.id,
|
|
82
|
-
"createdDate": credentialSchema.createdDate,
|
|
83
|
-
"lastModified": credentialSchema.lastModified,
|
|
84
|
-
"name": credentialSchema.name,
|
|
85
|
-
"format": credentialSchema.format,
|
|
86
|
-
"revocationMethod": credentialSchema.revocationMethod,
|
|
87
|
-
"schemaId": credentialSchema.schemaId,
|
|
88
|
-
"importedSourceUrl": credentialSchema.importedSourceUrl,
|
|
89
|
-
"schemaType": serialize(credentialSchemaType: credentialSchema.schemaType)
|
|
90
|
-
]
|
|
91
|
-
result.addOpt("walletStorageType", opt(credentialSchema.walletStorageType, serializeEnumValue))
|
|
92
|
-
result.addOpt("layoutType", opt(credentialSchema.layoutType, serializeEnumValue))
|
|
93
|
-
result.addOpt("layoutProperties", opt(credentialSchema.layoutProperties, {properties in serialize(layoutProperties: properties)}))
|
|
94
|
-
return result as NSDictionary
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
func serialize(credentialSchemaDetail: CredentialSchemaDetailBindingDto) -> NSDictionary {
|
|
98
|
-
var result: [String: Any] = [
|
|
99
|
-
"id": credentialSchemaDetail.id,
|
|
100
|
-
"createdDate": credentialSchemaDetail.createdDate,
|
|
101
|
-
"lastModified": credentialSchemaDetail.lastModified,
|
|
102
|
-
"name": credentialSchemaDetail.name,
|
|
103
|
-
"format": credentialSchemaDetail.format,
|
|
104
|
-
"revocationMethod": credentialSchemaDetail.revocationMethod,
|
|
105
|
-
"schemaId": credentialSchemaDetail.schemaId,
|
|
106
|
-
"importedSourceUrl": credentialSchemaDetail.importedSourceUrl,
|
|
107
|
-
"schemaType": serialize(credentialSchemaType: credentialSchemaDetail.schemaType),
|
|
108
|
-
"claims": credentialSchemaDetail.claims.map { serialize(claimSchema: $0) }
|
|
109
|
-
]
|
|
110
|
-
result.addOpt("walletStorageType", opt(credentialSchemaDetail.walletStorageType, serializeEnumValue))
|
|
111
|
-
result.addOpt("layoutType", opt(credentialSchemaDetail.layoutType, serializeEnumValue))
|
|
112
|
-
result.addOpt("layoutProperties", opt(credentialSchemaDetail.layoutProperties, {properties in serialize(layoutProperties: properties)}))
|
|
113
|
-
|
|
114
|
-
return result as NSDictionary
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
func serialize(claimSchema: CredentialClaimSchemaBindingDto) -> NSDictionary {
|
|
118
|
-
return [
|
|
119
|
-
"id": claimSchema.id,
|
|
120
|
-
"createdDate": claimSchema.createdDate,
|
|
121
|
-
"lastModified": claimSchema.lastModified,
|
|
122
|
-
"required": claimSchema.required,
|
|
123
|
-
"key": claimSchema.key,
|
|
124
|
-
"array": claimSchema.array,
|
|
125
|
-
"datatype": claimSchema.datatype,
|
|
126
|
-
"claims": claimSchema.claims.map { serialize(claimSchema: $0) }
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
func serialize(layoutProperties: CredentialSchemaLayoutPropertiesBindingDto) -> NSDictionary {
|
|
131
|
-
var result: [String: Any] = [:]
|
|
132
|
-
result.addOpt("background", opt(layoutProperties.background, {background in serialize(backgroundProperties: background)}))
|
|
133
|
-
result.addOpt("logo", opt(layoutProperties.logo, {logo in serialize(logoProperties: logo)}))
|
|
134
|
-
result.addOpt("primaryAttribute", layoutProperties.primaryAttribute)
|
|
135
|
-
result.addOpt("secondaryAttribute", layoutProperties.secondaryAttribute)
|
|
136
|
-
result.addOpt("pictureAttribute", layoutProperties.pictureAttribute)
|
|
137
|
-
result.addOpt("code", opt(layoutProperties.code, {code in serialize(codeProperties: code)}))
|
|
138
|
-
return result as NSDictionary
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
func serialize(backgroundProperties: CredentialSchemaBackgroundPropertiesBindingDto) -> NSDictionary {
|
|
142
|
-
var result: [String: Any] = [:]
|
|
143
|
-
result.addOpt("color", backgroundProperties.color)
|
|
144
|
-
result.addOpt("image", backgroundProperties.image)
|
|
145
|
-
return result as NSDictionary
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
func serialize(logoProperties: CredentialSchemaLogoPropertiesBindingDto) -> NSDictionary {
|
|
149
|
-
var result: [String: Any] = [:]
|
|
150
|
-
result.addOpt("fontColor", logoProperties.fontColor)
|
|
151
|
-
result.addOpt("backgroundColor", logoProperties.backgroundColor)
|
|
152
|
-
result.addOpt("image", logoProperties.image)
|
|
153
|
-
return result as NSDictionary
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
func serialize(codeProperties: CredentialSchemaCodePropertiesBindingDto) -> NSDictionary {
|
|
157
|
-
return [
|
|
158
|
-
"attribute": codeProperties.attribute,
|
|
159
|
-
"type": serializeEnumValue(value: codeProperties.type),
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
func serialize(claim: ClaimBindingDto) -> NSDictionary {
|
|
164
|
-
return [
|
|
165
|
-
"id": claim.id,
|
|
166
|
-
"key": claim.key,
|
|
167
|
-
"dataType": claim.dataType,
|
|
168
|
-
"array": claim.array,
|
|
169
|
-
"value": serialize(claimValue: claim.value),
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
func serialize(claimValue: ClaimValueBindingDto) -> Any {
|
|
72
|
+
private func serialize(claimValue: ClaimValueBindingDto) throws -> Any {
|
|
174
73
|
switch (claimValue) {
|
|
175
74
|
case let .boolean(value):
|
|
176
75
|
return value;
|
|
@@ -181,366 +80,29 @@ func serialize(claimValue: ClaimValueBindingDto) -> Any {
|
|
|
181
80
|
case let .string(value):
|
|
182
81
|
return value;
|
|
183
82
|
case .nested(value: let values):
|
|
184
|
-
return values.map {
|
|
83
|
+
return try values.map { try serializeAny($0) }
|
|
185
84
|
}
|
|
186
85
|
}
|
|
187
86
|
|
|
188
|
-
func serialize(
|
|
189
|
-
var result: [String: Any] = [
|
|
190
|
-
"id": credentialListItem.id,
|
|
191
|
-
"createdDate": credentialListItem.createdDate,
|
|
192
|
-
"issuanceDate": credentialListItem.issuanceDate,
|
|
193
|
-
"lastModified": credentialListItem.lastModified,
|
|
194
|
-
"state": serializeEnumValue(value: credentialListItem.state),
|
|
195
|
-
"schema": serialize(credentialSchema: credentialListItem.schema),
|
|
196
|
-
"role": serializeEnumValue(value: credentialListItem.role),
|
|
197
|
-
]
|
|
198
|
-
result.addOpt("revocationDate", credentialListItem.revocationDate)
|
|
199
|
-
result.addOpt("issuerDid", credentialListItem.issuerDid)
|
|
200
|
-
result.addOpt("suspendEndDate", credentialListItem.suspendEndDate)
|
|
201
|
-
return result as NSDictionary
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
func serialize(credentialDetail: CredentialDetailBindingDto) -> NSDictionary {
|
|
205
|
-
var result: [String: Any] = [
|
|
206
|
-
"id": credentialDetail.id,
|
|
207
|
-
"createdDate": credentialDetail.createdDate,
|
|
208
|
-
"issuanceDate": credentialDetail.issuanceDate,
|
|
209
|
-
"lastModified": credentialDetail.lastModified,
|
|
210
|
-
"state": serializeEnumValue(value: credentialDetail.state),
|
|
211
|
-
"claims": credentialDetail.claims.map { serialize(claim: $0) },
|
|
212
|
-
"schema": serialize(credentialSchema: credentialDetail.schema),
|
|
213
|
-
"role": serializeEnumValue(value: credentialDetail.role),
|
|
214
|
-
]
|
|
215
|
-
result.addOpt("revocationDate", credentialDetail.revocationDate)
|
|
216
|
-
result.addOpt("issuerDid", opt(credentialDetail.issuerDid, {issuerDid in serialize(didListItem: issuerDid)}))
|
|
217
|
-
result.addOpt("holderDid", opt(credentialDetail.holderDid, {holderDid in serialize(didListItem: holderDid)}))
|
|
218
|
-
result.addOpt("redirectUri", credentialDetail.redirectUri)
|
|
219
|
-
result.addOpt("lvvcIssuanceDate", credentialDetail.lvvcIssuanceDate)
|
|
220
|
-
result.addOpt("suspendEndDate", credentialDetail.suspendEndDate)
|
|
221
|
-
result.addOpt("mdocMsoValidity", opt(credentialDetail.mdocMsoValidity, {validity in serialize(mdocMsoValidity: validity)}) )
|
|
222
|
-
return result as NSDictionary
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
func serialize(mdocMsoValidity: MdocMsoValidityResponseBindingDto) -> NSDictionary {
|
|
226
|
-
return [
|
|
227
|
-
"expiration": mdocMsoValidity.expiration,
|
|
228
|
-
"nextUpdate": mdocMsoValidity.nextUpdate,
|
|
229
|
-
"lastUpdate": mdocMsoValidity.lastUpdate,
|
|
230
|
-
]
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
func serialize(credentialList: CredentialListBindingDto) -> NSDictionary {
|
|
234
|
-
return [
|
|
235
|
-
"totalItems": credentialList.totalItems,
|
|
236
|
-
"totalPages": credentialList.totalPages,
|
|
237
|
-
"values": credentialList.values.map { serialize(credentialListItem: $0) },
|
|
238
|
-
]
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
func serialize(didList: DidListBindingDto) -> NSDictionary {
|
|
242
|
-
return [
|
|
243
|
-
"totalItems": didList.totalItems,
|
|
244
|
-
"totalPages": didList.totalPages,
|
|
245
|
-
"values": didList.values.map { serialize(didListItem: $0) },
|
|
246
|
-
]
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
func serialize(credentialSchemaList: CredentialSchemaListBindingDto) -> NSDictionary {
|
|
250
|
-
return [
|
|
251
|
-
"totalItems": credentialSchemaList.totalItems,
|
|
252
|
-
"totalPages": credentialSchemaList.totalPages,
|
|
253
|
-
"values": credentialSchemaList.values.map { serialize(credentialSchema: $0) },
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
func serialize(proofList: ProofListBindingDto) -> NSDictionary {
|
|
258
|
-
return [
|
|
259
|
-
"totalItems": proofList.totalItems,
|
|
260
|
-
"totalPages": proofList.totalPages,
|
|
261
|
-
"values": proofList.values.map { serialize(proofListItem: $0) },
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
func serialize(proofListItem: ProofListItemBindingDto) -> NSDictionary {
|
|
266
|
-
var result: [String: Any] = [
|
|
267
|
-
"id": proofListItem.id,
|
|
268
|
-
"createdDate": proofListItem.createdDate,
|
|
269
|
-
"lastModified": proofListItem.lastModified,
|
|
270
|
-
"issuanceDate": proofListItem.issuanceDate,
|
|
271
|
-
"exchange": proofListItem.exchange,
|
|
272
|
-
"transport": proofListItem.transport,
|
|
273
|
-
"state": serializeEnumValue(value: proofListItem.state),
|
|
274
|
-
]
|
|
275
|
-
|
|
276
|
-
result.addOpt("requestedDate", proofListItem.requestedDate)
|
|
277
|
-
result.addOpt("completedDate", proofListItem.completedDate)
|
|
278
|
-
result.addOpt("schema", opt(proofListItem.schema, {proofSchema in serialize(proofSchemaListItem: proofSchema) }))
|
|
279
|
-
result.addOpt("verifierDid", proofListItem.verifierDid)
|
|
280
|
-
|
|
281
|
-
return result as NSDictionary
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
func serialize(proposeProofResponse: ProposeProofResponseBindingDto) -> NSDictionary {
|
|
285
|
-
return [
|
|
286
|
-
"proofId": proposeProofResponse.proofId,
|
|
287
|
-
"interactionId": proposeProofResponse.interactionId,
|
|
288
|
-
"url": proposeProofResponse.url,
|
|
289
|
-
]
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
func serialize(proofRequest: ProofRequestBindingDto) -> NSDictionary {
|
|
293
|
-
var result: [String: Any] = [
|
|
294
|
-
"id": proofRequest.id,
|
|
295
|
-
"createdDate": proofRequest.createdDate,
|
|
296
|
-
"lastModified": proofRequest.lastModified,
|
|
297
|
-
"proofInputs": proofRequest.proofInputs.map { serialize(proofInput: $0) },
|
|
298
|
-
"state": serializeEnumValue(value: proofRequest.state),
|
|
299
|
-
"exchange": proofRequest.exchange,
|
|
300
|
-
]
|
|
301
|
-
result.addOpt("proofSchema", opt(proofRequest.proofSchema, {proofSchema in serialize(proofSchemaListItem: proofSchema) }))
|
|
302
|
-
result.addOpt("verifierDid", opt(proofRequest.verifierDid, {verifierDid in serialize(didListItem: verifierDid)}))
|
|
303
|
-
result.addOpt("holderDid", opt(proofRequest.holderDid, {holderDid in serialize(didListItem: holderDid)}))
|
|
304
|
-
result.addOpt("redirectUri", proofRequest.redirectUri)
|
|
305
|
-
return result as NSDictionary
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
func serialize(proofSchemaList: ProofSchemaListBindingDto) -> NSDictionary {
|
|
309
|
-
return [
|
|
310
|
-
"totalItems": proofSchemaList.totalItems,
|
|
311
|
-
"totalPages": proofSchemaList.totalPages,
|
|
312
|
-
"values": proofSchemaList.values.map { serialize(proofSchemaListItem: $0) },
|
|
313
|
-
]
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
func serialize(proofSchemaListItem: GetProofSchemaListItemBindingDto) -> NSDictionary {
|
|
317
|
-
var result: [String: Any] = [
|
|
318
|
-
"id": proofSchemaListItem.id,
|
|
319
|
-
"createdDate": proofSchemaListItem.createdDate,
|
|
320
|
-
"lastModified": proofSchemaListItem.lastModified,
|
|
321
|
-
"name": proofSchemaListItem.name,
|
|
322
|
-
"expireDuration": proofSchemaListItem.expireDuration
|
|
323
|
-
]
|
|
324
|
-
|
|
325
|
-
result.addOpt("deletedAt", proofSchemaListItem.deletedAt)
|
|
326
|
-
return result as NSDictionary
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
func serialize(proofSchema: GetProofSchemaBindingDto) -> NSDictionary {
|
|
330
|
-
var result: [String: Any] = [
|
|
331
|
-
"id": proofSchema.id,
|
|
332
|
-
"createdDate": proofSchema.createdDate,
|
|
333
|
-
"lastModified": proofSchema.lastModified,
|
|
334
|
-
"name": proofSchema.name,
|
|
335
|
-
"organisationId": proofSchema.organisationId,
|
|
336
|
-
"expireDuration": proofSchema.expireDuration,
|
|
337
|
-
"proofInputSchemas": proofSchema.proofInputSchemas.map { serialize(proofInputSchema: $0) }
|
|
338
|
-
]
|
|
339
|
-
result.addOpt("importedSourceUrl", proofSchema.importedSourceUrl)
|
|
340
|
-
return result as NSDictionary
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
func serialize(proofInputSchema: ProofInputSchemaBindingDto) -> NSDictionary {
|
|
344
|
-
var result: [String: Any] = [
|
|
345
|
-
"claimSchemas": proofInputSchema.claimSchemas.map { serialize(proofClaimSchema: $0) },
|
|
346
|
-
"credentialSchema": serialize(credentialSchema: proofInputSchema.credentialSchema),
|
|
347
|
-
]
|
|
348
|
-
result.addOpt("validityConstraint", proofInputSchema.validityConstraint)
|
|
349
|
-
|
|
350
|
-
return result as NSDictionary
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
func serialize(proofInput: ProofInputBindingDto) -> NSDictionary {
|
|
354
|
-
var result: [String: Any] = [
|
|
355
|
-
"claims": proofInput.claims.map { serialize(proofRequestClaim: $0) },
|
|
356
|
-
"credentialSchema": serialize(credentialSchema: proofInput.credentialSchema),
|
|
357
|
-
]
|
|
358
|
-
result.addOpt("credential", opt(proofInput.credential, { credential in serialize(credentialDetail: credential) }))
|
|
359
|
-
result.addOpt("validityConstraint", proofInput.validityConstraint)
|
|
360
|
-
return result as NSDictionary
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
func serialize(proofRequestClaim: ProofRequestClaimBindingDto) -> NSDictionary {
|
|
364
|
-
var result: [String: Any] = [
|
|
365
|
-
"schema": serialize(proofClaimSchema: proofRequestClaim.schema),
|
|
366
|
-
]
|
|
367
|
-
|
|
368
|
-
result.addOpt("value", opt(proofRequestClaim.value, { claim in serialize(proofRequestClaimValue: claim) }))
|
|
369
|
-
return result as NSDictionary
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
func serialize(proofRequestClaimValue: ProofRequestClaimValueBindingDto) -> Any {
|
|
87
|
+
private func serialize(proofRequestClaimValue: ProofRequestClaimValueBindingDto) throws -> Any {
|
|
373
88
|
switch (proofRequestClaimValue) {
|
|
374
89
|
case let .value(value):
|
|
375
90
|
return value;
|
|
376
91
|
case .claims(value: let values):
|
|
377
|
-
return values.map {
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
func serialize(proofClaimSchema: ProofClaimSchemaBindingDto) -> NSDictionary {
|
|
382
|
-
return [
|
|
383
|
-
"id": proofClaimSchema.id,
|
|
384
|
-
"requested": proofClaimSchema.requested,
|
|
385
|
-
"required": proofClaimSchema.required,
|
|
386
|
-
"key": proofClaimSchema.key,
|
|
387
|
-
"dataType": proofClaimSchema.dataType,
|
|
388
|
-
"claims": proofClaimSchema.claims.map { serialize(proofClaimSchema: $0)},
|
|
389
|
-
"array": proofClaimSchema.array,
|
|
390
|
-
]
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
func serialize(presentationDefinition: PresentationDefinitionBindingDto) -> NSDictionary {
|
|
394
|
-
return [
|
|
395
|
-
"requestGroups": presentationDefinition.requestGroups.map { serialize(presentationDefinitionRequestGroup: $0) },
|
|
396
|
-
]
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
func serialize(presentationDefinitionRequestGroup: PresentationDefinitionRequestGroupBindingDto) -> NSDictionary {
|
|
400
|
-
var result: [String: Any] = [
|
|
401
|
-
"id": presentationDefinitionRequestGroup.id,
|
|
402
|
-
"rule": serialize(presentationDefinitionRule: presentationDefinitionRequestGroup.rule),
|
|
403
|
-
"requestedCredentials": presentationDefinitionRequestGroup.requestedCredentials.map { serialize(presentationDefinitionRequestedCredential: $0) },
|
|
404
|
-
]
|
|
405
|
-
result.addOpt("name", presentationDefinitionRequestGroup.name)
|
|
406
|
-
result.addOpt("purpose", presentationDefinitionRequestGroup.purpose)
|
|
407
|
-
return result as NSDictionary
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
func serialize(presentationDefinitionRequestedCredential: PresentationDefinitionRequestedCredentialBindingDto) -> NSDictionary {
|
|
411
|
-
var result: [String: Any] = [
|
|
412
|
-
"id": presentationDefinitionRequestedCredential.id,
|
|
413
|
-
"fields": presentationDefinitionRequestedCredential.fields.map { serialize(presentationDefinitionField: $0) },
|
|
414
|
-
"applicableCredentials": presentationDefinitionRequestedCredential.applicableCredentials,
|
|
415
|
-
"inapplicableCredentials": presentationDefinitionRequestedCredential.inapplicableCredentials,
|
|
416
|
-
]
|
|
417
|
-
result.addOpt("name", presentationDefinitionRequestedCredential.name)
|
|
418
|
-
result.addOpt("purpose", presentationDefinitionRequestedCredential.purpose)
|
|
419
|
-
result.addOpt("validityCredentialNbf", presentationDefinitionRequestedCredential.validityCredentialNbf)
|
|
420
|
-
return result as NSDictionary
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
func serialize(presentationDefinitionField: PresentationDefinitionFieldBindingDto) -> NSDictionary {
|
|
424
|
-
var result: [String: Any] = [
|
|
425
|
-
"id": presentationDefinitionField.id,
|
|
426
|
-
"required": presentationDefinitionField.required,
|
|
427
|
-
"keyMap": presentationDefinitionField.keyMap,
|
|
428
|
-
]
|
|
429
|
-
result.addOpt("name", presentationDefinitionField.name)
|
|
430
|
-
result.addOpt("purpose", presentationDefinitionField.purpose)
|
|
431
|
-
return result as NSDictionary
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
func serialize(presentationDefinitionRule: PresentationDefinitionRuleBindingDto) -> NSDictionary {
|
|
435
|
-
var result: [String: Any] = [
|
|
436
|
-
"type": serializeEnumValue(value: presentationDefinitionRule.type),
|
|
437
|
-
]
|
|
438
|
-
result.addOpt("min", presentationDefinitionRule.min)
|
|
439
|
-
result.addOpt("max", presentationDefinitionRule.max)
|
|
440
|
-
result.addOpt("count", presentationDefinitionRule.count)
|
|
441
|
-
return result as NSDictionary
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
func serialize(credentialRevocationCheckResponse: CredentialRevocationCheckResponseBindingDto) -> NSDictionary {
|
|
445
|
-
var result: [String: Any] = [
|
|
446
|
-
"credentialId": credentialRevocationCheckResponse.credentialId,
|
|
447
|
-
"status": serializeEnumValue(value: credentialRevocationCheckResponse.status),
|
|
448
|
-
"success": credentialRevocationCheckResponse.success,
|
|
449
|
-
]
|
|
450
|
-
result.addOpt("reason", credentialRevocationCheckResponse.reason)
|
|
451
|
-
return result as NSDictionary
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
func serialize(historyList: HistoryListBindingDto) -> NSDictionary {
|
|
455
|
-
return [
|
|
456
|
-
"totalItems": historyList.totalItems,
|
|
457
|
-
"totalPages": historyList.totalPages,
|
|
458
|
-
"values": historyList.values.map { serialize(historyListItem: $0) },
|
|
459
|
-
]
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
func serialize(historyListItem: HistoryListItemBindingDto) -> NSDictionary {
|
|
463
|
-
var result = [
|
|
464
|
-
"id": historyListItem.id,
|
|
465
|
-
"createdDate": historyListItem.createdDate,
|
|
466
|
-
"action": serializeEnumValue(value: historyListItem.action),
|
|
467
|
-
"entityType": serializeEnumValue(value: historyListItem.entityType),
|
|
468
|
-
"organisationId": historyListItem.organisationId,
|
|
469
|
-
]
|
|
470
|
-
result.addOpt("entityId", historyListItem.entityId)
|
|
471
|
-
result.addOpt("metadata", opt(historyListItem.metadata, {data in serialize(historyMetadata: data)}))
|
|
472
|
-
return result as NSDictionary
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
func serialize(historyMetadata: HistoryMetadataBinding) -> NSDictionary {
|
|
476
|
-
switch (historyMetadata) {
|
|
477
|
-
case let .unexportableEntities(value):
|
|
478
|
-
return serialize(unexportableEntities: value);
|
|
92
|
+
return try values.map { try serializeAny($0)}
|
|
479
93
|
}
|
|
480
94
|
}
|
|
481
95
|
|
|
482
|
-
func serialize(
|
|
483
|
-
return [
|
|
484
|
-
"id": keyListItem.id,
|
|
485
|
-
"createdDate": keyListItem.createdDate,
|
|
486
|
-
"lastModified": keyListItem.lastModified,
|
|
487
|
-
"name": keyListItem.name,
|
|
488
|
-
"publicKey": keyListItem.publicKey,
|
|
489
|
-
"storageType": keyListItem.storageType,
|
|
490
|
-
"keyType": keyListItem.keyType,
|
|
491
|
-
]
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
func serialize(didListItem: DidListItemBindingDto) -> NSDictionary {
|
|
495
|
-
return [
|
|
496
|
-
"id": didListItem.id,
|
|
497
|
-
"createdDate": didListItem.createdDate,
|
|
498
|
-
"lastModified": didListItem.lastModified,
|
|
499
|
-
"name": didListItem.name,
|
|
500
|
-
"did": didListItem.did,
|
|
501
|
-
"didType": serializeEnumValue(value: didListItem.didType),
|
|
502
|
-
"didMethod": didListItem.didMethod,
|
|
503
|
-
"deactivated": didListItem.deactivated,
|
|
504
|
-
]
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
func serialize(unexportableEntities: UnexportableEntitiesBindingDto) -> NSDictionary {
|
|
508
|
-
return [
|
|
509
|
-
"credentials": unexportableEntities.credentials.map { serialize(credentialDetail: $0) },
|
|
510
|
-
"keys": unexportableEntities.keys.map { serialize(keyListItem: $0) },
|
|
511
|
-
"dids": unexportableEntities.dids.map { serialize(didListItem: $0) },
|
|
512
|
-
"totalCredentials": unexportableEntities.totalCredentials,
|
|
513
|
-
"totalKeys": unexportableEntities.totalKeys,
|
|
514
|
-
"totalDids": unexportableEntities.totalDids,
|
|
515
|
-
]
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
func serialize(backupCreate: BackupCreateBindingDto) -> NSDictionary {
|
|
519
|
-
return [
|
|
520
|
-
"historyId": backupCreate.historyId,
|
|
521
|
-
"file": backupCreate.file,
|
|
522
|
-
"unexportable": serialize(unexportableEntities: backupCreate.unexportable),
|
|
523
|
-
]
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
func serialize(importBackupMetadata: MetadataBindingDto) -> NSDictionary {
|
|
527
|
-
return [
|
|
528
|
-
"dbVersion": importBackupMetadata.dbVersion,
|
|
529
|
-
"dbHash": importBackupMetadata.dbHash,
|
|
530
|
-
"createdAt": importBackupMetadata.createdAt,
|
|
531
|
-
]
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
func serialize(invitationResponse: HandleInvitationResponseBindingEnum) -> NSDictionary {
|
|
96
|
+
private func serialize(invitationResponse: HandleInvitationResponseBindingEnum) throws -> NSDictionary {
|
|
535
97
|
switch (invitationResponse) {
|
|
536
98
|
case let .credentialIssuance(interactionId, credentialIds, txCode):
|
|
537
99
|
var result: [String: Any] = [
|
|
538
100
|
"interactionId": interactionId,
|
|
539
101
|
"credentialIds": credentialIds
|
|
540
102
|
];
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
103
|
+
if let txCode = txCode {
|
|
104
|
+
result["txCode"] = try serializeAny(txCode)
|
|
105
|
+
}
|
|
544
106
|
return result as NSDictionary;
|
|
545
107
|
|
|
546
108
|
case let .proofRequest(interactionId, proofId):
|
|
@@ -550,115 +112,3 @@ func serialize(invitationResponse: HandleInvitationResponseBindingEnum) -> NSDic
|
|
|
550
112
|
];
|
|
551
113
|
}
|
|
552
114
|
}
|
|
553
|
-
|
|
554
|
-
func serialize(txCode: OpenId4vciTxCodeBindingDto) -> NSDictionary {
|
|
555
|
-
var result: [String: Any] = [:];
|
|
556
|
-
|
|
557
|
-
result.addOpt("inputMode", opt(txCode.inputMode, serializeEnumValue));
|
|
558
|
-
result.addOpt("length", txCode.length);
|
|
559
|
-
result.addOpt("description", txCode.description);
|
|
560
|
-
|
|
561
|
-
return result as NSDictionary;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
func serialize(shareProofResponse: ShareProofResponseBindingDto) -> NSDictionary {
|
|
565
|
-
return [
|
|
566
|
-
"url": shareProofResponse.url,
|
|
567
|
-
]
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
func serialize(proofSchemaShareResponse: ProofSchemaShareResponseBindingDto) -> NSDictionary {
|
|
571
|
-
return [
|
|
572
|
-
"url": proofSchemaShareResponse.url,
|
|
573
|
-
]
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
func serialize(credentialSchemaShareResponse: CredentialSchemaShareResponseBindingDto) -> NSDictionary {
|
|
577
|
-
return [
|
|
578
|
-
"url": credentialSchemaShareResponse.url,
|
|
579
|
-
]
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
func serialize(resolveJsonLdContextResponse: ResolveJsonLdContextResponseBindingDto) -> NSDictionary {
|
|
583
|
-
return [
|
|
584
|
-
"context": resolveJsonLdContextResponse.context,
|
|
585
|
-
]
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
func serialize(trustAnchor: GetTrustAnchorResponseBindingDto) -> NSDictionary {
|
|
589
|
-
return [
|
|
590
|
-
"id": trustAnchor.id,
|
|
591
|
-
"createdDate": trustAnchor.createdDate,
|
|
592
|
-
"lastModified": trustAnchor.lastModified,
|
|
593
|
-
"name": trustAnchor.name,
|
|
594
|
-
"type": trustAnchor.type,
|
|
595
|
-
"isPublisher": trustAnchor.isPublisher,
|
|
596
|
-
"publisherReference": trustAnchor.publisherReference,
|
|
597
|
-
]
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
func serialize(trustAnchorList: TrustAnchorsListBindingDto) -> NSDictionary {
|
|
601
|
-
return [
|
|
602
|
-
"totalItems": trustAnchorList.totalItems,
|
|
603
|
-
"totalPages": trustAnchorList.totalPages,
|
|
604
|
-
"values": trustAnchorList.values.map { serialize(trustAnchorListItem: $0) },
|
|
605
|
-
]
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
func serialize(trustEntityList: TrustEntitiesListBindingDto) -> NSDictionary {
|
|
609
|
-
return [
|
|
610
|
-
"totalItems": trustEntityList.totalItems,
|
|
611
|
-
"totalPages": trustEntityList.totalPages,
|
|
612
|
-
"values": trustEntityList.values.map { serialize(trustEntityListItem: $0) },
|
|
613
|
-
]
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
func serialize(trustAnchorListItem: TrustAnchorsListItemResponseBindingDto) -> NSDictionary {
|
|
617
|
-
return [
|
|
618
|
-
"id": trustAnchorListItem.id,
|
|
619
|
-
"createdDate": trustAnchorListItem.createdDate,
|
|
620
|
-
"lastModified": trustAnchorListItem.lastModified,
|
|
621
|
-
"name": trustAnchorListItem.name,
|
|
622
|
-
"type": trustAnchorListItem.type,
|
|
623
|
-
"isPublisher": trustAnchorListItem.isPublisher,
|
|
624
|
-
"publisherReference": trustAnchorListItem.publisherReference,
|
|
625
|
-
"entities": trustAnchorListItem.entities,
|
|
626
|
-
]
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
func serialize(trustEntity: GetTrustEntityResponseBindingDto) -> NSDictionary {
|
|
630
|
-
var result: [String: Any] = [
|
|
631
|
-
"id": trustEntity.id,
|
|
632
|
-
"organisationId": trustEntity.organisationId,
|
|
633
|
-
"createdDate": trustEntity.createdDate,
|
|
634
|
-
"lastModified": trustEntity.lastModified,
|
|
635
|
-
"name": trustEntity.name,
|
|
636
|
-
"role": serializeEnumValue(value: trustEntity.role),
|
|
637
|
-
"trustAnchor": serialize(trustAnchor: trustEntity.trustAnchor),
|
|
638
|
-
"did": serialize(didListItem: trustEntity.did),
|
|
639
|
-
"state": serializeEnumValue(value: trustEntity.state),
|
|
640
|
-
]
|
|
641
|
-
result.addOpt("logo", trustEntity.logo)
|
|
642
|
-
result.addOpt("website", trustEntity.website)
|
|
643
|
-
result.addOpt("termsUrl", trustEntity.termsUrl)
|
|
644
|
-
result.addOpt("privacyUrl", trustEntity.privacyUrl)
|
|
645
|
-
return result as NSDictionary
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
func serialize(trustEntityListItem: TrustEntitiesListItemResponseBindingDto) -> NSDictionary {
|
|
649
|
-
var result: [String: Any] = [
|
|
650
|
-
"id": trustEntityListItem.id,
|
|
651
|
-
"createdDate": trustEntityListItem.createdDate,
|
|
652
|
-
"lastModified": trustEntityListItem.lastModified,
|
|
653
|
-
"name": trustEntityListItem.name,
|
|
654
|
-
"role": serializeEnumValue(value: trustEntityListItem.role),
|
|
655
|
-
"trustAnchor": serialize(trustAnchor: trustEntityListItem.trustAnchor),
|
|
656
|
-
"did": serialize(didListItem: trustEntityListItem.did),
|
|
657
|
-
"state": serializeEnumValue(value: trustEntityListItem.state),
|
|
658
|
-
]
|
|
659
|
-
result.addOpt("logo", trustEntityListItem.logo)
|
|
660
|
-
result.addOpt("website", trustEntityListItem.website)
|
|
661
|
-
result.addOpt("termsUrl", trustEntityListItem.termsUrl)
|
|
662
|
-
result.addOpt("privacyUrl", trustEntityListItem.privacyUrl)
|
|
663
|
-
return result as NSDictionary
|
|
664
|
-
}
|