@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.
@@ -5,14 +5,14 @@
5
5
  "setup": "scripts/setup.sh",
6
6
  "ios": "scripts/ios.sh",
7
7
  "android": "scripts/android.sh",
8
- "start": "expo start --port 8083"
8
+ "start": "expo start --port \"$npm_package_config_metroPort\""
9
9
  },
10
10
  "dependencies": {
11
- "@regulaforensics/idv": "3.10.230-beta",
12
- "@regulaforensics/idv-module-document-reader": "3.10.294-beta",
13
- "@regulaforensics/idv-module-face": "3.10.295-beta",
14
- "@regulaforensics/document-reader-core-fullauthrfid": "9.9.3183-beta",
15
- "@regulaforensics/face-core-basic": "8.4.854-beta",
11
+ "@regulaforensics/idv": "3.10.239-rc",
12
+ "@regulaforensics/idv-module-document-reader": "3.10.288-rc",
13
+ "@regulaforensics/idv-module-face": "3.10.289-rc",
14
+ "@regulaforensics/document-reader-core-fullauthrfid": "9.9.3273-rc",
15
+ "@regulaforensics/face-core-basic": "8.4.877-rc",
16
16
  "expo": "58.0.0-preview.3",
17
17
  "expo-dev-client": "58.0.3",
18
18
  "expo-build-properties": "58.0.3",
@@ -29,5 +29,8 @@
29
29
  "expo-custom-assets": {
30
30
  "expo": "$expo"
31
31
  }
32
+ },
33
+ "config": {
34
+ "metroPort": 8083
32
35
  }
33
36
  }
@@ -1,13 +1,15 @@
1
1
  #!/usr/bin/env bash
2
2
  set -e
3
3
 
4
- adb reverse tcp:8083 tcp:8083 >/dev/null || :
4
+ adb reverse tcp:${npm_package_config_metroPort} tcp:${npm_package_config_metroPort} >/dev/null || :
5
5
  if [[ " $* " == *" --open "* ]] || [[ " $* " == *" -o "* ]]; then
6
6
  open -a 'Android Studio' android
7
- # Check Metro for this product on port 8083.
8
- if [[ "$(curl --silent --max-time 2 http://localhost:8083/status)" != "packager-status:running" ]]; then
7
+ # Check if Metro is running at app's port.
8
+ if [[ "$(curl --silent --max-time 2 http://localhost:${npm_package_config_metroPort}/status)" != "packager-status:running" ]]; then
9
9
  npm start
10
+ else
11
+ echo "Metro is already running on port ${npm_package_config_metroPort}."
10
12
  fi
11
13
  else
12
- expo run:android --device --port 8083
14
+ expo run:android --device --port ${npm_package_config_metroPort}
13
15
  fi
@@ -3,10 +3,12 @@ set -e
3
3
 
4
4
  if [[ " $* " == *" --open "* ]] || [[ " $* " == *" -o "* ]]; then
5
5
  open ios/IDV.xcworkspace
6
- # Check Metro for this product on port 8083.
7
- if [[ "$(curl --silent --max-time 2 http://localhost:8083/status)" != "packager-status:running" ]]; then
6
+ # Check if Metro is running at app's port.
7
+ if [[ "$(curl --silent --max-time 2 http://localhost:${npm_package_config_metroPort}/status)" != "packager-status:running" ]]; then
8
8
  npm start
9
+ else
10
+ echo "Metro is already running on port ${npm_package_config_metroPort}."
9
11
  fi
10
12
  else
11
- npx expo run:ios --device --port 8083
13
+ npx expo run:ios --device --port ${npm_package_config_metroPort}
12
14
  fi
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
  set -e
3
3
 
4
+ # Kill Metro instance at app's port.
5
+ lsof -tiTCP:${npm_package_config_metroPort} -sTCP:LISTEN | xargs kill 2>/dev/null || true
6
+
4
7
  npm install
5
8
  rm -rf node_modules/expo/node_modules/expo-modules-core/android/.cxx # Temp fix for expo@58.0.0-preview.3
6
9
  npx expo prebuild --no-install
@@ -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
- var workflowIds: string[] = []
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 success = ({
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 success()) return
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
- var [wfs, error] = await idv.getWorkflows()
44
+ async function showWorkflowList() {
45
+ setStatus("Fetching workflows...")
46
+ let [wfs, error] = await idv.getWorkflows()
28
47
  if (handleException(error, "getWorkflows")) return
29
- if (loginType == Configuration.token) {
30
- wfs = wfs!.filter((wf: any) => workflowIds.includes(wf.id))
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
- setWorkflows(wfs!)
34
- setStatus("Ready")
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 [wfIds, error] = await idv.configureWithToken({ url: tokenUrl })
84
+ var [workflowIds, error] = await idv.configureWithToken({ url: tokenUrl })
49
85
  if (handleException(error, "configureWithToken")) return false
50
- workflowIds = wfIds!
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
- if (workflows.length != 0) {
101
- selectedWorkflow = workflows[0].id
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/idv",
3
- "version": "3.10.230-beta",
3
+ "version": "3.10.239-rc",
4
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
5
  "main": "www/react-native/index.js",
6
6
  "module": "www/capacitor/index.js",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="@regulaforensics/idv" version="3.10.230-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
2
+ <plugin id="@regulaforensics/idv" version="3.10.239-rc" xmlns="http://apache.org/cordova/ns/plugins/1.0">
3
3
  <name>IDV</name>
4
4
  <description>Cordova plugin for Regula IDV</description>
5
5
  <license>commercial</license>
@@ -26,7 +26,7 @@
26
26
  <source url="https://github.com/regulaforensics/podspecs.git" />
27
27
  </config>
28
28
  <pods>
29
- <pod name="IDVSDK" spec="3.9.1987" nospm="true" />
29
+ <pod name="IDVSDKStage" spec="3.10.2101" nospm="true" />
30
30
  </pods>
31
31
  </podspec>
32
32
  </platform>
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'react-native-idv'
3
- s.version = '3.10.230-beta'
3
+ s.version = '3.10.239-rc'
4
4
  s.summary = 'Regula React Native plugin.'
5
5
  s.license = 'commercial'
6
6
  s.authors = { 'RegulaForensics' => 'support@regulaforensics.com' }
@@ -9,6 +9,6 @@ Pod::Spec.new do |s|
9
9
  s.ios.deployment_target = '15.0'
10
10
  s.source_files = [ 'ios/*.swift', 'ios/RN*.m' ]
11
11
  s.exclude_files = [ 'ios/CDVIDV.swift' ]
12
- s.dependency 'IDVSDK', '3.9.1987'
12
+ s.dependency 'IDVSDKStage', '3.10.2101'
13
13
  s.dependency 'React'
14
14
  end
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "..": {
15
15
  "name": "@regulaforensics/idv",
16
- "version": "3.10.230-beta",
16
+ "version": "3.10.239-rc",
17
17
  "dev": true,
18
18
  "license": "commercial",
19
19
  "dependencies": {