@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.
- package/README.md +2 -8
- package/RNIDV.podspec +3 -3
- package/android/CVDIDV.kt +3 -0
- package/android/build.gradle +2 -11
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/idv/JSONConstructor.kt +32 -0
- package/android/src/main/java/com/regula/plugin/idv/Main.kt +21 -1
- package/android/src/main/java/com/regula/plugin/idv/RNIDVModule.kt +3 -0
- package/examples/capacitor/android/build.gradle +1 -1
- package/examples/capacitor/index.tsx +5 -5
- package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +4 -0
- package/examples/capacitor/package-lock.json +3350 -0
- package/examples/capacitor/package.json +7 -7
- package/examples/capacitor/src/main.html +9 -30
- package/examples/capacitor/src/main.tsx +115 -1
- package/examples/ionic/README.md +2 -2
- package/examples/ionic/config.xml +1 -0
- package/examples/ionic/index.tsx +5 -1
- package/examples/ionic/package-lock.json +16573 -0
- package/examples/ionic/package.json +19 -19
- package/examples/ionic/src/main.html +9 -30
- package/examples/ionic/src/main.tsx +115 -1
- package/examples/react_native/README.md +2 -2
- package/examples/react_native/index.html +5 -4
- package/examples/react_native/package-lock.json +8996 -0
- package/examples/react_native/package.json +7 -7
- package/examples/react_native/scripts/setup.sh +3 -0
- package/examples/react_native/src/main.html +9 -30
- package/examples/react_native/src/main.tsx +115 -1
- package/ios/CVDIDV.swift +24 -45
- package/ios/JSONConstructor.swift +24 -2
- package/ios/Main.swift +28 -12
- package/ios/RNIDV.m +11 -0
- package/ios/RNIDV.swift +30 -55
- package/ios/Utils.swift +0 -4
- package/package.json +1 -1
- package/plugin.xml +6 -5
- package/test/json.tsx +49 -0
- package/test/package-lock.json +1 -1
- package/test/test.tsx +14 -2
- package/www/capacitor/config/api_key_connection_config.js +32 -0
- package/www/capacitor/config/credentials_connection_config.js +32 -0
- package/www/capacitor/config/prepare_workflow_config.js +20 -0
- package/www/capacitor/config/send_data_config.js +28 -0
- package/www/capacitor/config/start_session_config.js +24 -0
- package/www/capacitor/config/start_workflow_config.js +24 -0
- package/www/capacitor/config/token_connection_config.js +20 -0
- package/www/capacitor/index.js +113 -1
- package/www/capacitor/internal/bridge.js +19 -8
- package/www/capacitor/model/workflow.js +28 -0
- package/www/capacitor/model/workflow_result.js +21 -0
- package/www/capacitor/model/workflow_step.js +19 -0
- package/www/cordova.js +559 -16
- package/www/react-native/config/api_key_connection_config.js +32 -0
- package/www/react-native/config/credentials_connection_config.js +32 -0
- package/www/react-native/config/prepare_workflow_config.js +20 -0
- package/www/react-native/config/send_data_config.js +28 -0
- package/www/react-native/config/start_session_config.js +24 -0
- package/www/react-native/config/start_workflow_config.js +24 -0
- package/www/react-native/config/token_connection_config.js +20 -0
- package/www/react-native/index.js +113 -1
- package/www/react-native/internal/bridge.js +19 -8
- package/www/react-native/model/workflow.js +28 -0
- package/www/react-native/model/workflow_result.js +21 -0
- package/www/react-native/model/workflow_step.js +19 -0
- package/www/types/config/api_key_connection_config.d.ts +6 -0
- package/www/types/config/credentials_connection_config.d.ts +6 -0
- package/www/types/config/prepare_workflow_config.d.ts +3 -0
- package/www/types/config/send_data_config.d.ts +5 -0
- package/www/types/config/start_session_config.d.ts +4 -0
- package/www/types/config/start_workflow_config.d.ts +4 -0
- package/www/types/config/token_connection_config.d.ts +3 -0
- package/www/types/index.d.ts +49 -0
- package/www/types/model/workflow.d.ts +9 -0
- package/www/types/model/workflow_result.d.ts +8 -0
- package/www/types/model/workflow_step.d.ts +6 -0
- package/ios/FlutterIDVPlugin.swift +0 -72
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/idv": "3.2.
|
|
10
|
-
"@regulaforensics/document-reader": "
|
|
11
|
-
"@regulaforensics/face-sdk": "7.
|
|
12
|
-
"@regulaforensics/document-reader-core-fullauthrfid": "
|
|
13
|
-
"@regulaforensics/face-core-basic": "7.
|
|
14
|
-
"@regulaforensics/idv-module-document-reader": "3.2.
|
|
15
|
-
"@regulaforensics/idv-module-face": "3.2.
|
|
9
|
+
"@regulaforensics/idv": "3.2.68-beta",
|
|
10
|
+
"@regulaforensics/document-reader": "9.1.505",
|
|
11
|
+
"@regulaforensics/face-sdk": "7.2.691",
|
|
12
|
+
"@regulaforensics/document-reader-core-fullauthrfid": "9.1.1281",
|
|
13
|
+
"@regulaforensics/face-core-basic": "7.2.265",
|
|
14
|
+
"@regulaforensics/idv-module-document-reader": "3.2.48-beta",
|
|
15
|
+
"@regulaforensics/idv-module-face": "3.2.49-beta",
|
|
16
16
|
"@capacitor/cli": "7.0.1",
|
|
17
17
|
"@capacitor/core": "7.0.1",
|
|
18
18
|
"@capacitor/app": "7.0.0",
|
|
@@ -1,38 +1,17 @@
|
|
|
1
1
|
<div class="column" style="height: 100%">
|
|
2
2
|
<div class="column header">
|
|
3
|
-
<span id="status">
|
|
3
|
+
<span id="status">Initializing...</span>
|
|
4
4
|
<div class="column divider"></div>
|
|
5
5
|
</div>
|
|
6
|
-
<div id="
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
<p>Portrait</p>
|
|
10
|
-
<img id="portrait-image" src="images/portrait.png" height="160px" width="120px">
|
|
11
|
-
</div>
|
|
12
|
-
<div class="column" style="padding: 5px;">
|
|
13
|
-
<p>Document image</p>
|
|
14
|
-
<img id="document-image" src="images/document.png" height="160px" width="200px">
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
<div id="scenario-container" class="column no-scroll" style="margin-top: 15px; background-color: rgba(0, 0, 0, 0.03);">
|
|
18
|
-
<div id="scenarios" class="scroll"></div>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="row" style="width: 360px; padding-top: 15px;">
|
|
21
|
-
<span id="rfid-checkbox-description" style="font-size: 18px;width: 100%;">Process rfid reading(unavailable)</span>
|
|
22
|
-
<input id="rfid-checkbox" type="checkbox" style="margin-left: auto;" disabled />
|
|
23
|
-
</div>
|
|
24
|
-
<div class="row">
|
|
25
|
-
<button id="scan" class="button">Scan document</button>
|
|
26
|
-
<button id="recognize" class="button">Scan image</button>
|
|
27
|
-
</div>
|
|
28
|
-
<button id="connect" class="button" style="width: 360px; display: none;">Connect</button>
|
|
29
|
-
<div style="padding-top: 20px;"></div>
|
|
6
|
+
<div id="sub-header" class="column sub-header" style="display: none;">
|
|
7
|
+
<span id="description"></span>
|
|
8
|
+
<div class="column divider"></div>
|
|
30
9
|
</div>
|
|
31
|
-
<div id="
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
<div id="progress"></div>
|
|
10
|
+
<div id="main" class="column no-scroll">
|
|
11
|
+
<div class="column no-scroll" style="padding-top: 15px; background-color: rgba(0, 0, 0, 0.03);">
|
|
12
|
+
<div id="radio-group" class="scroll"></div>
|
|
35
13
|
</div>
|
|
36
|
-
<button id="
|
|
14
|
+
<button id="start-workflow" class="button" style="width: 360px">Start Workflow</button>
|
|
15
|
+
<div style="padding-top: 30px"></div>
|
|
37
16
|
</div>
|
|
38
17
|
</div>
|
|
@@ -1,10 +1,124 @@
|
|
|
1
|
-
import { IDV } from '@regulaforensics/idv'
|
|
1
|
+
import { IDV, Workflow } from '@regulaforensics/idv'
|
|
2
|
+
|
|
3
|
+
enum Configuration { credentials, token, apiKey }
|
|
4
|
+
|
|
5
|
+
const loginType: Configuration = Configuration.credentials
|
|
6
|
+
const baseUrl = "https://idv.regula.app"
|
|
7
|
+
const username = "username_placeholder"
|
|
8
|
+
const password = "password_placeholder"
|
|
9
|
+
const tokenUrl = "token_placeholder"
|
|
10
|
+
const apiKey = "api_key_placeholder"
|
|
2
11
|
|
|
3
12
|
var idv = IDV.instance
|
|
13
|
+
var selectedWorkflow = ""
|
|
14
|
+
var workflowIds: string[] = []
|
|
15
|
+
|
|
16
|
+
async function init() {
|
|
17
|
+
var [_, iError] = await idv.initialize()
|
|
18
|
+
if (handleException(iError, "initialize")) return
|
|
19
|
+
|
|
20
|
+
var success = ({
|
|
21
|
+
[Configuration.credentials]: async () => await configureWithCredentials(),
|
|
22
|
+
[Configuration.token]: async () => await configureWithToken(),
|
|
23
|
+
[Configuration.apiKey]: async () => await configureApiKey(),
|
|
24
|
+
})[loginType]!
|
|
25
|
+
if (!await success()) return
|
|
26
|
+
|
|
27
|
+
var [wfs, error] = await idv.getWorkflows()
|
|
28
|
+
if (handleException(error, "getWorkflows")) return
|
|
29
|
+
if (loginType == Configuration.token) {
|
|
30
|
+
wfs = wfs!.filter((wf: any) => workflowIds.includes(wf.id))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
setWorkflows(wfs!)
|
|
34
|
+
setStatus("Ready")
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function configureWithCredentials(): Promise<boolean> {
|
|
38
|
+
var [success, error] = await idv.configureWithCredentials({
|
|
39
|
+
baseUrl: baseUrl,
|
|
40
|
+
userName: username,
|
|
41
|
+
password: password
|
|
42
|
+
})
|
|
43
|
+
handleException(error, "configureWithCredentials")
|
|
44
|
+
return success
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function configureWithToken(): Promise<boolean> {
|
|
48
|
+
var [wfIds, error] = await idv.configureWithToken({ url: tokenUrl })
|
|
49
|
+
if (handleException(error, "configureWithToken")) return false
|
|
50
|
+
workflowIds = wfIds!
|
|
51
|
+
return true
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function configureApiKey(): Promise<boolean> {
|
|
55
|
+
var [success, error] = await idv.configureWithApiKey({ baseUrl, apiKey })
|
|
56
|
+
handleException(error, "configureWithApiKey")
|
|
57
|
+
return success
|
|
58
|
+
}
|
|
4
59
|
|
|
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
|
+
function handleException(error?: string | null, tag?: string): boolean {
|
|
75
|
+
if (error == null) return false
|
|
76
|
+
setStatus(`Error - IDV.${tag}()`)
|
|
77
|
+
setDescription(error)
|
|
78
|
+
console.log(error)
|
|
79
|
+
return true
|
|
80
|
+
}
|
|
5
81
|
|
|
6
82
|
// --------------------------------------------------------------------------------------------------------------------
|
|
7
83
|
|
|
8
84
|
export function main() {
|
|
85
|
+
document.getElementById("start-workflow")!.onclick = () => startWorkflow()
|
|
86
|
+
|
|
87
|
+
init()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var setStatus = (data: string) => document.getElementById("status")!.innerHTML = data
|
|
91
|
+
var setDescription = (data: string) => {
|
|
92
|
+
document.getElementById("description")!.innerHTML = data
|
|
93
|
+
document.getElementById("sub-header")!.style.display = data.length > 0 ? "block" : "none"
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var workflows: Workflow[] = []
|
|
97
|
+
function setWorkflows(data: Workflow[]) {
|
|
98
|
+
var radioGroup = document.getElementById("radio-group")!
|
|
99
|
+
workflows = data
|
|
100
|
+
if (workflows.length != 0) {
|
|
101
|
+
selectedWorkflow = workflows[0].id
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
data.forEach(item => {
|
|
105
|
+
var checked = selectedWorkflow == item.id ? "checked" : ""
|
|
106
|
+
var radioElement = `
|
|
107
|
+
<div class="row radio">
|
|
108
|
+
<input type="radio" name="radio" id="${item.id}" value="${item.id}" ${checked}>
|
|
109
|
+
<span id="${item.id}-caption" style="width: 200px; padding-left: 5px;">${item.name}</span>
|
|
110
|
+
</div>`
|
|
111
|
+
radioGroup.insertAdjacentHTML("beforeend", radioElement)
|
|
112
|
+
})
|
|
9
113
|
|
|
114
|
+
data.forEach(item => {
|
|
115
|
+
var element = document.getElementById(item.id) as HTMLInputElement
|
|
116
|
+
var elementCaption = document.getElementById(item.id + "-caption")!
|
|
117
|
+
var onclick = () => {
|
|
118
|
+
selectedWorkflow = item.id
|
|
119
|
+
element.checked = true
|
|
120
|
+
}
|
|
121
|
+
element.onclick = onclick
|
|
122
|
+
elementCaption.onclick = onclick
|
|
123
|
+
})
|
|
10
124
|
}
|
package/examples/ionic/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## How to build demo application
|
|
4
4
|
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-idv.git`.
|
|
5
|
-
2. Put `regula.license` file at `
|
|
6
|
-
3. Put `db.dat` file at `
|
|
5
|
+
2. Put `regula.license` file at `assets/` (you can get a trial license [here](https://client.regulaforensics.com)).
|
|
6
|
+
3. Put `db.dat` file at `assets/` (you can get a trial database [here](https://client.regulaforensics.com/customer/databases))
|
|
7
7
|
4. Execute `npm run setup` within this directory.
|
|
8
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`.
|
|
9
9
|
6. Run the app:
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<preference name="android-minSdkVersion" value="24" />
|
|
12
12
|
<preference name="android-targetSdkVersion" value="36" />
|
|
13
13
|
<preference name="GradlePluginKotlinEnabled" value="true" />
|
|
14
|
+
<preference name="GradlePluginKotlinVersion" value="2.1.20" />
|
|
14
15
|
<config-file parent="/*" target="AndroidManifest.xml">
|
|
15
16
|
<uses-permission android:name="android.permission.NFC" />
|
|
16
17
|
</config-file>
|
package/examples/ionic/index.tsx
CHANGED
|
@@ -14,7 +14,11 @@ import { main } from './src/main'
|
|
|
14
14
|
})
|
|
15
15
|
class Main {
|
|
16
16
|
constructor(platform: Platform) {
|
|
17
|
-
|
|
17
|
+
(async () => {
|
|
18
|
+
await platform.ready()
|
|
19
|
+
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))
|
|
20
|
+
main()
|
|
21
|
+
})()
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
|