@velocitycareerlabs/vcl-react-native 2.4.4 → 2.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,11 +5,13 @@ Velocity Career Labs React Native SDK
5
5
 
6
6
  Android:
7
7
 
8
- kotlin version: 1.7.21
8
+ kotlin version: 1.8.0
9
9
 
10
- minSdkVersion 24
10
+ minSdkVersion: 24
11
11
 
12
- targetSdkVersion 33
12
+ compileSdkVersion: 34
13
+
14
+ targetSdkVersion: 34
13
15
 
14
16
 
15
17
  iOS:
@@ -23,13 +25,13 @@ React Native:
23
25
 
24
26
  react version 18.2.0
25
27
 
26
- react native version 0.72.4
28
+ react native version 0.73.6
27
29
 
28
30
  # React Native SDK
29
31
 
30
32
  The React Native SDK is a wrapper of iOS and Android SDKs.
31
- The minimum supported Android API is 21.
32
- The iOS target deployment API is 12.0.
33
+ The minimum supported Android API is 24.
34
+ The iOS target deployment API is 13.0.
33
35
 
34
36
  ## Installation
35
37
  - Add the path to the Velocity specs to the head of the Pod file in the iOS folder
@@ -61,3 +63,5 @@ vcl.initialize(initializationDescriptor).then(
61
63
  }
62
64
  );
63
65
  ```
66
+
67
+ More details can be found [HERE](https://www.velocitynetwork.foundation/main/career-wallets-velocity-sdks#react-native)
@@ -93,6 +93,6 @@ dependencies {
93
93
 
94
94
  // VCL:
95
95
  implementation "com.nimbusds:nimbus-jose-jwt:9.37.3"
96
- implementation "io.velocitycareerlabs:vcl:2.4.4"
96
+ implementation "io.velocitycareerlabs:vcl:2.4.5"
97
97
  }
98
98
 
@@ -186,7 +186,7 @@ object Converter {
186
186
  fun deepLinkToMap(deepLink: VCLDeepLink?): ReadableMap? {
187
187
  deepLink?.value?.let {
188
188
  val retVal = Arguments.createMap()
189
- retVal.putString("value", deepLink?.value)
189
+ retVal.putString("value", deepLink.value)
190
190
  return retVal
191
191
  }
192
192
  return null
@@ -216,7 +216,7 @@ object Converter {
216
216
  presentationRequestMap: ReadableMap?
217
217
  ) = VCLPresentationRequest(
218
218
  jwt = mapToJwt(presentationRequestMap?.getMapOpt("jwt")),
219
- publicJwk = mapToPublicJwk(presentationRequestMap?.getMapOpt("publicJwk")),
219
+ verifiedProfile = mapToVerifiedProfile(presentationRequestMap?.getMapOpt("verifiedProfile")),
220
220
  deepLink = mapToDeepLink(presentationRequestMap?.getMapOpt("deepLink")) ?: VCLDeepLink(""),
221
221
  pushDelegate = mapToPushDelegate(presentationRequestMap?.getMapOpt("pushDelegate")),
222
222
  didJwk = mapToDidJwk(presentationRequestMap?.getMapOpt("didJwk")),
@@ -230,9 +230,7 @@ object Converter {
230
230
  val jwtMap = Arguments.createMap()
231
231
  jwtMap.putString("encodedJwt", presentationRequest.jwt.encodedJwt)
232
232
  presentationRequestMap.putMap("jwt", jwtMap)
233
- val jwkMap = Arguments.createMap()
234
- jwkMap.putString("valueStr", presentationRequest.publicJwk.valueStr)
235
- presentationRequestMap.putMap("publicJwk", jwkMap)
233
+ presentationRequestMap.putMap("verifiedProfile", verifiedProfileToMap(presentationRequest.verifiedProfile))
236
234
  presentationRequestMap.putString("iss", presentationRequest.iss)
237
235
  presentationRequestMap.putString("exchangeId", presentationRequest.exchangeId)
238
236
  presentationRequestMap.putString(
@@ -702,6 +700,12 @@ object Converter {
702
700
  return verifiedProfileMap
703
701
  }
704
702
 
703
+ fun mapToVerifiedProfile(
704
+ verifiedProfileMap: ReadableMap?
705
+ ): VCLVerifiedProfile {
706
+ return VCLVerifiedProfile(payload = verifiedProfileMap?.getMapOpt("payload")?.toJsonObject() ?: JSONObject("{}"))
707
+ }
708
+
705
709
  fun mapToJwtDescriptor(
706
710
  jwtDescriptorDictionary: ReadableMap
707
711
  ) = VCLJwtDescriptor(
@@ -215,7 +215,7 @@ func dictionaryToPresentationRequest(
215
215
  ) -> VCLPresentationRequest {
216
216
  return VCLPresentationRequest(
217
217
  jwt: dictionaryToJwt(presentationRequestDictionary?["jwt"] as? [String : Any]),
218
- publicJwk: dictionaryToPublicJwk(presentationRequestDictionary?["publicJwk"] as? [String: Any]),
218
+ verifiedProfile: dictionaryToVerifiedProfile(presentationRequestDictionary?["verifiedProfile"] as? [String: Any]),
219
219
  deepLink: dictionaryToDeepLink(presentationRequestDictionary?["deepLink"] as? [String : Any]) ?? VCLDeepLink(value: ""),
220
220
  pushDelegate: dictionaryToPushDelegate(presentationRequestDictionary?["pushDelegate"] as? [String : Any]),
221
221
  didJwk: dictionaryToDidJwk(presentationRequestDictionary?["didJwk"] as? [String : Any]),
@@ -228,9 +228,7 @@ func presentationRequestToDictionary(
228
228
  ) -> [String: Any] {
229
229
  var presentationRequestDictionary = [String: Any]()
230
230
  presentationRequestDictionary["jwt"] = ["encodedJwt": presentationRequest.jwt.encodedJwt]
231
- var publicJwkDictionary = [String: Any]()
232
- publicJwkDictionary["valueStr"] = presentationRequest.publicJwk.valueStr
233
- presentationRequestDictionary["publicJwk"] = publicJwkDictionary
231
+ presentationRequestDictionary["verifiedProfile"] = verifiedProfileToDictionary(presentationRequest.verifiedProfile)
234
232
  presentationRequestDictionary["iss"] = presentationRequest.iss
235
233
  presentationRequestDictionary["exchangeId"] = presentationRequest.exchangeId
236
234
  presentationRequestDictionary["presentationDefinitionId"] = presentationRequest.presentationDefinitionId
@@ -645,6 +643,12 @@ func verifiedProfileToDictionary(
645
643
  return verifiedProfileDictionary
646
644
  }
647
645
 
646
+ func dictionaryToVerifiedProfile(
647
+ _ verifiedProfileDictionary: [String: Any]?
648
+ ) -> VCLVerifiedProfile {
649
+ return VCLVerifiedProfile(payload: verifiedProfileDictionary?["payload"] as? [String : Any] ?? [String : Any]())
650
+ }
651
+
648
652
  func dictionaryToJwtDescriptor(
649
653
  _ jwtDescriptorDictionary: [String: Any]
650
654
  ) -> VCLJwtDescriptor {
@@ -4,7 +4,5 @@
4
4
  * Copyright 2022 Velocity Career Labs inc.
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
- export type Dictionary<T> = {
8
- [key: string]: T;
9
- };
7
+ export type Dictionary<T> = Record<string, T>;
10
8
  //# sourceMappingURL=Dictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dictionary.d.ts","sourceRoot":"","sources":["../../../../src/api/Dictionary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;CAClB,CAAC"}
1
+ {"version":3,"file":"Dictionary.d.ts","sourceRoot":"","sources":["../../../../src/api/Dictionary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC"}
@@ -11,7 +11,7 @@ import type { VCLToken } from './VCLToken';
11
11
  import type { VCLVerifiedProfile } from './VCLVerifiedProfile';
12
12
  export interface VCLCredentialManifest {
13
13
  jwt: VCLJwt;
14
- vendorOriginContext?: String;
14
+ vendorOriginContext?: string;
15
15
  verifiedProfile: VCLVerifiedProfile;
16
16
  deepLink?: VCLDeepLink;
17
17
  iss: string;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { Dictionary } from '../Dictionary';
8
8
  export interface VCLCredentialTypes {
9
- all: Dictionary<string>[];
10
- recommendedTypes: Dictionary<string>[];
9
+ all: Array<Dictionary<string>>;
10
+ recommendedTypes: Array<Dictionary<string>>;
11
11
  }
12
12
  //# sourceMappingURL=VCLCredentialTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VCLCredentialTypes.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/VCLCredentialTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;IAC1B,gBAAgB,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;CACxC"}
1
+ {"version":3,"file":"VCLCredentialTypes.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/VCLCredentialTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/B,gBAAgB,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;CAC7C"}
@@ -25,6 +25,6 @@ export interface VCLJwtDescriptor {
25
25
  /**
26
26
  * The issuer DID
27
27
  */
28
- aud?: String;
28
+ aud?: string;
29
29
  }
30
30
  //# sourceMappingURL=VCLJwtDescriptor.d.ts.map
@@ -6,12 +6,12 @@
6
6
  */
7
7
  import type { VCLDidJwk } from './VCLDidJwk';
8
8
  import type { VCLJwt } from './VCLJwt';
9
- import type { VCLPublicJwk } from './VCLPublicJwk';
10
9
  import type { VCLToken } from './VCLToken';
10
+ import type { VCLVerifiedProfile } from './VCLVerifiedProfile';
11
11
  export interface VCLPresentationRequest {
12
12
  exchangeId: string;
13
13
  jwt: VCLJwt;
14
- publicJwk: VCLPublicJwk;
14
+ verifiedProfile: VCLVerifiedProfile;
15
15
  keyID: string;
16
16
  presentationDefinitionId: string;
17
17
  iss: string;
@@ -1 +1 @@
1
- {"version":3,"file":"VCLPresentationRequest.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/VCLPresentationRequest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB,EAAE,MAAM,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,CAAC;IAClB,yBAAyB,CAAC,EAAE,QAAQ,CAAC;CACtC"}
1
+ {"version":3,"file":"VCLPresentationRequest.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/VCLPresentationRequest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,kBAAkB,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB,EAAE,MAAM,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,CAAC;IAClB,yBAAyB,CAAC,EAAE,QAAQ,CAAC;CACtC"}
@@ -6,6 +6,6 @@
6
6
  */
7
7
  export interface VCLToken {
8
8
  value: string;
9
- expiresIn?: BigInt;
9
+ expiresIn?: bigint;
10
10
  }
11
11
  //# sourceMappingURL=VCLToken.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velocitycareerlabs/vcl-react-native",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "description": "Velocity Career Labs React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -59,11 +59,16 @@
59
59
  "@release-it/conventional-changelog": "^8.0.1",
60
60
  "@types/jest": "^29.5.5",
61
61
  "@types/react": "^18.2.44",
62
+ "@typescript-eslint/eslint-plugin": "^6.4.0",
62
63
  "commitlint": "^19.1.0",
63
64
  "del-cli": "^5.1.0",
64
- "eslint": "^8.51.0",
65
+ "eslint": "^8.0.1",
65
66
  "eslint-config-prettier": "^9.0.0",
67
+ "eslint-plugin-import": "^2.25.2",
68
+ "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
66
69
  "eslint-plugin-prettier": "^5.0.1",
70
+ "eslint-plugin-react": "^7.34.1",
71
+ "eslint-plugin-react-native": "^4.1.0",
67
72
  "jest": "^29.7.0",
68
73
  "prettier": "^3.0.3",
69
74
  "react": "18.2.0",
@@ -5,6 +5,4 @@
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
7
 
8
- export type Dictionary<T> = {
9
- [key: string]: T;
10
- };
8
+ export type Dictionary<T> = Record<string, T>;
@@ -13,7 +13,7 @@ import type { VCLVerifiedProfile } from './VCLVerifiedProfile';
13
13
 
14
14
  export interface VCLCredentialManifest {
15
15
  jwt: VCLJwt;
16
- vendorOriginContext?: String;
16
+ vendorOriginContext?: string;
17
17
  verifiedProfile: VCLVerifiedProfile;
18
18
  deepLink?: VCLDeepLink;
19
19
  iss: string;
@@ -8,6 +8,6 @@
8
8
  import type { Dictionary } from '../Dictionary';
9
9
 
10
10
  export interface VCLCredentialTypes {
11
- all: Dictionary<string>[];
12
- recommendedTypes: Dictionary<string>[];
11
+ all: Array<Dictionary<string>>;
12
+ recommendedTypes: Array<Dictionary<string>>;
13
13
  }
@@ -27,5 +27,5 @@ export interface VCLJwtDescriptor {
27
27
  /**
28
28
  * The issuer DID
29
29
  */
30
- aud?: String;
30
+ aud?: string;
31
31
  }
@@ -7,13 +7,13 @@
7
7
 
8
8
  import type { VCLDidJwk } from './VCLDidJwk';
9
9
  import type { VCLJwt } from './VCLJwt';
10
- import type { VCLPublicJwk } from './VCLPublicJwk';
11
10
  import type { VCLToken } from './VCLToken';
11
+ import type { VCLVerifiedProfile } from './VCLVerifiedProfile';
12
12
 
13
13
  export interface VCLPresentationRequest {
14
14
  exchangeId: string;
15
15
  jwt: VCLJwt;
16
- publicJwk: VCLPublicJwk;
16
+ verifiedProfile: VCLVerifiedProfile;
17
17
  keyID: string;
18
18
  presentationDefinitionId: string;
19
19
  iss: string;
@@ -7,5 +7,5 @@
7
7
 
8
8
  export interface VCLToken {
9
9
  value: string;
10
- expiresIn?: BigInt;
10
+ expiresIn?: bigint;
11
11
  }
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
19
19
  # https://github.com/CocoaPods/CocoaPods/issues/7234#issuecomment-346136322
20
20
  # s.static_framework = true
21
21
 
22
- s.dependency "VCL", "2.4.4"
22
+ s.dependency "VCL", "2.4.5"
23
23
 
24
24
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
25
25
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.