@regulaforensics/idv 3.2.26-beta → 3.2.68-beta

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 (77) hide show
  1. package/README.md +2 -8
  2. package/RNIDV.podspec +3 -3
  3. package/android/CVDIDV.kt +3 -0
  4. package/android/build.gradle +2 -11
  5. package/android/cordova.gradle +2 -2
  6. package/android/src/main/java/com/regula/plugin/idv/JSONConstructor.kt +32 -0
  7. package/android/src/main/java/com/regula/plugin/idv/Main.kt +21 -1
  8. package/android/src/main/java/com/regula/plugin/idv/RNIDVModule.kt +3 -0
  9. package/examples/capacitor/android/build.gradle +1 -1
  10. package/examples/capacitor/index.tsx +5 -5
  11. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +4 -0
  12. package/examples/capacitor/package-lock.json +3350 -0
  13. package/examples/capacitor/package.json +7 -7
  14. package/examples/capacitor/src/main.html +9 -30
  15. package/examples/capacitor/src/main.tsx +115 -1
  16. package/examples/ionic/README.md +2 -2
  17. package/examples/ionic/config.xml +1 -0
  18. package/examples/ionic/index.tsx +5 -1
  19. package/examples/ionic/package-lock.json +16573 -0
  20. package/examples/ionic/package.json +19 -19
  21. package/examples/ionic/src/main.html +9 -30
  22. package/examples/ionic/src/main.tsx +115 -1
  23. package/examples/react_native/README.md +2 -2
  24. package/examples/react_native/index.html +5 -4
  25. package/examples/react_native/package-lock.json +8996 -0
  26. package/examples/react_native/package.json +7 -7
  27. package/examples/react_native/scripts/setup.sh +3 -0
  28. package/examples/react_native/src/main.html +9 -30
  29. package/examples/react_native/src/main.tsx +115 -1
  30. package/ios/CVDIDV.swift +24 -45
  31. package/ios/JSONConstructor.swift +24 -2
  32. package/ios/Main.swift +28 -12
  33. package/ios/RNIDV.m +11 -0
  34. package/ios/RNIDV.swift +30 -55
  35. package/ios/Utils.swift +0 -4
  36. package/package.json +1 -1
  37. package/plugin.xml +6 -5
  38. package/test/json.tsx +49 -0
  39. package/test/package-lock.json +1 -1
  40. package/test/test.tsx +14 -2
  41. package/www/capacitor/config/api_key_connection_config.js +32 -0
  42. package/www/capacitor/config/credentials_connection_config.js +32 -0
  43. package/www/capacitor/config/prepare_workflow_config.js +20 -0
  44. package/www/capacitor/config/send_data_config.js +28 -0
  45. package/www/capacitor/config/start_session_config.js +24 -0
  46. package/www/capacitor/config/start_workflow_config.js +24 -0
  47. package/www/capacitor/config/token_connection_config.js +20 -0
  48. package/www/capacitor/index.js +113 -1
  49. package/www/capacitor/internal/bridge.js +19 -8
  50. package/www/capacitor/model/workflow.js +28 -0
  51. package/www/capacitor/model/workflow_result.js +21 -0
  52. package/www/capacitor/model/workflow_step.js +19 -0
  53. package/www/cordova.js +559 -16
  54. package/www/react-native/config/api_key_connection_config.js +32 -0
  55. package/www/react-native/config/credentials_connection_config.js +32 -0
  56. package/www/react-native/config/prepare_workflow_config.js +20 -0
  57. package/www/react-native/config/send_data_config.js +28 -0
  58. package/www/react-native/config/start_session_config.js +24 -0
  59. package/www/react-native/config/start_workflow_config.js +24 -0
  60. package/www/react-native/config/token_connection_config.js +20 -0
  61. package/www/react-native/index.js +113 -1
  62. package/www/react-native/internal/bridge.js +19 -8
  63. package/www/react-native/model/workflow.js +28 -0
  64. package/www/react-native/model/workflow_result.js +21 -0
  65. package/www/react-native/model/workflow_step.js +19 -0
  66. package/www/types/config/api_key_connection_config.d.ts +6 -0
  67. package/www/types/config/credentials_connection_config.d.ts +6 -0
  68. package/www/types/config/prepare_workflow_config.d.ts +3 -0
  69. package/www/types/config/send_data_config.d.ts +5 -0
  70. package/www/types/config/start_session_config.d.ts +4 -0
  71. package/www/types/config/start_workflow_config.d.ts +4 -0
  72. package/www/types/config/token_connection_config.d.ts +3 -0
  73. package/www/types/index.d.ts +49 -0
  74. package/www/types/model/workflow.d.ts +9 -0
  75. package/www/types/model/workflow_result.d.ts +8 -0
  76. package/www/types/model/workflow_step.d.ts +6 -0
  77. package/ios/FlutterIDVPlugin.swift +0 -72
package/README.md CHANGED
@@ -3,16 +3,10 @@ IDV is a framework that unifies access to all Regula products. This plugin makes
3
3
 
4
4
  ## Android Integration
5
5
 
6
+ This step is only needed for ***React Native***
6
7
 
7
- TODO check this
8
-
9
-
10
- In order to use this plugin, in `android/app/build.gradle` add `kotlin-kapt` plugin and enable `dataBinding`:
8
+ In order to use this plugin, in `android/app/build.gradle` enable `dataBinding`:
11
9
  ```
12
- plugins {
13
- id "kotlin-kapt"
14
- }
15
-
16
10
  android {
17
11
  buildFeatures {
18
12
  dataBinding true
package/RNIDV.podspec CHANGED
@@ -5,7 +5,7 @@ source = File.join(__dir__, 'ios')
5
5
 
6
6
  Pod::Spec.new do |s|
7
7
  s.name = 'RNIDV'
8
- s.version = '3.2.26-beta'
8
+ s.version = '3.2.68-beta'
9
9
  s.summary = package['description']
10
10
  s.license = package['license']
11
11
 
@@ -14,8 +14,8 @@ Pod::Spec.new do |s|
14
14
 
15
15
  s.source = { http: "file:#{source}" }
16
16
  s.ios.deployment_target = '14.0'
17
- s.source_files = 'ios/**/*.{h,m}'
17
+ s.source_files = [ 'ios/**/*.swift', 'ios/**/RN*.m' ]
18
18
  s.exclude_files = [ 'ios/CVDIDV.swift' ]
19
- s.dependency 'IDVSDK', '3.1.1492'
19
+ s.dependency 'IDVSDK', '3.2.1670'
20
20
  s.dependency 'React'
21
21
  end
package/android/CVDIDV.kt CHANGED
@@ -1,5 +1,6 @@
1
1
  package com.regula.plugin.idv
2
2
 
3
+ import android.app.Activity
3
4
  import android.content.Context
4
5
  import android.util.Log
5
6
  import org.apache.cordova.CallbackContext
@@ -13,6 +14,8 @@ lateinit var args: JSONArray
13
14
  lateinit var binding: CordovaPlugin
14
15
  val context: Context
15
16
  get() = binding.cordova.context
17
+ val activity: Activity
18
+ get() = binding.cordova.activity
16
19
 
17
20
  fun sendEvent(callbackId: String, data: Any? = "") {
18
21
  val pluginResult = when (data) {
@@ -3,18 +3,11 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'kotlin-kapt'
4
4
 
5
5
  android {
6
- // Conditional for compatibility with AGP <4.2.
7
- if (project.android.hasProperty("namespace")) {
8
- namespace 'com.regula.plugin.idv'
9
- }
10
-
6
+ namespace 'com.regula.plugin.idv'
11
7
  compileSdk 36
12
8
 
13
9
  defaultConfig {
14
10
  minSdkVersion 24
15
- targetSdk 36
16
- versionCode 1
17
- versionName "1.0"
18
11
  }
19
12
 
20
13
  buildFeatures {
@@ -31,10 +24,8 @@ rootProject.allprojects {
31
24
  }
32
25
 
33
26
  dependencies {
34
- //noinspection GradleDynamicVersion
35
27
  implementation 'com.facebook.react:react-native:+'
36
- //noinspection GradleDependency
37
- implementation('com.regula.idv:api:3.1.90') {
28
+ implementation('com.regula.idv:api:3.2.101') {
38
29
  transitive = true
39
30
  }
40
31
  }
@@ -1,3 +1,4 @@
1
+ apply plugin: 'kotlin-android'
1
2
  apply plugin: 'kotlin-kapt'
2
3
 
3
4
  android {
@@ -13,8 +14,7 @@ repositories {
13
14
  }
14
15
 
15
16
  dependencies {
16
- //noinspection GradleDependency
17
- implementation('com.regula.idv:api:3.1.90') {
17
+ implementation('com.regula.idv:api:3.2.101') {
18
18
  transitive = true
19
19
  }
20
20
  }
@@ -5,6 +5,8 @@ package com.regula.plugin.idv
5
5
  import com.regula.idv.api.config.ApiKeyConnectionConfig
6
6
  import com.regula.idv.api.config.CredentialsConnectionConfig
7
7
  import com.regula.idv.api.config.PrepareWorkflowConfig
8
+ import com.regula.idv.api.config.SendDataConfig
9
+ import com.regula.idv.api.config.SessionConfig
8
10
  import com.regula.idv.api.config.StartWorkflowConfig
9
11
  import com.regula.idv.api.config.TokenConnectionConfig
10
12
  import com.regula.idv.api.models.WorkflowResult
@@ -84,6 +86,36 @@ fun generateStartWorkflowConfig(input: StartWorkflowConfig?) = input?.let {
84
86
  ).toJson()
85
87
  }
86
88
 
89
+ fun sendDataConfigFromJSON(input: JSONObject?) = input?.let {
90
+ SendDataConfig(
91
+ it.getString("sessionId"),
92
+ it.getString("step"),
93
+ it.getJSONObject("data")
94
+ )
95
+ }
96
+
97
+ fun generateSendDataConfig(input: SendDataConfig?) = input?.let {
98
+ mapOf(
99
+ "sessionId" to it.sessionId,
100
+ "step" to it.step,
101
+ "data" to it.data,
102
+ ).toJson()
103
+ }
104
+
105
+ fun startSessionConfigFromJSON(input: JSONObject?) = input?.let {
106
+ SessionConfig(
107
+ it.getString("workflowId"),
108
+ it.getJSONObjectOrNull("metadata")
109
+ )
110
+ }
111
+
112
+ fun generateStartSessionConfig(input: SessionConfig?) = input?.let {
113
+ mapOf(
114
+ "workflowId" to it.workflowId,
115
+ "metadata" to it.metadata,
116
+ ).toJson()
117
+ }
118
+
87
119
  // Model ------------------------------
88
120
 
89
121
  fun workflowFromJSON(input: JSONObject?) = input?.let {
@@ -29,6 +29,8 @@ fun methodCall(method: String, callback: Callback): Any = when (method) {
29
29
  "prepareWorkflow" -> prepareWorkflow(callback, args(0))
30
30
  "startWorkflow" -> startWorkflow(callback, argsNullable(0))
31
31
  "getWorkflows" -> getWorkflows(callback)
32
+ "startSession" -> startSession(args(0), callback)
33
+ "sendData" -> sendData(args(0), callback)
32
34
  else -> Unit
33
35
  }
34
36
 
@@ -99,7 +101,7 @@ fun prepareWorkflow(callback: Callback, data: JSONObject) = instance().prepareWo
99
101
  }
100
102
 
101
103
  fun startWorkflow(callback: Callback, data: JSONObject?) = instance().startWorkflow(
102
- context,
104
+ activity,
103
105
  startWorkflowConfigFromJSON(data)
104
106
  ) {
105
107
  generateCompletion(
@@ -115,6 +117,24 @@ fun getWorkflows(callback: Callback) = instance().getWorkflows {
115
117
  ).send(callback)
116
118
  }
117
119
 
120
+ fun startSession(config: JSONObject, callback: Callback) = instance().startSession(
121
+ startSessionConfigFromJSON(config)!!
122
+ ) {
123
+ generateCompletion(
124
+ it.getOrNull(),
125
+ it.exceptionOrNull() as BaseException?
126
+ ).send(callback)
127
+ }
128
+
129
+ fun sendData(config: JSONObject, callback: Callback) = instance().sendData(
130
+ sendDataConfigFromJSON(config)!!
131
+ ) {
132
+ generateCompletion(
133
+ it.isSuccess,
134
+ it.exceptionOrNull() as BaseException?
135
+ ).send(callback)
136
+ }
137
+
118
138
  // Weak references
119
139
  var listener = object : IdvSdkListener {
120
140
  override fun didStartSession() = sendEvent(didStartSessionEvent)
@@ -2,6 +2,7 @@
2
2
 
3
3
  package com.regula.plugin.idv
4
4
 
5
+ import android.app.Activity
5
6
  import android.content.Context
6
7
  import android.util.Log
7
8
  import com.facebook.react.ReactPackage
@@ -22,6 +23,8 @@ lateinit var args: JSONArray
22
23
  lateinit var binding: ReactContext
23
24
  val context: Context
24
25
  get() = binding.applicationContext
26
+ val activity: Activity
27
+ get() = binding.currentActivity!!
25
28
 
26
29
  fun sendEvent(event: String, data: Any? = "") {
27
30
  if (listenerCount <= 0) return
@@ -9,7 +9,7 @@ buildscript {
9
9
  dependencies {
10
10
  classpath 'com.android.tools.build:gradle:8.8.0'
11
11
  classpath 'com.google.gms:google-services:4.4.2'
12
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25"
12
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20"
13
13
 
14
14
  // NOTE: Do not place your application dependencies here; they belong
15
15
  // in the individual module build.gradle files
@@ -4,11 +4,11 @@ import { setupIonicReact } from '@ionic/react'
4
4
  import { StatusBar, Style } from '@capacitor/status-bar'
5
5
  import { main } from './src/main'
6
6
 
7
- document.addEventListener('deviceready', () => fetch("main.html")
8
- .then(response => response.text())
9
- .then(html => document.getElementById("content").innerHTML = html)
10
- .then(_ => document.dispatchEvent(new Event('ready')))
11
- )
7
+ document.addEventListener('deviceready', async () => {
8
+ document.getElementById("content").innerHTML = await fetch("main.html").then(r => r.text())
9
+ await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))
10
+ document.dispatchEvent(new Event('ready'))
11
+ })
12
12
 
13
13
  document.addEventListener('ready', main)
14
14
 
@@ -16,6 +16,7 @@
16
16
  50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
17
17
  A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; };
18
18
  C3C12F0D2DEDD3AA0068B75D /* db.dat in Resources */ = {isa = PBXBuildFile; fileRef = C3C12F0C2DEDD3AA0068B75D /* db.dat */; };
19
+ C3D68A432E9FF39D006194D2 /* regula.license in Resources */ = {isa = PBXBuildFile; fileRef = C3D68A422E9FF39D006194D2 /* regula.license */; };
19
20
  /* End PBXBuildFile section */
20
21
 
21
22
  /* Begin PBXFileReference section */
@@ -32,6 +33,7 @@
32
33
  AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; };
33
34
  AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = "<group>"; };
34
35
  C3C12F0C2DEDD3AA0068B75D /* db.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = db.dat; sourceTree = "<group>"; };
36
+ C3D68A422E9FF39D006194D2 /* regula.license */ = {isa = PBXFileReference; lastKnownFileType = file; path = regula.license; sourceTree = "<group>"; };
35
37
  FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = "<group>"; };
36
38
  /* End PBXFileReference section */
37
39
 
@@ -85,6 +87,7 @@
85
87
  504EC3131FED79650016851F /* Info.plist */,
86
88
  2FAD9762203C412B000D30F8 /* config.xml */,
87
89
  50B271D01FEDC1A000F3C39B /* public */,
90
+ C3D68A422E9FF39D006194D2 /* regula.license */,
88
91
  C3C12F0C2DEDD3AA0068B75D /* db.dat */,
89
92
  );
90
93
  path = App;
@@ -167,6 +170,7 @@
167
170
  504EC30D1FED79650016851F /* Main.storyboard in Resources */,
168
171
  2FAD9763203C412B000D30F8 /* config.xml in Resources */,
169
172
  C3C12F0D2DEDD3AA0068B75D /* db.dat in Resources */,
173
+ C3D68A432E9FF39D006194D2 /* regula.license in Resources */,
170
174
  );
171
175
  runOnlyForDeploymentPostprocessing = 0;
172
176
  };