@velocitycareerlabs/vcl-react-native 1.3.0 → 1.4.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.
Files changed (51) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativeModule.kt +27 -12
  3. package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/MapExtensions.kt +15 -1
  4. package/android/src/main/java/io/velocitycareerlabs/reactnative/utlis/Converter.kt +32 -30
  5. package/ios/Utils/Converter.swift +38 -51
  6. package/ios/VclReactNative.m +5 -4
  7. package/ios/VclReactNative.swift +19 -10
  8. package/lib/commonjs/api/entities/VCLDidJwk.js +2 -0
  9. package/lib/commonjs/api/entities/{VCLPublicKey.js.map → VCLDidJwk.js.map} +0 -0
  10. package/lib/commonjs/api/entities/VCLErrorCode.js +21 -0
  11. package/lib/commonjs/api/entities/VCLErrorCode.js.map +1 -0
  12. package/lib/commonjs/api/entities/VCLJwkPublic.js +2 -0
  13. package/lib/{module/api/entities/VCLPublicKey.js.map → commonjs/api/entities/VCLJwkPublic.js.map} +0 -0
  14. package/lib/commonjs/api/entities/VCLJwtDescriptor.js +6 -0
  15. package/lib/commonjs/api/entities/VCLJwtDescriptor.js.map +1 -0
  16. package/lib/commonjs/api/entities/VCLServiceType.js +1 -0
  17. package/lib/commonjs/api/entities/VCLServiceType.js.map +1 -1
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/module/api/entities/VCLDidJwk.js +2 -0
  20. package/lib/module/api/entities/VCLDidJwk.js.map +1 -0
  21. package/lib/module/api/entities/VCLErrorCode.js +13 -0
  22. package/lib/module/api/entities/VCLErrorCode.js.map +1 -0
  23. package/lib/module/api/entities/VCLJwkPublic.js +2 -0
  24. package/lib/module/api/entities/VCLJwkPublic.js.map +1 -0
  25. package/lib/module/api/entities/VCLJwtDescriptor.js +2 -0
  26. package/lib/module/api/entities/VCLJwtDescriptor.js.map +1 -0
  27. package/lib/module/api/entities/VCLServiceType.js +1 -0
  28. package/lib/module/api/entities/VCLServiceType.js.map +1 -1
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/typescript/api/VCLApi.d.ts +6 -4
  31. package/lib/typescript/api/entities/{VCLPublicKey.d.ts → VCLDidJwk.d.ts} +2 -2
  32. package/lib/typescript/api/entities/VCLErrorCode.d.ts +10 -0
  33. package/lib/typescript/api/entities/VCLJwkPublic.d.ts +9 -0
  34. package/lib/typescript/api/entities/VCLJwtDescriptor.d.ts +12 -0
  35. package/lib/typescript/api/entities/VCLPresentationRequest.d.ts +2 -2
  36. package/lib/typescript/api/entities/VCLServiceType.d.ts +1 -0
  37. package/lib/typescript/api/entities/VCLVerifiedProfileDescriptor.d.ts +1 -1
  38. package/lib/typescript/index.d.ts +5 -2
  39. package/package.json +1 -1
  40. package/src/api/VCLApi.ts +7 -8
  41. package/src/api/entities/{VCLPublicKey.ts → VCLDidJwk.ts} +2 -2
  42. package/src/api/entities/VCLErrorCode.ts +11 -0
  43. package/src/api/entities/VCLJwkPublic.ts +10 -0
  44. package/src/api/entities/VCLJwtDescriptor.ts +14 -0
  45. package/src/api/entities/VCLPresentationRequest.ts +2 -2
  46. package/src/api/entities/VCLServiceType.ts +1 -0
  47. package/src/api/entities/VCLVerifiedProfileDescriptor.ts +1 -1
  48. package/src/index.tsx +8 -2
  49. package/vcl-react-native.podspec +1 -1
  50. package/lib/commonjs/api/entities/VCLPublicKey.js +0 -2
  51. package/lib/module/api/entities/VCLPublicKey.js +0 -2
@@ -131,5 +131,5 @@ dependencies {
131
131
 
132
132
  // VCL:
133
133
  implementation "com.nimbusds:nimbus-jose-jwt:9.25.6"
134
- implementation "io.velocitycareerlabs:vcl:1.3.0"
134
+ implementation "io.velocitycareerlabs:vcl:1.4.0"
135
135
  }
@@ -29,15 +29,16 @@ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToFinalizedOffersDes
29
29
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToGenerateOffersDescriptor
30
30
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToJwt
31
31
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToOrganizationsSearchDescriptor
32
- import io.velocitycareerlabs.reactnative.utlis.Converter.mapToPublicKey
32
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToJwkPublic
33
33
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToToken
34
34
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToVerifiedProfileDescriptor
35
35
  import io.velocitycareerlabs.reactnative.utlis.Converter.verifiedProfileToMap
36
36
  import io.velocitycareerlabs.api.VCLProvider
37
37
  import io.velocitycareerlabs.api.entities.VCLError
38
38
  import io.velocitycareerlabs.reactnative.extensions.toThrowable
39
+ import io.velocitycareerlabs.reactnative.utlis.Converter.didJwkToMap
39
40
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToInitializationDescriptor
40
- import org.json.JSONObject
41
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToJwtDescriptor
41
42
  import java.lang.Exception
42
43
 
43
44
  /**
@@ -188,7 +189,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
188
189
  promise: Promise
189
190
  ) {
190
191
  try {
191
- mapToCredentialManifestDescriptor(credentialManifestDescriptorMap)?.let{ credentialManifestDescriptor ->
192
+ mapToCredentialManifestDescriptor(credentialManifestDescriptorMap)?.let { credentialManifestDescriptor ->
192
193
  vcl.getCredentialManifest(credentialManifestDescriptor,
193
194
  {
194
195
  promise.resolve(credentialManifestToMap(it))
@@ -196,7 +197,8 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
196
197
  {
197
198
  promise.reject(it.toThrowable())
198
199
  })
199
- } ?: promise.reject(VCLError("Unexpected Credential Credential Manifest Descriptor: $credentialManifestDescriptorMap"))
200
+ }
201
+ ?: promise.reject(VCLError("Unexpected Credential Credential Manifest Descriptor: $credentialManifestDescriptorMap"))
200
202
  } catch (ex: Exception) {
201
203
  promise.reject(VCLError(ex.message))
202
204
  }
@@ -304,11 +306,11 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
304
306
  @ReactMethod
305
307
  fun verifyJwt(
306
308
  jwtMap: ReadableMap,
307
- publicKeyMap: ReadableMap,
309
+ jwkPublicMap: ReadableMap,
308
310
  promise: Promise
309
311
  ) {
310
312
  try {
311
- vcl.verifyJwt(mapToJwt(jwtMap), mapToPublicKey(publicKeyMap),
313
+ vcl.verifyJwt(mapToJwt(jwtMap), mapToJwkPublic(jwkPublicMap),
312
314
  {
313
315
  promise.resolve(it)
314
316
  },
@@ -322,15 +324,11 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
322
324
 
323
325
  @ReactMethod
324
326
  fun generateSignedJwt(
325
- jwtJsonMap: ReadableMap,
326
- iss: String,
327
- jti: String,
327
+ jwtDescriptorMap: ReadableMap,
328
328
  promise: Promise
329
329
  ) {
330
- var json: JSONObject? = null
331
330
  try {
332
- json = JSONObject(jwtJsonMap.toHashMap())
333
- vcl.generateSignedJwt(json, iss, jti,
331
+ vcl.generateSignedJwt(mapToJwtDescriptor(jwtDescriptorMap),
334
332
  {
335
333
  promise.resolve(Converter.jwtToMap(it))
336
334
  },
@@ -341,5 +339,22 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
341
339
  promise.reject(VCLError(e.message))
342
340
  }
343
341
  }
342
+
343
+ @ReactMethod
344
+ fun generateDidJwk(
345
+ promise: Promise
346
+ ) {
347
+ try {
348
+ vcl.generateDidJwk(
349
+ {
350
+ promise.resolve(didJwkToMap(it))
351
+ },
352
+ {
353
+ promise.reject(it.toThrowable())
354
+ })
355
+ } catch (e: Exception) {
356
+ promise.reject(VCLError(e.message))
357
+ }
358
+ }
344
359
  }
345
360
 
@@ -4,12 +4,13 @@
4
4
  * Copyright 2022 Velocity Career Labs inc.
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
-
7
+
8
8
  package io.velocitycareerlabs.reactnative.extensions
9
9
 
10
10
  import com.facebook.react.bridge.ReadableArray
11
11
  import com.facebook.react.bridge.ReadableMap
12
12
  import com.facebook.react.bridge.WritableMap
13
+ import org.json.JSONObject
13
14
  import java.lang.Exception
14
15
 
15
16
  /**
@@ -94,3 +95,16 @@ fun WritableMap.getMapOpt(key: String): ReadableMap? {
94
95
  return (this as ReadableMap).getMapOpt(key)
95
96
  }
96
97
 
98
+ fun ReadableMap.toJsonObject(): JSONObject {
99
+ return try {
100
+ JSONObject(this.toHashMap())
101
+ } catch (e: Exception) {
102
+ e.printStackTrace()
103
+ JSONObject("{}")
104
+ }
105
+ }
106
+
107
+ fun WritableMap.toJsonObject(): JSONObject {
108
+ return (this as ReadableMap).toJsonObject()
109
+ }
110
+
@@ -160,7 +160,7 @@ object Converter {
160
160
  presentationRequestMap: ReadableMap?
161
161
  ) = VCLPresentationRequest(
162
162
  mapToJwt(presentationRequestMap?.getMapOpt("jwt")),
163
- mapToPublicKey(presentationRequestMap?.getMapOpt("publicKey")),
163
+ mapToJwkPublic(presentationRequestMap?.getMapOpt("jwkPublic")),
164
164
  mapToDeepLink(presentationRequestMap?.getMapOpt("deepLink"))
165
165
  )
166
166
 
@@ -172,8 +172,8 @@ object Converter {
172
172
  jwtMap.putString("encodedJwt", presentationRequest.jwt.signedJwt.serialize())
173
173
  presentationRequestMap.putMap("jwt", jwtMap)
174
174
  val jwkMap = Arguments.createMap()
175
- jwkMap.putString("jwkStr", presentationRequest.publicKey.jwkStr)
176
- presentationRequestMap.putMap("publicKey", jwkMap)
175
+ jwkMap.putString("valueStr", presentationRequest.jwkPublic.valueStr)
176
+ presentationRequestMap.putMap("jwkPublic", jwkMap)
177
177
  presentationRequestMap.putString("iss", presentationRequest.iss)
178
178
  presentationRequestMap.putString("exchangeId", presentationRequest.exchangeId)
179
179
  presentationRequestMap.putString(
@@ -215,7 +215,8 @@ object Converter {
215
215
  VCLIdentificationSubmissionResult.KeyToken, tokenToMap(presentationSubmissionResult.token)
216
216
  )
217
217
  presentationSubmissionResultMap.putMap(
218
- VCLIdentificationSubmissionResult.KeyExchange, exchangeToMap(presentationSubmissionResult.exchange)
218
+ VCLIdentificationSubmissionResult.KeyExchange,
219
+ exchangeToMap(presentationSubmissionResult.exchange)
219
220
  )
220
221
  presentationSubmissionResultMap.putString(
221
222
  VCLIdentificationSubmissionResult.KeyJti, presentationSubmissionResult.jti
@@ -261,21 +262,6 @@ object Converter {
261
262
  mapToSubmissionResult(exchangeDescriptorMap.getMapOpt("submissionResult"))
262
263
  )
263
264
 
264
- fun stringToServiceType(
265
- serviceType: String?
266
- ): VCLServiceType? =
267
- when (serviceType) {
268
- "Issuer" -> VCLServiceType.Issuer
269
- "Inspector" -> VCLServiceType.Inspector
270
- "CredentialAgentOperator" -> VCLServiceType.CredentialAgentOperator
271
- "NodeOperator" -> VCLServiceType.NodeOperator
272
- "TrustRoot" -> VCLServiceType.TrustRoot
273
- "NotaryIssuer" -> VCLServiceType.NotaryIssuer
274
- "IdentityIssuer" -> VCLServiceType.IdentityIssuer
275
- "HolderAppProvider" -> VCLServiceType.HolderAppProvider
276
- else -> null
277
- }
278
-
279
265
  fun mapToOrganizationsSearchDescriptor(
280
266
  organizationsDescriptorMap: ReadableMap
281
267
  ) = VCLOrganizationsSearchDescriptor(
@@ -294,8 +280,7 @@ object Converter {
294
280
  serviceTypesArr?.let {
295
281
  serviceTypesList = mutableListOf()
296
282
  for (i in 0 until it.size()) {
297
- val serviceType = stringToServiceType(it.getStringOpt(i))
298
- serviceType?.let { st -> serviceTypesList?.add(st) }
283
+ serviceTypesList?.add(VCLServiceType.fromString(it.getStringOpt(i) ?: ""))
299
284
  }
300
285
  }
301
286
  val credentialTypesArr = filterMap?.getArrayOpt("credentialTypes")
@@ -399,7 +384,8 @@ object Converter {
399
384
  fun mapToCredentialManifestDescriptorByService(
400
385
  credentialManifestDescriptorByServiceMap: ReadableMap
401
386
  ): VCLCredentialManifestDescriptorByService {
402
- val pushDelegate = mapToPushDelegate(credentialManifestDescriptorByServiceMap.getMapOpt("pushDelegate"))
387
+ val pushDelegate =
388
+ mapToPushDelegate(credentialManifestDescriptorByServiceMap.getMapOpt("pushDelegate"))
403
389
  return VCLCredentialManifestDescriptorByService(
404
390
  service = mapToServiceCredentialAgentIssuer(
405
391
  credentialManifestDescriptorByServiceMap.getMapOpt("service")
@@ -453,7 +439,7 @@ object Converter {
453
439
  credentialManifestMap: ReadableMap?
454
440
  ): VCLCredentialManifest {
455
441
  val jwt =
456
- VCLJWT(encodedJwt = credentialManifestMap?.getMapOpt("jwt")?.getStringOpt("encodedJwt") ?: "")
442
+ VCLJwt(encodedJwt = credentialManifestMap?.getMapOpt("jwt")?.getStringOpt("encodedJwt") ?: "")
457
443
  val vendorOriginContext: String? = credentialManifestMap?.getStringOpt("vendorOriginContext")
458
444
  return VCLCredentialManifest(jwt = jwt, vendorOriginContext = vendorOriginContext)
459
445
  }
@@ -507,10 +493,10 @@ object Converter {
507
493
  }
508
494
 
509
495
  fun mapToJwt(jwtMap: ReadableMap?) =
510
- VCLJWT(encodedJwt = jwtMap?.getStringOpt("encodedJwt") ?: "")
496
+ VCLJwt(encodedJwt = jwtMap?.getStringOpt("encodedJwt") ?: "")
511
497
 
512
- fun mapToPublicKey(publicKeyMap: ReadableMap?) =
513
- VCLPublicKey(jwkStr = publicKeyMap?.getStringOpt("jwkStr") ?: "")
498
+ fun mapToJwkPublic(jwkPublicMap: ReadableMap?) =
499
+ VCLJwkPublic(valueStr = jwkPublicMap?.getStringOpt("valueStr") ?: "")
514
500
 
515
501
  fun mapToFinalizedOffersDescriptor(
516
502
  finalizedOffersDescriptorMap: ReadableMap
@@ -534,7 +520,7 @@ object Converter {
534
520
  return jwtVerifiableCredentialsMap
535
521
  }
536
522
 
537
- fun jwtToMap(jwt: VCLJWT): ReadableMap {
523
+ fun jwtToMap(jwt: VCLJwt): ReadableMap {
538
524
  val jwtReadableMap = Arguments.createMap()
539
525
  jwtReadableMap.putString("encodedJwt", jwt.signedJwt.serialize())
540
526
  return jwtReadableMap
@@ -550,9 +536,9 @@ object Converter {
550
536
  fun mapToVerifiedProfileDescriptor(verifiedProfileDescriptor: ReadableMap) =
551
537
  VCLVerifiedProfileDescriptor(
552
538
  did = verifiedProfileDescriptor.getStringOpt("did") ?: "",
553
- serviceType = VCLServiceType.fromString(
554
- verifiedProfileDescriptor.getStringOpt("serviceType") ?: ""
555
- ))
539
+ serviceType = verifiedProfileDescriptor.getStringOpt("serviceType")?.let {
540
+ VCLServiceType.fromString(it)
541
+ })
556
542
 
557
543
  fun verifiedProfileToMap(
558
544
  verifiedProfile: VCLVerifiedProfile
@@ -564,5 +550,21 @@ object Converter {
564
550
  verifiedProfileMap.putString("name", verifiedProfile.name)
565
551
  return verifiedProfileMap
566
552
  }
553
+
554
+ fun mapToJwtDescriptor(
555
+ jwtDescriptorDictionary: ReadableMap
556
+ ) = VCLJwtDescriptor(
557
+ payload = jwtDescriptorDictionary.getMapOpt("payload")?.toJsonObject() ?: JSONObject("{}"),
558
+ iss = jwtDescriptorDictionary.getStringOpt("iss") ?: "",
559
+ jti = jwtDescriptorDictionary.getStringOpt("jti") ?: ""
560
+ )
561
+
562
+ fun didJwkToMap(
563
+ didJwk: VCLDidJwk
564
+ ): ReadableMap {
565
+ val didJwkMap = Arguments.createMap()
566
+ didJwkMap.putString("value", didJwk.value)
567
+ return didJwkMap
568
+ }
567
569
  }
568
570
 
@@ -158,7 +158,7 @@ func dictionaryToPresentationRequest(
158
158
  ) -> VCLPresentationRequest {
159
159
  return VCLPresentationRequest(
160
160
  jwt: dictionaryToJwt(presentationRequestDictionary?["jwt"] as? [String : Any]),
161
- publicKey: dictionaryToPublicKey(presentationRequestDictionary?["publicKey"] as? [String: Any]),
161
+ jwkPublic: dictionaryToPJwkPublic(presentationRequestDictionary?["jwkPublic"] as? [String: Any]),
162
162
  deepLink: dictionaryToDeepLink(presentationRequestDictionary?["deepLink"] as? [String : Any])
163
163
  )
164
164
  }
@@ -168,9 +168,9 @@ func presentationRequestToDictionary(
168
168
  ) -> [String: Any] {
169
169
  var presentationRequestDictionary = [String: Any]()
170
170
  presentationRequestDictionary["jwt"] = ["encodedJwt": presentationRequest.jwt.encodedJwt]
171
- var jwkDictionary = [String: Any]()
172
- jwkDictionary["jwkStr"] = presentationRequest.publicKey.jwkStr
173
- presentationRequestDictionary["publicKey"] = jwkDictionary
171
+ var jwkPublicDictionary = [String: Any]()
172
+ jwkPublicDictionary["valueStr"] = presentationRequest.jwkPublic.valueStr
173
+ presentationRequestDictionary["jwkPublic"] = jwkPublicDictionary
174
174
  presentationRequestDictionary["iss"] = presentationRequest.iss
175
175
  presentationRequestDictionary["exchangeId"] = presentationRequest.exchangeId
176
176
  presentationRequestDictionary["presentationDefinitionId"] = presentationRequest.presentationDefinitionId
@@ -249,36 +249,6 @@ func dictionaryToExchangeDescriptor(
249
249
  )
250
250
  }
251
251
 
252
- func stringToServiceType(
253
- _ serviceTypeStr: String?
254
- ) -> VCLServiceType? {
255
- var serviceType: VCLServiceType? = nil
256
- guard (serviceTypeStr != nil) else {
257
- return nil
258
- }
259
- switch serviceTypeStr {
260
- case "Issuer":
261
- serviceType = .Issuer
262
- case "Inspector":
263
- serviceType = .Inspector
264
- case "CredentialAgentOperator":
265
- serviceType = .CredentialAgentOperator
266
- case "NodeOperator":
267
- serviceType = .NodeOperator
268
- case "TrustRoot":
269
- serviceType = .TrustRoot
270
- case "NotaryIssuer":
271
- serviceType = .NotaryIssuer
272
- case "IdentityIssuer":
273
- serviceType = .IdentityIssuer
274
- case "HolderAppProvider":
275
- serviceType = .HolderAppProvider
276
- default:
277
- serviceType = nil
278
- }
279
- return serviceType
280
- }
281
-
282
252
  func dictionayToOrganizationsSearchDescriptor(
283
253
  _ organizationsDescriptorDictionary: [String: Any]
284
254
  ) -> VCLOrganizationsSearchDescriptor {
@@ -298,10 +268,7 @@ func dictionaryToFilter(
298
268
  if let serviceTypesArr = (filterDictionary?["serviceTypes"] as? [String]) {
299
269
  serviceTypesList = [VCLServiceType]()
300
270
  for serviceTypeStr in serviceTypesArr {
301
- let serviceType = stringToServiceType(serviceTypeStr)
302
- if let st = serviceType {
303
- serviceTypesList?.append(st)
304
- }
271
+ serviceTypesList?.append(VCLServiceType.fromString(value: serviceTypeStr))
305
272
  }
306
273
  }
307
274
  var credentialTypesList: [String]? = nil
@@ -432,7 +399,7 @@ func credentialManifestToDictionary(
432
399
  func dictionaryToCredentialManifest(
433
400
  _ credentialMAnifestDictionary: [String: Any]?
434
401
  ) -> VCLCredentialManifest {
435
- let jwt: VCLJWT = VCLJWT(encodedJwt: (credentialMAnifestDictionary?["jwt"] as? [String: Any])?["encodedJwt"] as? String ?? "")
402
+ let jwt: VCLJwt = VCLJwt(encodedJwt: (credentialMAnifestDictionary?["jwt"] as? [String: Any])?["encodedJwt"] as? String ?? "")
436
403
  let vendorOriginContext: String? = credentialMAnifestDictionary?["vendorOriginContext"] as? String
437
404
  return VCLCredentialManifest(jwt: jwt, vendorOriginContext: vendorOriginContext)
438
405
  }
@@ -481,14 +448,14 @@ func credentialTypesFormSchemaToDictionary(
481
448
 
482
449
  func dictionaryToJwt(
483
450
  _ jwtDictionary: [String: Any]?
484
- ) -> VCLJWT {
485
- return VCLJWT(encodedJwt: jwtDictionary?["encodedJwt"] as? String ?? "")
451
+ ) -> VCLJwt {
452
+ return VCLJwt(encodedJwt: jwtDictionary?["encodedJwt"] as? String ?? "")
486
453
  }
487
454
 
488
- func dictionaryToPublicKey(
489
- _ publicKeyDictionary: [String: Any]?
490
- ) -> VCLPublicKey {
491
- return VCLPublicKey(jwkStr: (publicKeyDictionary?["jwkStr"] as? String ?? ""))
455
+ func dictionaryToPJwkPublic(
456
+ _ jwkPublicDictionary: [String: Any]?
457
+ ) -> VCLJwkPublic {
458
+ return VCLJwkPublic(valueStr: (jwkPublicDictionary?["valueStr"] as? String ?? ""))
492
459
  }
493
460
 
494
461
  func dictionaryToFinalizedOffersDescriptor(
@@ -512,7 +479,7 @@ func jwtVerifiableCredentialsToDictionary(
512
479
  return jwtVerifiableCredentialsDictionary
513
480
  }
514
481
 
515
- func jwtToReadableMap(_ jwt: VCLJWT) -> [String: Any] {
482
+ func jwtToReadableMap(_ jwt: VCLJwt) -> [String: Any] {
516
483
  return ["encodedJwt": jwt.encodedJwt]
517
484
  }
518
485
 
@@ -528,11 +495,13 @@ func readableMapToCredentialTypesUIFormSchemaDescriptor(
528
495
  func dictionaryToVerifiedProfileDescriptor(
529
496
  _ verifiedProfileDescriptor: [String: Any]
530
497
  ) -> VCLVerifiedProfileDescriptor {
531
- return VCLVerifiedProfileDescriptor(
532
- did: (verifiedProfileDescriptor["did"] as? String) ?? "",
533
- serviceType: VCLServiceType.fromString(
534
- value: verifiedProfileDescriptor["serviceType"] as? String ?? ""
535
- ))
498
+ if let serviceTypeStr = verifiedProfileDescriptor["serviceType"] as? String {
499
+ return VCLVerifiedProfileDescriptor(
500
+ did: (verifiedProfileDescriptor["did"] as? String) ?? "",
501
+ serviceType: VCLServiceType.fromString(value: serviceTypeStr)
502
+ )
503
+ }
504
+ return VCLVerifiedProfileDescriptor(did: (verifiedProfileDescriptor["did"] as? String) ?? "")
536
505
  }
537
506
 
538
507
  func verifiedProfileToDictionary(
@@ -545,3 +514,21 @@ func verifiedProfileToDictionary(
545
514
  verifiedProfileDictionary["name"] = verifiedProfile.name
546
515
  return verifiedProfileDictionary
547
516
  }
517
+
518
+ func dictionaryToJwtDescriptor(
519
+ _ jwtDescriptorDictionary: [String: Any]
520
+ ) -> VCLJwtDescriptor {
521
+ return VCLJwtDescriptor(
522
+ payload: jwtDescriptorDictionary["payload"] as? [String: Any] ?? [String: Any](),
523
+ iss: jwtDescriptorDictionary["iss"] as? String ?? "",
524
+ jti: jwtDescriptorDictionary["jti"] as? String ?? ""
525
+ )
526
+ }
527
+
528
+ func didJwkToDictionary(
529
+ _ didJwk: VCLDidJwk
530
+ ) -> [String: Any] {
531
+ var didJwkDictionary = [String: Any]()
532
+ didJwkDictionary["value"] = didJwk.value
533
+ return didJwkDictionary
534
+ }
@@ -64,14 +64,15 @@ RCT_EXTERN_METHOD(getVerifiedProfile:(NSDictionary*)verifiedProfileDescriptorDic
64
64
  withRejecter:(RCTPromiseRejectBlock)reject)
65
65
 
66
66
  RCT_EXTERN_METHOD(verifyJwt:(NSDictionary*)jwtDictionary
67
- withPublicKeyDictionary:(NSDictionary*)publicKeyDictionary
67
+ withJwkPublicDictionary:(NSDictionary*)jwkPublicDictionary
68
68
  withResolver:(RCTPromiseResolveBlock)resolve
69
69
  withRejecter:(RCTPromiseRejectBlock)reject)
70
70
 
71
- RCT_EXTERN_METHOD(generateSignedJwt:(NSDictionary*)jwtDictionary
72
- withIss:(NSString*)iss
73
- withJti:(NSString*)jti
71
+ RCT_EXTERN_METHOD(generateSignedJwt:(NSDictionary*)jwtDescriptorDictionary
74
72
  withResolver:(RCTPromiseResolveBlock)resolve
75
73
  withRejecter:(RCTPromiseRejectBlock)reject)
76
74
 
75
+ RCT_EXTERN_METHOD(generateDidJwk:(RCTPromiseResolveBlock)resolve
76
+ withRejecter:(RCTPromiseRejectBlock)reject)
77
+
77
78
  @end
@@ -222,15 +222,15 @@ class VclReactNative: NSObject {
222
222
  })
223
223
  }
224
224
 
225
- @objc(verifyJwt:withPublicKeyDictionary:withResolver:withRejecter:)
225
+ @objc(verifyJwt:withJwkPublicDictionary:withResolver:withRejecter:)
226
226
  func verifyJwt(
227
227
  jwtDictionary: [String: Any],
228
- publicKeyDictionary: [String: Any],
228
+ jwkPublicDictionary: [String: Any],
229
229
  resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
230
230
  ) {
231
231
  vcl.verifyJwt(
232
232
  jwt: dictionaryToJwt(jwtDictionary),
233
- publicKey: dictionaryToPublicKey(publicKeyDictionary),
233
+ jwkPublic: dictionaryToPJwkPublic(jwkPublicDictionary),
234
234
  successHandler: {
235
235
  resolve($0)
236
236
  },
@@ -239,17 +239,13 @@ class VclReactNative: NSObject {
239
239
  })
240
240
  }
241
241
 
242
- @objc(generateSignedJwt:withIss:withJti:withResolver:withRejecter:)
242
+ @objc(generateSignedJwt:withResolver:withRejecter:)
243
243
  func generateSignedJwt(
244
- jwtDictionary: [String: Any],
245
- iss: String,
246
- jti: String,
244
+ jwtDescriptorDictionary: [String: Any],
247
245
  resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
248
246
  ) {
249
247
  vcl.generateSignedJwt(
250
- payload: jwtDictionary,
251
- iss: iss,
252
- jti: jti,
248
+ jwtDescriptor: dictionaryToJwtDescriptor(jwtDescriptorDictionary),
253
249
  successHandler: {
254
250
  resolve(jwtToReadableMap($0))
255
251
  },
@@ -257,4 +253,17 @@ class VclReactNative: NSObject {
257
253
  reject(nil, "\($0.toJsonString())", $0)
258
254
  })
259
255
  }
256
+
257
+ @objc(generateDidJwk:withRejecter:)
258
+ func generateDidJwk(
259
+ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
260
+ ) {
261
+ vcl.generateDidJwk(
262
+ successHandler: {
263
+ resolve(didJwkToDictionary($0))
264
+ },
265
+ errorHandler: {
266
+ reject(nil, "\($0.toJsonString())", $0)
267
+ })
268
+ }
260
269
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=VCLDidJwk.js.map
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VCLErrorCode = void 0;
7
+
8
+ /**
9
+ * Created by Michael Avoyan.
10
+ *
11
+ * Copyright 2022 Velocity Career Labs inc.
12
+ * SPDX-License-Identifier: Apache-2.0
13
+ */
14
+ let VCLErrorCode;
15
+ exports.VCLErrorCode = VCLErrorCode;
16
+
17
+ (function (VCLErrorCode) {
18
+ VCLErrorCode[VCLErrorCode["NetworkError"] = 1] = "NetworkError";
19
+ VCLErrorCode[VCLErrorCode["VerificationError"] = 403] = "VerificationError";
20
+ })(VCLErrorCode || (exports.VCLErrorCode = VCLErrorCode = {}));
21
+ //# sourceMappingURL=VCLErrorCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["VCLErrorCode.ts"],"names":["VCLErrorCode"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;IAEYA,Y;;;WAAAA,Y;AAAAA,EAAAA,Y,CAAAA,Y;AAAAA,EAAAA,Y,CAAAA,Y;GAAAA,Y,4BAAAA,Y","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport enum VCLErrorCode {\n NetworkError = 1,\n VerificationError = 403,\n}\n"]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=VCLJwkPublic.js.map
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=VCLJwtDescriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -18,6 +18,7 @@ exports.VCLServiceType = VCLServiceType;
18
18
  VCLServiceType["Issuer"] = "Issuer";
19
19
  VCLServiceType["Inspector"] = "Inspector";
20
20
  VCLServiceType["TrustRoot"] = "TrustRoot";
21
+ VCLServiceType["CareerIssuer"] = "CareerIssuer";
21
22
  VCLServiceType["NodeOperator"] = "NodeOperator";
22
23
  VCLServiceType["NotaryIssuer"] = "NotaryIssuer";
23
24
  VCLServiceType["IdentityIssuer"] = "IdentityIssuer";
@@ -1 +1 @@
1
- {"version":3,"sources":["VCLServiceType.ts"],"names":["VCLServiceType"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;IAEYA,c;;;WAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;GAAAA,c,8BAAAA,c","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport enum VCLServiceType {\n Issuer = 'Issuer',\n Inspector = 'Inspector',\n TrustRoot = 'TrustRoot',\n NodeOperator = 'NodeOperator',\n NotaryIssuer = 'NotaryIssuer',\n IdentityIssuer = 'IdentityIssuer',\n HolderAppProvider = 'HolderAppProvider',\n CredentialAgentOperator = 'CredentialAgentOperator',\n Undefined = 'Undefined',\n}\n"]}
1
+ {"version":3,"sources":["VCLServiceType.ts"],"names":["VCLServiceType"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;IAEYA,c;;;WAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;GAAAA,c,8BAAAA,c","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport enum VCLServiceType {\n Issuer = 'Issuer',\n Inspector = 'Inspector',\n TrustRoot = 'TrustRoot',\n CareerIssuer = 'CareerIssuer',\n NodeOperator = 'NodeOperator',\n NotaryIssuer = 'NotaryIssuer',\n IdentityIssuer = 'IdentityIssuer',\n HolderAppProvider = 'HolderAppProvider',\n CredentialAgentOperator = 'CredentialAgentOperator',\n Undefined = 'Undefined',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["VclReactNative","NativeModules"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;AAGA;;AAGA;;AAgCA;;AA7CA;AACA;AACA;AACA;AACA;AACA;AAkDA,MAAM;AAAEA,EAAAA;AAAF,IAAqBC,0BAA3B;eAEeD,c","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { NativeModules } from 'react-native';\nimport type { VclApi } from './api/VCLApi';\nimport type { VCLEnvironment } from './api/VCLEnvironment';\nimport { VCLEnvTypes } from './api/VCLEnvironment';\nimport type { VCLCountry } from './api/entities/VCLCountry';\nimport type { VCLCountries } from './api/entities/VCLCountries';\nimport { VCLCountryCodes } from './api/entities/VCLCountries';\nimport type { VCLRegion } from './api/entities/VCLRegion';\nimport type { VCLRegions } from './api/entities/VCLRegions';\nimport type { VCLCredentialManifest } from './api/entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './api/entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialManifestDescriptorByDeepLink } from './api/entities/VCLCredentialManifestDescriptorByDeepLink';\nimport type { VCLCredentialManifestDescriptorByService } from './api/entities/VCLCredentialManifestDescriptorByService';\nimport type { VCLCredentialManifestDescriptorRefresh } from './api/entities/VCLCredentialManifestDescriptorRefresh';\nimport type { VCLCredentialType } from './api/entities/VCLCredentialType';\nimport type { VCLCredentialTypeSchema } from './api/entities/VCLCredentialTypeSchema';\nimport type { VCLCredentialTypeSchemas } from './api/entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './api/entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLCredentialTypesUIFormSchema } from './api/entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLDeepLink } from './api/entities/VCLDeepLink';\nimport type { VCLExchange } from './api/entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './api/entities/VCLExchangeDescriptor';\nimport type { VCLFilter } from './api/entities/VCLFilter';\nimport type { VCLFinalizeOffersDescriptor } from './api/entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './api/entities/VCLGenerateOffersDescriptor';\nimport type { VCLJWT } from './api/entities/VCLJWT';\nimport type { VCLJwtVerifiableCredentials } from './api/entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './api/entities/VCLOffers';\nimport type { VCLOrganization } from './api/entities/VCLOrganization';\nimport type { VCLOrganizations } from './api/entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPage } from './api/entities/VCLPage';\nimport type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';\nimport type { VCLPublicKey } from './api/entities/VCLPublicKey';\nimport type { VCLPushDelegate } from './api/entities/VCLPushDelegate';\nimport type { VCLService } from './api/entities/VCLService';\nimport type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';\nimport { VCLServiceType } from './api/entities/VCLServiceType';\nimport type { VCLSubmissionResult } from './api/entities/VCLSubmissionResult';\nimport type { VCLToken } from './api/entities/VCLToken';\nimport type { VCLVerifiableCredential } from './api/entities/VCLVerifiableCredential';\nimport type { VCLVerifiedProfile } from './api/entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedProfileDescriptor';\nimport type { Dictionary } from './api/Dictionary';\nimport type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';\nimport type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';\n\nconst { VclReactNative } = NativeModules;\n\nexport default VclReactNative as VclApi;\nexport {\n Dictionary,\n VCLEnvironment,\n VCLEnvTypes,\n VCLCountry,\n VCLCountries,\n VCLCountryCodes,\n VCLRegion,\n VCLRegions,\n VCLCredentialManifest,\n VCLCredentialManifestDescriptor,\n VCLCredentialManifestDescriptorByDeepLink,\n VCLCredentialManifestDescriptorByService,\n VCLCredentialType,\n VCLCredentialTypeSchema,\n VCLCredentialTypeSchemas,\n VCLCredentialTypesUIFormSchema,\n VCLCredentialTypesUIFormSchemaDescriptor,\n VCLCredentialManifestDescriptorRefresh,\n VCLDeepLink,\n VCLExchange,\n VCLExchangeDescriptor,\n VCLFilter,\n VCLFinalizeOffersDescriptor,\n VCLGenerateOffersDescriptor,\n VCLJWT,\n VCLJwtVerifiableCredentials,\n VCLOffers,\n VCLOrganization,\n VCLOrganizations,\n VCLOrganizationsSearchDescriptor,\n VCLPage,\n VCLPresentationRequest,\n VCLPresentationSubmission,\n VCLPublicKey,\n VCLPushDelegate,\n VCLService,\n VCLServiceCredentialAgentIssuer,\n VCLServiceType,\n VCLSubmissionResult,\n VCLToken,\n VCLVerifiableCredential,\n VCLVerifiedProfile,\n VCLVerifiedProfileDescriptor,\n VCLInitializationDescriptor,\n VCLPresentationRequestDescriptor,\n};\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["VclReactNative","NativeModules"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;AAGA;;AAGA;;AAgCA;;AA7CA;AACA;AACA;AACA;AACA;AACA;AAqDA,MAAM;AAAEA,EAAAA;AAAF,IAAqBC,0BAA3B;eAEeD,c","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { NativeModules } from 'react-native';\nimport type { VclApi } from './api/VCLApi';\nimport type { VCLEnvironment } from './api/VCLEnvironment';\nimport { VCLEnvTypes } from './api/VCLEnvironment';\nimport type { VCLCountry } from './api/entities/VCLCountry';\nimport type { VCLCountries } from './api/entities/VCLCountries';\nimport { VCLCountryCodes } from './api/entities/VCLCountries';\nimport type { VCLRegion } from './api/entities/VCLRegion';\nimport type { VCLRegions } from './api/entities/VCLRegions';\nimport type { VCLCredentialManifest } from './api/entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './api/entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialManifestDescriptorByDeepLink } from './api/entities/VCLCredentialManifestDescriptorByDeepLink';\nimport type { VCLCredentialManifestDescriptorByService } from './api/entities/VCLCredentialManifestDescriptorByService';\nimport type { VCLCredentialManifestDescriptorRefresh } from './api/entities/VCLCredentialManifestDescriptorRefresh';\nimport type { VCLCredentialType } from './api/entities/VCLCredentialType';\nimport type { VCLCredentialTypeSchema } from './api/entities/VCLCredentialTypeSchema';\nimport type { VCLCredentialTypeSchemas } from './api/entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './api/entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLCredentialTypesUIFormSchema } from './api/entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLDeepLink } from './api/entities/VCLDeepLink';\nimport type { VCLExchange } from './api/entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './api/entities/VCLExchangeDescriptor';\nimport type { VCLFilter } from './api/entities/VCLFilter';\nimport type { VCLFinalizeOffersDescriptor } from './api/entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './api/entities/VCLGenerateOffersDescriptor';\nimport type { VCLJWT } from './api/entities/VCLJWT';\nimport type { VCLJwtVerifiableCredentials } from './api/entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './api/entities/VCLOffers';\nimport type { VCLOrganization } from './api/entities/VCLOrganization';\nimport type { VCLOrganizations } from './api/entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPage } from './api/entities/VCLPage';\nimport type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './api/entities/VCLJwkPublic';\nimport type { VCLPushDelegate } from './api/entities/VCLPushDelegate';\nimport type { VCLService } from './api/entities/VCLService';\nimport type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';\nimport { VCLServiceType } from './api/entities/VCLServiceType';\nimport type { VCLSubmissionResult } from './api/entities/VCLSubmissionResult';\nimport type { VCLToken } from './api/entities/VCLToken';\nimport type { VCLVerifiableCredential } from './api/entities/VCLVerifiableCredential';\nimport type { VCLVerifiedProfile } from './api/entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedProfileDescriptor';\nimport type { Dictionary } from './api/Dictionary';\nimport type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';\nimport type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './api/entities/VCLDidJwk';\nimport type { VCLErrorCode } from './api/entities/VCLErrorCode';\n\nconst { VclReactNative } = NativeModules;\n\nexport default VclReactNative as VclApi;\nexport {\n Dictionary,\n VCLEnvironment,\n VCLEnvTypes,\n VCLCountry,\n VCLCountries,\n VCLCountryCodes,\n VCLRegion,\n VCLRegions,\n VCLCredentialManifest,\n VCLCredentialManifestDescriptor,\n VCLCredentialManifestDescriptorByDeepLink,\n VCLCredentialManifestDescriptorByService,\n VCLCredentialType,\n VCLCredentialTypeSchema,\n VCLCredentialTypeSchemas,\n VCLCredentialTypesUIFormSchema,\n VCLCredentialTypesUIFormSchemaDescriptor,\n VCLCredentialManifestDescriptorRefresh,\n VCLDeepLink,\n VCLExchange,\n VCLExchangeDescriptor,\n VCLFilter,\n VCLFinalizeOffersDescriptor,\n VCLGenerateOffersDescriptor,\n VCLJWT,\n VCLJwtVerifiableCredentials,\n VCLOffers,\n VCLOrganization,\n VCLOrganizations,\n VCLOrganizationsSearchDescriptor,\n VCLPage,\n VCLPresentationRequest,\n VCLPresentationSubmission,\n VCLJwkPublic,\n VCLPushDelegate,\n VCLService,\n VCLServiceCredentialAgentIssuer,\n VCLServiceType,\n VCLSubmissionResult,\n VCLToken,\n VCLVerifiableCredential,\n VCLVerifiedProfile,\n VCLVerifiedProfileDescriptor,\n VCLInitializationDescriptor,\n VCLPresentationRequestDescriptor,\n VCLJwtDescriptor,\n VCLDidJwk,\n VCLErrorCode,\n};\n"]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=VCLDidJwk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Created by Michael Avoyan.
3
+ *
4
+ * Copyright 2022 Velocity Career Labs inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ export let VCLErrorCode;
8
+
9
+ (function (VCLErrorCode) {
10
+ VCLErrorCode[VCLErrorCode["NetworkError"] = 1] = "NetworkError";
11
+ VCLErrorCode[VCLErrorCode["VerificationError"] = 403] = "VerificationError";
12
+ })(VCLErrorCode || (VCLErrorCode = {}));
13
+ //# sourceMappingURL=VCLErrorCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["VCLErrorCode.ts"],"names":["VCLErrorCode"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,YAAZ;;WAAYA,Y;AAAAA,EAAAA,Y,CAAAA,Y;AAAAA,EAAAA,Y,CAAAA,Y;GAAAA,Y,KAAAA,Y","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport enum VCLErrorCode {\n NetworkError = 1,\n VerificationError = 403,\n}\n"]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=VCLJwkPublic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=VCLJwtDescriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -10,6 +10,7 @@ export let VCLServiceType;
10
10
  VCLServiceType["Issuer"] = "Issuer";
11
11
  VCLServiceType["Inspector"] = "Inspector";
12
12
  VCLServiceType["TrustRoot"] = "TrustRoot";
13
+ VCLServiceType["CareerIssuer"] = "CareerIssuer";
13
14
  VCLServiceType["NodeOperator"] = "NodeOperator";
14
15
  VCLServiceType["NotaryIssuer"] = "NotaryIssuer";
15
16
  VCLServiceType["IdentityIssuer"] = "IdentityIssuer";
@@ -1 +1 @@
1
- {"version":3,"sources":["VCLServiceType.ts"],"names":["VCLServiceType"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,cAAZ;;WAAYA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;GAAAA,c,KAAAA,c","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport enum VCLServiceType {\n Issuer = 'Issuer',\n Inspector = 'Inspector',\n TrustRoot = 'TrustRoot',\n NodeOperator = 'NodeOperator',\n NotaryIssuer = 'NotaryIssuer',\n IdentityIssuer = 'IdentityIssuer',\n HolderAppProvider = 'HolderAppProvider',\n CredentialAgentOperator = 'CredentialAgentOperator',\n Undefined = 'Undefined',\n}\n"]}
1
+ {"version":3,"sources":["VCLServiceType.ts"],"names":["VCLServiceType"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,cAAZ;;WAAYA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;GAAAA,c,KAAAA,c","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport enum VCLServiceType {\n Issuer = 'Issuer',\n Inspector = 'Inspector',\n TrustRoot = 'TrustRoot',\n CareerIssuer = 'CareerIssuer',\n NodeOperator = 'NodeOperator',\n NotaryIssuer = 'NotaryIssuer',\n IdentityIssuer = 'IdentityIssuer',\n HolderAppProvider = 'HolderAppProvider',\n CredentialAgentOperator = 'CredentialAgentOperator',\n Undefined = 'Undefined',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["NativeModules","VCLEnvTypes","VCLCountryCodes","VCLServiceType","VclReactNative"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAT,QAA8B,cAA9B;AAGA,SAASC,WAAT,QAA4B,sBAA5B;AAGA,SAASC,eAAT,QAAgC,6BAAhC;AAgCA,SAASC,cAAT,QAA+B,+BAA/B;AAUA,MAAM;AAAEC,EAAAA;AAAF,IAAqBJ,aAA3B;AAEA,eAAeI,cAAf;AACA,SAGEH,WAHF,EAMEC,eANF,EAsCEC,cAtCF","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { NativeModules } from 'react-native';\nimport type { VclApi } from './api/VCLApi';\nimport type { VCLEnvironment } from './api/VCLEnvironment';\nimport { VCLEnvTypes } from './api/VCLEnvironment';\nimport type { VCLCountry } from './api/entities/VCLCountry';\nimport type { VCLCountries } from './api/entities/VCLCountries';\nimport { VCLCountryCodes } from './api/entities/VCLCountries';\nimport type { VCLRegion } from './api/entities/VCLRegion';\nimport type { VCLRegions } from './api/entities/VCLRegions';\nimport type { VCLCredentialManifest } from './api/entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './api/entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialManifestDescriptorByDeepLink } from './api/entities/VCLCredentialManifestDescriptorByDeepLink';\nimport type { VCLCredentialManifestDescriptorByService } from './api/entities/VCLCredentialManifestDescriptorByService';\nimport type { VCLCredentialManifestDescriptorRefresh } from './api/entities/VCLCredentialManifestDescriptorRefresh';\nimport type { VCLCredentialType } from './api/entities/VCLCredentialType';\nimport type { VCLCredentialTypeSchema } from './api/entities/VCLCredentialTypeSchema';\nimport type { VCLCredentialTypeSchemas } from './api/entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './api/entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLCredentialTypesUIFormSchema } from './api/entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLDeepLink } from './api/entities/VCLDeepLink';\nimport type { VCLExchange } from './api/entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './api/entities/VCLExchangeDescriptor';\nimport type { VCLFilter } from './api/entities/VCLFilter';\nimport type { VCLFinalizeOffersDescriptor } from './api/entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './api/entities/VCLGenerateOffersDescriptor';\nimport type { VCLJWT } from './api/entities/VCLJWT';\nimport type { VCLJwtVerifiableCredentials } from './api/entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './api/entities/VCLOffers';\nimport type { VCLOrganization } from './api/entities/VCLOrganization';\nimport type { VCLOrganizations } from './api/entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPage } from './api/entities/VCLPage';\nimport type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';\nimport type { VCLPublicKey } from './api/entities/VCLPublicKey';\nimport type { VCLPushDelegate } from './api/entities/VCLPushDelegate';\nimport type { VCLService } from './api/entities/VCLService';\nimport type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';\nimport { VCLServiceType } from './api/entities/VCLServiceType';\nimport type { VCLSubmissionResult } from './api/entities/VCLSubmissionResult';\nimport type { VCLToken } from './api/entities/VCLToken';\nimport type { VCLVerifiableCredential } from './api/entities/VCLVerifiableCredential';\nimport type { VCLVerifiedProfile } from './api/entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedProfileDescriptor';\nimport type { Dictionary } from './api/Dictionary';\nimport type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';\nimport type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';\n\nconst { VclReactNative } = NativeModules;\n\nexport default VclReactNative as VclApi;\nexport {\n Dictionary,\n VCLEnvironment,\n VCLEnvTypes,\n VCLCountry,\n VCLCountries,\n VCLCountryCodes,\n VCLRegion,\n VCLRegions,\n VCLCredentialManifest,\n VCLCredentialManifestDescriptor,\n VCLCredentialManifestDescriptorByDeepLink,\n VCLCredentialManifestDescriptorByService,\n VCLCredentialType,\n VCLCredentialTypeSchema,\n VCLCredentialTypeSchemas,\n VCLCredentialTypesUIFormSchema,\n VCLCredentialTypesUIFormSchemaDescriptor,\n VCLCredentialManifestDescriptorRefresh,\n VCLDeepLink,\n VCLExchange,\n VCLExchangeDescriptor,\n VCLFilter,\n VCLFinalizeOffersDescriptor,\n VCLGenerateOffersDescriptor,\n VCLJWT,\n VCLJwtVerifiableCredentials,\n VCLOffers,\n VCLOrganization,\n VCLOrganizations,\n VCLOrganizationsSearchDescriptor,\n VCLPage,\n VCLPresentationRequest,\n VCLPresentationSubmission,\n VCLPublicKey,\n VCLPushDelegate,\n VCLService,\n VCLServiceCredentialAgentIssuer,\n VCLServiceType,\n VCLSubmissionResult,\n VCLToken,\n VCLVerifiableCredential,\n VCLVerifiedProfile,\n VCLVerifiedProfileDescriptor,\n VCLInitializationDescriptor,\n VCLPresentationRequestDescriptor,\n};\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["NativeModules","VCLEnvTypes","VCLCountryCodes","VCLServiceType","VclReactNative"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAT,QAA8B,cAA9B;AAGA,SAASC,WAAT,QAA4B,sBAA5B;AAGA,SAASC,eAAT,QAAgC,6BAAhC;AAgCA,SAASC,cAAT,QAA+B,+BAA/B;AAaA,MAAM;AAAEC,EAAAA;AAAF,IAAqBJ,aAA3B;AAEA,eAAeI,cAAf;AACA,SAGEH,WAHF,EAMEC,eANF,EAsCEC,cAtCF","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { NativeModules } from 'react-native';\nimport type { VclApi } from './api/VCLApi';\nimport type { VCLEnvironment } from './api/VCLEnvironment';\nimport { VCLEnvTypes } from './api/VCLEnvironment';\nimport type { VCLCountry } from './api/entities/VCLCountry';\nimport type { VCLCountries } from './api/entities/VCLCountries';\nimport { VCLCountryCodes } from './api/entities/VCLCountries';\nimport type { VCLRegion } from './api/entities/VCLRegion';\nimport type { VCLRegions } from './api/entities/VCLRegions';\nimport type { VCLCredentialManifest } from './api/entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './api/entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialManifestDescriptorByDeepLink } from './api/entities/VCLCredentialManifestDescriptorByDeepLink';\nimport type { VCLCredentialManifestDescriptorByService } from './api/entities/VCLCredentialManifestDescriptorByService';\nimport type { VCLCredentialManifestDescriptorRefresh } from './api/entities/VCLCredentialManifestDescriptorRefresh';\nimport type { VCLCredentialType } from './api/entities/VCLCredentialType';\nimport type { VCLCredentialTypeSchema } from './api/entities/VCLCredentialTypeSchema';\nimport type { VCLCredentialTypeSchemas } from './api/entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './api/entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLCredentialTypesUIFormSchema } from './api/entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLDeepLink } from './api/entities/VCLDeepLink';\nimport type { VCLExchange } from './api/entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './api/entities/VCLExchangeDescriptor';\nimport type { VCLFilter } from './api/entities/VCLFilter';\nimport type { VCLFinalizeOffersDescriptor } from './api/entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './api/entities/VCLGenerateOffersDescriptor';\nimport type { VCLJWT } from './api/entities/VCLJWT';\nimport type { VCLJwtVerifiableCredentials } from './api/entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './api/entities/VCLOffers';\nimport type { VCLOrganization } from './api/entities/VCLOrganization';\nimport type { VCLOrganizations } from './api/entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPage } from './api/entities/VCLPage';\nimport type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './api/entities/VCLJwkPublic';\nimport type { VCLPushDelegate } from './api/entities/VCLPushDelegate';\nimport type { VCLService } from './api/entities/VCLService';\nimport type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';\nimport { VCLServiceType } from './api/entities/VCLServiceType';\nimport type { VCLSubmissionResult } from './api/entities/VCLSubmissionResult';\nimport type { VCLToken } from './api/entities/VCLToken';\nimport type { VCLVerifiableCredential } from './api/entities/VCLVerifiableCredential';\nimport type { VCLVerifiedProfile } from './api/entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedProfileDescriptor';\nimport type { Dictionary } from './api/Dictionary';\nimport type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';\nimport type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './api/entities/VCLDidJwk';\nimport type { VCLErrorCode } from './api/entities/VCLErrorCode';\n\nconst { VclReactNative } = NativeModules;\n\nexport default VclReactNative as VclApi;\nexport {\n Dictionary,\n VCLEnvironment,\n VCLEnvTypes,\n VCLCountry,\n VCLCountries,\n VCLCountryCodes,\n VCLRegion,\n VCLRegions,\n VCLCredentialManifest,\n VCLCredentialManifestDescriptor,\n VCLCredentialManifestDescriptorByDeepLink,\n VCLCredentialManifestDescriptorByService,\n VCLCredentialType,\n VCLCredentialTypeSchema,\n VCLCredentialTypeSchemas,\n VCLCredentialTypesUIFormSchema,\n VCLCredentialTypesUIFormSchemaDescriptor,\n VCLCredentialManifestDescriptorRefresh,\n VCLDeepLink,\n VCLExchange,\n VCLExchangeDescriptor,\n VCLFilter,\n VCLFinalizeOffersDescriptor,\n VCLGenerateOffersDescriptor,\n VCLJWT,\n VCLJwtVerifiableCredentials,\n VCLOffers,\n VCLOrganization,\n VCLOrganizations,\n VCLOrganizationsSearchDescriptor,\n VCLPage,\n VCLPresentationRequest,\n VCLPresentationSubmission,\n VCLJwkPublic,\n VCLPushDelegate,\n VCLService,\n VCLServiceCredentialAgentIssuer,\n VCLServiceType,\n VCLSubmissionResult,\n VCLToken,\n VCLVerifiableCredential,\n VCLVerifiedProfile,\n VCLVerifiedProfileDescriptor,\n VCLInitializationDescriptor,\n VCLPresentationRequestDescriptor,\n VCLJwtDescriptor,\n VCLDidJwk,\n VCLErrorCode,\n};\n"]}
@@ -21,15 +21,16 @@ import type { VCLOrganizations } from './entities/VCLOrganizations';
21
21
  import type { VCLOrganizationsSearchDescriptor } from './entities/VCLOrganizationsSearchDescriptor';
22
22
  import type { VCLPresentationRequest } from './entities/VCLPresentationRequest';
23
23
  import type { VCLPresentationSubmission } from './entities/VCLPresentationSubmission';
24
- import type { VCLPublicKey } from './entities/VCLPublicKey';
24
+ import type { VCLJwkPublic } from './entities/VCLJwkPublic';
25
25
  import type { VCLToken } from './entities/VCLToken';
26
26
  import type { VCLVerifiedProfile } from './entities/VCLVerifiedProfile';
27
27
  import type { VCLVerifiedProfileDescriptor } from './entities/VCLVerifiedProfileDescriptor';
28
28
  import type { VCLCountries } from './entities/VCLCountries';
29
- import type { Dictionary } from './Dictionary';
30
29
  import type { VCLInitializationDescriptor } from './entities/VCLInitializationDescriptor';
31
30
  import type { VCLSubmissionResult } from './entities/VCLSubmissionResult';
32
31
  import type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';
32
+ import type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';
33
+ import type { VCLDidJwk } from 'src/api/entities/VCLDidJwk';
33
34
  export declare type VclApi = {
34
35
  initialize(initializationDescriptor: VCLInitializationDescriptor): Promise<void>;
35
36
  getCountries(): Promise<VCLCountries>;
@@ -45,6 +46,7 @@ export declare type VclApi = {
45
46
  finalizeOffers(finalizeOffersDescriptor: VCLFinalizeOffersDescriptor, token: VCLToken): Promise<VCLJwtVerifiableCredentials>;
46
47
  getCredentialTypesUIFormSchema(credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor): Promise<VCLCredentialTypesUIFormSchema>;
47
48
  getVerifiedProfile(verifiedProfileDescriptor: VCLVerifiedProfileDescriptor): Promise<VCLVerifiedProfile>;
48
- verifyJwt(jwt: VCLJWT, publicKey: VCLPublicKey): Promise<boolean>;
49
- generateSignedJwt(payload: Dictionary<any>, iss: string, jti: string): Promise<VCLJWT>;
49
+ verifyJwt(jwt: VCLJWT, jwkPublic: VCLJwkPublic): Promise<boolean>;
50
+ generateSignedJwt(jwtDescriptor: VCLJwtDescriptor): Promise<VCLJWT>;
51
+ generateDidJwk(): Promise<VCLDidJwk>;
50
52
  };
@@ -4,6 +4,6 @@
4
4
  * Copyright 2022 Velocity Career Labs inc.
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
- export interface VCLPublicKey {
8
- jwkStr: string;
7
+ export interface VCLDidJwk {
8
+ value: string;
9
9
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Created by Michael Avoyan.
3
+ *
4
+ * Copyright 2022 Velocity Career Labs inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ export declare enum VCLErrorCode {
8
+ NetworkError = 1,
9
+ VerificationError = 403
10
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Created by Michael Avoyan.
3
+ *
4
+ * Copyright 2022 Velocity Career Labs inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ export interface VCLJwkPublic {
8
+ valueStr: string;
9
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Created by Michael Avoyan.
3
+ *
4
+ * Copyright 2022 Velocity Career Labs inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ import type { Dictionary } from '../Dictionary';
8
+ export interface VCLJwtDescriptor {
9
+ payload: Dictionary<any>;
10
+ iss: string;
11
+ jti: string;
12
+ }
@@ -5,11 +5,11 @@
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
7
  import type { VCLJWT } from './VCLJWT';
8
- import type { VCLPublicKey } from './VCLPublicKey';
8
+ import type { VCLJwkPublic } from './VCLJwkPublic';
9
9
  export interface VCLPresentationRequest {
10
10
  exchangeId: string;
11
11
  jwt: VCLJWT;
12
- publicKey: VCLPublicKey;
12
+ jwkPublic: VCLJwkPublic;
13
13
  keyID: string;
14
14
  presentationDefinitionId: string;
15
15
  iss: string;
@@ -8,6 +8,7 @@ export declare enum VCLServiceType {
8
8
  Issuer = "Issuer",
9
9
  Inspector = "Inspector",
10
10
  TrustRoot = "TrustRoot",
11
+ CareerIssuer = "CareerIssuer",
11
12
  NodeOperator = "NodeOperator",
12
13
  NotaryIssuer = "NotaryIssuer",
13
14
  IdentityIssuer = "IdentityIssuer",
@@ -7,5 +7,5 @@
7
7
  import type { VCLServiceType } from './VCLServiceType';
8
8
  export interface VCLVerifiedProfileDescriptor {
9
9
  did: string;
10
- serviceType: VCLServiceType;
10
+ serviceType?: VCLServiceType;
11
11
  }
@@ -37,7 +37,7 @@ import type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganiz
37
37
  import type { VCLPage } from './api/entities/VCLPage';
38
38
  import type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';
39
39
  import type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';
40
- import type { VCLPublicKey } from './api/entities/VCLPublicKey';
40
+ import type { VCLJwkPublic } from './api/entities/VCLJwkPublic';
41
41
  import type { VCLPushDelegate } from './api/entities/VCLPushDelegate';
42
42
  import type { VCLService } from './api/entities/VCLService';
43
43
  import type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';
@@ -50,6 +50,9 @@ import type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedPro
50
50
  import type { Dictionary } from './api/Dictionary';
51
51
  import type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';
52
52
  import type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';
53
+ import type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';
54
+ import type { VCLDidJwk } from './api/entities/VCLDidJwk';
55
+ import type { VCLErrorCode } from './api/entities/VCLErrorCode';
53
56
  declare const _default: VclApi;
54
57
  export default _default;
55
- export { Dictionary, VCLEnvironment, VCLEnvTypes, VCLCountry, VCLCountries, VCLCountryCodes, VCLRegion, VCLRegions, VCLCredentialManifest, VCLCredentialManifestDescriptor, VCLCredentialManifestDescriptorByDeepLink, VCLCredentialManifestDescriptorByService, VCLCredentialType, VCLCredentialTypeSchema, VCLCredentialTypeSchemas, VCLCredentialTypesUIFormSchema, VCLCredentialTypesUIFormSchemaDescriptor, VCLCredentialManifestDescriptorRefresh, VCLDeepLink, VCLExchange, VCLExchangeDescriptor, VCLFilter, VCLFinalizeOffersDescriptor, VCLGenerateOffersDescriptor, VCLJWT, VCLJwtVerifiableCredentials, VCLOffers, VCLOrganization, VCLOrganizations, VCLOrganizationsSearchDescriptor, VCLPage, VCLPresentationRequest, VCLPresentationSubmission, VCLPublicKey, VCLPushDelegate, VCLService, VCLServiceCredentialAgentIssuer, VCLServiceType, VCLSubmissionResult, VCLToken, VCLVerifiableCredential, VCLVerifiedProfile, VCLVerifiedProfileDescriptor, VCLInitializationDescriptor, VCLPresentationRequestDescriptor, };
58
+ export { Dictionary, VCLEnvironment, VCLEnvTypes, VCLCountry, VCLCountries, VCLCountryCodes, VCLRegion, VCLRegions, VCLCredentialManifest, VCLCredentialManifestDescriptor, VCLCredentialManifestDescriptorByDeepLink, VCLCredentialManifestDescriptorByService, VCLCredentialType, VCLCredentialTypeSchema, VCLCredentialTypeSchemas, VCLCredentialTypesUIFormSchema, VCLCredentialTypesUIFormSchemaDescriptor, VCLCredentialManifestDescriptorRefresh, VCLDeepLink, VCLExchange, VCLExchangeDescriptor, VCLFilter, VCLFinalizeOffersDescriptor, VCLGenerateOffersDescriptor, VCLJWT, VCLJwtVerifiableCredentials, VCLOffers, VCLOrganization, VCLOrganizations, VCLOrganizationsSearchDescriptor, VCLPage, VCLPresentationRequest, VCLPresentationSubmission, VCLJwkPublic, VCLPushDelegate, VCLService, VCLServiceCredentialAgentIssuer, VCLServiceType, VCLSubmissionResult, VCLToken, VCLVerifiableCredential, VCLVerifiedProfile, VCLVerifiedProfileDescriptor, VCLInitializationDescriptor, VCLPresentationRequestDescriptor, VCLJwtDescriptor, VCLDidJwk, VCLErrorCode, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velocitycareerlabs/vcl-react-native",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Velocity Career Labs React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/api/VCLApi.ts CHANGED
@@ -22,15 +22,16 @@ import type { VCLOrganizations } from './entities/VCLOrganizations';
22
22
  import type { VCLOrganizationsSearchDescriptor } from './entities/VCLOrganizationsSearchDescriptor';
23
23
  import type { VCLPresentationRequest } from './entities/VCLPresentationRequest';
24
24
  import type { VCLPresentationSubmission } from './entities/VCLPresentationSubmission';
25
- import type { VCLPublicKey } from './entities/VCLPublicKey';
25
+ import type { VCLJwkPublic } from './entities/VCLJwkPublic';
26
26
  import type { VCLToken } from './entities/VCLToken';
27
27
  import type { VCLVerifiedProfile } from './entities/VCLVerifiedProfile';
28
28
  import type { VCLVerifiedProfileDescriptor } from './entities/VCLVerifiedProfileDescriptor';
29
29
  import type { VCLCountries } from './entities/VCLCountries';
30
- import type { Dictionary } from './Dictionary';
31
30
  import type { VCLInitializationDescriptor } from './entities/VCLInitializationDescriptor';
32
31
  import type { VCLSubmissionResult } from './entities/VCLSubmissionResult';
33
32
  import type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';
33
+ import type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';
34
+ import type { VCLDidJwk } from 'src/api/entities/VCLDidJwk';
34
35
 
35
36
  export type VclApi = {
36
37
  initialize(
@@ -83,11 +84,9 @@ export type VclApi = {
83
84
  verifiedProfileDescriptor: VCLVerifiedProfileDescriptor
84
85
  ): Promise<VCLVerifiedProfile>;
85
86
 
86
- verifyJwt(jwt: VCLJWT, publicKey: VCLPublicKey): Promise<boolean>;
87
+ verifyJwt(jwt: VCLJWT, jwkPublic: VCLJwkPublic): Promise<boolean>;
87
88
 
88
- generateSignedJwt(
89
- payload: Dictionary<any>,
90
- iss: string,
91
- jti: string
92
- ): Promise<VCLJWT>;
89
+ generateSignedJwt(jwtDescriptor: VCLJwtDescriptor): Promise<VCLJWT>;
90
+
91
+ generateDidJwk(): Promise<VCLDidJwk>;
93
92
  };
@@ -5,6 +5,6 @@
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
7
 
8
- export interface VCLPublicKey {
9
- jwkStr: string;
8
+ export interface VCLDidJwk {
9
+ value: string;
10
10
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Created by Michael Avoyan.
3
+ *
4
+ * Copyright 2022 Velocity Career Labs inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+
8
+ export enum VCLErrorCode {
9
+ NetworkError = 1,
10
+ VerificationError = 403,
11
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Created by Michael Avoyan.
3
+ *
4
+ * Copyright 2022 Velocity Career Labs inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+
8
+ export interface VCLJwkPublic {
9
+ valueStr: string;
10
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Created by Michael Avoyan.
3
+ *
4
+ * Copyright 2022 Velocity Career Labs inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+
8
+ import type { Dictionary } from '../Dictionary';
9
+
10
+ export interface VCLJwtDescriptor {
11
+ payload: Dictionary<any>;
12
+ iss: string;
13
+ jti: string;
14
+ }
@@ -6,12 +6,12 @@
6
6
  */
7
7
 
8
8
  import type { VCLJWT } from './VCLJWT';
9
- import type { VCLPublicKey } from './VCLPublicKey';
9
+ import type { VCLJwkPublic } from './VCLJwkPublic';
10
10
 
11
11
  export interface VCLPresentationRequest {
12
12
  exchangeId: string;
13
13
  jwt: VCLJWT;
14
- publicKey: VCLPublicKey;
14
+ jwkPublic: VCLJwkPublic;
15
15
  keyID: string;
16
16
  presentationDefinitionId: string;
17
17
  iss: string;
@@ -9,6 +9,7 @@ export enum VCLServiceType {
9
9
  Issuer = 'Issuer',
10
10
  Inspector = 'Inspector',
11
11
  TrustRoot = 'TrustRoot',
12
+ CareerIssuer = 'CareerIssuer',
12
13
  NodeOperator = 'NodeOperator',
13
14
  NotaryIssuer = 'NotaryIssuer',
14
15
  IdentityIssuer = 'IdentityIssuer',
@@ -9,5 +9,5 @@ import type { VCLServiceType } from './VCLServiceType';
9
9
 
10
10
  export interface VCLVerifiedProfileDescriptor {
11
11
  did: string;
12
- serviceType: VCLServiceType;
12
+ serviceType?: VCLServiceType;
13
13
  }
package/src/index.tsx CHANGED
@@ -39,7 +39,7 @@ import type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganiz
39
39
  import type { VCLPage } from './api/entities/VCLPage';
40
40
  import type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';
41
41
  import type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';
42
- import type { VCLPublicKey } from './api/entities/VCLPublicKey';
42
+ import type { VCLJwkPublic } from './api/entities/VCLJwkPublic';
43
43
  import type { VCLPushDelegate } from './api/entities/VCLPushDelegate';
44
44
  import type { VCLService } from './api/entities/VCLService';
45
45
  import type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';
@@ -52,6 +52,9 @@ import type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedPro
52
52
  import type { Dictionary } from './api/Dictionary';
53
53
  import type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';
54
54
  import type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';
55
+ import type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';
56
+ import type { VCLDidJwk } from './api/entities/VCLDidJwk';
57
+ import type { VCLErrorCode } from './api/entities/VCLErrorCode';
55
58
 
56
59
  const { VclReactNative } = NativeModules;
57
60
 
@@ -90,7 +93,7 @@ export {
90
93
  VCLPage,
91
94
  VCLPresentationRequest,
92
95
  VCLPresentationSubmission,
93
- VCLPublicKey,
96
+ VCLJwkPublic,
94
97
  VCLPushDelegate,
95
98
  VCLService,
96
99
  VCLServiceCredentialAgentIssuer,
@@ -102,4 +105,7 @@ export {
102
105
  VCLVerifiedProfileDescriptor,
103
106
  VCLInitializationDescriptor,
104
107
  VCLPresentationRequestDescriptor,
108
+ VCLJwtDescriptor,
109
+ VCLDidJwk,
110
+ VCLErrorCode,
105
111
  };
@@ -18,5 +18,5 @@ Pod::Spec.new do |s|
18
18
  s.swift_version = "5.0"
19
19
 
20
20
  s.dependency "React"
21
- s.dependency "VCL", "1.3.0"
21
+ s.dependency "VCL", "1.4.0"
22
22
  end
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=VCLPublicKey.js.map
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=VCLPublicKey.js.map