@regulaforensics/idv 3.10.230-beta → 3.10.239-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 +1 -1
- package/android/build.gradle.kts +1 -1
- package/android/cordova.gradle.kts +1 -1
- package/examples/capacitor/README.md +2 -2
- package/examples/capacitor/package-lock.json +2517 -0
- package/examples/capacitor/package.json +5 -5
- package/examples/capacitor/src/main.tsx +50 -28
- package/examples/ionic/README.md +2 -2
- package/examples/ionic/package-lock.json +14067 -0
- package/examples/ionic/package.json +5 -5
- package/examples/ionic/src/main.tsx +50 -28
- package/examples/react_native/README.md +2 -2
- package/examples/react_native/package-lock.json +7258 -0
- package/examples/react_native/package.json +9 -6
- package/examples/react_native/scripts/android.sh +6 -4
- package/examples/react_native/scripts/ios.sh +5 -3
- package/examples/react_native/scripts/setup.sh +3 -0
- package/examples/react_native/src/main.tsx +50 -28
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/react-native-idv.podspec +2 -2
- package/test/package-lock.json +1 -1
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/idv": "3.10.
|
|
10
|
-
"@regulaforensics/idv-module-document-reader": "3.10.
|
|
11
|
-
"@regulaforensics/idv-module-face": "3.10.
|
|
12
|
-
"@regulaforensics/document-reader-core-fullauthrfid": "9.9.
|
|
13
|
-
"@regulaforensics/face-core-basic": "8.4.
|
|
9
|
+
"@regulaforensics/idv": "3.10.239-rc",
|
|
10
|
+
"@regulaforensics/idv-module-document-reader": "3.10.288-rc",
|
|
11
|
+
"@regulaforensics/idv-module-face": "3.10.289-rc",
|
|
12
|
+
"@regulaforensics/document-reader-core-fullauthrfid": "9.9.3273-rc",
|
|
13
|
+
"@regulaforensics/face-core-basic": "8.4.877-rc",
|
|
14
14
|
"@capacitor/cli": "^8.5.2",
|
|
15
15
|
"@capacitor/core": "^8.5.2",
|
|
16
16
|
"@capacitor/ios": "^8.5.2",
|
|
@@ -9,29 +9,65 @@ 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" : ""
|
package/examples/ionic/README.md
CHANGED
|
@@ -7,11 +7,11 @@ Requires Node.js 22+, Xcode 26+, Android Studio with JDK 17 and Android SDK 36.
|
|
|
7
7
|
2. Put `regula.license` file at `assets/` (you can get a trial license [here](https://client.regulaforensics.com)).
|
|
8
8
|
3. Put `db.dat` file at `assets/` (you can get a trial database [here](https://client.regulaforensics.com/customer/databases))
|
|
9
9
|
4. Execute `npm run setup` within this directory.
|
|
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`.
|
|
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).
|
|
11
11
|
6. Run the app:
|
|
12
12
|
* IOS: `npm run ios`.
|
|
13
13
|
* Android: `npm run android`.
|
|
14
|
-
7. After initialization
|
|
14
|
+
7. After initialization click the **Start Workflow** button.
|
|
15
15
|
8. Complete workflow and get your session id.
|
|
16
16
|
|
|
17
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.
|