@velocitycareerlabs/vcl-react-native 1.12.0 → 1.13.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 (34) hide show
  1. package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
  2. package/android/.gradle/7.4.2/checksums/md5-checksums.bin +0 -0
  3. package/android/.gradle/7.4.2/checksums/sha1-checksums.bin +0 -0
  4. package/android/build.gradle +2 -2
  5. package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativeModule.kt +18 -11
  6. package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/MapExtensions.kt +16 -1
  7. package/android/src/main/java/io/velocitycareerlabs/reactnative/utlis/Converter.kt +25 -6
  8. package/ios/Utils/Converter.swift +30 -11
  9. package/ios/VclReactNative.m +3 -0
  10. package/ios/VclReactNative.swift +16 -8
  11. package/lib/commonjs/api/VCLApi.js +6 -6
  12. package/lib/commonjs/api/VCLApi.js.map +1 -1
  13. package/lib/commonjs/api/entities/VCLDidJwk.js.map +1 -1
  14. package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js.map +1 -1
  15. package/lib/commonjs/api/entities/VCLJwtDescriptor.js.map +1 -1
  16. package/lib/commonjs/api/entities/VCLOffers.js.map +1 -1
  17. package/lib/module/api/VCLApi.js +6 -6
  18. package/lib/module/api/VCLApi.js.map +1 -1
  19. package/lib/module/api/entities/VCLDidJwk.js.map +1 -1
  20. package/lib/module/api/entities/VCLFinalizeOffersDescriptor.js.map +1 -1
  21. package/lib/module/api/entities/VCLJwtDescriptor.js.map +1 -1
  22. package/lib/module/api/entities/VCLOffers.js.map +1 -1
  23. package/lib/typescript/api/VCLApi.d.ts +3 -3
  24. package/lib/typescript/api/entities/VCLDidJwk.d.ts +11 -0
  25. package/lib/typescript/api/entities/VCLFinalizeOffersDescriptor.d.ts +2 -0
  26. package/lib/typescript/api/entities/VCLJwtDescriptor.d.ts +18 -1
  27. package/lib/typescript/api/entities/VCLOffers.d.ts +2 -0
  28. package/package.json +1 -1
  29. package/src/api/VCLApi.ts +14 -4
  30. package/src/api/entities/VCLDidJwk.ts +11 -0
  31. package/src/api/entities/VCLFinalizeOffersDescriptor.ts +2 -0
  32. package/src/api/entities/VCLJwtDescriptor.ts +18 -1
  33. package/src/api/entities/VCLOffers.ts +2 -0
  34. package/vcl-react-native.podspec +4 -2
@@ -9,7 +9,7 @@ buildscript {
9
9
  }
10
10
 
11
11
  dependencies {
12
- classpath 'com.android.tools.build:gradle:7.4.0'
12
+ classpath 'com.android.tools.build:gradle:7.4.1'
13
13
  // noinspection DifferentKotlinGradleVersion
14
14
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15
15
  }
@@ -131,5 +131,5 @@ dependencies {
131
131
 
132
132
  // VCL:
133
133
  implementation "com.nimbusds:nimbus-jose-jwt:9.31"
134
- implementation "io.velocitycareerlabs:vcl:1.12.0"
134
+ implementation "io.velocitycareerlabs:vcl:1.13.0"
135
135
  }
@@ -16,7 +16,7 @@ import io.velocitycareerlabs.reactnative.utlis.Converter.credentialTypesFormSche
16
16
  import io.velocitycareerlabs.reactnative.utlis.Converter.credentialTypesToMap
17
17
  import io.velocitycareerlabs.reactnative.utlis.Converter.exchangeToMap
18
18
  import io.velocitycareerlabs.reactnative.utlis.Converter.jwtVerifiableCredentialsToMap
19
- import io.velocitycareerlabs.reactnative.utlis.Converter.generatedOffersToMap
19
+ import io.velocitycareerlabs.reactnative.utlis.Converter.offersToMap
20
20
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToCredentialManifestDescriptor
21
21
  import io.velocitycareerlabs.reactnative.utlis.Converter.organizationsToMap
22
22
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToPresentationSubmission
@@ -37,8 +37,10 @@ import io.velocitycareerlabs.api.VCLProvider
37
37
  import io.velocitycareerlabs.api.entities.VCLError
38
38
  import io.velocitycareerlabs.reactnative.extensions.toThrowable
39
39
  import io.velocitycareerlabs.reactnative.utlis.Converter.didJwkToMap
40
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToDidJwk
40
41
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToInitializationDescriptor
41
42
  import io.velocitycareerlabs.reactnative.utlis.Converter.mapToJwtDescriptor
43
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToOffers
42
44
  import java.lang.Exception
43
45
 
44
46
  /**
@@ -50,7 +52,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
50
52
  const val ModuleName = "VclReactNative"
51
53
  }
52
54
 
53
- private val vcl = VCLProvider.vclInstance()
55
+ private val vcl = VCLProvider.vclInstance(reactContext.applicationContext)
54
56
 
55
57
  override fun getName(): String {
56
58
  return ModuleName
@@ -64,7 +66,6 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
64
66
  try {
65
67
  vcl.initialize(
66
68
  initializationDescriptor = mapToInitializationDescriptor(
67
- reactContext,
68
69
  initializationDescriptor
69
70
  ),
70
71
  successHandler = {
@@ -110,12 +111,12 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
110
111
 
111
112
  @ReactMethod
112
113
  fun getPresentationRequest(
113
- presentationRequestDescriptorReadableMap: ReadableMap,
114
+ presentationRequestDescriptorMap: ReadableMap,
114
115
  promise: Promise
115
116
  ) {
116
117
  try {
117
118
  vcl.getPresentationRequest(
118
- mapTopPresentationRequestDescriptor(presentationRequestDescriptorReadableMap),
119
+ mapTopPresentationRequestDescriptor(presentationRequestDescriptorMap),
119
120
  {
120
121
  promise.resolve(presentationRequestToMap(it))
121
122
  },
@@ -129,12 +130,14 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
129
130
 
130
131
  @ReactMethod
131
132
  fun submitPresentation(
132
- presentationSubmissionReadableMap: ReadableMap,
133
+ presentationSubmissionMap: ReadableMap,
134
+ didJwkMap: ReadableMap,
133
135
  promise: Promise
134
136
  ) {
135
137
  try {
136
138
  vcl.submitPresentation(
137
- mapToPresentationSubmission(presentationSubmissionReadableMap),
139
+ mapToPresentationSubmission(presentationSubmissionMap),
140
+ mapToDidJwk(didJwkMap),
138
141
  {
139
142
  promise.resolve(presentationSubmissionResultToMap(it))
140
143
  },
@@ -148,11 +151,11 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
148
151
 
149
152
  @ReactMethod
150
153
  fun getExchangeProgress(
151
- exchangeDescriptorReadableMap: ReadableMap,
154
+ exchangeDescriptorMap: ReadableMap,
152
155
  promise: Promise
153
156
  ) {
154
157
  try {
155
- vcl.getExchangeProgress(mapToExchangeDescriptor(exchangeDescriptorReadableMap),
158
+ vcl.getExchangeProgress(mapToExchangeDescriptor(exchangeDescriptorMap),
156
159
  {
157
160
  promise.resolve(exchangeToMap(it))
158
161
  },
@@ -207,13 +210,15 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
207
210
  @ReactMethod
208
211
  fun generateOffers(
209
212
  generateOffersDescriptorMap: ReadableMap,
213
+ didJwkMap: ReadableMap,
210
214
  promise: Promise
211
215
  ) {
212
216
  try {
213
217
  vcl.generateOffers(
214
218
  mapToGenerateOffersDescriptor(generateOffersDescriptorMap),
219
+ mapToDidJwk(didJwkMap),
215
220
  {
216
- promise.resolve(generatedOffersToMap(it))
221
+ promise.resolve(offersToMap(it))
217
222
  },
218
223
  {
219
224
  promise.reject(it.toThrowable())
@@ -234,7 +239,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
234
239
  mapToGenerateOffersDescriptor(generateOffersDescriptorMap),
235
240
  mapToToken(tokenMap),
236
241
  {
237
- promise.resolve(generatedOffersToMap(it))
242
+ promise.resolve(offersToMap(it))
238
243
  },
239
244
  {
240
245
  promise.reject(it.toThrowable())
@@ -247,12 +252,14 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
247
252
  @ReactMethod
248
253
  fun finalizeOffers(
249
254
  finalizeOffersDescriptorMap: ReadableMap,
255
+ didJwkMap: ReadableMap,
250
256
  tokenMap: ReadableMap,
251
257
  promise: Promise
252
258
  ) {
253
259
  try {
254
260
  vcl.finalizeOffers(
255
261
  mapToFinalizedOffersDescriptor(finalizeOffersDescriptorMap),
262
+ mapToDidJwk(didJwkMap),
256
263
  mapToToken(tokenMap),
257
264
  {
258
265
  promise.resolve(jwtVerifiableCredentialsToMap(it))
@@ -9,7 +9,9 @@
9
9
 
10
10
  import com.facebook.react.bridge.ReadableArray
11
11
  import com.facebook.react.bridge.ReadableMap
12
+ import com.facebook.react.bridge.WritableArray
12
13
  import com.facebook.react.bridge.WritableMap
14
+ import org.json.JSONArray
13
15
  import org.json.JSONObject
14
16
  import java.lang.Exception
15
17
 
@@ -100,7 +102,7 @@ fun ReadableMap.toJsonObject(): JSONObject {
100
102
  JSONObject(this.toHashMap())
101
103
  } catch (e: Exception) {
102
104
  e.printStackTrace()
103
- JSONObject("{}")
105
+ JSONObject()
104
106
  }
105
107
  }
106
108
 
@@ -108,3 +110,16 @@ fun WritableMap.toJsonObject(): JSONObject {
108
110
  return (this as ReadableMap).toJsonObject()
109
111
  }
110
112
 
113
+ fun ReadableArray.toJsonArray(): JSONArray {
114
+ return try {
115
+ JSONArray(this.toArrayList())
116
+ } catch (e: Exception) {
117
+ e.printStackTrace()
118
+ JSONArray()
119
+ }
120
+ }
121
+
122
+ fun WritableArray.toJsonArray(): JSONArray {
123
+ return (this as ReadableArray).toJsonArray()
124
+ }
125
+
@@ -11,6 +11,7 @@ import com.facebook.react.bridge.*
11
11
  import io.velocitycareerlabs.api.*
12
12
  import io.velocitycareerlabs.api.entities.*
13
13
  import io.velocitycareerlabs.reactnative.extensions.*
14
+ import org.json.JSONArray
14
15
  import org.json.JSONObject
15
16
  import java.lang.Exception
16
17
 
@@ -20,11 +21,9 @@ import java.lang.Exception
20
21
  object Converter {
21
22
 
22
23
  fun mapToInitializationDescriptor(
23
- reactContext: ReactApplicationContext,
24
24
  initializationDescriptorMap: ReadableMap
25
25
  ) =
26
26
  VCLInitializationDescriptor(
27
- context = reactContext,
28
27
  environment = mapToEnvironment(
29
28
  initializationDescriptorMap.getMapOpt("environment")
30
29
  ?: mapOf(Pair("value", VCLEnvironment.PROD.value)).toReadableMap()
@@ -490,16 +489,28 @@ object Converter {
490
489
  )
491
490
  }
492
491
 
493
- fun generatedOffersToMap(
492
+ fun offersToMap(
494
493
  offers: VCLOffers
495
494
  ): ReadableMap {
496
495
  val generatedOffersMap = Arguments.createMap()
496
+ generatedOffersMap.putMap("payload", offers.payload.toReadableMap())
497
497
  generatedOffersMap.putArray("all", offers.all.toReadableArray())
498
498
  generatedOffersMap.putInt("responseCode", offers.responseCode)
499
499
  generatedOffersMap.putMap("token", tokenToMap(offers.token))
500
+ generatedOffersMap.putString("challenge", offers.challenge)
500
501
  return generatedOffersMap
501
502
  }
502
503
 
504
+ fun mapToOffers(offersMap: ReadableMap?): VCLOffers {
505
+ return VCLOffers(
506
+ payload = offersMap?.getMapOpt("payload")?.toJsonObject() ?: JSONObject(),
507
+ all = offersMap?.getArrayOpt("all")?.toJsonArray() ?: JSONArray(),
508
+ responseCode = offersMap?.getIntOpt("responseCode") ?: -1,
509
+ token = mapToToken(offersMap?.getMapOpt("token")),
510
+ challenge = offersMap?.getStringOpt("challenge") ?: ""
511
+ )
512
+ }
513
+
503
514
  fun credentialTypesFormSchemaToMap(
504
515
  credentialTypesFormSchema: VCLCredentialTypesUIFormSchema
505
516
  ): ReadableMap {
@@ -521,6 +532,7 @@ object Converter {
521
532
  finalizedOffersDescriptorMap: ReadableMap
522
533
  ) = VCLFinalizeOffersDescriptor(
523
534
  credentialManifest = mapToCredentialManifest(finalizedOffersDescriptorMap.getMapOpt("credentialManifest")),
535
+ offers = mapToOffers(finalizedOffersDescriptorMap.getMapOpt("offers")),
524
536
  approvedOfferIds = (finalizedOffersDescriptorMap.getArrayOpt("approvedOfferIds")?.toArrayList()
525
537
  ?.toList() as? List<String>) ?: listOf(),
526
538
  rejectedOfferIds = (finalizedOffersDescriptorMap.getArrayOpt("rejectedOfferIds")?.toArrayList()
@@ -581,12 +593,19 @@ object Converter {
581
593
  jti = jwtDescriptorDictionary.getStringOpt("jti") ?: ""
582
594
  )
583
595
 
584
- fun didJwkToMap(
585
- didJwk: VCLDidJwk
586
- ): ReadableMap {
596
+ fun didJwkToMap(didJwk: VCLDidJwk): ReadableMap {
587
597
  val didJwkMap = Arguments.createMap()
598
+ didJwkMap.putString("keyId", didJwk.keyId)
588
599
  didJwkMap.putString("value", didJwk.value)
600
+ didJwkMap.putString("kid", didJwk.kid)
589
601
  return didJwkMap
590
602
  }
603
+
604
+ fun mapToDidJwk(didJwkMap: ReadableMap) =
605
+ VCLDidJwk(
606
+ keyId = didJwkMap.getStringOpt("keyId") ?: "",
607
+ value = didJwkMap.getStringOpt("value") ?: "",
608
+ kid = didJwkMap.getStringOpt("kid") ?: "",
609
+ )
591
610
  }
592
611
 
@@ -450,14 +450,24 @@ func dictionaryToGenerateOffersDescriptor(
450
450
  )
451
451
  }
452
452
 
453
- func generatedOffersToDictionary(
454
- _ offers: VCLOffers
455
- ) -> [String: Any] {
456
- var generatedOffersDictionary = [String: Any]()
457
- generatedOffersDictionary["all"] = offers.all
458
- generatedOffersDictionary["responseCode"] = offers.responseCode
459
- generatedOffersDictionary["token"] = tokenToDictionary(offers.token)
460
- return generatedOffersDictionary
453
+ func offersToDictionary(_ offers: VCLOffers) -> [String: Any] {
454
+ var offersDictionary = [String: Any]()
455
+ offersDictionary["payload"] = offers.payload
456
+ offersDictionary["all"] = offers.all
457
+ offersDictionary["responseCode"] = offers.responseCode
458
+ offersDictionary["token"] = tokenToDictionary(offers.token)
459
+ offersDictionary["challenge"] = offers.challenge
460
+ return offersDictionary
461
+ }
462
+
463
+ func dictionaryToOffers(_ offersDictionary: [String : Any]?) -> VCLOffers {
464
+ return VCLOffers(
465
+ payload: offersDictionary?["payload"] as? [String: Any] ?? [String: Any](),
466
+ all: offersDictionary?["all"] as? [[String: Any]] ?? [[String: Any]](),
467
+ responseCode: offersDictionary?["responseCode"] as? Int ?? 0,
468
+ token: dictionaryToToken(offersDictionary?["token"] as? [String: Any]),
469
+ challenge: offersDictionary?["challenge"] as? String ?? ""
470
+ )
461
471
  }
462
472
 
463
473
  func credentialTypesFormSchemaToDictionary(
@@ -485,6 +495,7 @@ func dictionaryToFinalizedOffersDescriptor(
485
495
  ) -> VCLFinalizeOffersDescriptor {
486
496
  return VCLFinalizeOffersDescriptor(
487
497
  credentialManifest: dictionaryToCredentialManifest(finalizedOffersDescriptorDictionary["credentialManifest"] as? [String : Any]),
498
+ offers: dictionaryToOffers(finalizedOffersDescriptorDictionary["offers"] as? [String : Any]),
488
499
  approvedOfferIds: finalizedOffersDescriptorDictionary["approvedOfferIds"] as? [String] ?? [String](),
489
500
  rejectedOfferIds: finalizedOffersDescriptorDictionary["rejectedOfferIds"] as? [String] ?? [String]()
490
501
  )
@@ -545,10 +556,18 @@ func dictionaryToJwtDescriptor(
545
556
  )
546
557
  }
547
558
 
548
- func didJwkToDictionary(
549
- _ didJwk: VCLDidJwk
550
- ) -> [String: Any] {
559
+ func didJwkToDictionary(_ didJwk: VCLDidJwk) -> [String: Any] {
551
560
  var didJwkDictionary = [String: Any]()
561
+ didJwkDictionary["keyId"] = didJwk.keyId
552
562
  didJwkDictionary["value"] = didJwk.value
563
+ didJwkDictionary["kid"] = didJwk.kid
553
564
  return didJwkDictionary
554
565
  }
566
+
567
+ func dictionaryToJwk(_ didJwkDictionary: [String: Any]) -> VCLDidJwk {
568
+ return VCLDidJwk(
569
+ keyId: didJwkDictionary["keyId"] as? String ?? "",
570
+ value: didJwkDictionary["value"] as? String ?? "",
571
+ kid: didJwkDictionary["kid"] as? String ?? ""
572
+ )
573
+ }
@@ -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
+ withDidJwkDictionary:(NSDictionary*)didJwkDictionary
29
30
  withResolver:(RCTPromiseResolveBlock)resolve
30
31
  withRejecter:(RCTPromiseRejectBlock)reject)
31
32
 
@@ -42,6 +43,7 @@ RCT_EXTERN_METHOD(getCredentialManifest:(NSDictionary*)credentialManifestDescrip
42
43
  withRejecter:(RCTPromiseRejectBlock)reject)
43
44
 
44
45
  RCT_EXTERN_METHOD(generateOffers:(NSDictionary*)generateOffersDescriptorDictionary
46
+ withDidJwkDictionary:(NSDictionary*)didJwkDictionary
45
47
  withResolver:(RCTPromiseResolveBlock)resolve
46
48
  withRejecter:(RCTPromiseRejectBlock)reject)
47
49
 
@@ -51,6 +53,7 @@ RCT_EXTERN_METHOD(checkForOffers:(NSDictionary*)generateOffersDescriptorDictiona
51
53
  withRejecter:(RCTPromiseRejectBlock)reject)
52
54
 
53
55
  RCT_EXTERN_METHOD(finalizeOffers:(NSDictionary*)finalizeOffersDescriptorDictionary
56
+ withDidJwkDictionary:(NSDictionary*)didJwkDictionary
54
57
  withTokenDictionary:(NSDictionary*)tokenDictionary
55
58
  withResolver:(RCTPromiseResolveBlock)resolve
56
59
  withRejecter:(RCTPromiseRejectBlock)reject)
@@ -1,7 +1,7 @@
1
1
  // Created by Michael Avoyan on 05/07/2021.
2
2
  //
3
- // Copyright 2022 Velocity Career Labs inc.
4
- // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright 2022 Velocity Career Labs inc.
4
+ // SPDX-License-Identifier: Apache-2.0
5
5
  //
6
6
 
7
7
  import VCL
@@ -78,13 +78,17 @@ class VclReactNative: NSObject {
78
78
  )
79
79
  }
80
80
 
81
- @objc(submitPresentation:withResolver:withRejecter:)
81
+ @objc(submitPresentation:withDidJwkDictionary:withResolver:withRejecter:)
82
82
  func submitPresentation(
83
83
  presentationSubmissionDictionary: [String: Any],
84
+ didJwkDictionary: [String: Any],
84
85
  resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
85
86
  ) {
86
87
  vcl.submitPresentation(
87
- presentationSubmission: dictionaryToPresentationSubmission(presentationSubmissionDictionary),
88
+ presentationSubmission: dictionaryToPresentationSubmission(
89
+ presentationSubmissionDictionary
90
+ ),
91
+ didJwk: dictionaryToJwk(didJwkDictionary),
88
92
  successHandler: {
89
93
  resolve(presentationSubmissionResultToDictionary($0))
90
94
  },
@@ -142,15 +146,17 @@ class VclReactNative: NSObject {
142
146
  }
143
147
  }
144
148
 
145
- @objc(generateOffers:withResolver:withRejecter:)
149
+ @objc(generateOffers:withDidJwkDictionary:withResolver:withRejecter:)
146
150
  func generateOffers(
147
151
  generateOffersDescriptorDictionary: [String: Any],
152
+ didJwkDictionary: [String: Any],
148
153
  resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
149
154
  ) {
150
155
  vcl.generateOffers(
151
156
  generateOffersDescriptor: dictionaryToGenerateOffersDescriptor(generateOffersDescriptorDictionary),
157
+ didJwk: dictionaryToJwk(didJwkDictionary),
152
158
  successHandler: {
153
- resolve(generatedOffersToDictionary($0))
159
+ resolve(offersToDictionary($0))
154
160
  },
155
161
  errorHandler: {
156
162
  reject(nil, $0.toDictionary().toJsonString(), $0)
@@ -167,21 +173,23 @@ class VclReactNative: NSObject {
167
173
  generateOffersDescriptor: dictionaryToGenerateOffersDescriptor(generateOffersDescriptorDictionary),
168
174
  token: dictionaryToToken(tokenDictionary),
169
175
  successHandler: {
170
- resolve(generatedOffersToDictionary($0))
176
+ resolve(offersToDictionary($0))
171
177
  },
172
178
  errorHandler: {
173
179
  reject(nil, $0.toDictionary().toJsonString(), $0)
174
180
  })
175
181
  }
176
182
 
177
- @objc(finalizeOffers:withTokenDictionary:withResolver:withRejecter:)
183
+ @objc(finalizeOffers:withDidJwkDictionary:withTokenDictionary:withResolver:withRejecter:)
178
184
  func finalizeOffers(
179
185
  finalizeOffersDescriptorDictionary: [String: Any],
186
+ didJwkDictionary: [String: Any],
180
187
  tokenDictionary: [String: Any],
181
188
  resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
182
189
  ) {
183
190
  vcl.finalizeOffers(
184
191
  finalizeOffersDescriptor: dictionaryToFinalizedOffersDescriptor(finalizeOffersDescriptorDictionary),
192
+ didJwk: dictionaryToJwk(didJwkDictionary),
185
193
  token: dictionaryToToken(tokenDictionary),
186
194
  successHandler: {
187
195
  resolve(jwtVerifiableCredentialsToDictionary($0))
@@ -52,9 +52,9 @@ const VclApi = {
52
52
  throw new _VCLError.VCLError(e);
53
53
  }
54
54
  },
55
- submitPresentation: async presentationSubmission => {
55
+ submitPresentation: async (presentationSubmission, didJwk) => {
56
56
  try {
57
- return await VclReactNative.submitPresentation(presentationSubmission);
57
+ return await VclReactNative.submitPresentation(presentationSubmission, didJwk);
58
58
  } catch (e) {
59
59
  throw new _VCLError.VCLError(e);
60
60
  }
@@ -80,9 +80,9 @@ const VclApi = {
80
80
  throw new _VCLError.VCLError(e);
81
81
  }
82
82
  },
83
- generateOffers: async generateOffersDescriptor => {
83
+ generateOffers: async (generateOffersDescriptor, didJwk) => {
84
84
  try {
85
- return await VclReactNative.generateOffers(generateOffersDescriptor);
85
+ return await VclReactNative.generateOffers(generateOffersDescriptor, didJwk);
86
86
  } catch (e) {
87
87
  throw new _VCLError.VCLError(e);
88
88
  }
@@ -94,9 +94,9 @@ const VclApi = {
94
94
  throw new _VCLError.VCLError(e);
95
95
  }
96
96
  },
97
- finalizeOffers: async (finalizeOffersDescriptor, token) => {
97
+ finalizeOffers: async (finalizeOffersDescriptor, didJwk, token) => {
98
98
  try {
99
- return await VclReactNative.finalizeOffers(finalizeOffersDescriptor, token);
99
+ return await VclReactNative.finalizeOffers(finalizeOffersDescriptor, didJwk, token);
100
100
  } catch (e) {
101
101
  throw new _VCLError.VCLError(e);
102
102
  }
@@ -1 +1 @@
1
- {"version":3,"names":["VclReactNative","NativeModules","VclApi","initialize","initializationDescriptor","e","VCLError","getCountries","getCredentialTypes","getCredentialTypeSchemas","getPresentationRequest","presentationRequestDescriptor","submitPresentation","presentationSubmission","getExchangeProgress","exchangeDescriptor","searchForOrganizations","organizationsSearchDescriptor","getCredentialManifest","credentialManifestDescriptor","generateOffers","generateOffersDescriptor","checkForOffers","token","finalizeOffers","finalizeOffersDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","generateSignedJwt","jwtDescriptor","generateDidJwk"],"sources":["VCLApi.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialTypeSchemas } from './entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchema } from './entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLExchange } from './entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './entities/VCLExchangeDescriptor';\nimport type { VCLFinalizeOffersDescriptor } from './entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './entities/VCLOffers';\nimport type { VCLOrganizations } from './entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPresentationRequest } from './entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './entities/VCLJwkPublic';\nimport type { VCLToken } from './entities/VCLToken';\nimport type { VCLVerifiedProfile } from './entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './entities/VCLVerifiedProfileDescriptor';\nimport type { VCLCountries } from './entities/VCLCountries';\nimport type { VCLInitializationDescriptor } from './entities/VCLInitializationDescriptor';\nimport type { VCLSubmissionResult } from './entities/VCLSubmissionResult';\nimport type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './entities/VCLDidJwk';\nimport type { VCLCredentialTypes } from './entities/VCLCredentialTypes';\n\nimport { NativeModules } from 'react-native';\nimport { VCLError } from './entities/VCLError';\nconst { VclReactNative } = NativeModules;\n\nexport const VclApi = {\n initialize: async (\n initializationDescriptor: VCLInitializationDescriptor\n ): Promise<void> => {\n try {\n return await VclReactNative.initialize(initializationDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCountries: async (): Promise<VCLCountries> => {\n try {\n return await VclReactNative.getCountries();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypes: async (): Promise<VCLCredentialTypes> => {\n try {\n return await VclReactNative.getCredentialTypes();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypeSchemas: async (): Promise<VCLCredentialTypeSchemas> => {\n try {\n return await VclReactNative.getCredentialTypeSchemas();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getPresentationRequest: async (\n presentationRequestDescriptor: VCLPresentationRequestDescriptor\n ): Promise<VCLPresentationRequest> => {\n try {\n return await VclReactNative.getPresentationRequest(\n presentationRequestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n submitPresentation: async (\n presentationSubmission: VCLPresentationSubmission\n ): Promise<VCLSubmissionResult> => {\n try {\n return await VclReactNative.submitPresentation(presentationSubmission);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getExchangeProgress: async (\n exchangeDescriptor: VCLExchangeDescriptor\n ): Promise<VCLExchange> => {\n try {\n return await VclReactNative.getExchangeProgress(exchangeDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n searchForOrganizations: async (\n organizationsSearchDescriptor: VCLOrganizationsSearchDescriptor\n ): Promise<VCLOrganizations> => {\n try {\n return await VclReactNative.searchForOrganizations(\n organizationsSearchDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialManifest: async (\n credentialManifestDescriptor: VCLCredentialManifestDescriptor\n ): Promise<VCLCredentialManifest> => {\n try {\n return await VclReactNative.getCredentialManifest(\n credentialManifestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.generateOffers(generateOffersDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n checkForOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor,\n token: VCLToken\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.checkForOffers(\n generateOffersDescriptor,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n finalizeOffers: async (\n finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,\n token: VCLToken\n ): Promise<VCLJwtVerifiableCredentials> => {\n try {\n return await VclReactNative.finalizeOffers(\n finalizeOffersDescriptor,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypesUIFormSchema: async (\n credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor\n ): Promise<VCLCredentialTypesUIFormSchema> => {\n try {\n return await VclReactNative.getCredentialTypesUIFormSchema(\n credentialTypesUIFormSchemaDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getVerifiedProfile: async (\n verifiedProfileDescriptor: VCLVerifiedProfileDescriptor\n ): Promise<VCLVerifiedProfile> => {\n try {\n return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n verifyJwt: async (jwt: VCLJwt, jwkPublic: VCLJwkPublic): Promise<boolean> => {\n try {\n return await VclReactNative.verifyJwt(jwt, jwkPublic);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateSignedJwt: async (\n jwtDescriptor: VCLJwtDescriptor\n ): Promise<VCLJwt> => {\n try {\n return await VclReactNative.generateSignedJwt(jwtDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateDidJwk: async (): Promise<VCLDidJwk> => {\n try {\n return await VclReactNative.generateDidJwk();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n};\n"],"mappings":";;;;;;AAmCA;AACA;AApCA;AACA;AACA;AACA;AACA;AACA;;AAgCA,MAAM;EAAEA;AAAe,CAAC,GAAGC,0BAAa;AAEjC,MAAMC,MAAM,GAAG;EACpBC,UAAU,EAAE,MACVC,wBAAqD,IACnC;IAClB,IAAI;MACF,OAAO,MAAMJ,cAAc,CAACG,UAAU,CAACC,wBAAwB,CAAC;IAClE,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDE,YAAY,EAAE,YAAmC;IAC/C,IAAI;MACF,OAAO,MAAMP,cAAc,CAACO,YAAY,EAAE;IAC5C,CAAC,CAAC,OAAOF,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDG,kBAAkB,EAAE,YAAyC;IAC3D,IAAI;MACF,OAAO,MAAMR,cAAc,CAACQ,kBAAkB,EAAE;IAClD,CAAC,CAAC,OAAOH,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDI,wBAAwB,EAAE,YAA+C;IACvE,IAAI;MACF,OAAO,MAAMT,cAAc,CAACS,wBAAwB,EAAE;IACxD,CAAC,CAAC,OAAOJ,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IAC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4B,iBAAiB,EAAE,MACjBC,aAA+B,IACX;IACpB,IAAI;MACF,OAAO,MAAMlC,cAAc,CAACiC,iBAAiB,CAACC,aAAa,CAAC;IAC9D,CAAC,CAAC,OAAO7B,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAED8B,cAAc,EAAE,YAAgC;IAC9C,IAAI;MACF,OAAO,MAAMnC,cAAc,CAACmC,cAAc,EAAE;IAC9C,CAAC,CAAC,OAAO9B,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF;AACF,CAAC;AAAC"}
1
+ {"version":3,"names":["VclReactNative","NativeModules","VclApi","initialize","initializationDescriptor","e","VCLError","getCountries","getCredentialTypes","getCredentialTypeSchemas","getPresentationRequest","presentationRequestDescriptor","submitPresentation","presentationSubmission","didJwk","getExchangeProgress","exchangeDescriptor","searchForOrganizations","organizationsSearchDescriptor","getCredentialManifest","credentialManifestDescriptor","generateOffers","generateOffersDescriptor","checkForOffers","token","finalizeOffers","finalizeOffersDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","generateSignedJwt","jwtDescriptor","generateDidJwk"],"sources":["VCLApi.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialTypeSchemas } from './entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchema } from './entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLExchange } from './entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './entities/VCLExchangeDescriptor';\nimport type { VCLFinalizeOffersDescriptor } from './entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './entities/VCLOffers';\nimport type { VCLOrganizations } from './entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPresentationRequest } from './entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './entities/VCLJwkPublic';\nimport type { VCLToken } from './entities/VCLToken';\nimport type { VCLVerifiedProfile } from './entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './entities/VCLVerifiedProfileDescriptor';\nimport type { VCLCountries } from './entities/VCLCountries';\nimport type { VCLInitializationDescriptor } from './entities/VCLInitializationDescriptor';\nimport type { VCLSubmissionResult } from './entities/VCLSubmissionResult';\nimport type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './entities/VCLDidJwk';\nimport type { VCLCredentialTypes } from './entities/VCLCredentialTypes';\n\nimport { NativeModules } from 'react-native';\nimport { VCLError } from './entities/VCLError';\nconst { VclReactNative } = NativeModules;\n\nexport const VclApi = {\n initialize: async (\n initializationDescriptor: VCLInitializationDescriptor\n ): Promise<void> => {\n try {\n return await VclReactNative.initialize(initializationDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCountries: async (): Promise<VCLCountries> => {\n try {\n return await VclReactNative.getCountries();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypes: async (): Promise<VCLCredentialTypes> => {\n try {\n return await VclReactNative.getCredentialTypes();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypeSchemas: async (): Promise<VCLCredentialTypeSchemas> => {\n try {\n return await VclReactNative.getCredentialTypeSchemas();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getPresentationRequest: async (\n presentationRequestDescriptor: VCLPresentationRequestDescriptor\n ): Promise<VCLPresentationRequest> => {\n try {\n return await VclReactNative.getPresentationRequest(\n presentationRequestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n submitPresentation: async (\n presentationSubmission: VCLPresentationSubmission,\n didJwk: VCLDidJwk\n ): Promise<VCLSubmissionResult> => {\n try {\n return await VclReactNative.submitPresentation(\n presentationSubmission,\n didJwk\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getExchangeProgress: async (\n exchangeDescriptor: VCLExchangeDescriptor\n ): Promise<VCLExchange> => {\n try {\n return await VclReactNative.getExchangeProgress(exchangeDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n searchForOrganizations: async (\n organizationsSearchDescriptor: VCLOrganizationsSearchDescriptor\n ): Promise<VCLOrganizations> => {\n try {\n return await VclReactNative.searchForOrganizations(\n organizationsSearchDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialManifest: async (\n credentialManifestDescriptor: VCLCredentialManifestDescriptor\n ): Promise<VCLCredentialManifest> => {\n try {\n return await VclReactNative.getCredentialManifest(\n credentialManifestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor,\n didJwk: VCLDidJwk\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.generateOffers(\n generateOffersDescriptor,\n didJwk\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n checkForOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor,\n token: VCLToken\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.checkForOffers(\n generateOffersDescriptor,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n finalizeOffers: async (\n finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,\n didJwk: VCLDidJwk,\n token: VCLToken\n ): Promise<VCLJwtVerifiableCredentials> => {\n try {\n return await VclReactNative.finalizeOffers(\n finalizeOffersDescriptor,\n didJwk,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypesUIFormSchema: async (\n credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor\n ): Promise<VCLCredentialTypesUIFormSchema> => {\n try {\n return await VclReactNative.getCredentialTypesUIFormSchema(\n credentialTypesUIFormSchemaDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getVerifiedProfile: async (\n verifiedProfileDescriptor: VCLVerifiedProfileDescriptor\n ): Promise<VCLVerifiedProfile> => {\n try {\n return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n verifyJwt: async (jwt: VCLJwt, jwkPublic: VCLJwkPublic): Promise<boolean> => {\n try {\n return await VclReactNative.verifyJwt(jwt, jwkPublic);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateSignedJwt: async (\n jwtDescriptor: VCLJwtDescriptor\n ): Promise<VCLJwt> => {\n try {\n return await VclReactNative.generateSignedJwt(jwtDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateDidJwk: async (): Promise<VCLDidJwk> => {\n try {\n return await VclReactNative.generateDidJwk();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n};\n"],"mappings":";;;;;;AAmCA;AACA;AApCA;AACA;AACA;AACA;AACA;AACA;;AAgCA,MAAM;EAAEA;AAAe,CAAC,GAAGC,0BAAa;AAEjC,MAAMC,MAAM,GAAG;EACpBC,UAAU,EAAE,MACVC,wBAAqD,IACnC;IAClB,IAAI;MACF,OAAO,MAAMJ,cAAc,CAACG,UAAU,CAACC,wBAAwB,CAAC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AACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDsB,8BAA8B,EAAE,MAC9BC,qCAA+E,IACnC;IAC5C,IAAI;MACF,OAAO,MAAM5B,cAAc,CAAC2B,8BAA8B,CACxDC,qCAAqC,CACtC;IACH,CAAC,CAAC,OAAOvB,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDwB,kBAAkB,EAAE,MAClBC,yBAAuD,IACvB;IAChC,IAAI;MACF,OAAO,MAAM9B,cAAc,CAAC6B,kBAAkB,CAACC,yBAAyB,CAAC;IAC3E,CAAC,CAAC,OAAOzB,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAED0B,SAAS,EAAE,OAAOC,GAAW,EAAEC,SAAuB,KAAuB;IAC3E,IAAI;MACF,OAAO,MAAMjC,cAAc,CAAC+B,SAAS,CAACC,GAAG,EAAEC,SAAS,CAAC;IACvD,CAAC,CAAC,OAAO5B,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAED6B,iBAAiB,EAAE,MACjBC,aAA+B,IACX;IACpB,IAAI;MACF,OAAO,MAAMnC,cAAc,CAACkC,iBAAiB,CAACC,aAAa,CAAC;IAC9D,CAAC,CAAC,OAAO9B,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAED+B,cAAc,EAAE,YAAgC;IAC9C,IAAI;MACF,OAAO,MAAMpC,cAAc,CAACoC,cAAc,EAAE;IAC9C,CAAC,CAAC,OAAO/B,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF;AACF,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["VCLDidJwk.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface VCLDidJwk {\n value: string;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["VCLDidJwk.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface VCLDidJwk {\n /**\n * The id of private key save in secure enclave\n */\n keyId: string;\n /**\n * The did:jwk\n */\n value: string;\n /**\n * kid of jwt - did:jwk suffixed with #0\n */\n kid: string;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["VCLFinalizeOffersDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './VCLCredentialManifest';\n\nexport interface VCLFinalizeOffersDescriptor {\n credentialManifest: VCLCredentialManifest;\n rejectedOfferIds: string[];\n approvedOfferIds: string[];\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["VCLFinalizeOffersDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './VCLCredentialManifest';\nimport type { VCLOffers } from './VCLOffers';\n\nexport interface VCLFinalizeOffersDescriptor {\n credentialManifest: VCLCredentialManifest;\n offers: VCLOffers;\n rejectedOfferIds: string[];\n approvedOfferIds: string[];\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["VCLJwtDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Dictionary } from '../Dictionary';\n\nexport interface VCLJwtDescriptor {\n payload: Dictionary<any>;\n iss: string;\n jti: string;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["VCLJwtDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Dictionary } from '../Dictionary';\n\nexport interface VCLJwtDescriptor {\n /**\n * The Id of the existing private key to sign with\n */\n keyId?: string;\n /**\n * Json formatted payload\n */\n payload: Dictionary<any>;\n /**\n * JWT ID\n */\n jti: string;\n /**\n * The did of the wallet owner\n */\n iss: string;\n /**\n * The issuer DID\n */\n aud?: String;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["VCLOffers.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Dictionary } from '../Dictionary';\nimport type { VCLToken } from './VCLToken';\n\nexport interface VCLOffers {\n all: Dictionary<any>[];\n responseCode: number;\n token: VCLToken;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["VCLOffers.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Dictionary } from '../Dictionary';\nimport type { VCLToken } from './VCLToken';\n\nexport interface VCLOffers {\n payload: Dictionary<any>;\n all: Dictionary<any>[];\n responseCode: number;\n token: VCLToken;\n challenge: string;\n}\n"],"mappings":""}
@@ -46,9 +46,9 @@ export const VclApi = {
46
46
  throw new VCLError(e);
47
47
  }
48
48
  },
49
- submitPresentation: async presentationSubmission => {
49
+ submitPresentation: async (presentationSubmission, didJwk) => {
50
50
  try {
51
- return await VclReactNative.submitPresentation(presentationSubmission);
51
+ return await VclReactNative.submitPresentation(presentationSubmission, didJwk);
52
52
  } catch (e) {
53
53
  throw new VCLError(e);
54
54
  }
@@ -74,9 +74,9 @@ export const VclApi = {
74
74
  throw new VCLError(e);
75
75
  }
76
76
  },
77
- generateOffers: async generateOffersDescriptor => {
77
+ generateOffers: async (generateOffersDescriptor, didJwk) => {
78
78
  try {
79
- return await VclReactNative.generateOffers(generateOffersDescriptor);
79
+ return await VclReactNative.generateOffers(generateOffersDescriptor, didJwk);
80
80
  } catch (e) {
81
81
  throw new VCLError(e);
82
82
  }
@@ -88,9 +88,9 @@ export const VclApi = {
88
88
  throw new VCLError(e);
89
89
  }
90
90
  },
91
- finalizeOffers: async (finalizeOffersDescriptor, token) => {
91
+ finalizeOffers: async (finalizeOffersDescriptor, didJwk, token) => {
92
92
  try {
93
- return await VclReactNative.finalizeOffers(finalizeOffersDescriptor, token);
93
+ return await VclReactNative.finalizeOffers(finalizeOffersDescriptor, didJwk, token);
94
94
  } catch (e) {
95
95
  throw new VCLError(e);
96
96
  }
@@ -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","token","finalizeOffers","finalizeOffersDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","generateSignedJwt","jwtDescriptor","generateDidJwk"],"sources":["VCLApi.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialTypeSchemas } from './entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchema } from './entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLExchange } from './entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './entities/VCLExchangeDescriptor';\nimport type { VCLFinalizeOffersDescriptor } from './entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './entities/VCLOffers';\nimport type { VCLOrganizations } from './entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPresentationRequest } from './entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './entities/VCLJwkPublic';\nimport type { VCLToken } from './entities/VCLToken';\nimport type { VCLVerifiedProfile } from './entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './entities/VCLVerifiedProfileDescriptor';\nimport type { VCLCountries } from './entities/VCLCountries';\nimport type { VCLInitializationDescriptor } from './entities/VCLInitializationDescriptor';\nimport type { VCLSubmissionResult } from './entities/VCLSubmissionResult';\nimport type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './entities/VCLDidJwk';\nimport type { VCLCredentialTypes } from './entities/VCLCredentialTypes';\n\nimport { NativeModules } from 'react-native';\nimport { VCLError } from './entities/VCLError';\nconst { VclReactNative } = NativeModules;\n\nexport const VclApi = {\n initialize: async (\n initializationDescriptor: VCLInitializationDescriptor\n ): Promise<void> => {\n try {\n return await VclReactNative.initialize(initializationDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCountries: async (): Promise<VCLCountries> => {\n try {\n return await VclReactNative.getCountries();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypes: async (): Promise<VCLCredentialTypes> => {\n try {\n return await VclReactNative.getCredentialTypes();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypeSchemas: async (): Promise<VCLCredentialTypeSchemas> => {\n try {\n return await VclReactNative.getCredentialTypeSchemas();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getPresentationRequest: async (\n presentationRequestDescriptor: VCLPresentationRequestDescriptor\n ): Promise<VCLPresentationRequest> => {\n try {\n return await VclReactNative.getPresentationRequest(\n presentationRequestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n submitPresentation: async (\n presentationSubmission: VCLPresentationSubmission\n ): Promise<VCLSubmissionResult> => {\n try {\n return await VclReactNative.submitPresentation(presentationSubmission);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getExchangeProgress: async (\n exchangeDescriptor: VCLExchangeDescriptor\n ): Promise<VCLExchange> => {\n try {\n return await VclReactNative.getExchangeProgress(exchangeDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n searchForOrganizations: async (\n organizationsSearchDescriptor: VCLOrganizationsSearchDescriptor\n ): Promise<VCLOrganizations> => {\n try {\n return await VclReactNative.searchForOrganizations(\n organizationsSearchDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialManifest: async (\n credentialManifestDescriptor: VCLCredentialManifestDescriptor\n ): Promise<VCLCredentialManifest> => {\n try {\n return await VclReactNative.getCredentialManifest(\n credentialManifestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.generateOffers(generateOffersDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n checkForOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor,\n token: VCLToken\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.checkForOffers(\n generateOffersDescriptor,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n finalizeOffers: async (\n finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,\n token: VCLToken\n ): Promise<VCLJwtVerifiableCredentials> => {\n try {\n return await VclReactNative.finalizeOffers(\n finalizeOffersDescriptor,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypesUIFormSchema: async (\n credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor\n ): Promise<VCLCredentialTypesUIFormSchema> => {\n try {\n return await VclReactNative.getCredentialTypesUIFormSchema(\n credentialTypesUIFormSchemaDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getVerifiedProfile: async (\n verifiedProfileDescriptor: VCLVerifiedProfileDescriptor\n ): Promise<VCLVerifiedProfile> => {\n try {\n return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n verifyJwt: async (jwt: VCLJwt, jwkPublic: VCLJwkPublic): Promise<boolean> => {\n try {\n return await VclReactNative.verifyJwt(jwt, jwkPublic);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateSignedJwt: async (\n jwtDescriptor: VCLJwtDescriptor\n ): Promise<VCLJwt> => {\n try {\n return await VclReactNative.generateSignedJwt(jwtDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateDidJwk: async (): Promise<VCLDidJwk> => {\n try {\n return await VclReactNative.generateDidJwk();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AA8BA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,MAAM;EAAEC;AAAe,CAAC,GAAGF,aAAa;AAExC,OAAO,MAAMG,MAAM,GAAG;EACpBC,UAAU,EAAE,MACVC,wBAAqD,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F,CAAC;EAEDoB,8BAA8B,EAAE,MAC9BC,qCAA+E,IACnC;IAC5C,IAAI;MACF,OAAO,MAAMzB,cAAc,CAACwB,8BAA8B,CACxDC,qCAAqC,CACtC;IACH,CAAC,CAAC,OAAOrB,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDsB,kBAAkB,EAAE,MAClBC,yBAAuD,IACvB;IAChC,IAAI;MACF,OAAO,MAAM3B,cAAc,CAAC0B,kBAAkB,CAACC,yBAAyB,CAAC;IAC3E,CAAC,CAAC,OAAOvB,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDwB,SAAS,EAAE,OAAOC,GAAW,EAAEC,SAAuB,KAAuB;IAC3E,IAAI;MACF,OAAO,MAAM9B,cAAc,CAAC4B,SAAS,CAACC,GAAG,EAAEC,SAAS,CAAC;IACvD,CAAC,CAAC,OAAO1B,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAED2B,iBAAiB,EAAE,MACjBC,aAA+B,IACX;IACpB,IAAI;MACF,OAAO,MAAMhC,cAAc,CAAC+B,iBAAiB,CAACC,aAAa,CAAC;IAC9D,CAAC,CAAC,OAAO5B,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAED6B,cAAc,EAAE,YAAgC;IAC9C,IAAI;MACF,OAAO,MAAMjC,cAAc,CAACiC,cAAc,EAAE;IAC9C,CAAC,CAAC,OAAO7B,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF;AACF,CAAC"}
1
+ {"version":3,"names":["NativeModules","VCLError","VclReactNative","VclApi","initialize","initializationDescriptor","e","getCountries","getCredentialTypes","getCredentialTypeSchemas","getPresentationRequest","presentationRequestDescriptor","submitPresentation","presentationSubmission","didJwk","getExchangeProgress","exchangeDescriptor","searchForOrganizations","organizationsSearchDescriptor","getCredentialManifest","credentialManifestDescriptor","generateOffers","generateOffersDescriptor","checkForOffers","token","finalizeOffers","finalizeOffersDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","generateSignedJwt","jwtDescriptor","generateDidJwk"],"sources":["VCLApi.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialTypeSchemas } from './entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchema } from './entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLExchange } from './entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './entities/VCLExchangeDescriptor';\nimport type { VCLFinalizeOffersDescriptor } from './entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './entities/VCLOffers';\nimport type { VCLOrganizations } from './entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPresentationRequest } from './entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './entities/VCLJwkPublic';\nimport type { VCLToken } from './entities/VCLToken';\nimport type { VCLVerifiedProfile } from './entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './entities/VCLVerifiedProfileDescriptor';\nimport type { VCLCountries } from './entities/VCLCountries';\nimport type { VCLInitializationDescriptor } from './entities/VCLInitializationDescriptor';\nimport type { VCLSubmissionResult } from './entities/VCLSubmissionResult';\nimport type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './entities/VCLDidJwk';\nimport type { VCLCredentialTypes } from './entities/VCLCredentialTypes';\n\nimport { NativeModules } from 'react-native';\nimport { VCLError } from './entities/VCLError';\nconst { VclReactNative } = NativeModules;\n\nexport const VclApi = {\n initialize: async (\n initializationDescriptor: VCLInitializationDescriptor\n ): Promise<void> => {\n try {\n return await VclReactNative.initialize(initializationDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCountries: async (): Promise<VCLCountries> => {\n try {\n return await VclReactNative.getCountries();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypes: async (): Promise<VCLCredentialTypes> => {\n try {\n return await VclReactNative.getCredentialTypes();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypeSchemas: async (): Promise<VCLCredentialTypeSchemas> => {\n try {\n return await VclReactNative.getCredentialTypeSchemas();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getPresentationRequest: async (\n presentationRequestDescriptor: VCLPresentationRequestDescriptor\n ): Promise<VCLPresentationRequest> => {\n try {\n return await VclReactNative.getPresentationRequest(\n presentationRequestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n submitPresentation: async (\n presentationSubmission: VCLPresentationSubmission,\n didJwk: VCLDidJwk\n ): Promise<VCLSubmissionResult> => {\n try {\n return await VclReactNative.submitPresentation(\n presentationSubmission,\n didJwk\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getExchangeProgress: async (\n exchangeDescriptor: VCLExchangeDescriptor\n ): Promise<VCLExchange> => {\n try {\n return await VclReactNative.getExchangeProgress(exchangeDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n searchForOrganizations: async (\n organizationsSearchDescriptor: VCLOrganizationsSearchDescriptor\n ): Promise<VCLOrganizations> => {\n try {\n return await VclReactNative.searchForOrganizations(\n organizationsSearchDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialManifest: async (\n credentialManifestDescriptor: VCLCredentialManifestDescriptor\n ): Promise<VCLCredentialManifest> => {\n try {\n return await VclReactNative.getCredentialManifest(\n credentialManifestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor,\n didJwk: VCLDidJwk\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.generateOffers(\n generateOffersDescriptor,\n didJwk\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n checkForOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor,\n token: VCLToken\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.checkForOffers(\n generateOffersDescriptor,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n finalizeOffers: async (\n finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,\n didJwk: VCLDidJwk,\n token: VCLToken\n ): Promise<VCLJwtVerifiableCredentials> => {\n try {\n return await VclReactNative.finalizeOffers(\n finalizeOffersDescriptor,\n didJwk,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypesUIFormSchema: async (\n credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor\n ): Promise<VCLCredentialTypesUIFormSchema> => {\n try {\n return await VclReactNative.getCredentialTypesUIFormSchema(\n credentialTypesUIFormSchemaDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getVerifiedProfile: async (\n verifiedProfileDescriptor: VCLVerifiedProfileDescriptor\n ): Promise<VCLVerifiedProfile> => {\n try {\n return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n verifyJwt: async (jwt: VCLJwt, jwkPublic: VCLJwkPublic): Promise<boolean> => {\n try {\n return await VclReactNative.verifyJwt(jwt, jwkPublic);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateSignedJwt: async (\n jwtDescriptor: VCLJwtDescriptor\n ): Promise<VCLJwt> => {\n try {\n return await VclReactNative.generateSignedJwt(jwtDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateDidJwk: async (): Promise<VCLDidJwk> => {\n try {\n return await VclReactNative.generateDidJwk();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AA8BA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,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,YAAmC;IAC/C,IAAI;MACF,OAAO,MAAML,cAAc,CAACK,YAAY,EAAE;IAC5C,CAAC,CAAC,OAAOD,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDE,kBAAkB,EAAE,YAAyC;IAC3D,IAAI;MACF,OAAO,MAAMN,cAAc,CAACM,kBAAkB,EAAE;IAClD,CAAC,CAAC,OAAOF,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAEDG,wBAAwB,EAAE,YAA+C;IACvE,I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AAuB,KAAuB;IAC3E,IAAI;MACF,OAAO,MAAM/B,cAAc,CAAC6B,SAAS,CAACC,GAAG,EAAEC,SAAS,CAAC;IACvD,CAAC,CAAC,OAAO3B,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAED4B,iBAAiB,EAAE,MACjBC,aAA+B,IACX;IACpB,IAAI;MACF,OAAO,MAAMjC,cAAc,CAACgC,iBAAiB,CAACC,aAAa,CAAC;IAC9D,CAAC,CAAC,OAAO7B,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF,CAAC;EAED8B,cAAc,EAAE,YAAgC;IAC9C,IAAI;MACF,OAAO,MAAMlC,cAAc,CAACkC,cAAc,EAAE;IAC9C,CAAC,CAAC,OAAO9B,CAAC,EAAE;MACV,MAAM,IAAIL,QAAQ,CAACK,CAAC,CAAC;IACvB;EACF;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["VCLDidJwk.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface VCLDidJwk {\n value: string;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["VCLDidJwk.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface VCLDidJwk {\n /**\n * The id of private key save in secure enclave\n */\n keyId: string;\n /**\n * The did:jwk\n */\n value: string;\n /**\n * kid of jwt - did:jwk suffixed with #0\n */\n kid: string;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["VCLFinalizeOffersDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './VCLCredentialManifest';\n\nexport interface VCLFinalizeOffersDescriptor {\n credentialManifest: VCLCredentialManifest;\n rejectedOfferIds: string[];\n approvedOfferIds: string[];\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["VCLFinalizeOffersDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './VCLCredentialManifest';\nimport type { VCLOffers } from './VCLOffers';\n\nexport interface VCLFinalizeOffersDescriptor {\n credentialManifest: VCLCredentialManifest;\n offers: VCLOffers;\n rejectedOfferIds: string[];\n approvedOfferIds: string[];\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["VCLJwtDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Dictionary } from '../Dictionary';\n\nexport interface VCLJwtDescriptor {\n payload: Dictionary<any>;\n iss: string;\n jti: string;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["VCLJwtDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Dictionary } from '../Dictionary';\n\nexport interface VCLJwtDescriptor {\n /**\n * The Id of the existing private key to sign with\n */\n keyId?: string;\n /**\n * Json formatted payload\n */\n payload: Dictionary<any>;\n /**\n * JWT ID\n */\n jti: string;\n /**\n * The did of the wallet owner\n */\n iss: string;\n /**\n * The issuer DID\n */\n aud?: String;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["VCLOffers.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Dictionary } from '../Dictionary';\nimport type { VCLToken } from './VCLToken';\n\nexport interface VCLOffers {\n all: Dictionary<any>[];\n responseCode: number;\n token: VCLToken;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["VCLOffers.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Dictionary } from '../Dictionary';\nimport type { VCLToken } from './VCLToken';\n\nexport interface VCLOffers {\n payload: Dictionary<any>;\n all: Dictionary<any>[];\n responseCode: number;\n token: VCLToken;\n challenge: string;\n}\n"],"mappings":""}
@@ -37,13 +37,13 @@ export declare const VclApi: {
37
37
  getCredentialTypes: () => Promise<VCLCredentialTypes>;
38
38
  getCredentialTypeSchemas: () => Promise<VCLCredentialTypeSchemas>;
39
39
  getPresentationRequest: (presentationRequestDescriptor: VCLPresentationRequestDescriptor) => Promise<VCLPresentationRequest>;
40
- submitPresentation: (presentationSubmission: VCLPresentationSubmission) => Promise<VCLSubmissionResult>;
40
+ submitPresentation: (presentationSubmission: VCLPresentationSubmission, didJwk: VCLDidJwk) => Promise<VCLSubmissionResult>;
41
41
  getExchangeProgress: (exchangeDescriptor: VCLExchangeDescriptor) => Promise<VCLExchange>;
42
42
  searchForOrganizations: (organizationsSearchDescriptor: VCLOrganizationsSearchDescriptor) => Promise<VCLOrganizations>;
43
43
  getCredentialManifest: (credentialManifestDescriptor: VCLCredentialManifestDescriptor) => Promise<VCLCredentialManifest>;
44
- generateOffers: (generateOffersDescriptor: VCLGenerateOffersDescriptor) => Promise<VCLOffers>;
44
+ generateOffers: (generateOffersDescriptor: VCLGenerateOffersDescriptor, didJwk: VCLDidJwk) => Promise<VCLOffers>;
45
45
  checkForOffers: (generateOffersDescriptor: VCLGenerateOffersDescriptor, token: VCLToken) => Promise<VCLOffers>;
46
- finalizeOffers: (finalizeOffersDescriptor: VCLFinalizeOffersDescriptor, token: VCLToken) => Promise<VCLJwtVerifiableCredentials>;
46
+ finalizeOffers: (finalizeOffersDescriptor: VCLFinalizeOffersDescriptor, didJwk: VCLDidJwk, token: VCLToken) => Promise<VCLJwtVerifiableCredentials>;
47
47
  getCredentialTypesUIFormSchema: (credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor) => Promise<VCLCredentialTypesUIFormSchema>;
48
48
  getVerifiedProfile: (verifiedProfileDescriptor: VCLVerifiedProfileDescriptor) => Promise<VCLVerifiedProfile>;
49
49
  verifyJwt: (jwt: VCLJwt, jwkPublic: VCLJwkPublic) => Promise<boolean>;
@@ -5,5 +5,16 @@
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
7
  export interface VCLDidJwk {
8
+ /**
9
+ * The id of private key save in secure enclave
10
+ */
11
+ keyId: string;
12
+ /**
13
+ * The did:jwk
14
+ */
8
15
  value: string;
16
+ /**
17
+ * kid of jwt - did:jwk suffixed with #0
18
+ */
19
+ kid: string;
9
20
  }
@@ -5,8 +5,10 @@
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
7
  import type { VCLCredentialManifest } from './VCLCredentialManifest';
8
+ import type { VCLOffers } from './VCLOffers';
8
9
  export interface VCLFinalizeOffersDescriptor {
9
10
  credentialManifest: VCLCredentialManifest;
11
+ offers: VCLOffers;
10
12
  rejectedOfferIds: string[];
11
13
  approvedOfferIds: string[];
12
14
  }
@@ -6,7 +6,24 @@
6
6
  */
7
7
  import type { Dictionary } from '../Dictionary';
8
8
  export interface VCLJwtDescriptor {
9
+ /**
10
+ * The Id of the existing private key to sign with
11
+ */
12
+ keyId?: string;
13
+ /**
14
+ * Json formatted payload
15
+ */
9
16
  payload: Dictionary<any>;
10
- iss: string;
17
+ /**
18
+ * JWT ID
19
+ */
11
20
  jti: string;
21
+ /**
22
+ * The did of the wallet owner
23
+ */
24
+ iss: string;
25
+ /**
26
+ * The issuer DID
27
+ */
28
+ aud?: String;
12
29
  }
@@ -7,7 +7,9 @@
7
7
  import type { Dictionary } from '../Dictionary';
8
8
  import type { VCLToken } from './VCLToken';
9
9
  export interface VCLOffers {
10
+ payload: Dictionary<any>;
10
11
  all: Dictionary<any>[];
11
12
  responseCode: number;
12
13
  token: VCLToken;
14
+ challenge: string;
13
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velocitycareerlabs/vcl-react-native",
3
- "version": "1.12.0",
3
+ "version": "1.13.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
@@ -85,10 +85,14 @@ export const VclApi = {
85
85
  },
86
86
 
87
87
  submitPresentation: async (
88
- presentationSubmission: VCLPresentationSubmission
88
+ presentationSubmission: VCLPresentationSubmission,
89
+ didJwk: VCLDidJwk
89
90
  ): Promise<VCLSubmissionResult> => {
90
91
  try {
91
- return await VclReactNative.submitPresentation(presentationSubmission);
92
+ return await VclReactNative.submitPresentation(
93
+ presentationSubmission,
94
+ didJwk
95
+ );
92
96
  } catch (e) {
93
97
  throw new VCLError(e);
94
98
  }
@@ -129,10 +133,14 @@ export const VclApi = {
129
133
  },
130
134
 
131
135
  generateOffers: async (
132
- generateOffersDescriptor: VCLGenerateOffersDescriptor
136
+ generateOffersDescriptor: VCLGenerateOffersDescriptor,
137
+ didJwk: VCLDidJwk
133
138
  ): Promise<VCLOffers> => {
134
139
  try {
135
- return await VclReactNative.generateOffers(generateOffersDescriptor);
140
+ return await VclReactNative.generateOffers(
141
+ generateOffersDescriptor,
142
+ didJwk
143
+ );
136
144
  } catch (e) {
137
145
  throw new VCLError(e);
138
146
  }
@@ -154,11 +162,13 @@ export const VclApi = {
154
162
 
155
163
  finalizeOffers: async (
156
164
  finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,
165
+ didJwk: VCLDidJwk,
157
166
  token: VCLToken
158
167
  ): Promise<VCLJwtVerifiableCredentials> => {
159
168
  try {
160
169
  return await VclReactNative.finalizeOffers(
161
170
  finalizeOffersDescriptor,
171
+ didJwk,
162
172
  token
163
173
  );
164
174
  } catch (e) {
@@ -6,5 +6,16 @@
6
6
  */
7
7
 
8
8
  export interface VCLDidJwk {
9
+ /**
10
+ * The id of private key save in secure enclave
11
+ */
12
+ keyId: string;
13
+ /**
14
+ * The did:jwk
15
+ */
9
16
  value: string;
17
+ /**
18
+ * kid of jwt - did:jwk suffixed with #0
19
+ */
20
+ kid: string;
10
21
  }
@@ -6,9 +6,11 @@
6
6
  */
7
7
 
8
8
  import type { VCLCredentialManifest } from './VCLCredentialManifest';
9
+ import type { VCLOffers } from './VCLOffers';
9
10
 
10
11
  export interface VCLFinalizeOffersDescriptor {
11
12
  credentialManifest: VCLCredentialManifest;
13
+ offers: VCLOffers;
12
14
  rejectedOfferIds: string[];
13
15
  approvedOfferIds: string[];
14
16
  }
@@ -8,7 +8,24 @@
8
8
  import type { Dictionary } from '../Dictionary';
9
9
 
10
10
  export interface VCLJwtDescriptor {
11
+ /**
12
+ * The Id of the existing private key to sign with
13
+ */
14
+ keyId?: string;
15
+ /**
16
+ * Json formatted payload
17
+ */
11
18
  payload: Dictionary<any>;
12
- iss: string;
19
+ /**
20
+ * JWT ID
21
+ */
13
22
  jti: string;
23
+ /**
24
+ * The did of the wallet owner
25
+ */
26
+ iss: string;
27
+ /**
28
+ * The issuer DID
29
+ */
30
+ aud?: String;
14
31
  }
@@ -9,7 +9,9 @@ import type { Dictionary } from '../Dictionary';
9
9
  import type { VCLToken } from './VCLToken';
10
10
 
11
11
  export interface VCLOffers {
12
+ payload: Dictionary<any>;
12
13
  all: Dictionary<any>[];
13
14
  responseCode: number;
14
15
  token: VCLToken;
16
+ challenge: string;
15
17
  }
@@ -10,13 +10,15 @@ Pod::Spec.new do |s|
10
10
  s.license = package["license"]
11
11
  s.authors = package["author"]
12
12
 
13
- s.platforms = { :ios => "11" }
13
+ s.platforms = { :ios => "13" }
14
14
  s.source = { :git => "https://github.com/velocitycareerlabs/vcl-react-native.git", :tag => "#{s.version}" }
15
15
 
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
 
18
18
  s.swift_version = "5.0"
19
19
 
20
+ s.static_framework = true
21
+
20
22
  s.dependency "React"
21
- s.dependency "VCL", "1.12.0"
23
+ s.dependency "VCL", "1.13.0"
22
24
  end