@regulaforensics/idv 4.0.168-rc → 4.0.290-rc
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/Package.swift +27 -0
- package/README.md +3 -0
- package/android/CDVIDV.kt +5 -3
- package/android/build.gradle.kts +41 -0
- package/android/cordova.gradle.kts +20 -0
- package/android/src/main/{java → kotlin}/com/regula/plugin/idv/RNIDVModule.kt +3 -2
- package/app.plugin.js +10 -7
- package/examples/capacitor/README.md +4 -2
- package/examples/capacitor/android/app/build.gradle +2 -10
- package/examples/capacitor/android/build.gradle +12 -3
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/examples/capacitor/android/gradle.properties +4 -0
- package/examples/capacitor/android/gradlew +4 -7
- package/examples/capacitor/android/gradlew.bat +82 -94
- package/examples/capacitor/android/variables.gradle +13 -9
- package/examples/capacitor/capacitor.config.json +15 -0
- package/examples/capacitor/index.tsx +2 -7
- package/examples/capacitor/ios/App/App/AppDelegate.swift +5 -40
- package/examples/capacitor/ios/App/App/Info.plist +18 -2
- package/examples/capacitor/ios/App/App/SceneDelegate.swift +23 -0
- package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +25 -69
- package/examples/capacitor/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift +1 -0
- package/examples/capacitor/package-lock.json +392 -1493
- package/examples/capacitor/package.json +17 -18
- package/examples/capacitor/scripts/android.sh +5 -8
- package/examples/capacitor/scripts/ios.sh +5 -7
- package/examples/capacitor/scripts/setup.sh +2 -7
- package/examples/capacitor/src/main.css +5 -1
- package/examples/capacitor/src/main.tsx +51 -29
- package/examples/capacitor/vite.config.ts +0 -12
- package/examples/ionic/README.md +4 -2
- package/examples/ionic/config.xml +1 -1
- package/examples/ionic/index.tsx +8 -3
- package/examples/ionic/package-lock.json +8732 -7327
- package/examples/ionic/package.json +28 -25
- package/examples/ionic/scripts/android.sh +1 -3
- package/examples/ionic/scripts/ios.sh +3 -3
- package/examples/ionic/scripts/setup.sh +0 -2
- package/examples/ionic/src/main.tsx +51 -29
- package/examples/ionic/tsconfig.json +0 -1
- package/examples/react_native/README.md +5 -3
- package/examples/react_native/app.config.ts +4 -2
- package/examples/react_native/index.tsx +37 -7
- package/examples/react_native/metro.config.js +1 -3
- package/examples/react_native/package-lock.json +2074 -1328
- package/examples/react_native/package.json +19 -20
- package/examples/react_native/scripts/android.sh +1 -6
- package/examples/react_native/scripts/ios.sh +3 -9
- package/examples/react_native/scripts/setup.sh +2 -3
- package/examples/react_native/scripts/withoutMetroServer.js +86 -0
- package/examples/react_native/src/main.tsx +51 -29
- package/ios/CDVIDV.swift +23 -6
- package/ios/{Main.swift → Implementation.swift} +4 -4
- package/ios/RNIDV.swift +9 -3
- package/ios/Utils.swift +2 -0
- package/package.json +1 -1
- package/plugin.xml +10 -10
- package/react-native-idv.podspec +14 -0
- package/test/package-lock.json +2 -5
- package/test/test.tsx +26 -2
- package/www/capacitor/index.js +21 -3
- package/www/capacitor/internal/bridge.js +2 -1
- package/www/capacitor/internal/cordova.js +2 -2
- package/www/cordova.js +17 -40
- package/www/react-native/index.js +21 -3
- package/www/react-native/internal/bridge.js +2 -1
- package/www/types/index.d.ts +13 -2
- package/RNIDV.podspec +0 -21
- package/android/build.gradle +0 -32
- package/android/cordova.gradle +0 -20
- package/examples/capacitor/android/app/capacitor.build.gradle +0 -19
- package/examples/capacitor/android/capacitor.settings.gradle +0 -9
- package/examples/capacitor/ionic.config.json +0 -7
- package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +0 -19
- package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +0 -10
- package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/examples/capacitor/ios/App/Podfile +0 -29
- package/examples/capacitor/ios/App/Podfile.lock +0 -52
- package/examples/react_native/index.html +0 -12
- /package/android/src/main/{java/com/regula/plugin/idv/Main.kt → kotlin/com/regula/plugin/idv/Implementation.kt} +0 -0
- /package/android/src/main/{java → kotlin}/com/regula/plugin/idv/JSONConstructor.kt +0 -0
- /package/android/src/main/{java → kotlin}/com/regula/plugin/idv/Utils.kt +0 -0
|
@@ -6,23 +6,22 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/idv": "4.0.
|
|
10
|
-
"@regulaforensics/idv-module-document-reader": "4.0.
|
|
11
|
-
"@regulaforensics/idv-module-face": "4.0.
|
|
12
|
-
"@regulaforensics/document-reader-core-fullauthrfid": "9.
|
|
13
|
-
"@regulaforensics/face-core-basic": "8.
|
|
14
|
-
"@capacitor/cli": "^8.
|
|
15
|
-
"@capacitor/core": "^8.
|
|
16
|
-
"@capacitor/
|
|
17
|
-
"@capacitor/
|
|
18
|
-
"
|
|
19
|
-
"@capacitor/status-bar": "^8.0.0",
|
|
20
|
-
"@ionic/react": "^8.7.17",
|
|
21
|
-
"@vitejs/plugin-react": "^5.1.2",
|
|
22
|
-
"vite-plugin-static-copy": "^3.2.0",
|
|
23
|
-
"@types/react-router-dom": "^5.3.3"
|
|
9
|
+
"@regulaforensics/idv": "4.0.290-rc",
|
|
10
|
+
"@regulaforensics/idv-module-document-reader": "4.0.438-rc",
|
|
11
|
+
"@regulaforensics/idv-module-face": "4.0.439-rc",
|
|
12
|
+
"@regulaforensics/document-reader-core-fullauthrfid": "9.10.3518-rc",
|
|
13
|
+
"@regulaforensics/face-core-basic": "8.5.909-rc",
|
|
14
|
+
"@capacitor/cli": "^8.5.2",
|
|
15
|
+
"@capacitor/core": "^8.5.2",
|
|
16
|
+
"@capacitor/ios": "^8.5.2",
|
|
17
|
+
"@capacitor/android": "^8.5.2",
|
|
18
|
+
"vite": "^8.3.0"
|
|
24
19
|
},
|
|
25
20
|
"overrides": {
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
}
|
|
21
|
+
"xcode": {
|
|
22
|
+
"uuid": "^11.1.1"
|
|
23
|
+
},
|
|
24
|
+
"source-map-js": "^1.2.2"
|
|
25
|
+
},
|
|
26
|
+
"type": "module"
|
|
27
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -e
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
fi
|
|
10
|
-
|
|
11
|
-
exit 0
|
|
4
|
+
vite build
|
|
5
|
+
npx cap sync android
|
|
6
|
+
[[ " $* " == *" --open "* || " $* " == *" -o "* ]] &&
|
|
7
|
+
npx cap open android ||
|
|
8
|
+
npx cap run android --no-sync
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -e
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exit 0
|
|
4
|
+
vite build
|
|
5
|
+
npx cap sync ios
|
|
6
|
+
[[ " $* " == *" --open "* || " $* " == *" -o "* ]] &&
|
|
7
|
+
npx cap open ios ||
|
|
8
|
+
npx cap run ios --no-sync
|
|
@@ -2,15 +2,10 @@
|
|
|
2
2
|
set -e
|
|
3
3
|
|
|
4
4
|
npm install
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
pod update
|
|
8
|
-
cd ../../
|
|
9
|
-
}
|
|
5
|
+
vite build
|
|
6
|
+
npx cap sync
|
|
10
7
|
|
|
11
8
|
cp public/assets/regula.license ios/App/App/
|
|
12
9
|
cp public/assets/db.dat ios/App/App/
|
|
13
10
|
cp public/assets/regula.license android/app/src/main/assets/Regula/
|
|
14
11
|
cp public/assets/db.dat android/app/src/main/assets/Regula/
|
|
15
|
-
|
|
16
|
-
exit 0
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
html,
|
|
2
2
|
body {
|
|
3
3
|
margin: 0;
|
|
4
|
+
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, sans-serif;
|
|
4
5
|
width: 100%;
|
|
5
6
|
height: 99vh;
|
|
6
7
|
display: flex;
|
|
@@ -145,4 +146,7 @@ input[type="text"] {
|
|
|
145
146
|
height: 20px;
|
|
146
147
|
background-color: #4285F4;
|
|
147
148
|
border-radius: 5px;
|
|
148
|
-
}
|
|
149
|
+
}
|
|
150
|
+
* {
|
|
151
|
+
box-sizing: border-box;
|
|
152
|
+
}
|
|
@@ -3,35 +3,71 @@ import { IDV, Workflow } from '@regulaforensics/idv'
|
|
|
3
3
|
enum Configuration { credentials, token, apiKey }
|
|
4
4
|
|
|
5
5
|
const loginType: Configuration = Configuration.credentials
|
|
6
|
-
const baseUrl = "https://idv.
|
|
6
|
+
const baseUrl = "https://app.idv-platform.com"
|
|
7
7
|
const username = "username_placeholder"
|
|
8
8
|
const password = "password_placeholder"
|
|
9
9
|
const tokenUrl = "token_placeholder"
|
|
10
10
|
const apiKey = "api_key_placeholder"
|
|
11
11
|
|
|
12
|
-
var idv = IDV.instance
|
|
13
12
|
var selectedWorkflow = ""
|
|
14
|
-
|
|
13
|
+
|
|
14
|
+
var idv = IDV.instance
|
|
15
|
+
var workflowFilter: string[] = []
|
|
15
16
|
|
|
16
17
|
async function init() {
|
|
18
|
+
setStatus("Initializing...")
|
|
17
19
|
var [_, iError] = await idv.initialize()
|
|
18
20
|
if (handleException(iError, "initialize")) return
|
|
19
21
|
|
|
20
|
-
var
|
|
22
|
+
var login = ({
|
|
21
23
|
[Configuration.credentials]: async () => await configureWithCredentials(),
|
|
22
24
|
[Configuration.token]: async () => await configureWithToken(),
|
|
23
25
|
[Configuration.apiKey]: async () => await configureApiKey(),
|
|
24
26
|
})[loginType]!
|
|
25
|
-
if (!await
|
|
27
|
+
if (!await login()) return
|
|
28
|
+
|
|
29
|
+
if (selectedWorkflow.length > 0) {
|
|
30
|
+
workflowFilter = [] // Reset the filter in case both workflow and filter are specified.
|
|
31
|
+
// Show a list of 1 element just to show the workflow name.
|
|
32
|
+
var workflow = await prepareSelectedWorkflow()
|
|
33
|
+
if (workflow != null) setWorkflows([workflow])
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
if (workflowFilter.length > 0) {
|
|
37
|
+
showWorkflowList()
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
setStatus("No workflow selected!")
|
|
41
|
+
setDescription("Manually set `selectedWorkflow` to your workflow ID")
|
|
42
|
+
}
|
|
26
43
|
|
|
27
|
-
|
|
44
|
+
async function showWorkflowList() {
|
|
45
|
+
setStatus("Fetching workflows...")
|
|
46
|
+
let [wfs, error] = await idv.getWorkflows()
|
|
28
47
|
if (handleException(error, "getWorkflows")) return
|
|
29
|
-
|
|
30
|
-
|
|
48
|
+
wfs = workflowFilter.flatMap(id => wfs!.filter(wf => wf.id === id))
|
|
49
|
+
if (wfs.length > 0) {
|
|
50
|
+
setWorkflows(wfs)
|
|
51
|
+
return
|
|
31
52
|
}
|
|
53
|
+
setStatus("Empty workflow list!")
|
|
54
|
+
setDescription("No workflows remain after filtration")
|
|
55
|
+
}
|
|
32
56
|
|
|
33
|
-
|
|
34
|
-
setStatus("
|
|
57
|
+
async function prepareSelectedWorkflow() {
|
|
58
|
+
setStatus("Preparing Workflow...")
|
|
59
|
+
const [workflow, prepareError] = await idv.prepareWorkflow({ workflowId: selectedWorkflow })
|
|
60
|
+
handleException(prepareError, "prepareWorkflow")
|
|
61
|
+
return workflow
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function startWorkflow(): Promise<void> {
|
|
65
|
+
// If workflow is chosen from the list then it's not prepared yet.
|
|
66
|
+
if (workflowFilter.length > 0 && await prepareSelectedWorkflow() == null) return
|
|
67
|
+
var [result, error] = await idv.startWorkflow()
|
|
68
|
+
if (handleException(error, "startWorkflow")) return
|
|
69
|
+
setStatus("Success")
|
|
70
|
+
setDescription(`SessionID: ${result?.sessionId}`)
|
|
35
71
|
}
|
|
36
72
|
|
|
37
73
|
async function configureWithCredentials(): Promise<boolean> {
|
|
@@ -45,9 +81,10 @@ async function configureWithCredentials(): Promise<boolean> {
|
|
|
45
81
|
}
|
|
46
82
|
|
|
47
83
|
async function configureWithToken(): Promise<boolean> {
|
|
48
|
-
var [
|
|
84
|
+
var [workflowIds, error] = await idv.configureWithToken({ url: tokenUrl })
|
|
49
85
|
if (handleException(error, "configureWithToken")) return false
|
|
50
|
-
|
|
86
|
+
// Filter the IDs to the ones allowed by the token.
|
|
87
|
+
workflowFilter = workflowFilter.filter(wf => workflowIds!.includes(wf))
|
|
51
88
|
return true
|
|
52
89
|
}
|
|
53
90
|
|
|
@@ -57,20 +94,6 @@ async function configureApiKey(): Promise<boolean> {
|
|
|
57
94
|
return success
|
|
58
95
|
}
|
|
59
96
|
|
|
60
|
-
async function startWorkflow(): Promise<void> {
|
|
61
|
-
if (selectedWorkflow.length == 0) return
|
|
62
|
-
setStatus("Preparing Workflow...")
|
|
63
|
-
|
|
64
|
-
var [_, prepareError] = await idv.prepareWorkflow({ workflowId: selectedWorkflow })
|
|
65
|
-
if (handleException(prepareError, "prepareWorkflow")) return
|
|
66
|
-
|
|
67
|
-
var [result, error] = await idv.startWorkflow()
|
|
68
|
-
if (handleException(error, "startWorkflow")) return
|
|
69
|
-
|
|
70
|
-
setStatus("Success")
|
|
71
|
-
setDescription(`SessionID: ${result?.sessionId}`)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
97
|
function handleException(error?: string | null, tag?: string): boolean {
|
|
75
98
|
if (error == null) return false
|
|
76
99
|
setStatus(`Error - IDV.${tag}()`)
|
|
@@ -97,9 +120,8 @@ var workflows: Workflow[] = []
|
|
|
97
120
|
function setWorkflows(data: Workflow[]) {
|
|
98
121
|
var radioGroup = document.getElementById("radio-group")!
|
|
99
122
|
workflows = data
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
123
|
+
selectedWorkflow = workflows[0].id
|
|
124
|
+
setStatus("Ready")
|
|
103
125
|
|
|
104
126
|
data.forEach(item => {
|
|
105
127
|
var checked = selectedWorkflow == item.id ? "checked" : ""
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import react from '@vitejs/plugin-react'
|
|
2
1
|
import { defineConfig } from 'vite'
|
|
3
|
-
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
|
4
2
|
|
|
5
3
|
export default defineConfig({
|
|
6
|
-
plugins: [
|
|
7
|
-
react(),
|
|
8
|
-
viteStaticCopy({
|
|
9
|
-
targets: [
|
|
10
|
-
{
|
|
11
|
-
src: 'src/main.html',
|
|
12
|
-
dest: '.'
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
})],
|
|
16
4
|
build: { outDir: 'www' }
|
|
17
5
|
})
|
package/examples/ionic/README.md
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# Regula IDV Ionic demo application
|
|
2
2
|
|
|
3
|
+
Requires Node.js 22+, Xcode 26+, Android Studio with JDK 17 and Android SDK 36.
|
|
4
|
+
|
|
3
5
|
## How to build demo application
|
|
4
6
|
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-idv.git`.
|
|
5
7
|
2. Put `regula.license` file at `assets/` (you can get a trial license [here](https://client.regulaforensics.com)).
|
|
6
8
|
3. Put `db.dat` file at `assets/` (you can get a trial database [here](https://client.regulaforensics.com/customer/databases))
|
|
7
9
|
4. Execute `npm run setup` within this directory.
|
|
8
|
-
5. In `src/main.tsx` choose prefered login configuration(`loginType` variable) and provide your login data according to it: username and password for `credentials`, tokenUrl for `token`, apiKey for `apiKey`.
|
|
10
|
+
5. In `src/main.tsx` choose prefered login configuration(`loginType` variable) and provide your login data according to it: username and password for `credentials`, tokenUrl for `token`, apiKey for `apiKey`. Then set your workflow ID(`selectedWorkflow` variable).
|
|
9
11
|
6. Run the app:
|
|
10
12
|
* IOS: `npm run ios`.
|
|
11
13
|
* Android: `npm run android`.
|
|
12
|
-
7. After initialization
|
|
14
|
+
7. After initialization click the **Start Workflow** button.
|
|
13
15
|
8. Complete workflow and get your session id.
|
|
14
16
|
|
|
15
17
|
**Note**: `npm run ios`/`npm run android` is just one way of running the app. You can also pass `-- -o` or `-- --open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE.
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<platform name="ios">
|
|
22
22
|
<resource-file src="assets/regula.license" />
|
|
23
23
|
<resource-file src="assets/db.dat" />
|
|
24
|
-
<preference name="deployment-target" value="
|
|
24
|
+
<preference name="deployment-target" value="15.0" />
|
|
25
25
|
<preference name="orientation" value="portrait" />
|
|
26
26
|
<allow-intent href="itms:*" />
|
|
27
27
|
<allow-intent href="itms-apps:*" />
|
package/examples/ionic/index.tsx
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import 'zone.js';
|
|
2
2
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
|
|
3
3
|
import { BrowserModule } from '@angular/platform-browser'
|
|
4
|
-
import { IonicModule
|
|
5
|
-
import {
|
|
4
|
+
import { IonicModule } from '@ionic/angular/lazy'
|
|
5
|
+
import { Platform } from '@ionic/angular'
|
|
6
|
+
import { NgModule, provideZoneChangeDetection } from '@angular/core'
|
|
6
7
|
import { Component } from '@angular/core'
|
|
7
8
|
|
|
8
9
|
import { main } from './src/main'
|
|
9
10
|
|
|
10
11
|
@Component({
|
|
11
12
|
selector: 'app-root',
|
|
13
|
+
standalone: false,
|
|
12
14
|
templateUrl: 'src/main.html',
|
|
13
15
|
styleUrl: 'src/main.css'
|
|
14
16
|
})
|
|
@@ -24,9 +26,12 @@ class Main {
|
|
|
24
26
|
|
|
25
27
|
@NgModule({
|
|
26
28
|
bootstrap: [Main],
|
|
29
|
+
declarations: [Main],
|
|
27
30
|
providers: [Platform],
|
|
28
31
|
imports: [BrowserModule, IonicModule.forRoot()]
|
|
29
32
|
})
|
|
30
33
|
class MainModule { }
|
|
31
34
|
|
|
32
|
-
platformBrowserDynamic().bootstrapModule(MainModule
|
|
35
|
+
platformBrowserDynamic().bootstrapModule(MainModule, {
|
|
36
|
+
applicationProviders: [provideZoneChangeDetection()]
|
|
37
|
+
})
|