@velocitycareerlabs/vcl-react-native 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,6 +130,6 @@ dependencies {
130
130
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
131
131
 
132
132
  // VCL:
133
- implementation "com.nimbusds:nimbus-jose-jwt:9.25.6"
134
- implementation "io.velocitycareerlabs:vcl:1.5.0"
133
+ implementation "com.nimbusds:nimbus-jose-jwt:9.29"
134
+ implementation "io.velocitycareerlabs:vcl:1.5.1"
135
135
  }
@@ -135,6 +135,7 @@ object Converter {
135
135
  fun mapTopPresentationRequestDescriptor(presentationRequestDescriptorLinkMap: ReadableMap) =
136
136
  VCLPresentationRequestDescriptor(
137
137
  deepLink = mapToDeepLink(presentationRequestDescriptorLinkMap.getMapOpt("deepLink")),
138
+ serviceType = mapToServiceType(presentationRequestDescriptorLinkMap),
138
139
  pushDelegate = mapToPushDelegate(presentationRequestDescriptorLinkMap.getMapOpt("pushDelegate"))
139
140
  )
140
141
 
@@ -147,6 +148,9 @@ object Converter {
147
148
  return retVal
148
149
  }
149
150
 
151
+ fun mapToServiceType(serviceTypeMap: ReadableMap) =
152
+ VCLServiceType.fromString(serviceTypeMap.getStringOpt("serviceType") ?: "")
153
+
150
154
  fun mapToToken(tokenMap: ReadableMap?) =
151
155
  VCLToken(tokenMap?.getStringOpt("value") ?: "")
152
156
 
@@ -377,7 +381,8 @@ object Converter {
377
381
  credentialManifestDescriptorByDeepLinkMap: ReadableMap
378
382
  ): VCLCredentialManifestDescriptorByDeepLink {
379
383
  return VCLCredentialManifestDescriptorByDeepLink(
380
- mapToDeepLink(credentialManifestDescriptorByDeepLinkMap.getMapOpt("deepLink"))
384
+ mapToDeepLink(credentialManifestDescriptorByDeepLinkMap.getMapOpt("deepLink")),
385
+ mapToServiceType(credentialManifestDescriptorByDeepLinkMap)
381
386
  )
382
387
  }
383
388
 
@@ -390,6 +395,7 @@ object Converter {
390
395
  service = mapToServiceCredentialAgentIssuer(
391
396
  credentialManifestDescriptorByServiceMap.getMapOpt("service")
392
397
  ),
398
+ serviceType = mapToServiceType(credentialManifestDescriptorByServiceMap),
393
399
  credentialTypes =
394
400
  (credentialManifestDescriptorByServiceMap.getArrayOpt("credentialTypes")?.toArrayList()
395
401
  ?.toList() as? List<String>),
@@ -404,6 +410,7 @@ object Converter {
404
410
  service = mapToServiceCredentialAgentIssuer(
405
411
  credentialManifestDescriptorRefreshMap.getMapOpt("service")
406
412
  ),
413
+ serviceType = mapToServiceType(credentialManifestDescriptorRefreshMap),
407
414
  credentialIds = credentialManifestDescriptorRefreshMap.getArrayOpt("credentialIds")
408
415
  ?.toArrayList()?.toList() as? List<String> ?: listOf()
409
416
  )
@@ -133,6 +133,7 @@ func dictionaryTopPresentationRequestDescriptor(
133
133
  ) -> VCLPresentationRequestDescriptor {
134
134
  return VCLPresentationRequestDescriptor(
135
135
  deepLink: dictionaryToDeepLink(presentationRequestDescriptorLinkDictionary["deepLink"] as? [String: Any]),
136
+ serviceType: dictionaryToServiceType(serviceTypeDictionary: presentationRequestDescriptorLinkDictionary),
136
137
  pushDelegate: dictionaryToPushDelegate(presentationRequestDescriptorLinkDictionary["pushDelegate"] as? [String: Any])
137
138
  )
138
139
  }
@@ -153,6 +154,10 @@ func tokenToDictionary(_ token: VCLToken) -> [String: Any] {
153
154
  return ["value": token.value]
154
155
  }
155
156
 
157
+ func dictionaryToServiceType(serviceTypeDictionary: [String: Any]) -> VCLServiceType {
158
+ return VCLServiceType.fromString(value: serviceTypeDictionary["serviceType"] as? String ?? "")
159
+ }
160
+
156
161
  func dictionaryToPresentationRequest(
157
162
  _ presentationRequestDictionary: [String: Any]?
158
163
  ) -> VCLPresentationRequest {
@@ -349,7 +354,8 @@ func dictionaryToCredentialManifestDescriptorByDeepLink(
349
354
  return VCLCredentialManifestDescriptorByDeepLink(
350
355
  deepLink: dictionaryToDeepLink(
351
356
  credentialManifestDescriptorByDeepLinkDictionary["deepLink"] as? [String : Any]
352
- )
357
+ ),
358
+ serviceType: dictionaryToServiceType(serviceTypeDictionary: credentialManifestDescriptorByDeepLinkDictionary)
353
359
  )
354
360
  }
355
361
 
@@ -362,6 +368,7 @@ func dictionaryToCredentialManifestDescriptorByService(
362
368
  service: dictionaryToServiceCredentialAgentIssuer(
363
369
  credentialManifestDescriptorByServiceDictionary["service"] as? [String : Any]
364
370
  ),
371
+ serviceType: dictionaryToServiceType(serviceTypeDictionary: credentialManifestDescriptorByServiceDictionary),
365
372
  credentialTypes: credentialManifestDescriptorByServiceDictionary["credentialTypes"] as? [String],
366
373
  pushDelegate: pushDelegate
367
374
  )
@@ -374,6 +381,7 @@ func dictionaryToCredentialManifestDescriptorRefresh(
374
381
  service: dictionaryToServiceCredentialAgentIssuer(
375
382
  credentialManifestDescriptorRefreshDictionary["service"] as? [String : Any]
376
383
  ),
384
+ serviceType: dictionaryToServiceType(serviceTypeDictionary: credentialManifestDescriptorRefreshDictionary),
377
385
  credentialIds: credentialManifestDescriptorRefreshDictionary["credentialIds"] as? [String] ?? [String]()
378
386
  )
379
387
  }
@@ -25,7 +25,9 @@ class VCLError extends Error {
25
25
  const errorJson = JSON.parse(error.message);
26
26
  this.description = errorJson.description;
27
27
  this.code = parseInt(errorJson.code, 10);
28
- } catch (e) {}
28
+ } catch (e) {
29
+ this.description = JSON.stringify(error);
30
+ }
29
31
  }
30
32
 
31
33
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["VCLError.ts"],"names":["VCLError","Error","constructor","error","errorJson","JSON","parse","message","description","code","parseInt","e","toVclError"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAMA,QAAN,SAAuBC,KAAvB,CAA6B;AAIlCC,EAAAA,WAAW,CAACC,KAAD,EAAa;AACtB,UAAMA,KAAN;;AADsB;;AAAA;;AAEtB,QAAI;AACF,YAAMC,SAAS,GAAGC,IAAI,CAACC,KAAL,CAAWH,KAAK,CAACI,OAAjB,CAAlB;AACA,WAAKC,WAAL,GAAmBJ,SAAS,CAACI,WAA7B;AACA,WAAKC,IAAL,GAAYC,QAAQ,CAACN,SAAS,CAACK,IAAX,EAAiB,EAAjB,CAApB;AACD,KAJD,CAIE,OAAOE,CAAP,EAAU,CAAE;AACf;;AAXiC;;;;AAc7B,MAAMC,UAAU,GAAIT,KAAD,IAAgB;AACxC,SAAO,IAAIH,QAAJ,CAAaG,KAAb,CAAP;AACD,CAFM","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class VCLError extends Error {\n description?: string;\n code?: number;\n\n constructor(error: any) {\n super(error);\n try {\n const errorJson = JSON.parse(error.message);\n this.description = errorJson.description;\n this.code = parseInt(errorJson.code, 10);\n } catch (e) {}\n }\n}\n\nexport const toVclError = (error: any) => {\n return new VCLError(error);\n};\n"]}
1
+ {"version":3,"sources":["VCLError.ts"],"names":["VCLError","Error","constructor","error","errorJson","JSON","parse","message","description","code","parseInt","e","stringify","toVclError"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAMA,QAAN,SAAuBC,KAAvB,CAA6B;AAIlCC,EAAAA,WAAW,CAACC,KAAD,EAAa;AACtB,UAAMA,KAAN;;AADsB;;AAAA;;AAEtB,QAAI;AACF,YAAMC,SAAS,GAAGC,IAAI,CAACC,KAAL,CAAWH,KAAK,CAACI,OAAjB,CAAlB;AACA,WAAKC,WAAL,GAAmBJ,SAAS,CAACI,WAA7B;AACA,WAAKC,IAAL,GAAYC,QAAQ,CAACN,SAAS,CAACK,IAAX,EAAiB,EAAjB,CAApB;AACD,KAJD,CAIE,OAAOE,CAAP,EAAU;AACV,WAAKH,WAAL,GAAmBH,IAAI,CAACO,SAAL,CAAeT,KAAf,CAAnB;AACD;AACF;;AAbiC;;;;AAgB7B,MAAMU,UAAU,GAAIV,KAAD,IAAgB;AACxC,SAAO,IAAIH,QAAJ,CAAaG,KAAb,CAAP;AACD,CAFM","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class VCLError extends Error {\n description?: string;\n code?: number;\n\n constructor(error: any) {\n super(error);\n try {\n const errorJson = JSON.parse(error.message);\n this.description = errorJson.description;\n this.code = parseInt(errorJson.code, 10);\n } catch (e) {\n this.description = JSON.stringify(error);\n }\n }\n}\n\nexport const toVclError = (error: any) => {\n return new VCLError(error);\n};\n"]}
@@ -18,7 +18,9 @@ export class VCLError extends Error {
18
18
  const errorJson = JSON.parse(error.message);
19
19
  this.description = errorJson.description;
20
20
  this.code = parseInt(errorJson.code, 10);
21
- } catch (e) {}
21
+ } catch (e) {
22
+ this.description = JSON.stringify(error);
23
+ }
22
24
  }
23
25
 
24
26
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["VCLError.ts"],"names":["VCLError","Error","constructor","error","errorJson","JSON","parse","message","description","code","parseInt","e","toVclError"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,MAAMA,QAAN,SAAuBC,KAAvB,CAA6B;AAIlCC,EAAAA,WAAW,CAACC,KAAD,EAAa;AACtB,UAAMA,KAAN;;AADsB;;AAAA;;AAEtB,QAAI;AACF,YAAMC,SAAS,GAAGC,IAAI,CAACC,KAAL,CAAWH,KAAK,CAACI,OAAjB,CAAlB;AACA,WAAKC,WAAL,GAAmBJ,SAAS,CAACI,WAA7B;AACA,WAAKC,IAAL,GAAYC,QAAQ,CAACN,SAAS,CAACK,IAAX,EAAiB,EAAjB,CAApB;AACD,KAJD,CAIE,OAAOE,CAAP,EAAU,CAAE;AACf;;AAXiC;AAcpC,OAAO,MAAMC,UAAU,GAAIT,KAAD,IAAgB;AACxC,SAAO,IAAIH,QAAJ,CAAaG,KAAb,CAAP;AACD,CAFM","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class VCLError extends Error {\n description?: string;\n code?: number;\n\n constructor(error: any) {\n super(error);\n try {\n const errorJson = JSON.parse(error.message);\n this.description = errorJson.description;\n this.code = parseInt(errorJson.code, 10);\n } catch (e) {}\n }\n}\n\nexport const toVclError = (error: any) => {\n return new VCLError(error);\n};\n"]}
1
+ {"version":3,"sources":["VCLError.ts"],"names":["VCLError","Error","constructor","error","errorJson","JSON","parse","message","description","code","parseInt","e","stringify","toVclError"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,MAAMA,QAAN,SAAuBC,KAAvB,CAA6B;AAIlCC,EAAAA,WAAW,CAACC,KAAD,EAAa;AACtB,UAAMA,KAAN;;AADsB;;AAAA;;AAEtB,QAAI;AACF,YAAMC,SAAS,GAAGC,IAAI,CAACC,KAAL,CAAWH,KAAK,CAACI,OAAjB,CAAlB;AACA,WAAKC,WAAL,GAAmBJ,SAAS,CAACI,WAA7B;AACA,WAAKC,IAAL,GAAYC,QAAQ,CAACN,SAAS,CAACK,IAAX,EAAiB,EAAjB,CAApB;AACD,KAJD,CAIE,OAAOE,CAAP,EAAU;AACV,WAAKH,WAAL,GAAmBH,IAAI,CAACO,SAAL,CAAeT,KAAf,CAAnB;AACD;AACF;;AAbiC;AAgBpC,OAAO,MAAMU,UAAU,GAAIV,KAAD,IAAgB;AACxC,SAAO,IAAIH,QAAJ,CAAaG,KAAb,CAAP;AACD,CAFM","sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class VCLError extends Error {\n description?: string;\n code?: number;\n\n constructor(error: any) {\n super(error);\n try {\n const errorJson = JSON.parse(error.message);\n this.description = errorJson.description;\n this.code = parseInt(errorJson.code, 10);\n } catch (e) {\n this.description = JSON.stringify(error);\n }\n }\n}\n\nexport const toVclError = (error: any) => {\n return new VCLError(error);\n};\n"]}
@@ -5,7 +5,9 @@
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
7
  import type { VCLPushDelegate } from './VCLPushDelegate';
8
+ import type { VCLServiceType } from './VCLServiceType';
8
9
  export interface VCLCredentialManifestDescriptor {
10
+ serviceType: VCLServiceType;
9
11
  credentialTypes?: string[];
10
12
  pushDelegate?: VCLPushDelegate;
11
13
  }
@@ -6,7 +6,9 @@
6
6
  */
7
7
  import type { VCLDeepLink } from './VCLDeepLink';
8
8
  import type { VCLPushDelegate } from './VCLPushDelegate';
9
+ import type { VCLServiceType } from './VCLServiceType';
9
10
  export interface VCLPresentationRequestDescriptor {
10
11
  deepLink: VCLDeepLink;
12
+ serviceType: VCLServiceType;
11
13
  pushDelegate?: VCLPushDelegate;
12
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velocitycareerlabs/vcl-react-native",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Velocity Career Labs React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -6,8 +6,10 @@
6
6
  */
7
7
 
8
8
  import type { VCLPushDelegate } from './VCLPushDelegate';
9
+ import type { VCLServiceType } from './VCLServiceType';
9
10
 
10
11
  export interface VCLCredentialManifestDescriptor {
12
+ serviceType: VCLServiceType;
11
13
  credentialTypes?: string[];
12
14
  pushDelegate?: VCLPushDelegate;
13
15
  }
@@ -15,7 +15,9 @@ export class VCLError extends Error {
15
15
  const errorJson = JSON.parse(error.message);
16
16
  this.description = errorJson.description;
17
17
  this.code = parseInt(errorJson.code, 10);
18
- } catch (e) {}
18
+ } catch (e) {
19
+ this.description = JSON.stringify(error);
20
+ }
19
21
  }
20
22
  }
21
23
 
@@ -7,8 +7,10 @@
7
7
 
8
8
  import type { VCLDeepLink } from './VCLDeepLink';
9
9
  import type { VCLPushDelegate } from './VCLPushDelegate';
10
+ import type { VCLServiceType } from './VCLServiceType';
10
11
 
11
12
  export interface VCLPresentationRequestDescriptor {
12
13
  deepLink: VCLDeepLink;
14
+ serviceType: VCLServiceType;
13
15
  pushDelegate?: VCLPushDelegate;
14
16
  }
@@ -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.5.0"
21
+ s.dependency "VCL", "1.5.1"
22
22
  end