@velocitycareerlabs/vcl-react-native 2.7.6 → 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.
- package/{velocitycareerlabs-vcl-react-native.podspec → VclReactNative.podspec} +6 -9
- package/android/build.gradle +23 -42
- package/android/gradle.properties +3 -3
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativeModule.kt +32 -55
- package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativePackage.kt +24 -8
- package/ios/VclReactNative.h +13 -0
- package/ios/VclReactNative.mm +78 -68
- package/ios/{VclReactNative.swift → VclReactNativeImpl.swift} +46 -38
- package/lib/module/NativeVclReactNative.js +5 -0
- package/lib/module/NativeVclReactNative.js.map +1 -0
- package/lib/module/api/VCLApi.js.map +1 -1
- package/lib/module/index.js +11 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeVclReactNative.d.ts +24 -0
- package/lib/typescript/src/NativeVclReactNative.d.ts.map +1 -0
- package/lib/typescript/src/api/VCLApi.d.ts.map +1 -1
- package/lib/typescript/src/api/entities/VCLAuthToken.d.ts.map +1 -1
- package/lib/typescript/src/api/entities/VCLAuthTokenDescriptor.d.ts.map +1 -1
- package/lib/typescript/src/api/entities/VCLJwt.d.ts.map +1 -1
- package/package.json +62 -60
- package/src/NativeVclReactNative.ts +66 -0
- package/src/api/VCLApi.ts +5 -2
- package/src/api/entities/VCLAuthToken.ts +11 -8
- package/src/api/entities/VCLAuthTokenDescriptor.ts +10 -7
- package/src/api/entities/VCLJwt.ts +3 -3
- package/android/LICENSE +0 -177
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/ios/LICENSE +0 -177
- package/lib/commonjs/api/Dictionary.js +0 -2
- package/lib/commonjs/api/Dictionary.js.map +0 -1
- package/lib/commonjs/api/VCLApi.js +0 -147
- package/lib/commonjs/api/VCLApi.js.map +0 -1
- package/lib/commonjs/api/VCLCryptoServiceType.js +0 -18
- package/lib/commonjs/api/VCLCryptoServiceType.js.map +0 -1
- package/lib/commonjs/api/VCLEnvironment.js +0 -20
- package/lib/commonjs/api/VCLEnvironment.js.map +0 -1
- package/lib/commonjs/api/VCLSignatureAlgorithm.js +0 -18
- package/lib/commonjs/api/VCLSignatureAlgorithm.js.map +0 -1
- package/lib/commonjs/api/VCLXVnfProtocolVersion.js +0 -18
- package/lib/commonjs/api/VCLXVnfProtocolVersion.js.map +0 -1
- package/lib/commonjs/api/entities/VCLAuthToken.js +0 -6
- package/lib/commonjs/api/entities/VCLAuthToken.js.map +0 -1
- package/lib/commonjs/api/entities/VCLAuthTokenDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLAuthTokenDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCountries.js +0 -267
- package/lib/commonjs/api/entities/VCLCountries.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCountry.js +0 -6
- package/lib/commonjs/api/entities/VCLCountry.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialManifest.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialManifest.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByDeepLink.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByDeepLink.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByService.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByService.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorRefresh.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorRefresh.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialType.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialType.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialTypeSchema.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialTypeSchema.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialTypeSchemas.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialTypeSchemas.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialTypes.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialTypes.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchema.js +0 -6
- package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchema.js.map +0 -1
- package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js +0 -2
- package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLDeepLink.js +0 -2
- package/lib/commonjs/api/entities/VCLDeepLink.js.map +0 -1
- package/lib/commonjs/api/entities/VCLDidJwk.js +0 -6
- package/lib/commonjs/api/entities/VCLDidJwk.js.map +0 -1
- package/lib/commonjs/api/entities/VCLDidJwkDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLDidJwkDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLExchange.js +0 -2
- package/lib/commonjs/api/entities/VCLExchange.js.map +0 -1
- package/lib/commonjs/api/entities/VCLExchangeDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLExchangeDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLFilter.js +0 -6
- package/lib/commonjs/api/entities/VCLFilter.js.map +0 -1
- package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLGenerateOffersDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLGenerateOffersDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLIssuingType.js +0 -20
- package/lib/commonjs/api/entities/VCLIssuingType.js.map +0 -1
- package/lib/commonjs/api/entities/VCLJwt.js +0 -6
- package/lib/commonjs/api/entities/VCLJwt.js.map +0 -1
- package/lib/commonjs/api/entities/VCLJwtDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLJwtDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLJwtVerifiableCredentials.js +0 -6
- package/lib/commonjs/api/entities/VCLJwtVerifiableCredentials.js.map +0 -1
- package/lib/commonjs/api/entities/VCLOffer.js +0 -6
- package/lib/commonjs/api/entities/VCLOffer.js.map +0 -1
- package/lib/commonjs/api/entities/VCLOffers.js +0 -6
- package/lib/commonjs/api/entities/VCLOffers.js.map +0 -1
- package/lib/commonjs/api/entities/VCLOrganization.js +0 -6
- package/lib/commonjs/api/entities/VCLOrganization.js.map +0 -1
- package/lib/commonjs/api/entities/VCLOrganizations.js +0 -6
- package/lib/commonjs/api/entities/VCLOrganizations.js.map +0 -1
- package/lib/commonjs/api/entities/VCLOrganizationsSearchDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLOrganizationsSearchDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLPage.js +0 -2
- package/lib/commonjs/api/entities/VCLPage.js.map +0 -1
- package/lib/commonjs/api/entities/VCLPresentationRequest.js +0 -6
- package/lib/commonjs/api/entities/VCLPresentationRequest.js.map +0 -1
- package/lib/commonjs/api/entities/VCLPresentationRequestDescriptor.js +0 -6
- package/lib/commonjs/api/entities/VCLPresentationRequestDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/VCLPresentationSubmission.js +0 -6
- package/lib/commonjs/api/entities/VCLPresentationSubmission.js.map +0 -1
- package/lib/commonjs/api/entities/VCLPublicJwk.js +0 -2
- package/lib/commonjs/api/entities/VCLPublicJwk.js.map +0 -1
- package/lib/commonjs/api/entities/VCLPushDelegate.js +0 -2
- package/lib/commonjs/api/entities/VCLPushDelegate.js.map +0 -1
- package/lib/commonjs/api/entities/VCLRegion.js +0 -6
- package/lib/commonjs/api/entities/VCLRegion.js.map +0 -1
- package/lib/commonjs/api/entities/VCLRegions.js +0 -6
- package/lib/commonjs/api/entities/VCLRegions.js.map +0 -1
- package/lib/commonjs/api/entities/VCLService.js +0 -6
- package/lib/commonjs/api/entities/VCLService.js.map +0 -1
- package/lib/commonjs/api/entities/VCLServiceType.js +0 -27
- package/lib/commonjs/api/entities/VCLServiceType.js.map +0 -1
- package/lib/commonjs/api/entities/VCLServiceTypes.js +0 -6
- package/lib/commonjs/api/entities/VCLServiceTypes.js.map +0 -1
- package/lib/commonjs/api/entities/VCLSubmissionResult.js +0 -6
- package/lib/commonjs/api/entities/VCLSubmissionResult.js.map +0 -1
- package/lib/commonjs/api/entities/VCLToken.js +0 -2
- package/lib/commonjs/api/entities/VCLToken.js.map +0 -1
- package/lib/commonjs/api/entities/VCLVerifiableCredential.js +0 -2
- package/lib/commonjs/api/entities/VCLVerifiableCredential.js.map +0 -1
- package/lib/commonjs/api/entities/VCLVerifiedProfile.js +0 -6
- package/lib/commonjs/api/entities/VCLVerifiedProfile.js.map +0 -1
- package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js +0 -2
- package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/error/VCLError.js +0 -31
- package/lib/commonjs/api/entities/error/VCLError.js.map +0 -1
- package/lib/commonjs/api/entities/error/VCLErrorCode.js +0 -31
- package/lib/commonjs/api/entities/error/VCLErrorCode.js.map +0 -1
- package/lib/commonjs/api/entities/error/VCLStatusCode.js +0 -18
- package/lib/commonjs/api/entities/error/VCLStatusCode.js.map +0 -1
- package/lib/commonjs/api/entities/initialization/VCLCryptoServicesDescriptor.js +0 -6
- package/lib/commonjs/api/entities/initialization/VCLCryptoServicesDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/initialization/VCLInitializationDescriptor.js +0 -6
- package/lib/commonjs/api/entities/initialization/VCLInitializationDescriptor.js.map +0 -1
- package/lib/commonjs/api/entities/initialization/VCLJwtServiceUrls.js +0 -2
- package/lib/commonjs/api/entities/initialization/VCLJwtServiceUrls.js.map +0 -1
- package/lib/commonjs/api/entities/initialization/VCLKeyServiceUrls.js +0 -2
- package/lib/commonjs/api/entities/initialization/VCLKeyServiceUrls.js.map +0 -1
- package/lib/commonjs/api/entities/initialization/VCLRemoteCryptoServicesUrlsDescriptor.js +0 -6
- package/lib/commonjs/api/entities/initialization/VCLRemoteCryptoServicesUrlsDescriptor.js.map +0 -1
- package/lib/commonjs/index.js +0 -85
- package/lib/commonjs/index.js.map +0 -1
- 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 = "
|
|
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.
|
|
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
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import com.android.Version
|
|
2
|
-
|
|
3
1
|
buildscript {
|
|
4
|
-
|
|
5
|
-
|
|
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.
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.13.0"
|
|
14
13
|
// noinspection DifferentKotlinGradleVersion
|
|
15
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
98
|
-
implementation 'com.nimbusds:nimbus-jose-jwt:10.
|
|
99
|
-
implementation "androidx.security:security-crypto:1.1.0
|
|
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
|
+
VclReactNative_kotlinVersion=2.0.21
|
|
2
2
|
VclReactNative_minSdkVersion=24
|
|
3
3
|
VclReactNative_targetSdkVersion=34
|
|
4
|
-
VclReactNative_compileSdkVersion=
|
|
5
|
-
|
|
4
|
+
VclReactNative_compileSdkVersion=35
|
|
5
|
+
VclReactNative_ndkVersion=27.1.12297006
|
|
@@ -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
|
-
|
|
52
|
-
|
|
53
|
+
@ReactModule(name = VclReactNativeModule.NAME)
|
|
54
|
+
class VclReactNativeModule(val reactContext: ReactApplicationContext) :
|
|
55
|
+
NativeVclReactNativeSpec(reactContext) {
|
|
53
56
|
|
|
54
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
156
|
-
fun submitPresentation(
|
|
145
|
+
override fun submitPresentation(
|
|
157
146
|
presentationSubmissionMap: ReadableMap,
|
|
158
|
-
authTokenMap: ReadableMap
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
360
|
-
fun verifyJwt(
|
|
339
|
+
override fun verifyJwt(
|
|
361
340
|
jwtMap: ReadableMap,
|
|
362
341
|
publicJwkMap: ReadableMap,
|
|
363
|
-
remoteCryptoServicesTokenMap: ReadableMap
|
|
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
|
-
|
|
383
|
-
fun generateSignedJwt(
|
|
361
|
+
override fun generateSignedJwt(
|
|
384
362
|
jwtDescriptorMap: ReadableMap,
|
|
385
363
|
didJwkMap: ReadableMap,
|
|
386
|
-
remoteCryptoServicesTokenMap: ReadableMap
|
|
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
|
-
|
|
406
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
22
|
-
return
|
|
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
|
package/ios/VclReactNative.mm
CHANGED
|
@@ -1,93 +1,103 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
@
|
|
13
|
+
@implementation VclReactNative
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
15
|
+
//RCT_EXPORT_MODULE()
|
|
16
|
+
RCT_EXPORT_MODULE(VclAuthReactNative)
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
24
|
+
// MARK: - Spec methods (must match the generated header signatures)
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
- (void)getCountries:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
36
|
+
[VclReactNativeImpl.shared getCountriesWithResolve:resolve reject:reject];
|
|
37
|
+
}
|
|
27
38
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
39
|
+
- (void)getCredentialTypeSchemas:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
40
|
+
[VclReactNativeImpl.shared getCredentialTypeSchemasWithResolve:resolve reject:reject];
|
|
41
|
+
}
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
- (void)getCredentialTypes:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
44
|
+
[VclReactNativeImpl.shared getCredentialTypesWithResolve:resolve reject:reject];
|
|
45
|
+
}
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
- (void)getPresentationRequest:(NSDictionary *)presentationRequestDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
48
|
+
[VclReactNativeImpl.shared getPresentationRequestWithPresentationRequestDescriptorDictionary:presentationRequestDescriptor resolve:resolve reject:reject];
|
|
49
|
+
}
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
- (void)getCredentialManifest:(NSDictionary *)credentialManifestDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
60
|
+
[VclReactNativeImpl.shared getCredentialManifestWithCredentialManifestDescriptorDictionary:credentialManifestDescriptor resolve:resolve reject:reject];
|
|
61
|
+
}
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
- (void)getAuthToken:(NSDictionary *)authTokenDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
76
|
+
[VclReactNativeImpl.shared getAuthTokenWithAuthTokenDescriptorDictionary:authTokenDescriptor resolve:resolve reject:reject];
|
|
77
|
+
}
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
- (void)getCredentialTypesUIFormSchema:(NSDictionary *)credentialTypesUIFormSchemaDescriptor resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
80
|
+
[VclReactNativeImpl.shared getCredentialTypesUIFormSchemaWithCredentialTypesUIFormSchemaDescriptorDictionary:credentialTypesUIFormSchemaDescriptor resolve:resolve reject:reject];
|
|
81
|
+
}
|
|
70
82
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
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
|