@regulaforensics/face-sdk 7.1.432-nightly → 7.1.439-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.
Files changed (164) hide show
  1. package/README.md +2 -3
  2. package/RNFaceSDK.podspec +2 -2
  3. package/android/build.gradle +1 -1
  4. package/android/cordova.gradle +1 -1
  5. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +2 -2
  6. package/examples/capacitor/index.html +2 -7
  7. package/examples/capacitor/index.tsx +53 -0
  8. package/examples/capacitor/package-lock.json +12 -162
  9. package/examples/capacitor/package.json +4 -4
  10. package/examples/capacitor/scripts/setup.sh +4 -2
  11. package/examples/capacitor/src/main.css +60 -6
  12. package/examples/capacitor/src/main.html +1 -1
  13. package/examples/capacitor/src/main.tsx +51 -87
  14. package/examples/ionic/README.md +1 -1
  15. package/examples/ionic/angular.json +3 -3
  16. package/examples/ionic/config.xml +4 -2
  17. package/examples/ionic/index.tsx +68 -0
  18. package/examples/ionic/package-lock.json +42 -68
  19. package/examples/ionic/package.json +2 -2
  20. package/examples/ionic/src/main.css +60 -6
  21. package/examples/ionic/src/main.html +1 -1
  22. package/examples/ionic/src/{main.ts → main.tsx} +52 -97
  23. package/examples/ionic/tsconfig.json +3 -2
  24. package/examples/react_native/README.md +1 -0
  25. package/examples/react_native/app.config.ts +1 -1
  26. package/examples/react_native/index.tsx +49 -7
  27. package/examples/react_native/package-lock.json +594 -597
  28. package/examples/react_native/package.json +9 -9
  29. package/examples/react_native/src/main.css +60 -6
  30. package/examples/react_native/src/main.html +1 -1
  31. package/examples/react_native/src/main.tsx +54 -77
  32. package/package.json +1 -1
  33. package/plugin.xml +2 -2
  34. package/test/json.tsx +375 -0
  35. package/test/package-lock.json +584 -0
  36. package/test/package.json +9 -0
  37. package/test/test.tsx +61 -0
  38. package/test/utils.tsx +38 -0
  39. package/www/capacitor/customization/customization_fonts.js +1 -1
  40. package/www/capacitor/customization/customization_images.js +1 -1
  41. package/www/capacitor/customization/font.js +8 -0
  42. package/www/capacitor/detect_faces/detect_face_result.js +12 -0
  43. package/www/capacitor/detect_faces/detect_faces_attribute_result.js +9 -0
  44. package/www/capacitor/detect_faces/detect_faces_backend_exception.js +7 -0
  45. package/www/capacitor/detect_faces/detect_faces_config.js +34 -0
  46. package/www/capacitor/detect_faces/detect_faces_exception.js +8 -0
  47. package/www/capacitor/detect_faces/detect_faces_request.js +22 -0
  48. package/www/capacitor/detect_faces/detect_faces_response.js +9 -0
  49. package/www/capacitor/face_capture/face_capture_config.js +37 -0
  50. package/www/capacitor/face_capture/face_capture_exception.js +7 -0
  51. package/www/capacitor/face_capture/face_capture_image.js +8 -0
  52. package/www/capacitor/face_capture/face_capture_response.js +7 -0
  53. package/www/capacitor/image_params/output_image_crop.js +23 -0
  54. package/www/capacitor/image_params/output_image_params.js +19 -0
  55. package/www/capacitor/image_params/point.js +7 -0
  56. package/www/capacitor/image_params/rect.js +9 -0
  57. package/www/capacitor/image_params/size.js +12 -0
  58. package/www/capacitor/image_quality/image_quality_characteristic.js +22 -0
  59. package/www/capacitor/image_quality/image_quality_range.js +7 -0
  60. package/www/capacitor/image_quality/image_quality_result.js +10 -0
  61. package/www/capacitor/init/face_sdk_version.js +8 -0
  62. package/www/capacitor/init/init_config.js +19 -0
  63. package/www/capacitor/init/init_exception.js +8 -0
  64. package/www/capacitor/init/license_exception.js +7 -0
  65. package/www/capacitor/internal/bridge.js +20 -1
  66. package/www/capacitor/liveness/liveness_backend_exception.js +7 -0
  67. package/www/capacitor/liveness/liveness_config.js +43 -0
  68. package/www/capacitor/liveness/liveness_exception.js +8 -0
  69. package/www/capacitor/liveness/liveness_notification.js +7 -0
  70. package/www/capacitor/liveness/liveness_response.js +11 -0
  71. package/www/capacitor/match_faces/compared_face.js +9 -0
  72. package/www/capacitor/match_faces/compared_faces_pair.js +10 -0
  73. package/www/capacitor/match_faces/compared_faces_split.js +7 -0
  74. package/www/capacitor/match_faces/match_faces_backend_exception.js +7 -0
  75. package/www/capacitor/match_faces/match_faces_config.js +19 -0
  76. package/www/capacitor/match_faces/match_faces_detection.js +9 -0
  77. package/www/capacitor/match_faces/match_faces_detection_face.js +11 -0
  78. package/www/capacitor/match_faces/match_faces_exception.js +8 -0
  79. package/www/capacitor/match_faces/match_faces_image.js +9 -0
  80. package/www/capacitor/match_faces/match_faces_request.js +27 -0
  81. package/www/capacitor/match_faces/match_faces_response.js +9 -0
  82. package/www/capacitor/person_database/edit_group_persons_request.js +15 -0
  83. package/www/capacitor/person_database/image_upload.js +17 -0
  84. package/www/capacitor/person_database/pageable_item_list.js +8 -0
  85. package/www/capacitor/person_database/person.js +13 -0
  86. package/www/capacitor/person_database/person_group.js +11 -0
  87. package/www/capacitor/person_database/person_image.js +13 -0
  88. package/www/capacitor/person_database/search_person.js +14 -0
  89. package/www/capacitor/person_database/search_person_detection.js +9 -0
  90. package/www/capacitor/person_database/search_person_image.js +15 -0
  91. package/www/capacitor/person_database/search_person_request.js +27 -0
  92. package/www/cordova.js +703 -6
  93. package/www/react-native/customization/customization_fonts.js +1 -1
  94. package/www/react-native/customization/customization_images.js +1 -1
  95. package/www/react-native/customization/font.js +8 -0
  96. package/www/react-native/detect_faces/detect_face_result.js +12 -0
  97. package/www/react-native/detect_faces/detect_faces_attribute_result.js +9 -0
  98. package/www/react-native/detect_faces/detect_faces_backend_exception.js +7 -0
  99. package/www/react-native/detect_faces/detect_faces_config.js +34 -0
  100. package/www/react-native/detect_faces/detect_faces_exception.js +8 -0
  101. package/www/react-native/detect_faces/detect_faces_request.js +22 -0
  102. package/www/react-native/detect_faces/detect_faces_response.js +9 -0
  103. package/www/react-native/face_capture/face_capture_config.js +37 -0
  104. package/www/react-native/face_capture/face_capture_exception.js +7 -0
  105. package/www/react-native/face_capture/face_capture_image.js +8 -0
  106. package/www/react-native/face_capture/face_capture_response.js +7 -0
  107. package/www/react-native/image_params/output_image_crop.js +23 -0
  108. package/www/react-native/image_params/output_image_params.js +19 -0
  109. package/www/react-native/image_params/point.js +7 -0
  110. package/www/react-native/image_params/rect.js +9 -0
  111. package/www/react-native/image_params/size.js +12 -0
  112. package/www/react-native/image_quality/image_quality_characteristic.js +22 -0
  113. package/www/react-native/image_quality/image_quality_range.js +7 -0
  114. package/www/react-native/image_quality/image_quality_result.js +10 -0
  115. package/www/react-native/init/face_sdk_version.js +8 -0
  116. package/www/react-native/init/init_config.js +19 -0
  117. package/www/react-native/init/init_exception.js +8 -0
  118. package/www/react-native/init/license_exception.js +7 -0
  119. package/www/react-native/internal/bridge.js +20 -1
  120. package/www/react-native/liveness/liveness_backend_exception.js +7 -0
  121. package/www/react-native/liveness/liveness_config.js +43 -0
  122. package/www/react-native/liveness/liveness_exception.js +8 -0
  123. package/www/react-native/liveness/liveness_notification.js +7 -0
  124. package/www/react-native/liveness/liveness_response.js +11 -0
  125. package/www/react-native/match_faces/compared_face.js +9 -0
  126. package/www/react-native/match_faces/compared_faces_pair.js +10 -0
  127. package/www/react-native/match_faces/compared_faces_split.js +7 -0
  128. package/www/react-native/match_faces/match_faces_backend_exception.js +7 -0
  129. package/www/react-native/match_faces/match_faces_config.js +19 -0
  130. package/www/react-native/match_faces/match_faces_detection.js +9 -0
  131. package/www/react-native/match_faces/match_faces_detection_face.js +11 -0
  132. package/www/react-native/match_faces/match_faces_exception.js +8 -0
  133. package/www/react-native/match_faces/match_faces_image.js +9 -0
  134. package/www/react-native/match_faces/match_faces_request.js +27 -0
  135. package/www/react-native/match_faces/match_faces_response.js +9 -0
  136. package/www/react-native/person_database/edit_group_persons_request.js +15 -0
  137. package/www/react-native/person_database/image_upload.js +17 -0
  138. package/www/react-native/person_database/pageable_item_list.js +8 -0
  139. package/www/react-native/person_database/person.js +13 -0
  140. package/www/react-native/person_database/person_group.js +11 -0
  141. package/www/react-native/person_database/person_image.js +13 -0
  142. package/www/react-native/person_database/search_person.js +14 -0
  143. package/www/react-native/person_database/search_person_detection.js +9 -0
  144. package/www/react-native/person_database/search_person_image.js +15 -0
  145. package/www/react-native/person_database/search_person_request.js +27 -0
  146. package/www/types/match_faces/match_faces_config.d.ts +2 -0
  147. package/examples/cordova/.vscode/launch.json +0 -28
  148. package/examples/cordova/README.md +0 -25
  149. package/examples/cordova/config.xml +0 -26
  150. package/examples/cordova/package-lock.json +0 -1327
  151. package/examples/cordova/package.json +0 -30
  152. package/examples/cordova/scripts/android.sh +0 -8
  153. package/examples/cordova/scripts/ios.sh +0 -8
  154. package/examples/cordova/scripts/setup.sh +0 -8
  155. package/examples/cordova/www/images/logo.png +0 -0
  156. package/examples/cordova/www/index.html +0 -21
  157. package/examples/cordova/www/src/main.css +0 -83
  158. package/examples/cordova/www/src/main.html +0 -25
  159. package/examples/cordova/www/src/main.js +0 -152
  160. package/examples/ionic/index.ts +0 -17
  161. package/examples/ionic/src/images/portrait.png +0 -0
  162. /package/examples/ionic/{src/assets → assets}/.gitkeep +0 -0
  163. /package/examples/ionic/{src/images → images}/icon.png +0 -0
  164. /package/examples/{cordova/www → ionic}/images/portrait.png +0 -0
@@ -8,19 +8,19 @@
8
8
  "start": "expo start"
9
9
  },
10
10
  "dependencies": {
11
- "@regulaforensics/face-sdk": "7.1.432-nightly",
12
- "@regulaforensics/face-core-basic": "7.1.249-nightly",
13
- "react-native": "0.79.2",
11
+ "@regulaforensics/face-sdk": "7.1.439-nightly",
12
+ "@regulaforensics/face-core-basic": "7.1.257-nightly",
13
+ "react-native": "0.79.5",
14
14
  "react-native-fs": "2.20.0",
15
15
  "react-native-image-picker": "8.2.1",
16
- "react-native-webview": "13.13.5",
17
- "@react-native/metro-config": "0.79.2",
16
+ "react-native-webview": "13.15.0",
17
+ "@react-native/metro-config": "0.79.5",
18
18
  "react": "19.1.0",
19
- "@types/react": "19.1.4",
20
- "expo": "53.0.9",
21
- "expo-dev-client": "5.1.8",
19
+ "@types/react": "19.1.8",
20
+ "expo": "53.0.20",
21
+ "expo-dev-client": "5.2.4",
22
22
  "expo-custom-assets": "1.4.1",
23
- "expo-build-properties": "0.14.6",
23
+ "expo-build-properties": "0.14.8",
24
24
  "typescript": "5.8.3"
25
25
  }
26
26
  }
@@ -1,15 +1,19 @@
1
1
  html,
2
2
  body {
3
- width: 99%;
3
+ margin: 0;
4
+ width: 100%;
4
5
  height: 99vh;
5
6
  display: flex;
7
+ overflow: hidden;
6
8
  flex-direction: column;
7
9
  }
8
10
 
9
- .page {
10
- height: 100%;
11
- display: flex;
12
- flex-direction: column;
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;
13
17
  }
14
18
 
15
19
  .column {
@@ -52,10 +56,14 @@ body {
52
56
  margin-top: 13px;
53
57
  }
54
58
 
59
+ .scroll {
60
+ flex-grow: 1;
61
+ overflow-y: auto;
62
+ }
63
+
55
64
  .no-scroll {
56
65
  flex-grow: 1;
57
66
  overflow-y: hidden;
58
- overflow-x: hidden;
59
67
  }
60
68
 
61
69
  .button {
@@ -67,6 +75,7 @@ body {
67
75
  color: white;
68
76
  border: none;
69
77
  padding: 10px 20px;
78
+ justify-content: center;
70
79
  font-size: 16px;
71
80
  border-radius: 100px;
72
81
  cursor: pointer;
@@ -80,4 +89,49 @@ body {
80
89
  .button:active {
81
90
  position: relative;
82
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
+ .progress-bar {
124
+ width: 75%;
125
+ padding: 3px;
126
+ margin-top: 40px;
127
+ background-color: #eee;
128
+ border-radius: 8px;
129
+ box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
130
+ }
131
+
132
+ #progress {
133
+ width: 0%;
134
+ height: 20px;
135
+ background-color: #4285F4;
136
+ border-radius: 5px;
83
137
  }
@@ -1,4 +1,4 @@
1
- <div class="page">
1
+ <div class="column" style="height: 100%">
2
2
  <div class="column header">
3
3
  <span id="status">Loading...</span>
4
4
  <div class="column divider"></div>
@@ -1,14 +1,21 @@
1
- import { document } from '../index'
2
- import * as RNFS from 'react-native-fs'
3
- import { Alert, Platform } from 'react-native'
4
- import { launchImageLibrary } from 'react-native-image-picker'
5
1
  import { FaceSDK, MatchFacesRequest, MatchFacesImage, InitConfig, LivenessSkipStep, ImageType, LivenessStatus, LivenessConfig } from '@regulaforensics/face-sdk'
2
+ import { loadAssetIfExists, chooseOption, pickImage } from '../index'
3
+
4
+ var faceSdk = FaceSDK.instance
5
+ var image1: MatchFacesImage | null
6
+ var image2: MatchFacesImage | null
6
7
 
7
8
  async function init() {
8
- if (!await initialize()) return
9
+ if (!await initializeReader()) return
9
10
  setStatus("Ready")
10
11
  }
11
12
 
13
+ async function startFaceCapture(position: number) {
14
+ var image = (await faceSdk.startFaceCapture()).image
15
+ if (image == null) return
16
+ setImage("data:image/png;base64," + image.image, image.imageType, position)
17
+ }
18
+
12
19
  async function startLiveness() {
13
20
  var response = await faceSdk.startLiveness({
14
21
  config: new LivenessConfig({
@@ -19,7 +26,7 @@ async function startLiveness() {
19
26
  }
20
27
  })
21
28
  if (response.image == null) return
22
- setImage(response.image, ImageType.LIVE, 1)
29
+ setImage("data:image/png;base64," + response.image, ImageType.LIVE, 1)
23
30
  setLivenessStatus(response.liveness == LivenessStatus.PASSED ? "passed" : "unknown")
24
31
  }
25
32
 
@@ -39,18 +46,34 @@ async function matchFaces() {
39
46
  setStatus("Ready")
40
47
  }
41
48
 
42
- function clearResults() {
43
- setStatus("Ready")
49
+ async function getImage(position: number) {
50
+ var source = await chooseOption()
51
+ if (source == null) return
52
+ if (source) startFaceCapture(position)
53
+ else {
54
+ var image = await pickImage()
55
+ if (image == null) return
56
+ setImage(image, ImageType.PRINTED, position)
57
+ }
58
+ }
59
+
60
+ function setImage(base64: string, type: number, position: number) {
44
61
  setSimilarityStatus("null")
45
- setLivenessStatus("null")
46
- resetImages()
47
- image1 = null
48
- image2 = null
62
+ var mfImage = new MatchFacesImage(base64, type)
63
+ if (position == 1) {
64
+ image1 = mfImage
65
+ setUiImage1(base64)
66
+ setLivenessStatus("null")
67
+ }
68
+ if (position == 2) {
69
+ image2 = mfImage
70
+ setUiImage2(base64)
71
+ }
49
72
  }
50
73
 
51
74
  // If 'regula.license' exists, init using license(enables offline match)
52
75
  // otherwise init without license.
53
- async function initialize() {
76
+ async function initializeReader() {
54
77
  setStatus("Initializing...")
55
78
 
56
79
  var license = await loadAssetIfExists("regula.license")
@@ -58,82 +81,36 @@ async function initialize() {
58
81
  if (license != null) config = new InitConfig(license)
59
82
  var [success, error] = await faceSdk.initialize({ config: config })
60
83
 
61
- if (!success && error != null) {
84
+ if (error != null) {
62
85
  setStatus(error.message)
63
86
  console.log(error.code + ": " + error.message)
64
87
  }
65
88
  return success
66
89
  }
67
90
 
68
- function setImage(base64: string, type: number, position: number) {
69
- setSimilarityStatus("null")
70
- var mfImage = new MatchFacesImage(base64, type)
71
- if (position == 1) {
72
- image1 = mfImage
73
- setUiImage1("data:image/png;base64," + base64)
74
- setLivenessStatus("null")
75
- }
76
- if (position == 2) {
77
- image2 = mfImage
78
- setUiImage2("data:image/png;base64," + base64)
79
- }
80
- }
81
-
82
- async function useCamera(position: number) {
83
- var response = await faceSdk.startFaceCapture()
84
- if (response.image == null) return
85
- var image = response.image
86
- setImage(image.image, image.imageType, position)
87
- }
91
+ // --------------------------------------------------------------------------------------------------------------------
88
92
 
89
- function useGallery(position: number) {
90
- launchImageLibrary({
91
- mediaType: 'photo',
92
- selectionLimit: 1,
93
- includeBase64: true
94
- }, (response: any) => {
95
- if (response.assets == null) return
96
- setImage(response.assets[0].base64!, ImageType.PRINTED, position)
97
- })
98
- }
93
+ export function main() {
94
+ document.getElementById("first-image")!.onclick = () => getImage(1)
95
+ document.getElementById("second-image")!.onclick = () => getImage(2)
96
+ document.getElementById("match-faces")!.onclick = () => matchFaces()
97
+ document.getElementById("start-liveness")!.onclick = () => startLiveness()
98
+ document.getElementById("clear-results")!.onclick = () => clearResults()
99
99
 
100
- function pickImage(position: number) {
101
- Alert.alert("Select option", "", [
102
- { text: "Use gallery", onPress: () => useGallery(position) },
103
- { text: "Use camera", onPress: () => useCamera(position) }
104
- ], { cancelable: true })
105
- }
106
-
107
- async function loadAssetIfExists(path: string): Promise<string | null> {
108
- if (Platform.OS === 'ios') path = RNFS.MainBundlePath + "/" + path
109
- var readFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileRes
110
- try {
111
- return await readFile(path, 'base64')
112
- } catch {
113
- return null
114
- }
100
+ init()
115
101
  }
116
102
 
117
- var faceSdk = FaceSDK.instance
118
- var image1: MatchFacesImage | null
119
- var image2: MatchFacesImage | null
120
-
121
- var setStatus = (data: string) => document.getElementById("status").innerHTML = data
122
- var setLivenessStatus = (data: string) => document.getElementById("liveness-status").innerHTML = data
123
- var setSimilarityStatus = (data: string) => document.getElementById("similarity-status").innerHTML = data
103
+ var setStatus = (data: string) => document.getElementById("status")!.innerHTML = data
104
+ var setLivenessStatus = (data: string) => document.getElementById("liveness-status")!.innerHTML = data
105
+ var setSimilarityStatus = (data: string) => document.getElementById("similarity-status")!.innerHTML = data
124
106
  var setUiImage1 = (data: string) => (document.getElementById("first-image") as HTMLImageElement).src = data
125
107
  var setUiImage2 = (data: string) => (document.getElementById("second-image") as HTMLImageElement).src = data
126
- var resetImages = () => {
108
+ var clearResults = () => {
109
+ setStatus("Ready")
110
+ setSimilarityStatus("null")
111
+ setLivenessStatus("null")
127
112
  setUiImage1("images/portrait.png")
128
113
  setUiImage2("images/portrait.png")
129
- }
130
-
131
- export function onload() {
132
- document.getElementById("first-image").onclick = () => pickImage(1)
133
- document.getElementById("second-image").onclick = () => pickImage(2)
134
- document.getElementById("match-faces").onclick = () => matchFaces()
135
- document.getElementById("start-liveness").onclick = () => startLiveness()
136
- document.getElementById("clear-results").onclick = () => clearResults()
137
-
138
- init()
114
+ image1 = null
115
+ image2 = null
139
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/face-sdk",
3
- "version": "7.1.432-nightly",
3
+ "version": "7.1.439-nightly",
4
4
  "description": "This is an npm module for Regula Face SDK. It allows you to easily compaire faces using your phone's camera.",
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/face-sdk" version="7.1.432-nightly" xmlns="http://apache.org/cordova/ns/plugins/1.0">
2
+ <plugin id="@regulaforensics/face-sdk" version="7.1.439-nightly" xmlns="http://apache.org/cordova/ns/plugins/1.0">
3
3
  <name>FaceSDK</name>
4
4
  <description>Cordova plugin for Regula Face SDK</description>
5
5
  <license>commercial</license>
@@ -29,7 +29,7 @@
29
29
  <source url="https://github.com/CocoaPods/Specs.git" />
30
30
  </config>
31
31
  <pods>
32
- <pod name="FaceSDKNightly" spec="7.1.3037" />
32
+ <pod name="FaceSDKNightly" spec="7.1.3089" />
33
33
  </pods>
34
34
  </podspec>
35
35
  </platform>