@velocitycareerlabs/vcl-react-native 2.7.7 → 2.8.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.
Files changed (158) hide show
  1. package/{velocitycareerlabs-vcl-react-native.podspec → VclReactNative.podspec} +6 -9
  2. package/android/build.gradle +23 -42
  3. package/android/gradle.properties +3 -3
  4. package/android/src/main/AndroidManifest.xml +1 -2
  5. package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativeModule.kt +32 -55
  6. package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativePackage.kt +24 -8
  7. package/ios/VclReactNative.h +13 -0
  8. package/ios/VclReactNative.mm +78 -68
  9. package/ios/{VclReactNative.swift → VclReactNativeImpl.swift} +46 -38
  10. package/lib/module/NativeVclReactNative.js +5 -0
  11. package/lib/module/NativeVclReactNative.js.map +1 -0
  12. package/lib/module/api/VCLApi.js.map +1 -1
  13. package/lib/module/index.js +11 -11
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/module/package.json +1 -0
  16. package/lib/typescript/package.json +1 -0
  17. package/lib/typescript/src/NativeVclReactNative.d.ts +24 -0
  18. package/lib/typescript/src/NativeVclReactNative.d.ts.map +1 -0
  19. package/lib/typescript/src/api/VCLApi.d.ts.map +1 -1
  20. package/lib/typescript/src/api/entities/VCLAuthToken.d.ts.map +1 -1
  21. package/lib/typescript/src/api/entities/VCLAuthTokenDescriptor.d.ts.map +1 -1
  22. package/lib/typescript/src/api/entities/VCLJwt.d.ts.map +1 -1
  23. package/package.json +62 -60
  24. package/src/NativeVclReactNative.ts +66 -0
  25. package/src/api/VCLApi.ts +5 -2
  26. package/src/api/entities/VCLAuthToken.ts +11 -8
  27. package/src/api/entities/VCLAuthTokenDescriptor.ts +10 -7
  28. package/src/api/entities/VCLJwt.ts +3 -3
  29. package/android/LICENSE +0 -177
  30. package/android/src/main/AndroidManifestNew.xml +0 -2
  31. package/ios/LICENSE +0 -177
  32. package/lib/commonjs/api/Dictionary.js +0 -2
  33. package/lib/commonjs/api/Dictionary.js.map +0 -1
  34. package/lib/commonjs/api/VCLApi.js +0 -147
  35. package/lib/commonjs/api/VCLApi.js.map +0 -1
  36. package/lib/commonjs/api/VCLCryptoServiceType.js +0 -18
  37. package/lib/commonjs/api/VCLCryptoServiceType.js.map +0 -1
  38. package/lib/commonjs/api/VCLEnvironment.js +0 -20
  39. package/lib/commonjs/api/VCLEnvironment.js.map +0 -1
  40. package/lib/commonjs/api/VCLSignatureAlgorithm.js +0 -18
  41. package/lib/commonjs/api/VCLSignatureAlgorithm.js.map +0 -1
  42. package/lib/commonjs/api/VCLXVnfProtocolVersion.js +0 -18
  43. package/lib/commonjs/api/VCLXVnfProtocolVersion.js.map +0 -1
  44. package/lib/commonjs/api/entities/VCLAuthToken.js +0 -6
  45. package/lib/commonjs/api/entities/VCLAuthToken.js.map +0 -1
  46. package/lib/commonjs/api/entities/VCLAuthTokenDescriptor.js +0 -6
  47. package/lib/commonjs/api/entities/VCLAuthTokenDescriptor.js.map +0 -1
  48. package/lib/commonjs/api/entities/VCLCountries.js +0 -267
  49. package/lib/commonjs/api/entities/VCLCountries.js.map +0 -1
  50. package/lib/commonjs/api/entities/VCLCountry.js +0 -6
  51. package/lib/commonjs/api/entities/VCLCountry.js.map +0 -1
  52. package/lib/commonjs/api/entities/VCLCredentialManifest.js +0 -6
  53. package/lib/commonjs/api/entities/VCLCredentialManifest.js.map +0 -1
  54. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js +0 -6
  55. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js.map +0 -1
  56. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByDeepLink.js +0 -6
  57. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByDeepLink.js.map +0 -1
  58. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByService.js +0 -6
  59. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByService.js.map +0 -1
  60. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorRefresh.js +0 -6
  61. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorRefresh.js.map +0 -1
  62. package/lib/commonjs/api/entities/VCLCredentialType.js +0 -6
  63. package/lib/commonjs/api/entities/VCLCredentialType.js.map +0 -1
  64. package/lib/commonjs/api/entities/VCLCredentialTypeSchema.js +0 -6
  65. package/lib/commonjs/api/entities/VCLCredentialTypeSchema.js.map +0 -1
  66. package/lib/commonjs/api/entities/VCLCredentialTypeSchemas.js +0 -6
  67. package/lib/commonjs/api/entities/VCLCredentialTypeSchemas.js.map +0 -1
  68. package/lib/commonjs/api/entities/VCLCredentialTypes.js +0 -6
  69. package/lib/commonjs/api/entities/VCLCredentialTypes.js.map +0 -1
  70. package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchema.js +0 -6
  71. package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchema.js.map +0 -1
  72. package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js +0 -2
  73. package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js.map +0 -1
  74. package/lib/commonjs/api/entities/VCLDeepLink.js +0 -2
  75. package/lib/commonjs/api/entities/VCLDeepLink.js.map +0 -1
  76. package/lib/commonjs/api/entities/VCLDidJwk.js +0 -6
  77. package/lib/commonjs/api/entities/VCLDidJwk.js.map +0 -1
  78. package/lib/commonjs/api/entities/VCLDidJwkDescriptor.js +0 -6
  79. package/lib/commonjs/api/entities/VCLDidJwkDescriptor.js.map +0 -1
  80. package/lib/commonjs/api/entities/VCLExchange.js +0 -2
  81. package/lib/commonjs/api/entities/VCLExchange.js.map +0 -1
  82. package/lib/commonjs/api/entities/VCLExchangeDescriptor.js +0 -6
  83. package/lib/commonjs/api/entities/VCLExchangeDescriptor.js.map +0 -1
  84. package/lib/commonjs/api/entities/VCLFilter.js +0 -6
  85. package/lib/commonjs/api/entities/VCLFilter.js.map +0 -1
  86. package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js +0 -6
  87. package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js.map +0 -1
  88. package/lib/commonjs/api/entities/VCLGenerateOffersDescriptor.js +0 -6
  89. package/lib/commonjs/api/entities/VCLGenerateOffersDescriptor.js.map +0 -1
  90. package/lib/commonjs/api/entities/VCLIssuingType.js +0 -20
  91. package/lib/commonjs/api/entities/VCLIssuingType.js.map +0 -1
  92. package/lib/commonjs/api/entities/VCLJwt.js +0 -6
  93. package/lib/commonjs/api/entities/VCLJwt.js.map +0 -1
  94. package/lib/commonjs/api/entities/VCLJwtDescriptor.js +0 -6
  95. package/lib/commonjs/api/entities/VCLJwtDescriptor.js.map +0 -1
  96. package/lib/commonjs/api/entities/VCLJwtVerifiableCredentials.js +0 -6
  97. package/lib/commonjs/api/entities/VCLJwtVerifiableCredentials.js.map +0 -1
  98. package/lib/commonjs/api/entities/VCLOffer.js +0 -6
  99. package/lib/commonjs/api/entities/VCLOffer.js.map +0 -1
  100. package/lib/commonjs/api/entities/VCLOffers.js +0 -6
  101. package/lib/commonjs/api/entities/VCLOffers.js.map +0 -1
  102. package/lib/commonjs/api/entities/VCLOrganization.js +0 -6
  103. package/lib/commonjs/api/entities/VCLOrganization.js.map +0 -1
  104. package/lib/commonjs/api/entities/VCLOrganizations.js +0 -6
  105. package/lib/commonjs/api/entities/VCLOrganizations.js.map +0 -1
  106. package/lib/commonjs/api/entities/VCLOrganizationsSearchDescriptor.js +0 -6
  107. package/lib/commonjs/api/entities/VCLOrganizationsSearchDescriptor.js.map +0 -1
  108. package/lib/commonjs/api/entities/VCLPage.js +0 -2
  109. package/lib/commonjs/api/entities/VCLPage.js.map +0 -1
  110. package/lib/commonjs/api/entities/VCLPresentationRequest.js +0 -6
  111. package/lib/commonjs/api/entities/VCLPresentationRequest.js.map +0 -1
  112. package/lib/commonjs/api/entities/VCLPresentationRequestDescriptor.js +0 -6
  113. package/lib/commonjs/api/entities/VCLPresentationRequestDescriptor.js.map +0 -1
  114. package/lib/commonjs/api/entities/VCLPresentationSubmission.js +0 -6
  115. package/lib/commonjs/api/entities/VCLPresentationSubmission.js.map +0 -1
  116. package/lib/commonjs/api/entities/VCLPublicJwk.js +0 -2
  117. package/lib/commonjs/api/entities/VCLPublicJwk.js.map +0 -1
  118. package/lib/commonjs/api/entities/VCLPushDelegate.js +0 -2
  119. package/lib/commonjs/api/entities/VCLPushDelegate.js.map +0 -1
  120. package/lib/commonjs/api/entities/VCLRegion.js +0 -6
  121. package/lib/commonjs/api/entities/VCLRegion.js.map +0 -1
  122. package/lib/commonjs/api/entities/VCLRegions.js +0 -6
  123. package/lib/commonjs/api/entities/VCLRegions.js.map +0 -1
  124. package/lib/commonjs/api/entities/VCLService.js +0 -6
  125. package/lib/commonjs/api/entities/VCLService.js.map +0 -1
  126. package/lib/commonjs/api/entities/VCLServiceType.js +0 -27
  127. package/lib/commonjs/api/entities/VCLServiceType.js.map +0 -1
  128. package/lib/commonjs/api/entities/VCLServiceTypes.js +0 -6
  129. package/lib/commonjs/api/entities/VCLServiceTypes.js.map +0 -1
  130. package/lib/commonjs/api/entities/VCLSubmissionResult.js +0 -6
  131. package/lib/commonjs/api/entities/VCLSubmissionResult.js.map +0 -1
  132. package/lib/commonjs/api/entities/VCLToken.js +0 -2
  133. package/lib/commonjs/api/entities/VCLToken.js.map +0 -1
  134. package/lib/commonjs/api/entities/VCLVerifiableCredential.js +0 -2
  135. package/lib/commonjs/api/entities/VCLVerifiableCredential.js.map +0 -1
  136. package/lib/commonjs/api/entities/VCLVerifiedProfile.js +0 -6
  137. package/lib/commonjs/api/entities/VCLVerifiedProfile.js.map +0 -1
  138. package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js +0 -2
  139. package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js.map +0 -1
  140. package/lib/commonjs/api/entities/error/VCLError.js +0 -31
  141. package/lib/commonjs/api/entities/error/VCLError.js.map +0 -1
  142. package/lib/commonjs/api/entities/error/VCLErrorCode.js +0 -31
  143. package/lib/commonjs/api/entities/error/VCLErrorCode.js.map +0 -1
  144. package/lib/commonjs/api/entities/error/VCLStatusCode.js +0 -18
  145. package/lib/commonjs/api/entities/error/VCLStatusCode.js.map +0 -1
  146. package/lib/commonjs/api/entities/initialization/VCLCryptoServicesDescriptor.js +0 -6
  147. package/lib/commonjs/api/entities/initialization/VCLCryptoServicesDescriptor.js.map +0 -1
  148. package/lib/commonjs/api/entities/initialization/VCLInitializationDescriptor.js +0 -6
  149. package/lib/commonjs/api/entities/initialization/VCLInitializationDescriptor.js.map +0 -1
  150. package/lib/commonjs/api/entities/initialization/VCLJwtServiceUrls.js +0 -2
  151. package/lib/commonjs/api/entities/initialization/VCLJwtServiceUrls.js.map +0 -1
  152. package/lib/commonjs/api/entities/initialization/VCLKeyServiceUrls.js +0 -2
  153. package/lib/commonjs/api/entities/initialization/VCLKeyServiceUrls.js.map +0 -1
  154. package/lib/commonjs/api/entities/initialization/VCLRemoteCryptoServicesUrlsDescriptor.js +0 -6
  155. package/lib/commonjs/api/entities/initialization/VCLRemoteCryptoServicesUrlsDescriptor.js.map +0 -1
  156. package/lib/commonjs/index.js +0 -85
  157. package/lib/commonjs/index.js.map +0 -1
  158. package/lib/commonjs/package.json +0 -1
@@ -3,7 +3,7 @@ require "json"
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
5
  Pod::Spec.new do |s|
6
- s.name = "velocitycareerlabs-vcl-react-native"
6
+ s.name = "VclReactNative"
7
7
  s.version = package["version"]
8
8
  s.summary = package["description"]
9
9
  s.homepage = package["homepage"]
@@ -13,15 +13,12 @@ Pod::Spec.new do |s|
13
13
  s.platforms = { :ios => min_ios_version_supported }
14
14
  s.source = { :git => "https://github.com/velocitycareerlabs/vcl-react-native.git", :tag => "#{s.version}" }
15
15
 
16
- s.source_files = "ios/**/*.{h,m,mm,swift}"
16
+ s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
+ s.private_header_files = "ios/**/*.h"
17
18
 
18
- s.dependency "VCL", "2.7.7"
19
+ s.swift_version = "5.0"
20
+
21
+ s.dependency "VCL", "2.8.1"
19
22
 
20
- # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
21
- # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
22
- if respond_to?(:install_modules_dependencies, true)
23
23
  install_modules_dependencies(s)
24
- else
25
- s.dependency "React-Core"
26
- end
27
24
  end
@@ -1,8 +1,7 @@
1
- import com.android.Version
2
-
3
1
  buildscript {
4
- // Buildscript is evaluated before everything else so we can't use getExtOrDefault
5
- def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["VclReactNative_kotlinVersion"]
2
+ ext.getExtOrDefault = {name ->
3
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['VclReactNative_' + name]
4
+ }
6
5
 
7
6
  repositories {
8
7
  google()
@@ -10,57 +9,34 @@ buildscript {
10
9
  }
11
10
 
12
11
  dependencies {
13
- classpath "com.android.tools.build:gradle:8.8.2"
12
+ classpath "com.android.tools.build:gradle:8.13.0"
14
13
  // noinspection DifferentKotlinGradleVersion
15
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
16
15
  }
17
16
  }
18
17
 
19
- def isNewArchitectureEnabled() {
20
- return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
21
- }
22
18
 
23
19
  apply plugin: "com.android.library"
24
20
  apply plugin: "kotlin-android"
25
21
 
26
- if (isNewArchitectureEnabled()) {
27
- apply plugin: "com.facebook.react"
28
- }
29
-
30
- def getExtOrDefault(name) {
31
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["VclReactNative_" + name]
32
- }
22
+ apply plugin: "com.facebook.react"
33
23
 
34
24
  def getExtOrIntegerDefault(name) {
35
25
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["VclReactNative_" + name]).toInteger()
36
26
  }
37
27
 
38
- static def supportsNamespace() {
39
- def parsed = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
40
- def major = parsed[0].toInteger()
41
- def minor = parsed[1].toInteger()
42
-
43
- // Namespace support was added in 7.3.0
44
- return (major == 7 && minor >= 3) || major >= 8
45
- }
46
-
47
28
  android {
48
- if (supportsNamespace()) {
49
- namespace "io.velocitycareerlabs.reactnative"
50
-
51
- sourceSets {
52
- main {
53
- manifest.srcFile "src/main/AndroidManifestNew.xml"
54
- }
55
- }
56
- }
29
+ namespace "io.velocitycareerlabs.reactnative"
57
30
 
58
31
  compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
59
32
 
60
33
  defaultConfig {
61
34
  minSdkVersion getExtOrIntegerDefault("minSdkVersion")
62
35
  targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
36
+ }
63
37
 
38
+ buildFeatures {
39
+ buildConfig true
64
40
  }
65
41
 
66
42
  buildTypes {
@@ -77,6 +53,15 @@ android {
77
53
  sourceCompatibility JavaVersion.VERSION_1_8
78
54
  targetCompatibility JavaVersion.VERSION_1_8
79
55
  }
56
+
57
+ sourceSets {
58
+ main {
59
+ java.srcDirs += [
60
+ "generated/java",
61
+ "generated/jni"
62
+ ]
63
+ }
64
+ }
80
65
  }
81
66
 
82
67
  repositories {
@@ -87,16 +72,12 @@ repositories {
87
72
  def kotlin_version = getExtOrDefault("kotlinVersion")
88
73
 
89
74
  dependencies {
90
- // For < 0.71, this will be from the local maven repo
91
- // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
92
- //noinspection GradleDynamicVersion
93
- implementation "com.facebook.react:react-native:+"
75
+ implementation "com.facebook.react:react-android"
94
76
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
95
77
 
96
78
  //--------- Must: be added:
97
- implementation "io.velocitycareerlabs:vcl:2.7.7"
98
- implementation 'com.nimbusds:nimbus-jose-jwt:10.3.1'
99
- implementation "androidx.security:security-crypto:1.1.0-beta01"
79
+ implementation "io.velocitycareerlabs:vcl:2.8.1"
80
+ implementation 'com.nimbusds:nimbus-jose-jwt:10.5'
81
+ implementation "androidx.security:security-crypto:1.1.0"
100
82
  //-------------------------
101
83
  }
102
-
@@ -1,5 +1,5 @@
1
- VclReactNative_kotlinVersion=1.9.25
1
+ VclReactNative_kotlinVersion=2.0.21
2
2
  VclReactNative_minSdkVersion=24
3
3
  VclReactNative_targetSdkVersion=34
4
- VclReactNative_compileSdkVersion=34
5
- VclReactNative_ndkversion=21.4.7075529
4
+ VclReactNative_compileSdkVersion=35
5
+ VclReactNative_ndkVersion=27.1.12297006
@@ -1,3 +1,2 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="io.velocitycareerlabs.reactnative">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
2
  </manifest>
@@ -7,6 +7,8 @@
7
7
 
8
8
  package io.velocitycareerlabs.reactnative
9
9
 
10
+ import com.facebook.react.bridge.ReactApplicationContext
11
+ import com.facebook.react.module.annotations.ReactModule
10
12
  import com.facebook.react.bridge.*
11
13
  import io.velocitycareerlabs.reactnative.utlis.Converter
12
14
  import io.velocitycareerlabs.reactnative.utlis.Converter.countriesToMap
@@ -48,26 +50,19 @@ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToJwtDescriptor
48
50
  import io.velocitycareerlabs.reactnative.utlis.VCLLog
49
51
  import kotlin.Exception
50
52
 
51
- class VclReactNativeModule(reactContext: ReactApplicationContext) :
52
- ReactContextBaseJavaModule(reactContext) {
53
+ @ReactModule(name = VclReactNativeModule.NAME)
54
+ class VclReactNativeModule(val reactContext: ReactApplicationContext) :
55
+ NativeVclReactNativeSpec(reactContext) {
53
56
 
54
- val TAG = "VclReactNativeModule"
57
+ companion object {
58
+ const val NAME = "VclReactNative"
59
+ const val TAG = NAME
60
+ }
55
61
 
56
62
  override fun getName(): String {
57
63
  return NAME
58
64
  }
59
65
 
60
- // Example method
61
- // See https://reactnative.dev/docs/native-modules-android
62
- @ReactMethod
63
- fun multiply(a: Double, b: Double, promise: Promise) {
64
- promise.resolve(a * b)
65
- }
66
-
67
- companion object {
68
- const val NAME = "VclReactNative"
69
- }
70
-
71
66
  private val vcl = VCLProvider.vclInstance()
72
67
 
73
68
  private fun initGlobalConfigurations(
@@ -77,8 +72,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
77
72
  GlobalConfig.IsDebugOn = initializationDescriptor.isDebugOn
78
73
  }
79
74
 
80
- @ReactMethod
81
- fun initialize(
75
+ override fun initialize(
82
76
  initializationDescriptorMap: ReadableMap,
83
77
  promise: Promise
84
78
  ) {
@@ -88,7 +82,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
88
82
  )
89
83
  initGlobalConfigurations(initializationDescriptor)
90
84
  vcl.initialize(
91
- context = reactApplicationContext.applicationContext,
85
+ context = reactContext,
92
86
  initializationDescriptor = initializationDescriptor,
93
87
  successHandler = {
94
88
  promise.resolve("VCL initialization succeed!")
@@ -101,8 +95,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
101
95
  }
102
96
  }
103
97
 
104
- @ReactMethod
105
- fun getCountries(promise: Promise) {
98
+ override fun getCountries(promise: Promise) {
106
99
  try {
107
100
  vcl.countries?.let { promise.resolve(countriesToMap(it)) }
108
101
  ?: promise.reject(VCLError(message = "Countries not found").toThrowable())
@@ -111,8 +104,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
111
104
  }
112
105
  }
113
106
 
114
- @ReactMethod
115
- fun getCredentialTypeSchemas(promise: Promise) {
107
+ override fun getCredentialTypeSchemas(promise: Promise) {
116
108
  try {
117
109
  vcl.credentialTypeSchemas?.let { promise.resolve(credentialTypeSchemasToMap(it)) }
118
110
  ?: promise.reject(VCLError(message = "Credential Types not found").toThrowable())
@@ -121,8 +113,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
121
113
  }
122
114
  }
123
115
 
124
- @ReactMethod
125
- fun getCredentialTypes(promise: Promise) {
116
+ override fun getCredentialTypes(promise: Promise) {
126
117
  try {
127
118
  vcl.credentialTypes?.let { promise.resolve(credentialTypesToMap(it)) }
128
119
  ?: promise.reject(VCLError(message = "Credential Types not found").toThrowable())
@@ -131,8 +122,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
131
122
  }
132
123
  }
133
124
 
134
- @ReactMethod
135
- fun getPresentationRequest(
125
+ override fun getPresentationRequest(
136
126
  presentationRequestDescriptorMap: ReadableMap,
137
127
  promise: Promise
138
128
  ) {
@@ -152,10 +142,9 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
152
142
  }
153
143
  }
154
144
 
155
- @ReactMethod
156
- fun submitPresentation(
145
+ override fun submitPresentation(
157
146
  presentationSubmissionMap: ReadableMap,
158
- authTokenMap: ReadableMap? = null,
147
+ authTokenMap: ReadableMap?,
159
148
  promise: Promise
160
149
  ) {
161
150
  try {
@@ -173,8 +162,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
173
162
  }
174
163
  }
175
164
 
176
- @ReactMethod
177
- fun getExchangeProgress(
165
+ override fun getExchangeProgress(
178
166
  exchangeDescriptorMap: ReadableMap,
179
167
  promise: Promise
180
168
  ) {
@@ -191,8 +179,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
191
179
  }
192
180
  }
193
181
 
194
- @ReactMethod
195
- fun searchForOrganizations(
182
+ override fun searchForOrganizations(
196
183
  organizationsSearchDescriptorMap: ReadableMap,
197
184
  promise: Promise
198
185
  ) {
@@ -210,8 +197,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
210
197
  }
211
198
  }
212
199
 
213
- @ReactMethod
214
- fun getCredentialManifest(
200
+ override fun getCredentialManifest(
215
201
  credentialManifestDescriptorMap: ReadableMap,
216
202
  promise: Promise
217
203
  ) {
@@ -238,8 +224,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
238
224
  }
239
225
  }
240
226
 
241
- @ReactMethod
242
- fun generateOffers(
227
+ override fun generateOffers(
243
228
  generateOffersDescriptorMap: ReadableMap,
244
229
  promise: Promise
245
230
  ) {
@@ -257,8 +242,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
257
242
  }
258
243
  }
259
244
 
260
- @ReactMethod
261
- fun checkForOffers(
245
+ override fun checkForOffers(
262
246
  generateOffersDescriptorMap: ReadableMap,
263
247
  sessionTokenMap: ReadableMap,
264
248
  promise: Promise
@@ -278,8 +262,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
278
262
  }
279
263
  }
280
264
 
281
- @ReactMethod
282
- fun finalizeOffers(
265
+ override fun finalizeOffers(
283
266
  finalizeOffersDescriptorMap: ReadableMap,
284
267
  sessionTokenMap: ReadableMap,
285
268
  promise: Promise
@@ -299,8 +282,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
299
282
  }
300
283
  }
301
284
 
302
- @ReactMethod
303
- fun getAuthToken(
285
+ override fun getAuthToken(
304
286
  authTokenDescriptorMap: ReadableMap,
305
287
  promise: Promise
306
288
  ) {
@@ -318,8 +300,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
318
300
  }
319
301
  }
320
302
 
321
- @ReactMethod
322
- fun getCredentialTypesUIFormSchema(
303
+ override fun getCredentialTypesUIFormSchema(
323
304
  credentialTypesUIFormSchemaDescriptorMap: ReadableMap,
324
305
  promise: Promise
325
306
  ) {
@@ -338,8 +319,7 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
338
319
  }
339
320
  }
340
321
 
341
- @ReactMethod
342
- fun getVerifiedProfile(
322
+ override fun getVerifiedProfile(
343
323
  verifiedProfileDescriptorMap: ReadableMap,
344
324
  promise: Promise
345
325
  ) {
@@ -356,11 +336,10 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
356
336
  }
357
337
  }
358
338
 
359
- @ReactMethod
360
- fun verifyJwt(
339
+ override fun verifyJwt(
361
340
  jwtMap: ReadableMap,
362
341
  publicJwkMap: ReadableMap,
363
- remoteCryptoServicesTokenMap: ReadableMap? = null,
342
+ remoteCryptoServicesTokenMap: ReadableMap?,
364
343
  promise: Promise
365
344
  ) {
366
345
  try {
@@ -379,11 +358,10 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
379
358
  }
380
359
  }
381
360
 
382
- @ReactMethod
383
- fun generateSignedJwt(
361
+ override fun generateSignedJwt(
384
362
  jwtDescriptorMap: ReadableMap,
385
363
  didJwkMap: ReadableMap,
386
- remoteCryptoServicesTokenMap: ReadableMap? = null,
364
+ remoteCryptoServicesTokenMap: ReadableMap?,
387
365
  promise: Promise
388
366
  ) {
389
367
  try {
@@ -402,9 +380,8 @@ class VclReactNativeModule(reactContext: ReactApplicationContext) :
402
380
  }
403
381
  }
404
382
 
405
- @ReactMethod
406
- fun generateDidJwk(
407
- didJwkDescriptorMap: ReadableMap? = null,
383
+ override fun generateDidJwk(
384
+ didJwkDescriptorMap: ReadableMap?,
408
385
  promise: Promise
409
386
  ) {
410
387
  try {
@@ -7,18 +7,34 @@
7
7
 
8
8
  package io.velocitycareerlabs.reactnative
9
9
 
10
- import com.facebook.react.ReactPackage
10
+ import com.facebook.react.BaseReactPackage
11
11
  import com.facebook.react.bridge.NativeModule
12
12
  import com.facebook.react.bridge.ReactApplicationContext
13
- import com.facebook.react.uimanager.ViewManager
13
+ import com.facebook.react.module.model.ReactModuleInfo
14
+ import com.facebook.react.module.model.ReactModuleInfoProvider
15
+ import java.util.HashMap
14
16
 
15
-
16
- class VclReactNativePackage : ReactPackage {
17
- override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
18
- return listOf(VclReactNativeModule(reactContext))
17
+ class VclReactNativePackage : BaseReactPackage() {
18
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
19
+ return if (name == VclReactNativeModule.NAME) {
20
+ VclReactNativeModule(reactContext)
21
+ } else {
22
+ null
23
+ }
19
24
  }
20
25
 
21
- override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
22
- return emptyList()
26
+ override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
27
+ return ReactModuleInfoProvider {
28
+ val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
29
+ moduleInfos[VclReactNativeModule.NAME] = ReactModuleInfo(
30
+ VclReactNativeModule.NAME,
31
+ VclReactNativeModule.NAME,
32
+ false, // canOverrideExistingModule
33
+ false, // needsEagerInit
34
+ false, // isCxxModule
35
+ true // isTurboModule
36
+ )
37
+ moduleInfos
38
+ }
23
39
  }
24
40
  }
@@ -0,0 +1,13 @@
1
+ #pragma once
2
+
3
+ #import <Foundation/Foundation.h>
4
+ #import <React/RCTBridgeModule.h>
5
+ #import <VclReactNativeSpec/VclReactNativeSpec.h>
6
+
7
+ NS_ASSUME_NONNULL_BEGIN
8
+
9
+ @interface VclReactNative : NSObject <NativeVclReactNativeSpec>
10
+
11
+ @end
12
+
13
+ NS_ASSUME_NONNULL_END
@@ -1,93 +1,103 @@
1
- // Created by Michael Avoyan on 05/07/2021.
2
- //
3
- // Copyright 2022 Velocity Career Labs inc.
4
- // SPDX-License-Identifier: Apache-2.0
5
- //
1
+ #import "VclReactNative.h"
2
+ #import <objc/message.h>
6
3
 
7
- #import <React/RCTBridgeModule.h>
4
+ // Import the auto-generated Swift interface header
5
+ #if __has_include(<VclReactNative/VclReactNative-Swift.h>)
6
+ #import <VclReactNative/VclReactNative-Swift.h>
7
+ #elif __has_include("VclReactNative-Swift.h")
8
+ #import "VclReactNative-Swift.h"
9
+ #else
10
+ #warning "VclReactNative-Swift.h not found. Ensure the Swift sources are compiled and the header is exposed."
11
+ #endif
8
12
 
9
- @interface RCT_EXTERN_MODULE(VclReactNative, NSObject)
13
+ @implementation VclReactNative
10
14
 
11
- RCT_EXTERN_METHOD(initialize:(NSDictionary*)initializationDescriptorDictionary
12
- withResolver:(RCTPromiseResolveBlock)resolve
13
- withRejecter:(RCTPromiseRejectBlock)reject)
15
+ //RCT_EXPORT_MODULE()
16
+ RCT_EXPORT_MODULE(VclAuthReactNative)
14
17
 
15
- RCT_EXTERN_METHOD(getCountries:(RCTPromiseResolveBlock)resolve
16
- withRejecter:(RCTPromiseRejectBlock)reject)
18
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
19
+ (const facebook::react::ObjCTurboModule::InitParams &)params
20
+ {
21
+ return std::make_shared<facebook::react::NativeVclReactNativeSpecJSI>(params);
22
+ }
17
23
 
18
- RCT_EXTERN_METHOD(getCredentialTypeSchemas:(RCTPromiseResolveBlock)resolve
19
- withRejecter:(RCTPromiseRejectBlock)reject)
24
+ // MARK: - Spec methods (must match the generated header signatures)
20
25
 
21
- RCT_EXTERN_METHOD(getCredentialTypes:(RCTPromiseResolveBlock)resolve
22
- withRejecter:(RCTPromiseRejectBlock)reject)
26
+ - (void)initialize:(NSDictionary *)initializationDescriptor
27
+ resolve:(RCTPromiseResolveBlock)resolve
28
+ reject:(RCTPromiseRejectBlock)reject
29
+ {
30
+ [VclReactNativeImpl.shared initializeWithInitializationDescriptorDictionary:initializationDescriptor
31
+ resolve:resolve
32
+ reject:reject];
33
+ }
23
34
 
24
- RCT_EXTERN_METHOD(getPresentationRequest:(NSDictionary*)presentationRequestDescriptorDictionary
25
- withResolver:(RCTPromiseResolveBlock)resolve
26
- withRejecter:(RCTPromiseRejectBlock)reject)
35
+ - (void)getCountries:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
36
+ [VclReactNativeImpl.shared getCountriesWithResolve:resolve reject:reject];
37
+ }
27
38
 
28
- RCT_EXTERN_METHOD(submitPresentation:(NSDictionary*)presentationSubmissionDictionary
29
- withAuthTokenDictionary:(NSDictionary*)authTokenDictionary
30
- withResolver:(RCTPromiseResolveBlock)resolve
31
- withRejecter:(RCTPromiseRejectBlock)reject)
39
+ - (void)getCredentialTypeSchemas:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
40
+ [VclReactNativeImpl.shared getCredentialTypeSchemasWithResolve:resolve reject:reject];
41
+ }
32
42
 
33
- RCT_EXTERN_METHOD(getExchangeProgress:(NSDictionary*)exchangeDescriptorDictionary
34
- withResolver:(RCTPromiseResolveBlock)resolve
35
- withRejecter:(RCTPromiseRejectBlock)reject)
43
+ - (void)getCredentialTypes:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
44
+ [VclReactNativeImpl.shared getCredentialTypesWithResolve:resolve reject:reject];
45
+ }
36
46
 
37
- RCT_EXTERN_METHOD(searchForOrganizations:(NSDictionary*)organizationsSearchDescriptorDictionary
38
- withResolver:(RCTPromiseResolveBlock)resolve
39
- withRejecter:(RCTPromiseRejectBlock)reject)
47
+ - (void)getPresentationRequest:(NSDictionary *)presentationRequestDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
48
+ [VclReactNativeImpl.shared getPresentationRequestWithPresentationRequestDescriptorDictionary:presentationRequestDescriptor resolve:resolve reject:reject];
49
+ }
40
50
 
41
- RCT_EXTERN_METHOD(getCredentialManifest:(NSDictionary*)credentialManifestDescriptorDictionary
42
- withResolver:(RCTPromiseResolveBlock)resolve
43
- withRejecter:(RCTPromiseRejectBlock)reject)
51
+ - (void)submitPresentation:(NSDictionary *)presentationSubmission authToken:(NSDictionary *)authToken resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
52
+ [VclReactNativeImpl.shared submitPresentationWithPresentationSubmissionDictionary:presentationSubmission authTokenDictionary:authToken resolve:resolve reject:reject];
53
+ }
54
+
55
+ - (void)getExchangeProgress:(NSDictionary *)exchangeDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
56
+ [VclReactNativeImpl.shared getExchangeProgressWithExchangeDescriptorDictionary:exchangeDescriptor resolve:resolve reject:reject];
57
+ }
44
58
 
45
- RCT_EXTERN_METHOD(generateOffers:(NSDictionary*)generateOffersDescriptorDictionary
46
- withResolver:(RCTPromiseResolveBlock)resolve
47
- withRejecter:(RCTPromiseRejectBlock)reject)
59
+ - (void)getCredentialManifest:(NSDictionary *)credentialManifestDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
60
+ [VclReactNativeImpl.shared getCredentialManifestWithCredentialManifestDescriptorDictionary:credentialManifestDescriptor resolve:resolve reject:reject];
61
+ }
48
62
 
49
- RCT_EXTERN_METHOD(checkForOffers:(NSDictionary*)generateOffersDescriptorDictionary
50
- withtSessionTokenDictionary:(NSDictionary*)sessionTokenDictionary
51
- withResolver:(RCTPromiseResolveBlock)resolve
52
- withRejecter:(RCTPromiseRejectBlock)reject)
63
+ - (void)generateOffers:(NSDictionary *)generateOffersDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
64
+ [VclReactNativeImpl.shared generateOffersWithGenerateOffersDescriptorDictionary:generateOffersDescriptor resolve:resolve reject:reject];
65
+ }
53
66
 
54
- RCT_EXTERN_METHOD(finalizeOffers:(NSDictionary*)finalizeOffersDescriptorDictionary
55
- withSessionTokenDictionary:(NSDictionary*)sessionTokenDictionary
56
- withResolver:(RCTPromiseResolveBlock)resolve
57
- withRejecter:(RCTPromiseRejectBlock)reject)
67
+ - (void)checkForOffers:(NSDictionary *)generateOffersDescriptor sessionToken:(NSDictionary *)sessionToken resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
68
+ [VclReactNativeImpl.shared checkForOffersWithGenerateOffersDescriptorDictionary:generateOffersDescriptor sessionTokenDictionary:sessionToken resolve:resolve reject:reject];
69
+ }
58
70
 
59
- RCT_EXTERN_METHOD(getAuthToken:(NSDictionary*)authTokenDescriptorDictionary
60
- withResolver:(RCTPromiseResolveBlock)resolve
61
- withRejecter:(RCTPromiseRejectBlock)reject)
71
+ - (void)finalizeOffers:(NSDictionary *)finalizeOffersDescriptor sessionToken:(NSDictionary *)sessionToken resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
72
+ [VclReactNativeImpl.shared finalizeOffersWithFinalizeOffersDescriptorDictionary:finalizeOffersDescriptor sessionTokenDictionary:sessionToken resolve:resolve reject:reject];
73
+ }
62
74
 
63
- RCT_EXTERN_METHOD(getCredentialTypesUIFormSchema:(NSDictionary*)credentialTypesUIFormSchemaDescriptorDictionary
64
- withResolver:(RCTPromiseResolveBlock)resolve
65
- withRejecter:(RCTPromiseRejectBlock)reject)
75
+ - (void)getAuthToken:(NSDictionary *)authTokenDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
76
+ [VclReactNativeImpl.shared getAuthTokenWithAuthTokenDescriptorDictionary:authTokenDescriptor resolve:resolve reject:reject];
77
+ }
66
78
 
67
- RCT_EXTERN_METHOD(getVerifiedProfile:(NSDictionary*)verifiedProfileDescriptorDictionary
68
- withResolver:(RCTPromiseResolveBlock)resolve
69
- withRejecter:(RCTPromiseRejectBlock)reject)
79
+ - (void)getCredentialTypesUIFormSchema:(NSDictionary *)credentialTypesUIFormSchemaDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
80
+ [VclReactNativeImpl.shared getCredentialTypesUIFormSchemaWithCredentialTypesUIFormSchemaDescriptorDictionary:credentialTypesUIFormSchemaDescriptor resolve:resolve reject:reject];
81
+ }
70
82
 
71
- RCT_EXTERN_METHOD(verifyJwt:(NSDictionary*)jwtDictionary
72
- withPublicJwkDictionary:(NSDictionary*)publicJwkDictionary
73
- withRemoteCryptoServicesTokenDictionary:(NSDictionary*)remoteCryptoServicesTokenDictionary
74
- withResolver:(RCTPromiseResolveBlock)resolve
75
- withRejecter:(RCTPromiseRejectBlock)reject)
83
+ - (void)getVerifiedProfile:(NSDictionary *)verifiedProfileDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
84
+ [VclReactNativeImpl.shared getVerifiedProfileWithVerifiedProfileDescriptorDictionary:verifiedProfileDescriptor resolve:resolve reject:reject];
85
+ }
76
86
 
77
- RCT_EXTERN_METHOD(generateSignedJwt:(NSDictionary*)jwtDescriptorDictionary
78
- withDidJwkDictionary:(NSDictionary*)didJwkDictionary
79
- withRemoteCryptoServicesTokenDictionary:(NSDictionary*)remoteCryptoServicesTokenDictionary
80
- withResolver:(RCTPromiseResolveBlock)resolve
81
- withRejecter:(RCTPromiseRejectBlock)reject)
87
+ - (void)searchForOrganizations:(NSDictionary *)organizationsSearchDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
88
+ [VclReactNativeImpl.shared searchForOrganizationsWithOrganizationsSearchDescriptorDictionary:organizationsSearchDescriptor resolve:resolve reject:reject];
89
+ }
82
90
 
83
- RCT_EXTERN_METHOD(generateDidJwk:(NSDictionary*)didJwkDescriptorDictionary
84
- withResolver:(RCTPromiseResolveBlock)resolve
85
- withRejecter:(RCTPromiseRejectBlock)reject)
91
+ - (void)verifyJwt:(NSDictionary *)jwt jwkPublic:(NSDictionary *)jwkPublic remoteCryptoServicesToken:(NSDictionary *)remoteCryptoServicesToken resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
92
+ [VclReactNativeImpl.shared verifyJwtWithJwtDictionary:jwt publicJwkDictionary:jwkPublic remoteCryptoServicesTokenDictionary:remoteCryptoServicesToken resolve:resolve reject:reject];
93
+ }
86
94
 
95
+ - (void)generateSignedJwt:(NSDictionary *)jwtDescriptor didJwk:(NSDictionary *)didJwk remoteCryptoServicesToken:(NSDictionary *)remoteCryptoServicesToken resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
96
+ [VclReactNativeImpl.shared generateSignedJwtWithJwtDescriptorDictionary:jwtDescriptor didJwkDictionary:didJwk remoteCryptoServicesTokenDictionary:remoteCryptoServicesToken resolve:resolve reject:reject];
97
+ }
87
98
 
88
- + (BOOL)requiresMainQueueSetup
89
- {
90
- return NO;
99
+ - (void)generateDidJwk:(NSDictionary *)didJwkDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
100
+ [VclReactNativeImpl.shared generateDidJwkWithDidJwkDescriptorDictionary:didJwkDescriptor resolve:resolve reject:reject];
91
101
  }
92
102
 
93
103
  @end