@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.
- package/README.md +30 -0
- package/RNIDV.podspec +21 -0
- package/android/CVDIDV.kt +48 -0
- package/android/build.gradle +32 -0
- package/android/cordova.gradle +20 -0
- package/android/src/main/java/com/regula/plugin/idv/JSONConstructor.kt +135 -0
- package/android/src/main/java/com/regula/plugin/idv/Main.kt +124 -0
- package/android/src/main/java/com/regula/plugin/idv/RNIDVModule.kt +71 -0
- package/android/src/main/java/com/regula/plugin/idv/Utils.kt +60 -0
- package/examples/capacitor/README.md +15 -0
- package/examples/capacitor/android/app/build.gradle +50 -0
- package/examples/capacitor/android/app/capacitor.build.gradle +22 -0
- package/examples/capacitor/android/app/proguard-rules.pro +21 -0
- package/examples/capacitor/android/app/src/main/AndroidManifest.xml +26 -0
- package/examples/capacitor/android/app/src/main/assets/Regula/.gitkeep +0 -0
- package/examples/capacitor/android/app/src/main/java/com/regula/example/idv/capacitor/MainActivity.java +5 -0
- package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable/launcher.xml +4 -0
- package/examples/capacitor/android/app/src/main/res/drawable/launcher_round.xml +4 -0
- package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
- package/examples/capacitor/android/app/src/main/res/values/styles.xml +22 -0
- package/examples/capacitor/android/build.gradle +30 -0
- package/examples/capacitor/android/capacitor.settings.gradle +15 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/examples/capacitor/android/gradle.properties +22 -0
- package/examples/capacitor/android/gradlew +252 -0
- package/examples/capacitor/android/gradlew.bat +94 -0
- package/examples/capacitor/android/settings.gradle +5 -0
- package/examples/capacitor/android/variables.gradle +16 -0
- package/examples/capacitor/index.html +5 -0
- package/examples/capacitor/index.tsx +16 -0
- package/examples/capacitor/ionic.config.json +7 -0
- package/examples/capacitor/ios/App/App/App.entitlements +10 -0
- package/examples/capacitor/ios/App/App/AppDelegate.swift +49 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Contents.json +6 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
- package/examples/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
- package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +19 -0
- package/examples/capacitor/ios/App/App/Info.plist +65 -0
- package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +418 -0
- package/examples/capacitor/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
- package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/examples/capacitor/ios/App/Podfile +26 -0
- package/examples/capacitor/package-lock.json +3350 -0
- package/examples/capacitor/package.json +27 -0
- package/examples/capacitor/public/assets/.gitkeep +0 -0
- package/examples/capacitor/scripts/android.sh +9 -0
- package/examples/capacitor/scripts/ios.sh +8 -0
- package/examples/capacitor/scripts/setup.sh +14 -0
- package/examples/capacitor/src/main.css +148 -0
- package/examples/capacitor/src/main.html +17 -0
- package/examples/capacitor/src/main.tsx +124 -0
- package/examples/capacitor/tsconfig.json +5 -0
- package/examples/capacitor/vite.config.ts +17 -0
- package/examples/ionic/README.md +15 -0
- package/examples/ionic/angular.json +39 -0
- package/examples/ionic/assets/.gitkeep +0 -0
- package/examples/ionic/config.xml +60 -0
- package/examples/ionic/images/icon.png +0 -0
- package/examples/ionic/index.html +19 -0
- package/examples/ionic/index.tsx +32 -0
- package/examples/ionic/ionic.config.json +7 -0
- package/examples/ionic/package-lock.json +14261 -0
- package/examples/ionic/package.json +46 -0
- package/examples/ionic/scripts/android.sh +8 -0
- package/examples/ionic/scripts/ios.sh +8 -0
- package/examples/ionic/scripts/setup.sh +8 -0
- package/examples/ionic/src/main.css +148 -0
- package/examples/ionic/src/main.html +17 -0
- package/examples/ionic/src/main.tsx +124 -0
- package/examples/ionic/tsconfig.json +14 -0
- package/examples/react_native/README.md +15 -0
- package/examples/react_native/app.config.ts +46 -0
- package/examples/react_native/assets/.gitkeep +0 -0
- package/examples/react_native/images/icon.png +0 -0
- package/examples/react_native/index.html +12 -0
- package/examples/react_native/index.tsx +63 -0
- package/examples/react_native/metro.config.js +7 -0
- package/examples/react_native/package-lock.json +8996 -0
- package/examples/react_native/package.json +29 -0
- package/examples/react_native/scripts/android.sh +13 -0
- package/examples/react_native/scripts/ios.sh +12 -0
- package/examples/react_native/scripts/setup.sh +12 -0
- package/examples/react_native/src/main.css +148 -0
- package/examples/react_native/src/main.html +17 -0
- package/examples/react_native/src/main.tsx +124 -0
- package/ios/CVDIDV.swift +51 -0
- package/ios/JSONConstructor.swift +132 -0
- package/ios/Main.swift +91 -0
- package/ios/RNIDV.m +11 -0
- package/ios/RNIDV.swift +47 -0
- package/ios/Utils.swift +52 -0
- package/package.json +38 -0
- package/plugin.xml +46 -0
- package/test/json.tsx +40 -0
- package/test/package-lock.json +584 -0
- package/test/package.json +9 -0
- package/test/test.tsx +13 -0
- package/test/utils.tsx +38 -0
- 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/start_workflow_config.js +24 -0
- package/www/capacitor/config/token_connection_config.js +20 -0
- package/www/capacitor/index.js +110 -0
- package/www/capacitor/internal/bridge.js +30 -0
- package/www/capacitor/internal/cordova.js +17 -0
- 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 +595 -0
- 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/start_workflow_config.js +24 -0
- package/www/react-native/config/token_connection_config.js +20 -0
- package/www/react-native/index.js +110 -0
- package/www/react-native/internal/bridge.js +30 -0
- 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/start_workflow_config.d.ts +4 -0
- package/www/types/config/token_connection_config.d.ts +3 -0
- package/www/types/index.d.ts +62 -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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "idv",
|
|
3
|
+
"scripts": {
|
|
4
|
+
"setup": "scripts/setup.sh",
|
|
5
|
+
"ios": "scripts/ios.sh",
|
|
6
|
+
"android": "scripts/android.sh"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@regulaforensics/idv": "3.2.1-nightly",
|
|
10
|
+
"@regulaforensics/document-reader": "8.4.2-nightly",
|
|
11
|
+
"@regulaforensics/face-sdk": "8.1.1-nightly",
|
|
12
|
+
"@regulaforensics/document-reader-core-fullauthrfid": "8.4.7-nightly",
|
|
13
|
+
"@regulaforensics/face-core-basic": "8.1.1-nightly",
|
|
14
|
+
"@regulaforensics/idv-module-document-reader": "file:../ftp_5",
|
|
15
|
+
"@regulaforensics/idv-module-face": "file:../ftp_6",
|
|
16
|
+
"@capacitor/cli": "7.0.1",
|
|
17
|
+
"@capacitor/core": "7.0.1",
|
|
18
|
+
"@capacitor/app": "7.0.0",
|
|
19
|
+
"@capacitor/ios": "7.0.1",
|
|
20
|
+
"@capacitor/android": "7.0.1",
|
|
21
|
+
"@capacitor/status-bar": "7.0.0",
|
|
22
|
+
"@ionic/react": "8.4.3",
|
|
23
|
+
"@vitejs/plugin-react": "4.3.4",
|
|
24
|
+
"vite-plugin-static-copy": "3.1.2",
|
|
25
|
+
"@types/react-router-dom": "5.3.3"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
npm install
|
|
5
|
+
ionic cap sync ios || {
|
|
6
|
+
cd ios/App
|
|
7
|
+
pod update
|
|
8
|
+
cd ../../
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
cp public/assets/regula.license ios/App/App/
|
|
12
|
+
cp public/assets/db.dat ios/App/App/
|
|
13
|
+
cp public/assets/regula.license android/app/src/main/assets/Regula/
|
|
14
|
+
cp public/assets/db.dat android/app/src/main/assets/Regula/
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
margin: 0;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 99vh;
|
|
6
|
+
display: flex;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Prevent text selection */
|
|
12
|
+
* {
|
|
13
|
+
user-select: none !important;
|
|
14
|
+
-webkit-user-select: none !important;
|
|
15
|
+
-webkit-user-drag: none !important;
|
|
16
|
+
-webkit-touch-callout: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.column {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.row {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.header {
|
|
35
|
+
text-align: center;
|
|
36
|
+
padding-top: 80px;
|
|
37
|
+
margin-top: -10px;
|
|
38
|
+
background-color: rgba(0, 0, 0, 0.03);
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
font-size: 18px;
|
|
41
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.sub-header {
|
|
45
|
+
background-color: rgba(0, 0, 0, 0.03);
|
|
46
|
+
width: 100%;
|
|
47
|
+
padding-top: 13px;
|
|
48
|
+
text-align: center;
|
|
49
|
+
font-weight: 550;
|
|
50
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.divider {
|
|
54
|
+
height: 1px;
|
|
55
|
+
background-color: rgba(0, 0, 0, 0.075);
|
|
56
|
+
margin-top: 13px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.scroll {
|
|
60
|
+
flex-grow: 1;
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.no-scroll {
|
|
65
|
+
flex-grow: 1;
|
|
66
|
+
overflow-y: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.button {
|
|
70
|
+
width: 175px;
|
|
71
|
+
height: 40px;
|
|
72
|
+
margin: 5px;
|
|
73
|
+
margin-top: 10px;
|
|
74
|
+
background-color: #4285F4;
|
|
75
|
+
color: white;
|
|
76
|
+
border: none;
|
|
77
|
+
padding: 10px 20px;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
font-size: 16px;
|
|
80
|
+
border-radius: 100px;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
transition: all 0.3s ease;
|
|
83
|
+
user-select: none;
|
|
84
|
+
-webkit-user-select: none;
|
|
85
|
+
-moz-user-select: none;
|
|
86
|
+
-ms-user-select: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.button:active {
|
|
90
|
+
position: relative;
|
|
91
|
+
top: 1px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.text-button {
|
|
95
|
+
background: none;
|
|
96
|
+
border: none;
|
|
97
|
+
color: #2196f3;
|
|
98
|
+
font-size: 20px;
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
padding: 5px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.text-button:active {
|
|
104
|
+
position: relative;
|
|
105
|
+
top: 1px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.radio {
|
|
109
|
+
align-items: baseline;
|
|
110
|
+
padding: 15px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
input[type="checkbox"] {
|
|
114
|
+
width: 20px;
|
|
115
|
+
height: 20px;
|
|
116
|
+
border: 2px solid black;
|
|
117
|
+
background-color: white;
|
|
118
|
+
display: inline-block;
|
|
119
|
+
position: relative;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
input[type="text"] {
|
|
124
|
+
width: 173px;
|
|
125
|
+
height: 40px;
|
|
126
|
+
font-size: 15px;
|
|
127
|
+
margin: 5px;
|
|
128
|
+
border-radius: 100px;
|
|
129
|
+
padding-left: 10px;
|
|
130
|
+
padding-right: 10px;
|
|
131
|
+
margin-top: 10px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.progress-bar {
|
|
135
|
+
width: 75%;
|
|
136
|
+
padding: 3px;
|
|
137
|
+
margin-top: 40px;
|
|
138
|
+
background-color: #eee;
|
|
139
|
+
border-radius: 8px;
|
|
140
|
+
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
#progress {
|
|
144
|
+
width: 0%;
|
|
145
|
+
height: 20px;
|
|
146
|
+
background-color: #4285F4;
|
|
147
|
+
border-radius: 5px;
|
|
148
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div class="column" style="height: 100%">
|
|
2
|
+
<div class="column header">
|
|
3
|
+
<span id="status">Initializing...</span>
|
|
4
|
+
<div class="column divider"></div>
|
|
5
|
+
</div>
|
|
6
|
+
<div id="sub-header" class="column sub-header" style="display: none;">
|
|
7
|
+
<span id="description"></span>
|
|
8
|
+
<div class="column divider"></div>
|
|
9
|
+
</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>
|
|
13
|
+
</div>
|
|
14
|
+
<button id="start-workflow" class="button" style="width: 360px">Start Workflow</button>
|
|
15
|
+
<div style="padding-top: 30px"></div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,124 @@
|
|
|
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"
|
|
11
|
+
|
|
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
|
+
}
|
|
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
|
+
}
|
|
81
|
+
|
|
82
|
+
// --------------------------------------------------------------------------------------------------------------------
|
|
83
|
+
|
|
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
|
+
})
|
|
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
|
+
})
|
|
124
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import react from '@vitejs/plugin-react'
|
|
2
|
+
import { defineConfig } from 'vite'
|
|
3
|
+
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [
|
|
7
|
+
react(),
|
|
8
|
+
viteStaticCopy({
|
|
9
|
+
targets: [
|
|
10
|
+
{
|
|
11
|
+
src: 'src/main.html',
|
|
12
|
+
dest: '.'
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
})],
|
|
16
|
+
build: { outDir: 'www' }
|
|
17
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Regula IDV Ionic demo application
|
|
2
|
+
|
|
3
|
+
## How to build demo application
|
|
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 `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
|
+
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`.
|
|
9
|
+
6. Run the app:
|
|
10
|
+
* IOS: `npm run ios`.
|
|
11
|
+
* Android: `npm run android`.
|
|
12
|
+
7. After initialization choose **General KYC - AP** from workflows list and click **Start Workflow** button.
|
|
13
|
+
8. Complete workflow and get your session id.
|
|
14
|
+
|
|
15
|
+
**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.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"projects": {
|
|
4
|
+
"app": {
|
|
5
|
+
"root": "",
|
|
6
|
+
"sourceRoot": "src",
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"architect": {
|
|
9
|
+
"build": {
|
|
10
|
+
"builder": "@angular-devkit/build-angular:browser",
|
|
11
|
+
"options": {
|
|
12
|
+
"outputPath": "www",
|
|
13
|
+
"index": "index.html",
|
|
14
|
+
"main": "index.tsx",
|
|
15
|
+
"tsConfig": "tsconfig.json",
|
|
16
|
+
"assets": [
|
|
17
|
+
{
|
|
18
|
+
"glob": "**/*",
|
|
19
|
+
"input": "assets",
|
|
20
|
+
"output": "assets"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"glob": "**/*",
|
|
24
|
+
"input": "images",
|
|
25
|
+
"output": "images"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"ionic-cordova-build": {
|
|
31
|
+
"builder": "@ionic/cordova-builders:cordova-build",
|
|
32
|
+
"options": {
|
|
33
|
+
"browserTarget": "app:build"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
+
<widget android-packageName="com.regula.example.idv.ionic" ios-CFBundleIdentifier="com.regula.example.idv.ionic" version="1.0.0"
|
|
3
|
+
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
4
|
+
<name>IDV</name>
|
|
5
|
+
<icon src="images/icon.png" />
|
|
6
|
+
<platform name="android">
|
|
7
|
+
<resource-file src="assets/regula.license" target="app/src/main/assets/Regula/regula.license" />
|
|
8
|
+
<resource-file src="assets/db.dat" target="app/src/main/assets/Regula/db.dat" />
|
|
9
|
+
<preference name="orientation" value="portrait" />
|
|
10
|
+
<preference name="AndroidEdgeToEdge" value="true" />
|
|
11
|
+
<preference name="android-minSdkVersion" value="24" />
|
|
12
|
+
<preference name="android-targetSdkVersion" value="36" />
|
|
13
|
+
<preference name="GradlePluginKotlinEnabled" value="true" />
|
|
14
|
+
<preference name="GradlePluginKotlinVersion" value="2.1.20" />
|
|
15
|
+
<config-file parent="/*" target="AndroidManifest.xml">
|
|
16
|
+
<uses-permission android:name="android.permission.NFC" />
|
|
17
|
+
</config-file>
|
|
18
|
+
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
|
|
19
|
+
<application android:usesCleartextTraffic="true" />
|
|
20
|
+
</edit-config>
|
|
21
|
+
</platform>
|
|
22
|
+
<platform name="ios">
|
|
23
|
+
<resource-file src="assets/regula.license" />
|
|
24
|
+
<resource-file src="assets/db.dat" />
|
|
25
|
+
<preference name="deployment-target" value="14.0" />
|
|
26
|
+
<preference name="orientation" value="portrait" />
|
|
27
|
+
<allow-intent href="itms:*" />
|
|
28
|
+
<allow-intent href="itms-apps:*" />
|
|
29
|
+
<config-file parent="NSCameraUsageDescription" target="*-Info.plist">
|
|
30
|
+
<string>To use camera</string>
|
|
31
|
+
</config-file>
|
|
32
|
+
<config-file parent="NSPhotoLibraryUsageDescription" target="*-Info.plist">
|
|
33
|
+
<string>To pick images</string>
|
|
34
|
+
</config-file>
|
|
35
|
+
<config-file parent="NFCReaderUsageDescription" target="*-Info.plist">
|
|
36
|
+
<string>To use NFC</string>
|
|
37
|
+
</config-file>
|
|
38
|
+
<config-file parent="com.apple.developer.nfc.readersession.iso7816.select-identifiers" target="*-Info.plist">
|
|
39
|
+
<array>
|
|
40
|
+
<string>A0000002471001</string>
|
|
41
|
+
<string>E80704007F00070302</string>
|
|
42
|
+
<string>A000000167455349474E</string>
|
|
43
|
+
<string>A0000002480100</string>
|
|
44
|
+
<string>A0000002480200</string>
|
|
45
|
+
<string>A0000002480300</string>
|
|
46
|
+
<string>A00000045645444C2D3031</string>
|
|
47
|
+
</array>
|
|
48
|
+
</config-file>
|
|
49
|
+
<config-file parent="com.apple.developer.nfc.readersession.formats" target="*-Debug.plist">
|
|
50
|
+
<array>
|
|
51
|
+
<string>TAG</string>
|
|
52
|
+
</array>
|
|
53
|
+
</config-file>
|
|
54
|
+
<config-file parent="com.apple.developer.nfc.readersession.formats" target="*-Release.plist">
|
|
55
|
+
<array>
|
|
56
|
+
<string>TAG</string>
|
|
57
|
+
</array>
|
|
58
|
+
</config-file>
|
|
59
|
+
</platform>
|
|
60
|
+
</widget>
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<meta name="viewport"
|
|
3
|
+
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
4
|
+
<base href="/" />
|
|
5
|
+
</head>
|
|
6
|
+
|
|
7
|
+
<body>
|
|
8
|
+
<ion-app>
|
|
9
|
+
<app-root></app-root>
|
|
10
|
+
</ion-app>
|
|
11
|
+
</body>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
html,
|
|
15
|
+
body {
|
|
16
|
+
height: 100%;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import 'zone.js';
|
|
2
|
+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
|
|
3
|
+
import { BrowserModule } from '@angular/platform-browser'
|
|
4
|
+
import { IonicModule, Platform } from '@ionic/angular'
|
|
5
|
+
import { NgModule } from '@angular/core'
|
|
6
|
+
import { Component } from '@angular/core'
|
|
7
|
+
|
|
8
|
+
import { main } from './src/main'
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'app-root',
|
|
12
|
+
templateUrl: 'src/main.html',
|
|
13
|
+
styleUrl: 'src/main.css'
|
|
14
|
+
})
|
|
15
|
+
class Main {
|
|
16
|
+
constructor(platform: Platform) {
|
|
17
|
+
(async () => {
|
|
18
|
+
await platform.ready()
|
|
19
|
+
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))
|
|
20
|
+
main()
|
|
21
|
+
})()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@NgModule({
|
|
26
|
+
bootstrap: [Main],
|
|
27
|
+
providers: [Platform],
|
|
28
|
+
imports: [BrowserModule, IonicModule.forRoot()]
|
|
29
|
+
})
|
|
30
|
+
class MainModule { }
|
|
31
|
+
|
|
32
|
+
platformBrowserDynamic().bootstrapModule(MainModule)
|