@regulaforensics/face-sdk 8.5.1573-rc → 8.5.1575-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.
Files changed (63) hide show
  1. package/Package.swift +1 -1
  2. package/android/build.gradle.kts +1 -1
  3. package/android/cordova.gradle.kts +1 -1
  4. package/android/src/main/kotlin/com/regula/plugin/face/sdk/Config.kt +19 -1
  5. package/android/src/main/kotlin/com/regula/plugin/face/sdk/JSONConstructor.kt +16 -16
  6. package/examples/capacitor/ios/App/App/Info.plist +2 -0
  7. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +4 -4
  8. package/examples/capacitor/package-lock.json +272 -446
  9. package/examples/capacitor/package.json +8 -3
  10. package/examples/ionic/README.md +2 -2
  11. package/examples/ionic/config.xml +1 -1
  12. package/examples/ionic/package-lock.json +5143 -1586
  13. package/examples/ionic/package.json +24 -4
  14. package/examples/ionic/scripts/ios.sh +3 -1
  15. package/examples/react_native/README.md +1 -2
  16. package/examples/react_native/app.config.ts +3 -0
  17. package/examples/react_native/index.tsx +65 -35
  18. package/examples/react_native/metro.config.js +1 -3
  19. package/examples/react_native/package-lock.json +1304 -1661
  20. package/examples/react_native/package.json +19 -21
  21. package/examples/react_native/scripts/android.sh +1 -8
  22. package/examples/react_native/scripts/ios.sh +3 -11
  23. package/examples/react_native/scripts/setup.sh +1 -5
  24. package/examples/react_native/scripts/withoutMetroServer.js +89 -0
  25. package/ios/Config.swift +21 -29
  26. package/ios/Decoder.swift +25 -21
  27. package/ios/Implementation.swift +3 -3
  28. package/package.json +1 -1
  29. package/plugin.xml +2 -2
  30. package/react-native-face-sdk.podspec +2 -2
  31. package/test/json.tsx +12 -0
  32. package/test/package-lock.json +5 -2
  33. package/test/test.tsx +66 -74
  34. package/www/capacitor/customization/customization_images.js +8 -0
  35. package/www/capacitor/customization/screen_orientation.js +2 -0
  36. package/www/capacitor/detect_faces/detect_faces_response.js +3 -0
  37. package/www/capacitor/face_capture/face_capture_config.js +12 -0
  38. package/www/capacitor/liveness/enrollment_config.js +8 -0
  39. package/www/capacitor/liveness/liveness_config.js +8 -0
  40. package/www/capacitor/liveness/liveness_notification.js +4 -2
  41. package/www/capacitor/liveness/verification_config.js +8 -0
  42. package/www/capacitor/match_faces/match_faces_response.js +3 -0
  43. package/www/cordova.js +56 -2
  44. package/www/react-native/customization/customization_images.js +8 -0
  45. package/www/react-native/customization/screen_orientation.js +2 -0
  46. package/www/react-native/detect_faces/detect_faces_response.js +3 -0
  47. package/www/react-native/face_capture/face_capture_config.js +12 -0
  48. package/www/react-native/liveness/enrollment_config.js +8 -0
  49. package/www/react-native/liveness/liveness_config.js +8 -0
  50. package/www/react-native/liveness/liveness_notification.js +4 -2
  51. package/www/react-native/liveness/verification_config.js +8 -0
  52. package/www/react-native/match_faces/match_faces_response.js +3 -0
  53. package/www/types/customization/customization_images.d.ts +1 -0
  54. package/www/types/customization/screen_orientation.d.ts +4 -0
  55. package/www/types/detect_faces/detect_faces_response.d.ts +3 -0
  56. package/www/types/face_capture/face_capture_config.d.ts +15 -0
  57. package/www/types/liveness/enrollment_config.d.ts +6 -0
  58. package/www/types/liveness/liveness_backend_exception.d.ts +1 -1
  59. package/www/types/liveness/liveness_config.d.ts +8 -0
  60. package/www/types/liveness/liveness_notification.d.ts +2 -0
  61. package/www/types/liveness/verification_config.d.ts +8 -0
  62. package/www/types/match_faces/match_faces_response.d.ts +3 -0
  63. package/examples/react_native/index.html +0 -12
package/Package.swift CHANGED
@@ -10,7 +10,7 @@ let package = Package(
10
10
  .package(url: "https://github.com/apache/cordova-ios.git", branch: "master"),
11
11
  .package(
12
12
  url: "https://github.com/regulaforensics/FaceSDK-Swift-Package",
13
- exact: "8.5.5289-rc"
13
+ exact: "8.5.5291-rc"
14
14
  )
15
15
  ],
16
16
  targets: [
@@ -31,7 +31,7 @@ dependencies {
31
31
  //noinspection GradleDynamicVersion
32
32
  implementation("com.facebook.react:react-native:+")
33
33
  //noinspection GradleDependency
34
- implementation("com.regula.face:api:8.5.5698") {
34
+ implementation("com.regula.face:api:8.5.5703") {
35
35
  isTransitive = true
36
36
  }
37
37
  }
@@ -11,7 +11,7 @@ repositories {
11
11
 
12
12
  dependencies {
13
13
  //noinspection GradleDependency
14
- add("implementation", "com.regula.face:api:8.5.5698") {
14
+ add("implementation", "com.regula.face:api:8.5.5703") {
15
15
  isTransitive = true
16
16
  }
17
17
  }
@@ -28,6 +28,9 @@ fun setFaceCaptureConfig(builder: FaceCaptureConfiguration.Builder, config: JSON
28
28
  "detectOcclusion" -> builder.setDetectOcclusion(v as Boolean)
29
29
  "showFaceAnimation" -> builder.setShowFaceAnimation(v as Boolean)
30
30
  "preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
31
+ "usbCamera" -> builder.setUsbCamera(v as Boolean)
32
+ "usbCameraMirrorPreview" -> builder.setUsbCameraMirrorPreview(v as Boolean)
33
+ "rejectMultipleFaces" -> builder.setRejectMultipleFaces(v as Boolean)
31
34
  "cameraPositionAndroid" -> builder.setCameraId(v.toInt())
32
35
  "screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
33
36
  "timeout" -> builder.setTimeout(v.toFloat())
@@ -44,6 +47,9 @@ fun getFaceCaptureConfig(input: FaceCaptureConfiguration) = mapOf(
44
47
  "detectOcclusion" to input.isDetectOcclusion,
45
48
  "showFaceAnimation" to input.isShowFaceAnimation,
46
49
  "preventScreenRecording" to input.doPreventScreenRecording(),
50
+ "usbCamera" to input.isUsbCamera,
51
+ "usbCameraMirrorPreview" to input.isUsbCameraMirrorPreview,
52
+ "rejectMultipleFaces" to input.isRejectMultipleFaces,
47
53
  "cameraPositionAndroid" to input.cameraId,
48
54
  "screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
49
55
  "timeout" to input.timeout,
@@ -62,6 +68,8 @@ fun setLivenessConfig(builder: LivenessConfiguration.Builder, config: JSONObject
62
68
  "screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
63
69
  "locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
64
70
  "preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
71
+ "usbCamera" -> builder.setUsbCamera(v as Boolean)
72
+ "usbCameraMirrorPreview" -> builder.setUsbCameraMirrorPreview(v as Boolean)
65
73
  "attemptsCount" -> builder.setAttemptsCount(v.toInt())
66
74
  "recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
67
75
  "livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
@@ -81,6 +89,8 @@ fun getLivenessConfig(input: LivenessConfiguration) = mapOf(
81
89
  "screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
82
90
  "locationTrackingEnabled" to input.isLocationTrackingEnabled,
83
91
  "preventScreenRecording" to input.doPreventScreenRecording(),
92
+ "usbCamera" to input.isUsbCamera,
93
+ "usbCameraMirrorPreview" to input.isUsbCameraMirrorPreview,
84
94
  "attemptsCount" to input.attemptsCount,
85
95
  "recordingProcess" to input.recordingProcess.ordinal,
86
96
  "livenessType" to input.type.ordinal,
@@ -101,6 +111,8 @@ fun setEnrollmentConfig(builder: EnrollmentConfiguration.Builder, config: JSONOb
101
111
  "screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
102
112
  "locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
103
113
  "preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
114
+ "usbCamera" -> builder.setUsbCamera(v as Boolean)
115
+ "usbCameraMirrorPreview" -> builder.setUsbCameraMirrorPreview(v as Boolean)
104
116
  "attemptsCount" -> builder.setAttemptsCount(v.toInt())
105
117
  "recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
106
118
  "livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
@@ -122,6 +134,8 @@ fun getEnrollmentConfig(input: EnrollmentConfiguration) = mapOf(
122
134
  "screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
123
135
  "locationTrackingEnabled" to input.isLocationTrackingEnabled,
124
136
  "preventScreenRecording" to input.doPreventScreenRecording(),
137
+ "usbCamera" to input.isUsbCamera,
138
+ "usbCameraMirrorPreview" to input.isUsbCameraMirrorPreview,
125
139
  "attemptsCount" to input.attemptsCount,
126
140
  "recordingProcess" to input.recordingProcess.ordinal,
127
141
  "livenessType" to input.type.ordinal,
@@ -144,13 +158,15 @@ fun setVerificationConfig(builder: VerificationConfiguration.Builder, config: JS
144
158
  "screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
145
159
  "locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
146
160
  "preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
161
+ "usbCamera" -> builder.setUsbCamera(v as Boolean)
162
+ "usbCameraMirrorPreview" -> builder.setUsbCameraMirrorPreview(v as Boolean)
147
163
  "attemptsCount" -> builder.setAttemptsCount(v.toInt())
148
164
  "recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
149
165
  "livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
150
166
  "tag" -> builder.setTag(v as String)
151
167
  "skipStep" -> builder.setSkipStep(*livenessSkipStepArrayFromJSON(v as JSONArray))
152
168
  "metadata" -> builder.setMetadata(v as JSONObject)
153
- "personId" -> builder.setPrivateProperty("u", v as String)
169
+ "personId" -> builder.setPrivateProperty("w", v as String)
154
170
  "threshold" -> builder.setThreshold(v.toFloat())
155
171
  }
156
172
  }
@@ -165,6 +181,8 @@ fun getVerificationConfig(input: VerificationConfiguration) = mapOf(
165
181
  "screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
166
182
  "locationTrackingEnabled" to input.isLocationTrackingEnabled,
167
183
  "preventScreenRecording" to input.doPreventScreenRecording(),
184
+ "usbCamera" to input.isUsbCamera,
185
+ "usbCameraMirrorPreview" to input.isUsbCameraMirrorPreview,
168
186
  "attemptsCount" to input.attemptsCount,
169
187
  "recordingProcess" to input.recordingProcess.ordinal,
170
188
  "livenessType" to input.type.ordinal,
@@ -171,12 +171,12 @@ fun generateScreenOrientationArray(input: Array<ScreenOrientation>) = input.let
171
171
  // Exception ------------------------------
172
172
 
173
173
  fun faceCaptureExceptionFromJSON(input: JSONObject?) = input?.let {
174
- FaceCaptureException(FaceCaptureErrorCode.values()[it.getInt("code")])
174
+ FaceCaptureException(FaceCaptureErrorCode.get(it.getInt("code")))
175
175
  }
176
176
 
177
177
  fun generateFaceCaptureException(input: FaceCaptureException?) = input?.let {
178
178
  mapOf(
179
- "code" to it.errorCode.ordinal,
179
+ "code" to it.errorCode.value,
180
180
  "message" to it.message
181
181
  ).toJson()
182
182
  }
@@ -212,14 +212,14 @@ fun generateLicenseException(input: LicenseException?) = input?.let {
212
212
 
213
213
  fun livenessExceptionFromJSON(input: JSONObject?) = input?.let {
214
214
  LivenessErrorException(
215
- LivenessErrorCode.values()[it.getInt("code")],
215
+ LivenessErrorCode.get(it.getInt("code")),
216
216
  livenessBackendExceptionFromJSON(it.getJSONObjectOrNull("underlyingError"))
217
217
  )
218
218
  }
219
219
 
220
220
  fun generateLivenessException(input: LivenessErrorException?) = input?.let {
221
221
  mapOf(
222
- "code" to it.errorCode.ordinal,
222
+ "code" to it.errorCode.value,
223
223
  "message" to it.message,
224
224
  "underlyingError" to generateLivenessBackendException(it.underlyingException)
225
225
  ).toJson()
@@ -668,23 +668,20 @@ fun generateComparedFacesPair(it: MatchFacesComparedFacesPair) = mapOf(
668
668
  ).toJson()
669
669
 
670
670
  fun matchFacesResponseFromJSON(input: JSONObject) = input.let {
671
- MatchFacesResponse::class.constructor(
672
- ArrayList::class,
673
- ArrayList::class,
674
- String::class,
675
- MatchFacesException::class
676
- ).instantiate(
677
- it.getJSONArrayOrNull("detections").toList(::matchFacesDetectionFromJSON).toArrayList(),
678
- it.getJSONArrayOrNull("results").toList(::comparedFacesPairFromJSON).toArrayList(),
679
- it.getStringOrNull("tag"),
680
- matchFacesExceptionFromJSON(it.getJSONObjectOrNull("error")),
681
- )
671
+ val result = MatchFacesResponse::class.constructor().instantiate()
672
+ result.setPrivateProperty("detections", it.getJSONArrayOrNull("detections").toList(::matchFacesDetectionFromJSON))
673
+ result.setPrivateProperty("results", it.getJSONArrayOrNull("results").toList(::comparedFacesPairFromJSON))
674
+ result.setPrivateProperty("tag", it.getStringOrNull("tag"))
675
+ result.setPrivateProperty("transactionId", it.getStringOrNull("transactionId"))
676
+ result.setPrivateProperty("exception", matchFacesExceptionFromJSON(it.getJSONObjectOrNull("error")))
677
+ result
682
678
  }
683
679
 
684
680
  fun generateMatchFacesResponse(it: MatchFacesResponse) = mapOf(
685
681
  "detections" to it.detections.toJson(::generateMatchFacesDetection),
686
682
  "results" to it.results.toJson(::generateComparedFacesPair),
687
683
  "tag" to it.tag,
684
+ "transactionId" to it.transactionId,
688
685
  "error" to generateMatchFacesException(it.exception)
689
686
  ).toJson()
690
687
 
@@ -829,17 +826,20 @@ fun detectFacesResponseFromJSON(input: JSONObject): DetectFacesResponse = input.
829
826
  DetectFacesResponse::class.constructor(
830
827
  String::class,
831
828
  List::class,
832
- DetectFacesErrorException::class
829
+ DetectFacesErrorException::class,
830
+ String::class,
833
831
  ).instantiate(
834
832
  it.getStringOrNull("scenario"),
835
833
  it.getJSONArrayOrNull("allDetections").toList(::detectFaceResultFromJSON),
836
834
  detectFacesExceptionFromJSON(it.getJSONObjectOrNull("error")),
835
+ it.getStringOrNull("transactionId"),
837
836
  )
838
837
  }
839
838
 
840
839
  fun generateDetectFacesResponse(it: DetectFacesResponse) = mapOf(
841
840
  "detection" to generateDetectFaceResult(it.detection),
842
841
  "scenario" to it.scenario,
842
+ "transactionId" to it.transactionId,
843
843
  "error" to generateDetectFacesException(it.error),
844
844
  "allDetections" to it.allDetections.toJsonNullable(::generateDetectFaceResult)
845
845
  ).toJson()
@@ -31,6 +31,8 @@
31
31
  <string></string>
32
32
  <key>NSPhotoLibraryUsageDescription</key>
33
33
  <string></string>
34
+ <key>NSPhotoLibraryAddUsageDescription</key>
35
+ <string>Required by @capacitor/camera plugin, not used.</string>
34
36
  <key>UILaunchStoryboardName</key>
35
37
  <string>LaunchScreen</string>
36
38
  <key>UIRequiredDeviceCapabilities</key>
@@ -227,7 +227,7 @@
227
227
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
228
228
  GCC_WARN_UNUSED_FUNCTION = YES;
229
229
  GCC_WARN_UNUSED_VARIABLE = YES;
230
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
230
+ IPHONEOS_DEPLOYMENT_TARGET = 17.6;
231
231
  MTL_ENABLE_DEBUG_INFO = YES;
232
232
  ONLY_ACTIVE_ARCH = YES;
233
233
  SDKROOT = iphoneos;
@@ -279,7 +279,7 @@
279
279
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
280
280
  GCC_WARN_UNUSED_FUNCTION = YES;
281
281
  GCC_WARN_UNUSED_VARIABLE = YES;
282
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
282
+ IPHONEOS_DEPLOYMENT_TARGET = 17.6;
283
283
  MTL_ENABLE_DEBUG_INFO = NO;
284
284
  SDKROOT = iphoneos;
285
285
  SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -295,7 +295,7 @@
295
295
  CODE_SIGN_STYLE = Automatic;
296
296
  CURRENT_PROJECT_VERSION = 1;
297
297
  INFOPLIST_FILE = App/Info.plist;
298
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
298
+ IPHONEOS_DEPLOYMENT_TARGET = 17.6;
299
299
  LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
300
300
  MARKETING_VERSION = 1.0;
301
301
  PRODUCT_BUNDLE_IDENTIFIER = com.regula.example.face.capacitor;
@@ -315,7 +315,7 @@
315
315
  CODE_SIGN_STYLE = Automatic;
316
316
  CURRENT_PROJECT_VERSION = 1;
317
317
  INFOPLIST_FILE = App/Info.plist;
318
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
318
+ IPHONEOS_DEPLOYMENT_TARGET = 17.6;
319
319
  LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
320
320
  MARKETING_VERSION = 1.0;
321
321
  PRODUCT_BUNDLE_IDENTIFIER = com.regula.example.face.capacitor;