@velocitycareerlabs/vcl-react-native 2.6.12 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativeModule.kt +24 -0
- package/android/src/main/java/io/velocitycareerlabs/reactnative/utlis/Converter.kt +43 -2
- package/ios/Utils/Converter.swift +37 -0
- package/ios/VclReactNative.mm +5 -0
- package/ios/VclReactNative.swift +17 -1
- package/lib/commonjs/api/VCLApi.js +27 -20
- package/lib/commonjs/api/VCLApi.js.map +1 -1
- package/lib/commonjs/api/entities/VCLAuthToken.js +6 -0
- package/lib/commonjs/api/entities/VCLAuthToken.js.map +1 -0
- package/lib/commonjs/api/entities/VCLAuthTokenDescriptor.js +6 -0
- package/lib/commonjs/api/entities/VCLAuthTokenDescriptor.js.map +1 -0
- package/lib/commonjs/api/entities/VCLServiceType.js +1 -0
- package/lib/commonjs/api/entities/VCLServiceType.js.map +1 -1
- package/lib/commonjs/api/entities/error/VCLErrorCode.js +3 -0
- package/lib/commonjs/api/entities/error/VCLErrorCode.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/module/api/Dictionary.js +1 -1
- package/lib/module/api/VCLApi.js +12 -3
- package/lib/module/api/VCLApi.js.map +1 -1
- package/lib/module/api/VCLCryptoServiceType.js +2 -0
- package/lib/module/api/VCLCryptoServiceType.js.map +1 -1
- package/lib/module/api/VCLEnvironment.js +2 -0
- package/lib/module/api/VCLEnvironment.js.map +1 -1
- package/lib/module/api/VCLSignatureAlgorithm.js +2 -0
- package/lib/module/api/VCLSignatureAlgorithm.js.map +1 -1
- package/lib/module/api/VCLXVnfProtocolVersion.js +2 -0
- package/lib/module/api/VCLXVnfProtocolVersion.js.map +1 -1
- package/lib/module/api/entities/VCLAuthToken.js +4 -0
- package/lib/module/api/entities/VCLAuthToken.js.map +1 -0
- package/lib/module/api/entities/VCLAuthTokenDescriptor.js +4 -0
- package/lib/module/api/entities/VCLAuthTokenDescriptor.js.map +1 -0
- package/lib/module/api/entities/VCLCountries.js +2 -0
- package/lib/module/api/entities/VCLCountries.js.map +1 -1
- package/lib/module/api/entities/VCLCountry.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifest.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptor.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorByDeepLink.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorByService.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorRefresh.js +2 -0
- package/lib/module/api/entities/VCLCredentialType.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypeSchema.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypeSchemas.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypes.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypesUIFormSchema.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js +1 -1
- package/lib/module/api/entities/VCLDeepLink.js +1 -1
- package/lib/module/api/entities/VCLDidJwk.js +2 -0
- package/lib/module/api/entities/VCLDidJwkDescriptor.js +2 -0
- package/lib/module/api/entities/VCLExchange.js +1 -1
- package/lib/module/api/entities/VCLExchangeDescriptor.js +2 -0
- package/lib/module/api/entities/VCLFilter.js +2 -0
- package/lib/module/api/entities/VCLFinalizeOffersDescriptor.js +2 -0
- package/lib/module/api/entities/VCLGenerateOffersDescriptor.js +2 -0
- package/lib/module/api/entities/VCLIssuingType.js +2 -0
- package/lib/module/api/entities/VCLIssuingType.js.map +1 -1
- package/lib/module/api/entities/VCLJwt.js +2 -0
- package/lib/module/api/entities/VCLJwtDescriptor.js +2 -0
- package/lib/module/api/entities/VCLJwtVerifiableCredentials.js +2 -0
- package/lib/module/api/entities/VCLOffer.js +2 -0
- package/lib/module/api/entities/VCLOffers.js +2 -0
- package/lib/module/api/entities/VCLOrganization.js +2 -0
- package/lib/module/api/entities/VCLOrganizations.js +2 -0
- package/lib/module/api/entities/VCLOrganizationsSearchDescriptor.js +2 -0
- package/lib/module/api/entities/VCLPage.js +1 -1
- package/lib/module/api/entities/VCLPresentationRequest.js +2 -0
- package/lib/module/api/entities/VCLPresentationRequestDescriptor.js +2 -0
- package/lib/module/api/entities/VCLPresentationSubmission.js +2 -0
- package/lib/module/api/entities/VCLPublicJwk.js +1 -1
- package/lib/module/api/entities/VCLPushDelegate.js +1 -1
- package/lib/module/api/entities/VCLRegion.js +2 -0
- package/lib/module/api/entities/VCLRegions.js +2 -0
- package/lib/module/api/entities/VCLService.js +2 -0
- package/lib/module/api/entities/VCLServiceType.js +3 -0
- package/lib/module/api/entities/VCLServiceType.js.map +1 -1
- package/lib/module/api/entities/VCLServiceTypes.js +2 -0
- package/lib/module/api/entities/VCLSubmissionResult.js +2 -0
- package/lib/module/api/entities/VCLToken.js +1 -1
- package/lib/module/api/entities/VCLVerifiableCredential.js +1 -1
- package/lib/module/api/entities/VCLVerifiedProfile.js +2 -0
- package/lib/module/api/entities/VCLVerifiedProfileDescriptor.js +1 -1
- package/lib/module/api/entities/error/VCLError.js +2 -0
- package/lib/module/api/entities/error/VCLError.js.map +1 -1
- package/lib/module/api/entities/error/VCLErrorCode.js +5 -0
- package/lib/module/api/entities/error/VCLErrorCode.js.map +1 -1
- package/lib/module/api/entities/error/VCLStatusCode.js +2 -0
- package/lib/module/api/entities/error/VCLStatusCode.js.map +1 -1
- package/lib/module/api/entities/initialization/VCLCryptoServicesDescriptor.js +2 -0
- package/lib/module/api/entities/initialization/VCLInitializationDescriptor.js +2 -0
- package/lib/module/api/entities/initialization/VCLJwtServiceUrls.js +1 -1
- package/lib/module/api/entities/initialization/VCLKeyServiceUrls.js +1 -1
- package/lib/module/api/entities/initialization/VCLRemoteCryptoServicesUrlsDescriptor.js +2 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/api/VCLApi.d.ts +3 -29
- package/lib/typescript/src/api/VCLApi.d.ts.map +1 -1
- package/lib/typescript/src/api/entities/VCLAuthToken.d.ts +17 -0
- package/lib/typescript/src/api/entities/VCLAuthToken.d.ts.map +1 -0
- package/lib/typescript/src/api/entities/VCLAuthTokenDescriptor.d.ts +16 -0
- package/lib/typescript/src/api/entities/VCLAuthTokenDescriptor.d.ts.map +1 -0
- package/lib/typescript/src/api/entities/VCLPresentationRequest.d.ts +1 -0
- package/lib/typescript/src/api/entities/VCLPresentationRequest.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +17 -12
- package/src/api/VCLApi.ts +46 -32
- package/src/api/entities/VCLAuthToken.ts +17 -0
- package/src/api/entities/VCLAuthTokenDescriptor.ts +16 -0
- package/src/api/entities/VCLPresentationRequest.ts +1 -0
- package/src/index.tsx +4 -0
- package/velocitycareerlabs-vcl-react-native.podspec +7 -28
package/android/build.gradle
CHANGED
|
@@ -92,8 +92,8 @@ dependencies {
|
|
|
92
92
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
93
93
|
|
|
94
94
|
//--------- Must: be added:
|
|
95
|
-
implementation "io.velocitycareerlabs:vcl:2.
|
|
96
|
-
implementation 'com.nimbusds:nimbus-jose-jwt:
|
|
95
|
+
implementation "io.velocitycareerlabs:vcl:2.7.1"
|
|
96
|
+
implementation 'com.nimbusds:nimbus-jose-jwt:10.0.1'
|
|
97
97
|
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
98
98
|
//-------------------------
|
|
99
99
|
}
|
|
@@ -37,7 +37,10 @@ import io.velocitycareerlabs.api.VCLProvider
|
|
|
37
37
|
import io.velocitycareerlabs.api.entities.error.VCLError
|
|
38
38
|
import io.velocitycareerlabs.api.entities.initialization.VCLInitializationDescriptor
|
|
39
39
|
import io.velocitycareerlabs.reactnative.extensions.toThrowable
|
|
40
|
+
import io.velocitycareerlabs.reactnative.utlis.Converter.authTokenToMap
|
|
40
41
|
import io.velocitycareerlabs.reactnative.utlis.Converter.didJwkToMap
|
|
42
|
+
import io.velocitycareerlabs.reactnative.utlis.Converter.mapToAuthToken
|
|
43
|
+
import io.velocitycareerlabs.reactnative.utlis.Converter.mapToAuthTokenDescriptor
|
|
41
44
|
import io.velocitycareerlabs.reactnative.utlis.Converter.mapToDidJwk
|
|
42
45
|
import io.velocitycareerlabs.reactnative.utlis.Converter.mapToDidJwkDescriptor
|
|
43
46
|
import io.velocitycareerlabs.reactnative.utlis.Converter.mapToInitializationDescriptor
|
|
@@ -152,11 +155,13 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
152
155
|
@ReactMethod
|
|
153
156
|
fun submitPresentation(
|
|
154
157
|
presentationSubmissionMap: ReadableMap,
|
|
158
|
+
authTokenMap: ReadableMap? = null,
|
|
155
159
|
promise: Promise
|
|
156
160
|
) {
|
|
157
161
|
try {
|
|
158
162
|
vcl.submitPresentation(
|
|
159
163
|
presentationSubmission = mapToPresentationSubmission(presentationSubmissionMap),
|
|
164
|
+
authToken = mapToAuthToken(authTokenMap),
|
|
160
165
|
successHandler = {
|
|
161
166
|
promise.resolve(presentationSubmissionResultToMap(it))
|
|
162
167
|
},
|
|
@@ -294,6 +299,25 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
294
299
|
}
|
|
295
300
|
}
|
|
296
301
|
|
|
302
|
+
@ReactMethod
|
|
303
|
+
fun getAuthToken(
|
|
304
|
+
authTokenDescriptorMap: ReadableMap,
|
|
305
|
+
promise: Promise
|
|
306
|
+
) {
|
|
307
|
+
try {
|
|
308
|
+
vcl.getAuthToken(
|
|
309
|
+
authTokenDescriptor = mapToAuthTokenDescriptor(authTokenDescriptorMap),
|
|
310
|
+
successHandler = {
|
|
311
|
+
promise.resolve(authTokenToMap(it))
|
|
312
|
+
},
|
|
313
|
+
errorHandler = {
|
|
314
|
+
promise.reject(it.toThrowable())
|
|
315
|
+
})
|
|
316
|
+
} catch (ex: Exception) {
|
|
317
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
297
321
|
@ReactMethod
|
|
298
322
|
fun getCredentialTypesUIFormSchema(
|
|
299
323
|
credentialTypesUIFormSchemaDescriptorMap: ReadableMap,
|
|
@@ -242,6 +242,7 @@ object Converter {
|
|
|
242
242
|
)
|
|
243
243
|
presentationRequestMap.putMap("deepLink", deepLinkToMap(presentationRequest.deepLink))
|
|
244
244
|
presentationRequestMap.putMap("didJwk", didJwkToMap(presentationRequest.didJwk))
|
|
245
|
+
presentationRequestMap.putBoolean("feed", presentationRequest.feed)
|
|
245
246
|
presentationRequestMap.putMap(
|
|
246
247
|
"remoteCryptoServicesToken",
|
|
247
248
|
tokenToMap(presentationRequest.remoteCryptoServicesToken)
|
|
@@ -471,8 +472,8 @@ object Converter {
|
|
|
471
472
|
VCLIssuingType.Career
|
|
472
473
|
),
|
|
473
474
|
credentialTypes =
|
|
474
|
-
|
|
475
|
-
|
|
475
|
+
(credentialManifestDescriptorByServiceMap.getArrayOpt("credentialTypes")?.toArrayList()
|
|
476
|
+
?.toList() as? List<String>),
|
|
476
477
|
pushDelegate = mapToPushDelegate(
|
|
477
478
|
credentialManifestDescriptorByServiceMap.getMapOpt("pushDelegate")
|
|
478
479
|
),
|
|
@@ -683,6 +684,46 @@ object Converter {
|
|
|
683
684
|
fun mapToJwt(jwtMap: ReadableMap?) =
|
|
684
685
|
VCLJwt(encodedJwt = jwtMap?.getStringOpt("encodedJwt") ?: "")
|
|
685
686
|
|
|
687
|
+
fun mapToAuthTokenDescriptor(
|
|
688
|
+
authTokenDescriptorMap: ReadableMap
|
|
689
|
+
): VCLAuthTokenDescriptor {
|
|
690
|
+
authTokenDescriptorMap.getMapOpt("presentationRequest")?.let { presentationRequestMap ->
|
|
691
|
+
return VCLAuthTokenDescriptor(
|
|
692
|
+
presentationRequest = mapToPresentationRequest(
|
|
693
|
+
presentationRequestMap
|
|
694
|
+
)
|
|
695
|
+
)
|
|
696
|
+
}
|
|
697
|
+
return VCLAuthTokenDescriptor(
|
|
698
|
+
authTokenUri = authTokenDescriptorMap.getStringOpt("authTokenUri") ?: "",
|
|
699
|
+
refreshToken = mapToToken(authTokenDescriptorMap.getMapOpt("refreshToken")),
|
|
700
|
+
walletDid = authTokenDescriptorMap.getStringOpt("walletDid"),
|
|
701
|
+
relyingPartyDid = authTokenDescriptorMap.getStringOpt("relyingPartyDid"),
|
|
702
|
+
vendorOriginContext = authTokenDescriptorMap.getStringOpt("vendorOriginContext")
|
|
703
|
+
)
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
fun authTokenToMap(
|
|
707
|
+
authToken: VCLAuthToken
|
|
708
|
+
): ReadableMap {
|
|
709
|
+
val authTokenMap = Arguments.createMap()
|
|
710
|
+
authTokenMap.putMap("payload", authToken.payload.toReadableMap())
|
|
711
|
+
authTokenMap.putString("authTokenUri", authToken.authTokenUri)
|
|
712
|
+
authTokenMap.putMap("refreshToken", tokenToMap(authToken.refreshToken))
|
|
713
|
+
authTokenMap.putString("walletDid", authToken.walletDid)
|
|
714
|
+
authTokenMap.putString("relyingPartyDid", authToken.relyingPartyDid)
|
|
715
|
+
return authTokenMap
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
fun mapToAuthToken(authTokenMap: ReadableMap?): VCLAuthToken {
|
|
719
|
+
return VCLAuthToken(
|
|
720
|
+
payload = authTokenMap?.getMapOpt("payload")?.toJsonObject() ?: JSONObject(),
|
|
721
|
+
authTokenUri = authTokenMap?.getStringOpt("authTokenUri"),
|
|
722
|
+
walletDid = authTokenMap?.getStringOpt("walletDid"),
|
|
723
|
+
relyingPartyDid = authTokenMap?.getStringOpt("relyingPartyDid")
|
|
724
|
+
)
|
|
725
|
+
}
|
|
726
|
+
|
|
686
727
|
fun mapToCredentialTypesUIFormSchemaDescriptor(
|
|
687
728
|
credentialTypesUIFormSchemaDescriptorMap: ReadableMap
|
|
688
729
|
) = VCLCredentialTypesUIFormSchemaDescriptor(
|
|
@@ -234,6 +234,7 @@ func presentationRequestToDictionary(
|
|
|
234
234
|
presentationRequestDictionary["presentationDefinitionId"] = presentationRequest.presentationDefinitionId
|
|
235
235
|
presentationRequestDictionary["deepLink"] = deepLinkToDictionary(presentationRequest.deepLink)
|
|
236
236
|
presentationRequestDictionary["didJwk"] = didJwkToDictionary(presentationRequest.didJwk)
|
|
237
|
+
presentationRequestDictionary["feed"] = presentationRequest.feed
|
|
237
238
|
presentationRequestDictionary["remoteCryptoServicesToken"] = tokenToDictionary(presentationRequest.remoteCryptoServicesToken)
|
|
238
239
|
return presentationRequestDictionary
|
|
239
240
|
}
|
|
@@ -622,6 +623,42 @@ func jwtVerifiableCredentialsToDictionary(
|
|
|
622
623
|
return jwtVerifiableCredentialsDictionary
|
|
623
624
|
}
|
|
624
625
|
|
|
626
|
+
func dictionaryToAuthTokenDescriptor(
|
|
627
|
+
_ authTokenDescriptorDictionary: [String: Any]
|
|
628
|
+
) -> VCLAuthTokenDescriptor {
|
|
629
|
+
if let presentationRequestDictionary = authTokenDescriptorDictionary["presentationRequest"] as? [String: Any] {
|
|
630
|
+
return VCLAuthTokenDescriptor(presentationRequest: dictionaryToPresentationRequest(presentationRequestDictionary))
|
|
631
|
+
}
|
|
632
|
+
return VCLAuthTokenDescriptor(
|
|
633
|
+
authTokenUri: authTokenDescriptorDictionary["authTokenUri"] as? String ?? "",
|
|
634
|
+
refreshToken: dictionaryToToken(authTokenDescriptorDictionary["refreshToken"] as? [String : Any]),
|
|
635
|
+
walletDid: authTokenDescriptorDictionary["walletDid"] as? String,
|
|
636
|
+
relyingPartyDid: authTokenDescriptorDictionary["relyingPartyDid"] as? String,
|
|
637
|
+
vendorOriginContext: authTokenDescriptorDictionary["vendorOriginContext"] as? String
|
|
638
|
+
)
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
func authTokenToDictionary(
|
|
642
|
+
_ authToken: VCLAuthToken
|
|
643
|
+
) -> [String: Any] {
|
|
644
|
+
var authTokenDictionary = [String: Any]()
|
|
645
|
+
authTokenDictionary["payload"] = authToken.payload
|
|
646
|
+
authTokenDictionary["authTokenUri"] = authToken.authTokenUri
|
|
647
|
+
authTokenDictionary["refreshToken"] = tokenToDictionary(authToken.refreshToken)
|
|
648
|
+
authTokenDictionary["walletDid"] = authToken.walletDid
|
|
649
|
+
authTokenDictionary["relyingPartyDid"] = authToken.relyingPartyDid
|
|
650
|
+
return authTokenDictionary
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
func dictionaryToAuthToken(_ authTokenDictionary: [String: Any]) -> VCLAuthToken {
|
|
654
|
+
return VCLAuthToken(
|
|
655
|
+
payload: authTokenDictionary["payload"] as? [String: Any] ?? [:],
|
|
656
|
+
authTokenUri: authTokenDictionary["authTokenUri"] as? String,
|
|
657
|
+
walletDid: authTokenDictionary["walletDid"] as? String,
|
|
658
|
+
relyingPartyDid: authTokenDictionary["relyingPartyDid"] as? String
|
|
659
|
+
)
|
|
660
|
+
}
|
|
661
|
+
|
|
625
662
|
func readableMapToCredentialTypesUIFormSchemaDescriptor(
|
|
626
663
|
_ credentialTypesUIFormSchemaDescriptorDictionary: [String: Any]
|
|
627
664
|
) -> VCLCredentialTypesUIFormSchemaDescriptor {
|
package/ios/VclReactNative.mm
CHANGED
|
@@ -26,6 +26,7 @@ RCT_EXTERN_METHOD(getPresentationRequest:(NSDictionary*)presentationRequestDescr
|
|
|
26
26
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
27
27
|
|
|
28
28
|
RCT_EXTERN_METHOD(submitPresentation:(NSDictionary*)presentationSubmissionDictionary
|
|
29
|
+
withAuthTokenDictionary:(NSDictionary*)authTokenDictionary
|
|
29
30
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
30
31
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
31
32
|
|
|
@@ -55,6 +56,10 @@ RCT_EXTERN_METHOD(finalizeOffers:(NSDictionary*)finalizeOffersDescriptorDictiona
|
|
|
55
56
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
56
57
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
57
58
|
|
|
59
|
+
RCT_EXTERN_METHOD(getAuthToken:(NSDictionary*)authTokenDescriptorDictionary
|
|
60
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
61
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
62
|
+
|
|
58
63
|
RCT_EXTERN_METHOD(getCredentialTypesUIFormSchema:(NSDictionary*)credentialTypesUIFormSchemaDescriptorDictionary
|
|
59
64
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
60
65
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
package/ios/VclReactNative.swift
CHANGED
|
@@ -87,15 +87,17 @@ class VclReactNative: NSObject {
|
|
|
87
87
|
)
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
@objc(submitPresentation:withResolver:withRejecter:)
|
|
90
|
+
@objc(submitPresentation:withAuthTokenDictionary:withResolver:withRejecter:)
|
|
91
91
|
func submitPresentation(
|
|
92
92
|
presentationSubmissionDictionary: [String: Any],
|
|
93
|
+
authTokenDictionary: [String: Any],
|
|
93
94
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
94
95
|
) {
|
|
95
96
|
vcl.submitPresentation(
|
|
96
97
|
presentationSubmission: dictionaryToPresentationSubmission(
|
|
97
98
|
presentationSubmissionDictionary
|
|
98
99
|
),
|
|
100
|
+
authToken: dictionaryToAuthToken(authTokenDictionary),
|
|
99
101
|
successHandler: {
|
|
100
102
|
resolve(presentationSubmissionResultToDictionary($0))
|
|
101
103
|
},
|
|
@@ -203,6 +205,20 @@ class VclReactNative: NSObject {
|
|
|
203
205
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
204
206
|
})
|
|
205
207
|
}
|
|
208
|
+
|
|
209
|
+
@objc(getAuthToken:withResolver:withRejecter:)
|
|
210
|
+
func getAuthToken(
|
|
211
|
+
authTokenDescriptorDictionary: [String: Any],
|
|
212
|
+
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
213
|
+
) {
|
|
214
|
+
vcl.getAuthToken(authTokenDescriptor: dictionaryToAuthTokenDescriptor(authTokenDescriptorDictionary),
|
|
215
|
+
successHandler: {
|
|
216
|
+
resolve(authTokenToDictionary($0))
|
|
217
|
+
},
|
|
218
|
+
errorHandler: {
|
|
219
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
220
|
+
})
|
|
221
|
+
}
|
|
206
222
|
|
|
207
223
|
@objc(getCredentialTypesUIFormSchema:withResolver:withRejecter:)
|
|
208
224
|
func getCredentialTypesUIFormSchema(
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.VclApi = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
-
var
|
|
8
|
+
var _vclReactNative = require("@velocitycareerlabs/vcl-react-native");
|
|
9
9
|
/**
|
|
10
10
|
* Created by Michael Avoyan.
|
|
11
11
|
*
|
|
@@ -21,119 +21,126 @@ const VclApi = exports.VclApi = {
|
|
|
21
21
|
try {
|
|
22
22
|
return await VclReactNative.initialize(initializationDescriptor);
|
|
23
23
|
} catch (e) {
|
|
24
|
-
throw new
|
|
24
|
+
throw new _vclReactNative.VCLError(e);
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
getCountries: async () => {
|
|
28
28
|
try {
|
|
29
29
|
return await VclReactNative.getCountries();
|
|
30
30
|
} catch (e) {
|
|
31
|
-
throw new
|
|
31
|
+
throw new _vclReactNative.VCLError(e);
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
getCredentialTypes: async () => {
|
|
35
35
|
try {
|
|
36
36
|
return await VclReactNative.getCredentialTypes();
|
|
37
37
|
} catch (e) {
|
|
38
|
-
throw new
|
|
38
|
+
throw new _vclReactNative.VCLError(e);
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
getCredentialTypeSchemas: async () => {
|
|
42
42
|
try {
|
|
43
43
|
return await VclReactNative.getCredentialTypeSchemas();
|
|
44
44
|
} catch (e) {
|
|
45
|
-
throw new
|
|
45
|
+
throw new _vclReactNative.VCLError(e);
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
getPresentationRequest: async presentationRequestDescriptor => {
|
|
49
49
|
try {
|
|
50
50
|
return await VclReactNative.getPresentationRequest(presentationRequestDescriptor);
|
|
51
51
|
} catch (e) {
|
|
52
|
-
throw new
|
|
52
|
+
throw new _vclReactNative.VCLError(e);
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
submitPresentation: async presentationSubmission => {
|
|
55
|
+
submitPresentation: async (presentationSubmission, authToken) => {
|
|
56
56
|
try {
|
|
57
|
-
return await VclReactNative.submitPresentation(presentationSubmission);
|
|
57
|
+
return await VclReactNative.submitPresentation(presentationSubmission, authToken);
|
|
58
58
|
} catch (e) {
|
|
59
|
-
throw new
|
|
59
|
+
throw new _vclReactNative.VCLError(e);
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
getExchangeProgress: async exchangeDescriptor => {
|
|
63
63
|
try {
|
|
64
64
|
return await VclReactNative.getExchangeProgress(exchangeDescriptor);
|
|
65
65
|
} catch (e) {
|
|
66
|
-
throw new
|
|
66
|
+
throw new _vclReactNative.VCLError(e);
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
searchForOrganizations: async organizationsSearchDescriptor => {
|
|
70
70
|
try {
|
|
71
71
|
return await VclReactNative.searchForOrganizations(organizationsSearchDescriptor);
|
|
72
72
|
} catch (e) {
|
|
73
|
-
throw new
|
|
73
|
+
throw new _vclReactNative.VCLError(e);
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
getCredentialManifest: async credentialManifestDescriptor => {
|
|
77
77
|
try {
|
|
78
78
|
return await VclReactNative.getCredentialManifest(credentialManifestDescriptor);
|
|
79
79
|
} catch (e) {
|
|
80
|
-
throw new
|
|
80
|
+
throw new _vclReactNative.VCLError(e);
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
generateOffers: async generateOffersDescriptor => {
|
|
84
84
|
try {
|
|
85
85
|
return await VclReactNative.generateOffers(generateOffersDescriptor);
|
|
86
86
|
} catch (e) {
|
|
87
|
-
throw new
|
|
87
|
+
throw new _vclReactNative.VCLError(e);
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
checkForOffers: async (generateOffersDescriptor, sessionToken) => {
|
|
91
91
|
try {
|
|
92
92
|
return await VclReactNative.checkForOffers(generateOffersDescriptor, sessionToken);
|
|
93
93
|
} catch (e) {
|
|
94
|
-
throw new
|
|
94
|
+
throw new _vclReactNative.VCLError(e);
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
finalizeOffers: async (finalizeOffersDescriptor, sessionToken) => {
|
|
98
98
|
try {
|
|
99
99
|
return await VclReactNative.finalizeOffers(finalizeOffersDescriptor, sessionToken);
|
|
100
100
|
} catch (e) {
|
|
101
|
-
throw new
|
|
101
|
+
throw new _vclReactNative.VCLError(e);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
getAuthToken: async authTokenDescriptor => {
|
|
105
|
+
try {
|
|
106
|
+
return await VclReactNative.getAuthToken(authTokenDescriptor);
|
|
107
|
+
} catch (e) {
|
|
108
|
+
throw new _vclReactNative.VCLError(e);
|
|
102
109
|
}
|
|
103
110
|
},
|
|
104
111
|
getCredentialTypesUIFormSchema: async credentialTypesUIFormSchemaDescriptor => {
|
|
105
112
|
try {
|
|
106
113
|
return await VclReactNative.getCredentialTypesUIFormSchema(credentialTypesUIFormSchemaDescriptor);
|
|
107
114
|
} catch (e) {
|
|
108
|
-
throw new
|
|
115
|
+
throw new _vclReactNative.VCLError(e);
|
|
109
116
|
}
|
|
110
117
|
},
|
|
111
118
|
getVerifiedProfile: async verifiedProfileDescriptor => {
|
|
112
119
|
try {
|
|
113
120
|
return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);
|
|
114
121
|
} catch (e) {
|
|
115
|
-
throw new
|
|
122
|
+
throw new _vclReactNative.VCLError(e);
|
|
116
123
|
}
|
|
117
124
|
},
|
|
118
125
|
verifyJwt: async (jwt, jwkPublic, remoteCryptoServicesToken) => {
|
|
119
126
|
try {
|
|
120
127
|
return await VclReactNative.verifyJwt(jwt, jwkPublic, remoteCryptoServicesToken);
|
|
121
128
|
} catch (e) {
|
|
122
|
-
throw new
|
|
129
|
+
throw new _vclReactNative.VCLError(e);
|
|
123
130
|
}
|
|
124
131
|
},
|
|
125
132
|
generateSignedJwt: async (jwtDescriptor, didJwk, remoteCryptoServicesToken) => {
|
|
126
133
|
try {
|
|
127
134
|
return await VclReactNative.generateSignedJwt(jwtDescriptor, didJwk, remoteCryptoServicesToken);
|
|
128
135
|
} catch (e) {
|
|
129
|
-
throw new
|
|
136
|
+
throw new _vclReactNative.VCLError(e);
|
|
130
137
|
}
|
|
131
138
|
},
|
|
132
139
|
generateDidJwk: async didJwkDescriptor => {
|
|
133
140
|
try {
|
|
134
141
|
return await VclReactNative.generateDidJwk(didJwkDescriptor);
|
|
135
142
|
} catch (e) {
|
|
136
|
-
throw new
|
|
143
|
+
throw new _vclReactNative.VCLError(e);
|
|
137
144
|
}
|
|
138
145
|
}
|
|
139
146
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_vclReactNative","VclReactNative","NativeModules","VclApi","exports","initialize","initializationDescriptor","e","VCLError","getCountries","getCredentialTypes","getCredentialTypeSchemas","getPresentationRequest","presentationRequestDescriptor","submitPresentation","presentationSubmission","authToken","getExchangeProgress","exchangeDescriptor","searchForOrganizations","organizationsSearchDescriptor","getCredentialManifest","credentialManifestDescriptor","generateOffers","generateOffersDescriptor","checkForOffers","sessionToken","finalizeOffers","finalizeOffersDescriptor","getAuthToken","authTokenDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","remoteCryptoServicesToken","generateSignedJwt","jwtDescriptor","didJwk","generateDidJwk","didJwkDescriptor"],"sourceRoot":"../../../src","sources":["api/VCLApi.ts"],"mappings":";;;;;;AAOA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AARA;AACA;AACA;AACA;AACA;AACA;;AAqCA,MAAM;EAAEE;AAAe,CAAC,GAAGC,0BAAa;AAEjC,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,UAAU,EAAE,MACVC,wBAAqD,IACnC;IAClB,IAAI;MACF,OAAO,MAAML,cAAc,CAACI,UAAU,CAACC,wBAAwB,CAAC;IAClE,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,MAAM,IAAIC,wBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDE,YAAY,EAAE,MAAAA,CAAA,KAAmC;IAC/C,IAAI;MACF,OAAO,MAAMR,cAAc,CAACQ,YAAY,CAAC,CAAC;IAC5C,CAAC,CAAC,OAAOF,CAAC,EAAE;MACV,MAAM,IAAIC,wBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDG,kBAAkB,EAAE,MAAAA,CAAA,KAAyC;IAC3D,IAAI;MACF,OAAO,MAAMT,cAAc,CAACS,kBAAkB,CAAC,CAAC;IAClD,CAAC,CAAC,OAAOH,CAAC,EAAE;MACV,MAAM,IAAIC,wBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDI,wBAAwB,EAAE,MAAAA,CAAA,KAA+C;IACvE,IAAI;MACF,OAAO,MAAMV,cAAc,CAACU,wBAAwB,CAAC,CAAC;IACxD,CAAC,CAAC,OAAOJ,CAAC,EAAE;MACV,MAAM,IAAIC,wBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAED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AS,EAAE,MAAAA,CACTC,GAAW,EACXC,SAAuB,EACvBC,yBAAoC,KACf;IACrB,IAAI;MACF,OAAO,MAAMrC,cAAc,CAACkC,SAAS,CACnCC,GAAG,EACHC,SAAS,EACTC,yBACF,CAAC;IACH,CAAC,CAAC,OAAO/B,CAAC,EAAE;MACV,MAAM,IAAIC,wBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDgC,iBAAiB,EAAE,MAAAA,CACjBC,aAA+B,EAC/BC,MAAiB,EACjBH,yBAAoC,KAChB;IACpB,IAAI;MACF,OAAO,MAAMrC,cAAc,CAACsC,iBAAiB,CAC3CC,aAAa,EACbC,MAAM,EACNH,yBACF,CAAC;IACH,CAAC,CAAC,OAAO/B,CAAC,EAAE;MACV,MAAM,IAAIC,wBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDmC,cAAc,EAAE,MACdC,gBAAqC,IACd;IACvB,IAAI;MACF,OAAO,MAAM1C,cAAc,CAACyC,cAAc,CAACC,gBAAgB,CAAC;IAC9D,CAAC,CAAC,OAAOpC,CAAC,EAAE;MACV,MAAM,IAAIC,wBAAQ,CAACD,CAAC,CAAC;IACvB;EACF;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["api/entities/VCLAuthToken.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["api/entities/VCLAuthTokenDescriptor.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -15,6 +15,7 @@ let VCLServiceType = exports.VCLServiceType = /*#__PURE__*/function (VCLServiceT
|
|
|
15
15
|
VCLServiceType["Issuer"] = "Issuer";
|
|
16
16
|
VCLServiceType["NotaryIssuer"] = "NotaryIssuer";
|
|
17
17
|
VCLServiceType["CareerIssuer"] = "CareerIssuer";
|
|
18
|
+
// Identity issuer types:
|
|
18
19
|
VCLServiceType["IdentityIssuer"] = "IdentityIssuer";
|
|
19
20
|
VCLServiceType["IdDocumentIssuer"] = "IdDocumentIssuer";
|
|
20
21
|
VCLServiceType["NotaryIdDocumentIssuer"] = "NotaryIdDocumentIssuer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VCLServiceType","exports"],"sourceRoot":"../../../../src","sources":["api/entities/VCLServiceType.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AALA,IAOYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;
|
|
1
|
+
{"version":3,"names":["VCLServiceType","exports"],"sourceRoot":"../../../../src","sources":["api/entities/VCLServiceType.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AALA,IAOYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAKxB;EALUA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
|
@@ -11,6 +11,7 @@ exports.VCLErrorCode = void 0;
|
|
|
11
11
|
* SPDX-License-Identifier: Apache-2.0
|
|
12
12
|
*/
|
|
13
13
|
let VCLErrorCode = exports.VCLErrorCode = /*#__PURE__*/function (VCLErrorCode) {
|
|
14
|
+
// Credential issuer verification error codes:
|
|
14
15
|
VCLErrorCode["CredentialTypeNotRegistered"] = "credential_type_not_registered";
|
|
15
16
|
VCLErrorCode["IssuerRequiresIdentityPermission"] = "issuer_requires_identity_permission";
|
|
16
17
|
VCLErrorCode["IssuerRequiresNotaryPermission"] = "issuer_requires_notary_permission";
|
|
@@ -18,10 +19,12 @@ let VCLErrorCode = exports.VCLErrorCode = /*#__PURE__*/function (VCLErrorCode) {
|
|
|
18
19
|
VCLErrorCode["InvalidCredentialSubjectType"] = "invalid_credential_subject_type";
|
|
19
20
|
VCLErrorCode["InvalidCredentialSubjectContext"] = "invalid_credential_subject_context";
|
|
20
21
|
VCLErrorCode["IssuerUnexpectedPermissionFailure"] = "issuer_unexpected_permission_failure";
|
|
22
|
+
// DID consistent with the Deep Link
|
|
21
23
|
VCLErrorCode["MismatchedRequestIssuerDid"] = "mismatched_request_issuer_did";
|
|
22
24
|
VCLErrorCode["MismatchedOfferIssuerDid"] = "mismatched_offer_issuer_did";
|
|
23
25
|
VCLErrorCode["MismatchedCredentialIssuerDid"] = "mismatched_credential_issuer_did";
|
|
24
26
|
VCLErrorCode["MismatchedPresentationRequestInspectorDid"] = "mismatched_presentation_request_inspector_did";
|
|
27
|
+
// General error
|
|
25
28
|
VCLErrorCode["SdkError"] = "sdk_error";
|
|
26
29
|
return VCLErrorCode;
|
|
27
30
|
}({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VCLErrorCode","exports"],"sourceRoot":"../../../../../src","sources":["api/entities/error/VCLErrorCode.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AALA,IAOYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;
|
|
1
|
+
{"version":3,"names":["VCLErrorCode","exports"],"sourceRoot":"../../../../../src","sources":["api/entities/error/VCLErrorCode.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AALA,IAOYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EACtB;EADUA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAStB;EATUA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EActB;EAdUA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_VCLApi","require","_VCLEnvironment","_VCLXVnfProtocolVersion","_VCLCryptoServiceType","_VCLSignatureAlgorithm","_VCLCountries","_VCLServiceType","_VCLIssuingType","_VCLError","_VCLStatusCode","_VCLErrorCode","_default","exports","default","VclApi"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AAOA,IAAAK,aAAA,GAAAL,OAAA;AAiCA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,eAAA,GAAAP,OAAA;AAYA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAnEA;AACA;AACA;AACA;AACA;AACA;AALA,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,
|
|
1
|
+
{"version":3,"names":["_VCLApi","require","_VCLEnvironment","_VCLXVnfProtocolVersion","_VCLCryptoServiceType","_VCLSignatureAlgorithm","_VCLCountries","_VCLServiceType","_VCLIssuingType","_VCLError","_VCLStatusCode","_VCLErrorCode","_default","exports","default","VclApi"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AAOA,IAAAK,aAAA,GAAAL,OAAA;AAiCA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,eAAA,GAAAP,OAAA;AAYA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAnEA;AACA;AACA;AACA;AACA;AACA;AALA,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAuEeC,cAAM","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=Dictionary.js.map
|
package/lib/module/api/VCLApi.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Created by Michael Avoyan.
|
|
3
5
|
*
|
|
@@ -6,7 +8,7 @@
|
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
10
|
import { NativeModules } from 'react-native';
|
|
9
|
-
import { VCLError } from '
|
|
11
|
+
import { VCLError } from '@velocitycareerlabs/vcl-react-native';
|
|
10
12
|
const {
|
|
11
13
|
VclReactNative
|
|
12
14
|
} = NativeModules;
|
|
@@ -46,9 +48,9 @@ export const VclApi = {
|
|
|
46
48
|
throw new VCLError(e);
|
|
47
49
|
}
|
|
48
50
|
},
|
|
49
|
-
submitPresentation: async presentationSubmission => {
|
|
51
|
+
submitPresentation: async (presentationSubmission, authToken) => {
|
|
50
52
|
try {
|
|
51
|
-
return await VclReactNative.submitPresentation(presentationSubmission);
|
|
53
|
+
return await VclReactNative.submitPresentation(presentationSubmission, authToken);
|
|
52
54
|
} catch (e) {
|
|
53
55
|
throw new VCLError(e);
|
|
54
56
|
}
|
|
@@ -95,6 +97,13 @@ export const VclApi = {
|
|
|
95
97
|
throw new VCLError(e);
|
|
96
98
|
}
|
|
97
99
|
},
|
|
100
|
+
getAuthToken: async authTokenDescriptor => {
|
|
101
|
+
try {
|
|
102
|
+
return await VclReactNative.getAuthToken(authTokenDescriptor);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
throw new VCLError(e);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
98
107
|
getCredentialTypesUIFormSchema: async credentialTypesUIFormSchemaDescriptor => {
|
|
99
108
|
try {
|
|
100
109
|
return await VclReactNative.getCredentialTypesUIFormSchema(credentialTypesUIFormSchemaDescriptor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","VCLError","VclReactNative","VclApi","initialize","initializationDescriptor","e","getCountries","getCredentialTypes","getCredentialTypeSchemas","getPresentationRequest","presentationRequestDescriptor","submitPresentation","presentationSubmission","getExchangeProgress","exchangeDescriptor","searchForOrganizations","organizationsSearchDescriptor","getCredentialManifest","credentialManifestDescriptor","generateOffers","generateOffersDescriptor","checkForOffers","sessionToken","finalizeOffers","finalizeOffersDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","remoteCryptoServicesToken","generateSignedJwt","jwtDescriptor","didJwk","generateDidJwk","didJwkDescriptor"],"sourceRoot":"../../../src","sources":["api/VCLApi.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["NativeModules","VCLError","VclReactNative","VclApi","initialize","initializationDescriptor","e","getCountries","getCredentialTypes","getCredentialTypeSchemas","getPresentationRequest","presentationRequestDescriptor","submitPresentation","presentationSubmission","authToken","getExchangeProgress","exchangeDescriptor","searchForOrganizations","organizationsSearchDescriptor","getCredentialManifest","credentialManifestDescriptor","generateOffers","generateOffersDescriptor","checkForOffers","sessionToken","finalizeOffers","finalizeOffersDescriptor","getAuthToken","authTokenDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","remoteCryptoServicesToken","generateSignedJwt","jwtDescriptor","didJwk","generateDidJwk","didJwkDescriptor"],"sourceRoot":"../../../src","sources":["api/VCLApi.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SA+BEC,QAAQ,QACH,sCAAsC;AAE7C,MAAM;EAAEC;AAAe,CAAC,GAAGF,aAAa;AAExC,OAAO,MAAMG,MAAM,GAAG;EACpBC,UAAU,EAAE,MACVC,wBAAqD,IACnC;IAClB,IAAI;MACF,OAAO,MAAMH,cAAc,CAACE,UAAU,CAACC,wBAAwB,CAAC;IAClE,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDC,YAAY,EAAE,MAAAA,CAAA,KAAmC;IAC/C,IAAI;MACF,OAAO,MAAML,cAAc,CAACK,YAAY,CAAC,CAAC;IAC5C,CAAC,CAAC,OAAOD,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDE,kBAAkB,EAAE,MAAAA,CAAA,KAAyC;IAC3D,IAAI;MACF,OAAO,MAAMN,cAAc,CAACM,kBAAkB,CAAC,CAAC;IAClD,CAAC,CAAC,OAAOF,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDG,wBAAwB,EAAE,MAAAA,CAAA,KAA+C;IACvE,IAAI;MACF,OAAO,MAAMP,cAAc,CAACO,wBAAwB,CAAC,CAAC;IACxD,CAAC,CAAC,OAAOH,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDI,sBAAsB,EAAE,MACtBC,6BAA+D,IAC3B;IACpC,IAAI;MACF,OAAO,MAAMT,cAAc,CAACQ,sBAAsB,CAChDC,6BACF,CAAC;IACH,CAAC,CAAC,OAAOL,CAAC,EAAE;MACV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AC,CAAC,OAAO9B,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAED+B,iBAAiB,EAAE,MAAAA,CACjBC,aAA+B,EAC/BC,MAAiB,EACjBH,yBAAoC,KAChB;IACpB,IAAI;MACF,OAAO,MAAMlC,cAAc,CAACmC,iBAAiB,CAC3CC,aAAa,EACbC,MAAM,EACNH,yBACF,CAAC;IACH,CAAC,CAAC,OAAO9B,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDkC,cAAc,EAAE,MACdC,gBAAqC,IACd;IACvB,IAAI;MACF,OAAO,MAAMvC,cAAc,CAACsC,cAAc,CAACC,gBAAgB,CAAC;IAC9D,CAAC,CAAC,OAAOnC,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VCLCryptoServiceType"],"sourceRoot":"../../../src","sources":["api/VCLCryptoServiceType.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["VCLCryptoServiceType"],"sourceRoot":"../../../src","sources":["api/VCLCryptoServiceType.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VCLEnvironment"],"sourceRoot":"../../../src","sources":["api/VCLEnvironment.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["VCLEnvironment"],"sourceRoot":"../../../src","sources":["api/VCLEnvironment.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VCLSignatureAlgorithm"],"sourceRoot":"../../../src","sources":["api/VCLSignatureAlgorithm.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["VCLSignatureAlgorithm"],"sourceRoot":"../../../src","sources":["api/VCLSignatureAlgorithm.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VCLXVnfProtocolVersion"],"sourceRoot":"../../../src","sources":["api/VCLXVnfProtocolVersion.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["VCLXVnfProtocolVersion"],"sourceRoot":"../../../src","sources":["api/VCLXVnfProtocolVersion.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["api/entities/VCLAuthToken.ts"],"mappings":"","ignoreList":[]}
|