@regulaforensics/idv 3.2.1-nightly

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 (140) hide show
  1. package/README.md +30 -0
  2. package/RNIDV.podspec +21 -0
  3. package/android/CVDIDV.kt +48 -0
  4. package/android/build.gradle +32 -0
  5. package/android/cordova.gradle +20 -0
  6. package/android/src/main/java/com/regula/plugin/idv/JSONConstructor.kt +135 -0
  7. package/android/src/main/java/com/regula/plugin/idv/Main.kt +124 -0
  8. package/android/src/main/java/com/regula/plugin/idv/RNIDVModule.kt +71 -0
  9. package/android/src/main/java/com/regula/plugin/idv/Utils.kt +60 -0
  10. package/examples/capacitor/README.md +15 -0
  11. package/examples/capacitor/android/app/build.gradle +50 -0
  12. package/examples/capacitor/android/app/capacitor.build.gradle +22 -0
  13. package/examples/capacitor/android/app/proguard-rules.pro +21 -0
  14. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +26 -0
  15. package/examples/capacitor/android/app/src/main/assets/Regula/.gitkeep +0 -0
  16. package/examples/capacitor/android/app/src/main/java/com/regula/example/idv/capacitor/MainActivity.java +5 -0
  17. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher.png +0 -0
  18. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_foreground.png +0 -0
  19. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_round.png +0 -0
  20. package/examples/capacitor/android/app/src/main/res/drawable/launcher.xml +4 -0
  21. package/examples/capacitor/android/app/src/main/res/drawable/launcher_round.xml +4 -0
  22. package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
  23. package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
  24. package/examples/capacitor/android/app/src/main/res/values/styles.xml +22 -0
  25. package/examples/capacitor/android/build.gradle +30 -0
  26. package/examples/capacitor/android/capacitor.settings.gradle +15 -0
  27. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  28. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  29. package/examples/capacitor/android/gradle.properties +22 -0
  30. package/examples/capacitor/android/gradlew +252 -0
  31. package/examples/capacitor/android/gradlew.bat +94 -0
  32. package/examples/capacitor/android/settings.gradle +5 -0
  33. package/examples/capacitor/android/variables.gradle +16 -0
  34. package/examples/capacitor/index.html +5 -0
  35. package/examples/capacitor/index.tsx +16 -0
  36. package/examples/capacitor/ionic.config.json +7 -0
  37. package/examples/capacitor/ios/App/App/App.entitlements +10 -0
  38. package/examples/capacitor/ios/App/App/AppDelegate.swift +49 -0
  39. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  40. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  41. package/examples/capacitor/ios/App/App/Assets.xcassets/Contents.json +6 -0
  42. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  43. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  44. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  45. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  46. package/examples/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  47. package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +19 -0
  48. package/examples/capacitor/ios/App/App/Info.plist +65 -0
  49. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +418 -0
  50. package/examples/capacitor/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  51. package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
  52. package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  53. package/examples/capacitor/ios/App/Podfile +26 -0
  54. package/examples/capacitor/package-lock.json +3350 -0
  55. package/examples/capacitor/package.json +27 -0
  56. package/examples/capacitor/public/assets/.gitkeep +0 -0
  57. package/examples/capacitor/scripts/android.sh +9 -0
  58. package/examples/capacitor/scripts/ios.sh +8 -0
  59. package/examples/capacitor/scripts/setup.sh +14 -0
  60. package/examples/capacitor/src/main.css +148 -0
  61. package/examples/capacitor/src/main.html +17 -0
  62. package/examples/capacitor/src/main.tsx +124 -0
  63. package/examples/capacitor/tsconfig.json +5 -0
  64. package/examples/capacitor/vite.config.ts +17 -0
  65. package/examples/ionic/README.md +15 -0
  66. package/examples/ionic/angular.json +39 -0
  67. package/examples/ionic/assets/.gitkeep +0 -0
  68. package/examples/ionic/config.xml +60 -0
  69. package/examples/ionic/images/icon.png +0 -0
  70. package/examples/ionic/index.html +19 -0
  71. package/examples/ionic/index.tsx +32 -0
  72. package/examples/ionic/ionic.config.json +7 -0
  73. package/examples/ionic/package-lock.json +14261 -0
  74. package/examples/ionic/package.json +46 -0
  75. package/examples/ionic/scripts/android.sh +8 -0
  76. package/examples/ionic/scripts/ios.sh +8 -0
  77. package/examples/ionic/scripts/setup.sh +8 -0
  78. package/examples/ionic/src/main.css +148 -0
  79. package/examples/ionic/src/main.html +17 -0
  80. package/examples/ionic/src/main.tsx +124 -0
  81. package/examples/ionic/tsconfig.json +14 -0
  82. package/examples/react_native/README.md +15 -0
  83. package/examples/react_native/app.config.ts +46 -0
  84. package/examples/react_native/assets/.gitkeep +0 -0
  85. package/examples/react_native/images/icon.png +0 -0
  86. package/examples/react_native/index.html +12 -0
  87. package/examples/react_native/index.tsx +63 -0
  88. package/examples/react_native/metro.config.js +7 -0
  89. package/examples/react_native/package-lock.json +8996 -0
  90. package/examples/react_native/package.json +29 -0
  91. package/examples/react_native/scripts/android.sh +13 -0
  92. package/examples/react_native/scripts/ios.sh +12 -0
  93. package/examples/react_native/scripts/setup.sh +12 -0
  94. package/examples/react_native/src/main.css +148 -0
  95. package/examples/react_native/src/main.html +17 -0
  96. package/examples/react_native/src/main.tsx +124 -0
  97. package/ios/CVDIDV.swift +51 -0
  98. package/ios/JSONConstructor.swift +132 -0
  99. package/ios/Main.swift +91 -0
  100. package/ios/RNIDV.m +11 -0
  101. package/ios/RNIDV.swift +47 -0
  102. package/ios/Utils.swift +52 -0
  103. package/package.json +38 -0
  104. package/plugin.xml +46 -0
  105. package/test/json.tsx +40 -0
  106. package/test/package-lock.json +584 -0
  107. package/test/package.json +9 -0
  108. package/test/test.tsx +13 -0
  109. package/test/utils.tsx +38 -0
  110. package/www/capacitor/config/api_key_connection_config.js +32 -0
  111. package/www/capacitor/config/credentials_connection_config.js +32 -0
  112. package/www/capacitor/config/prepare_workflow_config.js +20 -0
  113. package/www/capacitor/config/start_workflow_config.js +24 -0
  114. package/www/capacitor/config/token_connection_config.js +20 -0
  115. package/www/capacitor/index.js +110 -0
  116. package/www/capacitor/internal/bridge.js +30 -0
  117. package/www/capacitor/internal/cordova.js +17 -0
  118. package/www/capacitor/model/workflow.js +28 -0
  119. package/www/capacitor/model/workflow_result.js +21 -0
  120. package/www/capacitor/model/workflow_step.js +19 -0
  121. package/www/cordova.js +595 -0
  122. package/www/react-native/config/api_key_connection_config.js +32 -0
  123. package/www/react-native/config/credentials_connection_config.js +32 -0
  124. package/www/react-native/config/prepare_workflow_config.js +20 -0
  125. package/www/react-native/config/start_workflow_config.js +24 -0
  126. package/www/react-native/config/token_connection_config.js +20 -0
  127. package/www/react-native/index.js +110 -0
  128. package/www/react-native/internal/bridge.js +30 -0
  129. package/www/react-native/model/workflow.js +28 -0
  130. package/www/react-native/model/workflow_result.js +21 -0
  131. package/www/react-native/model/workflow_step.js +19 -0
  132. package/www/types/config/api_key_connection_config.d.ts +6 -0
  133. package/www/types/config/credentials_connection_config.d.ts +6 -0
  134. package/www/types/config/prepare_workflow_config.d.ts +3 -0
  135. package/www/types/config/start_workflow_config.d.ts +4 -0
  136. package/www/types/config/token_connection_config.d.ts +3 -0
  137. package/www/types/index.d.ts +62 -0
  138. package/www/types/model/workflow.d.ts +9 -0
  139. package/www/types/model/workflow_result.d.ts +8 -0
  140. package/www/types/model/workflow_step.d.ts +6 -0
@@ -0,0 +1,52 @@
1
+ public typealias Callback = (Any?) -> Void
2
+
3
+ extension Any? {
4
+ func toSendable() -> Any {
5
+ guard let self else { return NSNull() }
6
+ if self is [String: Any?] || self is [Any?] {
7
+ let data = try! JSONSerialization.data(withJSONObject: fixNulls(self), options: .prettyPrinted)
8
+ return String(data: data, encoding: .utf8)!
9
+ }
10
+ return self
11
+ }
12
+ }
13
+
14
+ func fixNulls(_ value: Any?) -> Any {
15
+ guard let value else { return NSNull() }
16
+ switch value {
17
+ case let value as [String: Any?]:
18
+ var dict = [String: Any]()
19
+ for (k, v) in value { dict[k] = fixNulls(v) }
20
+ return dict
21
+ case let value as [Any?]: return value.map { fixNulls($0) }
22
+ default: return value
23
+ }
24
+ }
25
+
26
+ extension [String: Any?] {
27
+ func toDecoder() -> Decoder {
28
+ let data = try! JSONSerialization.data(withJSONObject: fixNulls(self), options: .prettyPrinted)
29
+ return try! JSONDecoder().decode(DecoderWrapper.self, from: data).decoder
30
+ }
31
+ }
32
+ struct DecoderWrapper: Decodable {
33
+ let decoder: Decoder
34
+ init(from decoder: Decoder) { self.decoder = decoder }
35
+ }
36
+
37
+ extension Result {
38
+ var successOrNil: Success? {
39
+ if case .success(let value) = self { return value }
40
+ else { return nil }
41
+ }
42
+
43
+ var failureOrNil: Failure? {
44
+ if case .failure(let error) = self { return error }
45
+ else { return nil }
46
+ }
47
+
48
+ var isSuccess: Bool {
49
+ if case .success = self { return true }
50
+ else { return false }
51
+ }
52
+ }
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@regulaforensics/idv",
3
+ "version": "3.2.1-nightly",
4
+ "description": "This is an npm module for Regula IDV, which unifies access to all Regula products. This plugin makes possible to use it with react-native, cordova and capacitor applications. Supports Android and iOS.",
5
+ "main": "www/react-native/index.js",
6
+ "module": "www/capacitor/index.js",
7
+ "types": "www/types/index.d.ts",
8
+ "cordova": {
9
+ "id": "@regulaforensics/idv",
10
+ "platforms": [
11
+ "ios",
12
+ "android"
13
+ ]
14
+ },
15
+ "keywords": [
16
+ "react",
17
+ "react-native",
18
+ "ionic",
19
+ "capacitor",
20
+ "cordova",
21
+ "face",
22
+ "reader",
23
+ "scanner",
24
+ "regula",
25
+ "platform",
26
+ "idv"
27
+ ],
28
+ "author": "RegulaForensics",
29
+ "license": "commercial",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/regulaforensics/npm-idv.git"
33
+ },
34
+ "homepage": "https://mobile.regulaforensics.com",
35
+ "publishConfig": {
36
+ "access": "public"
37
+ }
38
+ }
package/plugin.xml ADDED
@@ -0,0 +1,46 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <plugin id="@regulaforensics/idv" version="3.2.1-nightly" xmlns="http://apache.org/cordova/ns/plugins/1.0">
3
+ <name>IDV</name>
4
+ <description>Cordova plugin for Regula IDV</description>
5
+ <license>commercial</license>
6
+ <keywords>cordova,face,reader,scanner,regula,platform,idv</keywords>
7
+
8
+ <js-module name="IDVPlugin" src="www/cordova.js">
9
+ <clobbers target="IDVPlugin" />
10
+ </js-module>
11
+
12
+ <platform name="ios">
13
+ <config-file target="config.xml" parent="/widget">
14
+ <feature name="IDV">
15
+ <param name="ios-package" value="CVDIDV" />
16
+ </feature>
17
+ <preference name="deployment-target" value="14.0" />
18
+ <preference name="SwiftVersion" value="5" />
19
+ </config-file>
20
+ <source-file src="ios/CVDIDV.swift" />
21
+ <source-file src="ios/Main.swift" />
22
+ <source-file src="ios/JSONConstructor.swift" />
23
+ <source-file src="ios/Utils.swift" />
24
+ <podspec>
25
+ <config>
26
+ <source url="https://github.com/CocoaPods/Specs.git" />
27
+ </config>
28
+ <pods>
29
+ <pod name="IDVSDKNightly" spec="0.1.184" />
30
+ </pods>
31
+ </podspec>
32
+ </platform>
33
+
34
+ <platform name="android">
35
+ <config-file parent="/*" target="res/xml/config.xml">
36
+ <feature name="IDV">
37
+ <param name="android-package" value="com.regula.plugin.idv.CVDIDV" />
38
+ </feature>
39
+ </config-file>
40
+ <framework src="android/cordova.gradle" custom="true" type="gradleReference" />
41
+ <source-file src="android/CVDIDV.kt" target-dir="java/com.regula.plugin.idv" />
42
+ <source-file src="android/src/main/java/com/regula/plugin/idv/Main.kt" target-dir="java/com.regula.plugin.idv" />
43
+ <source-file src="android/src/main/java/com/regula/plugin/idv/JSONConstructor.kt" target-dir="java/com.regula.plugin.idv" />
44
+ <source-file src="android/src/main/java/com/regula/plugin/idv/Utils.kt" target-dir="java/com.regula.plugin.idv" />
45
+ </platform>
46
+ </plugin>
package/test/json.tsx ADDED
@@ -0,0 +1,40 @@
1
+ export var credentialsConnectionConfig = {
2
+ "baseUrl": "test3",
3
+ "userName": "test1",
4
+ "password": "test2",
5
+ "httpTimeoutMs": 1,
6
+ }
7
+ export var tokenConnectionConfig = {
8
+ "url": "test1",
9
+ }
10
+ export var apiKeyConnectionConfig = {
11
+ "baseUrl": "test1",
12
+ "apiKey": "test2",
13
+ "ttl": 1,
14
+ "httpTimeoutMs": 2,
15
+ }
16
+ export var prepareWorkflowConfig = {
17
+ "workflowId": "test1",
18
+ }
19
+ export var startWorkflowConfig = {
20
+ "locale": "test1",
21
+ "metadata": {
22
+ "test2": "test3",
23
+ },
24
+ }
25
+
26
+ export var workflow = {
27
+ "id": "test1",
28
+ "name": "test2",
29
+ "version": "test3",
30
+ "description": "test4",
31
+ "defaultLocale": "test5",
32
+ }
33
+ export var workflowStep = {
34
+ "id": "test1",
35
+ "name": "test2",
36
+ }
37
+ export var workflowResult = {
38
+ "sessionId": "test1",
39
+ "finalStep": workflowStep,
40
+ }