@regulaforensics/face-sdk 8.3.1174-rc → 8.3.1176-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 (118) hide show
  1. package/RNFaceSDK.podspec +2 -2
  2. package/android/build.gradle +2 -2
  3. package/android/cordova.gradle +2 -2
  4. package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +91 -0
  5. package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +106 -3
  6. package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +39 -1
  7. package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +0 -1
  8. package/examples/capacitor/README.md +1 -1
  9. package/examples/capacitor/package.json +2 -2
  10. package/examples/capacitor/scripts/android.sh +3 -1
  11. package/examples/capacitor/scripts/ios.sh +3 -1
  12. package/examples/capacitor/scripts/setup.sh +2 -0
  13. package/examples/ionic/README.md +1 -1
  14. package/examples/ionic/config.xml +0 -2
  15. package/examples/ionic/index.tsx +1 -1
  16. package/examples/ionic/package-lock.json +2360 -1733
  17. package/examples/ionic/package.json +21 -25
  18. package/examples/ionic/scripts/android.sh +4 -1
  19. package/examples/ionic/scripts/ios.sh +4 -1
  20. package/examples/ionic/scripts/setup.sh +2 -0
  21. package/examples/ionic/tsconfig.json +1 -1
  22. package/examples/react_native/README.md +1 -1
  23. package/examples/react_native/package.json +2 -2
  24. package/examples/react_native/scripts/android.sh +5 -5
  25. package/examples/react_native/scripts/ios.sh +5 -5
  26. package/examples/react_native/scripts/setup.sh +2 -0
  27. package/ios/Config.swift +107 -1
  28. package/ios/Decoder.swift +71 -3
  29. package/ios/Main.swift +24 -4
  30. package/package.json +1 -1
  31. package/plugin.xml +2 -2
  32. package/test/json.tsx +135 -57
  33. package/test/package-lock.json +2 -5
  34. package/test/test.tsx +183 -60
  35. package/www/capacitor/customization/customization_images.js +48 -0
  36. package/www/capacitor/customization/font.js +3 -3
  37. package/www/capacitor/detect_faces/detect_faces_config.js +5 -5
  38. package/www/capacitor/detect_faces/detect_faces_request.js +2 -2
  39. package/www/capacitor/face_capture/face_capture_config.js +14 -14
  40. package/www/capacitor/image_params/output_image_crop.js +4 -4
  41. package/www/capacitor/image_params/output_image_params.js +3 -3
  42. package/www/capacitor/image_quality/image_quality_characteristic.js +4 -4
  43. package/www/capacitor/image_quality/image_quality_group.js +2 -2
  44. package/www/capacitor/index.js +153 -32
  45. package/www/capacitor/init/init_config.js +2 -2
  46. package/www/capacitor/internal/bridge.js +2 -2
  47. package/www/capacitor/internal/cordova.js +2 -2
  48. package/www/capacitor/liveness/enrollment_config.js +102 -0
  49. package/www/capacitor/liveness/enrollment_request.js +39 -0
  50. package/www/capacitor/liveness/enrollment_response.js +26 -0
  51. package/www/capacitor/liveness/error_response.js +21 -0
  52. package/www/capacitor/liveness/liveness_config.js +18 -17
  53. package/www/capacitor/liveness/liveness_exception.js +7 -5
  54. package/www/capacitor/liveness/liveness_notification.js +2 -0
  55. package/www/capacitor/liveness/verification_config.js +98 -0
  56. package/www/capacitor/liveness/verification_response.js +27 -0
  57. package/www/capacitor/liveness/verify_match_response.js +21 -0
  58. package/www/capacitor/match_faces/match_faces_config.js +3 -3
  59. package/www/capacitor/match_faces/match_faces_image.js +2 -2
  60. package/www/capacitor/match_faces/match_faces_request.js +4 -4
  61. package/www/capacitor/person_database/edit_group_persons_request.js +3 -3
  62. package/www/capacitor/person_database/person_database.js +4 -4
  63. package/www/capacitor/person_database/search_person_request.js +7 -7
  64. package/www/cordova.js +703 -173
  65. package/www/react-native/customization/customization_images.js +48 -0
  66. package/www/react-native/customization/font.js +3 -3
  67. package/www/react-native/detect_faces/detect_faces_config.js +5 -5
  68. package/www/react-native/detect_faces/detect_faces_request.js +2 -2
  69. package/www/react-native/face_capture/face_capture_config.js +14 -14
  70. package/www/react-native/image_params/output_image_crop.js +4 -4
  71. package/www/react-native/image_params/output_image_params.js +3 -3
  72. package/www/react-native/image_quality/image_quality_characteristic.js +4 -4
  73. package/www/react-native/image_quality/image_quality_group.js +2 -2
  74. package/www/react-native/index.js +153 -32
  75. package/www/react-native/init/init_config.js +2 -2
  76. package/www/react-native/internal/bridge.js +2 -2
  77. package/www/react-native/liveness/enrollment_config.js +102 -0
  78. package/www/react-native/liveness/enrollment_request.js +39 -0
  79. package/www/react-native/liveness/enrollment_response.js +26 -0
  80. package/www/react-native/liveness/error_response.js +21 -0
  81. package/www/react-native/liveness/liveness_config.js +18 -17
  82. package/www/react-native/liveness/liveness_exception.js +7 -5
  83. package/www/react-native/liveness/liveness_notification.js +2 -0
  84. package/www/react-native/liveness/verification_config.js +98 -0
  85. package/www/react-native/liveness/verification_response.js +27 -0
  86. package/www/react-native/liveness/verify_match_response.js +21 -0
  87. package/www/react-native/match_faces/match_faces_config.js +3 -3
  88. package/www/react-native/match_faces/match_faces_image.js +2 -2
  89. package/www/react-native/match_faces/match_faces_request.js +4 -4
  90. package/www/react-native/person_database/edit_group_persons_request.js +3 -3
  91. package/www/react-native/person_database/person_database.js +4 -4
  92. package/www/react-native/person_database/search_person_request.js +7 -7
  93. package/www/types/customization/customization_images.d.ts +6 -0
  94. package/www/types/customization/font.d.ts +1 -1
  95. package/www/types/detect_faces/detect_faces_config.d.ts +1 -1
  96. package/www/types/detect_faces/detect_faces_request.d.ts +1 -1
  97. package/www/types/face_capture/face_capture_config.d.ts +1 -1
  98. package/www/types/image_params/output_image_crop.d.ts +1 -1
  99. package/www/types/image_params/output_image_params.d.ts +1 -1
  100. package/www/types/image_quality/image_quality_group.d.ts +1 -1
  101. package/www/types/index.d.ts +137 -15
  102. package/www/types/init/init_config.d.ts +1 -1
  103. package/www/types/liveness/enrollment_config.d.ts +97 -0
  104. package/www/types/liveness/enrollment_request.d.ts +24 -0
  105. package/www/types/liveness/enrollment_response.d.ts +9 -0
  106. package/www/types/liveness/error_response.d.ts +6 -0
  107. package/www/types/liveness/liveness_config.d.ts +2 -1
  108. package/www/types/liveness/liveness_exception.d.ts +32 -2
  109. package/www/types/liveness/liveness_notification.d.ts +2 -0
  110. package/www/types/liveness/verification_config.d.ts +95 -0
  111. package/www/types/liveness/verification_response.d.ts +10 -0
  112. package/www/types/liveness/verify_match_response.d.ts +6 -0
  113. package/www/types/match_faces/match_faces_config.d.ts +1 -1
  114. package/www/types/match_faces/match_faces_image.d.ts +1 -1
  115. package/www/types/match_faces/match_faces_request.d.ts +1 -1
  116. package/www/types/person_database/edit_group_persons_request.d.ts +1 -1
  117. package/www/types/person_database/person_database.d.ts +2 -2
  118. package/www/types/person_database/search_person_request.d.ts +1 -1
@@ -73,6 +73,42 @@ export class CustomizationImages {
73
73
  this._set({ "retryScreenHintGeo": val })
74
74
  }
75
75
 
76
+ _retryScreenHintBadSelfieQuality
77
+ set retryScreenHintBadSelfieQuality(val) {
78
+ this._retryScreenHintBadSelfieQuality = val
79
+ this._set({ "retryScreenHintBadSelfieQuality": val })
80
+ }
81
+
82
+ _retryScreenHintCleanLens
83
+ set retryScreenHintCleanLens(val) {
84
+ this._retryScreenHintCleanLens = val
85
+ this._set({ "retryScreenHintCleanLens": val })
86
+ }
87
+
88
+ _retryScreenHintAddIllumination
89
+ set retryScreenHintAddIllumination(val) {
90
+ this._retryScreenHintAddIllumination = val
91
+ this._set({ "retryScreenHintAddIllumination": val })
92
+ }
93
+
94
+ _retryScreenHintChangeBackground
95
+ set retryScreenHintChangeBackground(val) {
96
+ this._retryScreenHintChangeBackground = val
97
+ this._set({ "retryScreenHintChangeBackground": val })
98
+ }
99
+
100
+ _retryScreenHintFaceOcclusions
101
+ set retryScreenHintFaceOcclusions(val) {
102
+ this._retryScreenHintFaceOcclusions = val
103
+ this._set({ "retryScreenHintFaceOcclusions": val })
104
+ }
105
+
106
+ _retryScreenHintCovering
107
+ set retryScreenHintCovering(val) {
108
+ this._retryScreenHintCovering = val
109
+ this._set({ "retryScreenHintCovering": val })
110
+ }
111
+
76
112
  _processingScreenCloseButton
77
113
  set processingScreenCloseButton(val) {
78
114
  this._processingScreenCloseButton = val
@@ -100,6 +136,12 @@ export class CustomizationImages {
100
136
  result._retryScreenHintEnvironment = jsonObject["retryScreenHintEnvironment"]
101
137
  result._retryScreenHintSubject = jsonObject["retryScreenHintSubject"]
102
138
  result._retryScreenHintGeo = jsonObject["retryScreenHintGeo"]
139
+ result._retryScreenHintBadSelfieQuality = jsonObject["retryScreenHintBadSelfieQuality"]
140
+ result._retryScreenHintCleanLens = jsonObject["retryScreenHintCleanLens"]
141
+ result._retryScreenHintAddIllumination = jsonObject["retryScreenHintAddIllumination"]
142
+ result._retryScreenHintChangeBackground = jsonObject["retryScreenHintChangeBackground"]
143
+ result._retryScreenHintFaceOcclusions = jsonObject["retryScreenHintFaceOcclusions"]
144
+ result._retryScreenHintCovering = jsonObject["retryScreenHintCovering"]
103
145
  result._processingScreenCloseButton = jsonObject["processingScreenCloseButton"]
104
146
  result._successScreenImage = jsonObject["successScreenImage"]
105
147
 
@@ -120,6 +162,12 @@ export class CustomizationImages {
120
162
  "retryScreenHintEnvironment": this._retryScreenHintEnvironment,
121
163
  "retryScreenHintSubject": this._retryScreenHintSubject,
122
164
  "retryScreenHintGeo": this._retryScreenHintGeo,
165
+ "retryScreenHintBadSelfieQuality": this._retryScreenHintBadSelfieQuality,
166
+ "retryScreenHintCleanLens": this._retryScreenHintCleanLens,
167
+ "retryScreenHintAddIllumination": this._retryScreenHintAddIllumination,
168
+ "retryScreenHintChangeBackground": this._retryScreenHintChangeBackground,
169
+ "retryScreenHintFaceOcclusions": this._retryScreenHintFaceOcclusions,
170
+ "retryScreenHintCovering": this._retryScreenHintCovering,
123
171
  "processingScreenCloseButton": this._processingScreenCloseButton,
124
172
  "successScreenImage": this._successScreenImage,
125
173
  }
@@ -3,10 +3,10 @@ export class Font {
3
3
  size
4
4
  style
5
5
 
6
- constructor(name, params) {
6
+ constructor(name, options) {
7
7
  this.name = name
8
- this.size = params?.size
9
- this.style = params?.style
8
+ this.size = options?.size
9
+ this.style = options?.style
10
10
  }
11
11
 
12
12
  static fromJson(jsonObject) {
@@ -7,12 +7,12 @@ export class DetectFacesConfig {
7
7
  outputImageParams
8
8
  onlyCentralFace
9
9
 
10
- constructor(params) {
10
+ constructor(options) {
11
11
  this.onlyCentralFace = false
12
- this.attributes = params?.attributes
13
- this.customQuality = params?.customQuality
14
- this.outputImageParams = params?.outputImageParams
15
- this.onlyCentralFace = params?.onlyCentralFace ?? this.onlyCentralFace
12
+ this.attributes = options?.attributes
13
+ this.customQuality = options?.customQuality
14
+ this.outputImageParams = options?.outputImageParams
15
+ this.onlyCentralFace = options?.onlyCentralFace ?? this.onlyCentralFace
16
16
  }
17
17
 
18
18
  static fromJson(jsonObject) {
@@ -6,10 +6,10 @@ export class DetectFacesRequest {
6
6
  configuration
7
7
  tag
8
8
 
9
- constructor(image, configuration, params) {
9
+ constructor(image, configuration, options) {
10
10
  this.image = image
11
11
  this.configuration = configuration
12
- this.tag = params?.tag
12
+ this.tag = options?.tag
13
13
  }
14
14
 
15
15
  static qualityFull(image) {
@@ -16,20 +16,20 @@ export class FaceCaptureConfig {
16
16
  timeout
17
17
  holdStillDuration
18
18
 
19
- constructor(params) {
20
- this.copyright = params?.copyright ?? true
21
- this.cameraSwitchEnabled = params?.cameraSwitchEnabled ?? false
22
- this.closeButtonEnabled = params?.closeButtonEnabled ?? true
23
- this.torchButtonEnabled = params?.torchButtonEnabled ?? true
24
- this.vibrateOnSteps = params?.vibrateOnSteps ?? true
25
- this.detectOcclusion = params?.detectOcclusion ?? true
26
- this.showFaceAnimation = params?.showFaceAnimation ?? true
27
- this.preventScreenRecording = params?.preventScreenRecording ?? false
28
- this.cameraPositionIOS = params?.cameraPositionIOS ?? CameraPosition.FRONT
29
- this.cameraPositionAndroid = params?.cameraPositionAndroid
30
- this.screenOrientation = params?.screenOrientation ?? [ScreenOrientation.PORTRAIT]
31
- this.timeout = params?.timeout
32
- this.holdStillDuration = params?.holdStillDuration
19
+ constructor(options) {
20
+ this.copyright = options?.copyright ?? true
21
+ this.cameraSwitchEnabled = options?.cameraSwitchEnabled ?? false
22
+ this.closeButtonEnabled = options?.closeButtonEnabled ?? true
23
+ this.torchButtonEnabled = options?.torchButtonEnabled ?? true
24
+ this.vibrateOnSteps = options?.vibrateOnSteps ?? true
25
+ this.detectOcclusion = options?.detectOcclusion ?? true
26
+ this.showFaceAnimation = options?.showFaceAnimation ?? true
27
+ this.preventScreenRecording = options?.preventScreenRecording ?? false
28
+ this.cameraPositionIOS = options?.cameraPositionIOS ?? CameraPosition.FRONT
29
+ this.cameraPositionAndroid = options?.cameraPositionAndroid
30
+ this.screenOrientation = options?.screenOrientation ?? [ScreenOrientation.PORTRAIT]
31
+ this.timeout = options?.timeout
32
+ this.holdStillDuration = options?.holdStillDuration
33
33
  }
34
34
 
35
35
  static fromJson(jsonObject) {
@@ -6,11 +6,11 @@ export class OutputImageCrop {
6
6
  padColor
7
7
  returnOriginalRect
8
8
 
9
- constructor(type, params) {
9
+ constructor(type, options) {
10
10
  this.type = type
11
- this.size = params?.size
12
- this.padColor = params?.padColor
13
- this.returnOriginalRect = params?.returnOriginalRect ?? false
11
+ this.size = options?.size
12
+ this.padColor = options?.padColor
13
+ this.returnOriginalRect = options?.returnOriginalRect ?? false
14
14
  }
15
15
 
16
16
  static fromJson(jsonObject) {
@@ -4,9 +4,9 @@ export class OutputImageParams {
4
4
  crop
5
5
  backgroundColor
6
6
 
7
- constructor(params) {
8
- this.crop = params?.crop
9
- this.backgroundColor = params?.backgroundColor
7
+ constructor(options) {
8
+ this.crop = options?.crop
9
+ this.backgroundColor = options?.backgroundColor
10
10
  }
11
11
 
12
12
  static fromJson(jsonObject) {
@@ -6,12 +6,12 @@ export class ImageQualityCharacteristic {
6
6
  customRange
7
7
  color
8
8
 
9
- static _create(name, params) {
9
+ static _create(name, options) {
10
10
  var result = new ImageQualityCharacteristic()
11
11
  result.characteristicName = name
12
- result.recommendedRange = params?.recommended
13
- result.customRange = params?.custom
14
- result.color = params?.color
12
+ result.recommendedRange = options?.recommended
13
+ result.customRange = options?.custom
14
+ result.color = options?.color
15
15
  return result
16
16
  }
17
17
 
@@ -289,10 +289,10 @@ export class _Background {
289
289
  return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.OTHER_FACES)
290
290
  }
291
291
 
292
- backgroundColorMatch(params) {
292
+ backgroundColorMatch(options) {
293
293
  return ImageQualityCharacteristic._create(
294
294
  ImageQualityCharacteristicName.BACKGROUND_COLOR_MATCH,
295
- { color: params?.color }
295
+ { color: options?.color }
296
296
  )
297
297
  }
298
298
 
@@ -1,4 +1,9 @@
1
- import { exec, _setVideoEncoderCompletion, _setLivenessNotificationCompletion, _setCameraSwitchCallback } from './internal/bridge'
1
+ import {
2
+ exec,
3
+ _setVideoEncoderCompletion,
4
+ _setLivenessNotificationCompletion,
5
+ _setCameraSwitchCallback,
6
+ } from './internal/bridge'
2
7
 
3
8
  import { CameraPosition } from './customization/camera_position'
4
9
  import { CustomizationColors } from './customization/customization_colors'
@@ -7,8 +12,15 @@ import { CustomizationImages } from './customization/customization_images'
7
12
  import { Customization } from './customization/customization'
8
13
  import { Font } from './customization/font'
9
14
  import { ScreenOrientation } from './customization/screen_orientation'
10
-
11
- export { CameraPosition, CustomizationColors, CustomizationFonts, CustomizationImages, Customization, Font, ScreenOrientation }
15
+ export {
16
+ CameraPosition,
17
+ CustomizationColors,
18
+ CustomizationFonts,
19
+ CustomizationImages,
20
+ Customization,
21
+ Font,
22
+ ScreenOrientation,
23
+ }
12
24
 
13
25
  import { FaceSDKVersion } from './init/face_sdk_version'
14
26
  import { InitConfig } from './init/init_config'
@@ -16,8 +28,14 @@ import { InitException } from './init/init_exception'
16
28
  import { InitErrorCode } from './init/init_exception'
17
29
  import { LicenseException } from './init/license_exception'
18
30
  import { LicensingResultCode } from './init/license_exception'
19
-
20
- export { FaceSDKVersion, InitConfig, InitException, InitErrorCode, LicenseException, LicensingResultCode }
31
+ export {
32
+ FaceSDKVersion,
33
+ InitConfig,
34
+ InitException,
35
+ InitErrorCode,
36
+ LicenseException,
37
+ LicensingResultCode,
38
+ }
21
39
 
22
40
  import { DetectFaceResult } from './detect_faces/detect_face_result'
23
41
  import { DetectFacesAttributeResult } from './detect_faces/detect_faces_attribute_result'
@@ -28,39 +46,95 @@ import { DetectFacesException, DetectFacesErrorCode } from './detect_faces/detec
28
46
  import { DetectFacesRequest } from './detect_faces/detect_faces_request'
29
47
  import { DetectFacesResponse } from './detect_faces/detect_faces_response'
30
48
  import { DetectFacesScenario } from './detect_faces/detect_faces_scenario'
31
-
32
- export { DetectFaceResult, DetectFacesAttributeResult, DetectFacesAttribute, DetectFacesBackendException, DetectFacesBackendErrorCode, DetectFacesConfig, DetectFacesException, DetectFacesErrorCode, DetectFacesRequest, DetectFacesResponse, DetectFacesScenario }
49
+ export {
50
+ DetectFaceResult,
51
+ DetectFacesAttributeResult,
52
+ DetectFacesAttribute,
53
+ DetectFacesBackendException,
54
+ DetectFacesBackendErrorCode,
55
+ DetectFacesConfig,
56
+ DetectFacesException,
57
+ DetectFacesErrorCode,
58
+ DetectFacesRequest,
59
+ DetectFacesResponse,
60
+ DetectFacesScenario,
61
+ }
33
62
 
34
63
  import { FaceCaptureConfig } from './face_capture/face_capture_config'
35
64
  import { FaceCaptureException, FaceCaptureErrorCode } from './face_capture/face_capture_exception'
36
65
  import { FaceCaptureImage, ImageType } from './face_capture/face_capture_image'
37
66
  import { FaceCaptureResponse } from './face_capture/face_capture_response'
38
-
39
- export { FaceCaptureConfig, FaceCaptureException, FaceCaptureErrorCode, FaceCaptureImage, ImageType, FaceCaptureResponse }
67
+ export {
68
+ FaceCaptureConfig,
69
+ FaceCaptureException,
70
+ FaceCaptureErrorCode,
71
+ FaceCaptureImage,
72
+ ImageType,
73
+ FaceCaptureResponse,
74
+ }
40
75
 
41
76
  import { OutputImageCrop, OutputImageCropAspectRatio } from './image_params/output_image_crop'
42
77
  import { OutputImageParams } from './image_params/output_image_params'
43
78
  import { Point } from './image_params/point'
44
79
  import { Rect } from './image_params/rect'
45
80
  import { Size } from './image_params/size'
46
-
47
- export { OutputImageCrop, OutputImageCropAspectRatio, OutputImageParams, Point, Rect, Size }
81
+ export {
82
+ OutputImageCrop,
83
+ OutputImageCropAspectRatio,
84
+ OutputImageParams,
85
+ Point,
86
+ Rect,
87
+ Size,
88
+ }
48
89
 
49
90
  import { ImageQualityCharacteristicName } from './image_quality/image_quality_characteristic_name'
50
91
  import { ImageQualityCharacteristic } from './image_quality/image_quality_characteristic'
51
92
  import { ImageQualityGroup } from './image_quality/image_quality_group'
52
93
  import { ImageQualityRange } from './image_quality/image_quality_range'
53
94
  import { ImageQualityResult, ImageQualityGroupName, ImageQualityResultStatus } from './image_quality/image_quality_result'
95
+ export {
96
+ ImageQualityCharacteristicName,
97
+ ImageQualityCharacteristic,
98
+ ImageQualityGroup,
99
+ ImageQualityRange,
100
+ ImageQualityResult,
101
+ ImageQualityGroupName,
102
+ ImageQualityResultStatus,
103
+ }
54
104
 
55
- export { ImageQualityCharacteristicName, ImageQualityCharacteristic, ImageQualityGroup, ImageQualityRange, ImageQualityResult, ImageQualityGroupName, ImageQualityResultStatus }
56
-
57
- import { LivenessBackendException, LivenessBackendErrorCode } from './liveness/liveness_backend_exception'
58
105
  import { LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep } from './liveness/liveness_config'
106
+ import { EnrollmentConfig } from './liveness/enrollment_config'
107
+ import { EnrollmentRequest } from './liveness/enrollment_request'
108
+ import { VerificationConfig } from './liveness/verification_config'
109
+ import { LivenessBackendException, LivenessBackendErrorCode } from './liveness/liveness_backend_exception'
59
110
  import { LivenessException, LivenessErrorCode } from './liveness/liveness_exception'
60
- import { LivenessNotification, LivenessProcessStatus } from './liveness/liveness_notification'
61
111
  import { LivenessResponse, LivenessStatus } from './liveness/liveness_response'
62
-
63
- export { LivenessBackendException, LivenessBackendErrorCode, LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep, LivenessException, LivenessErrorCode, LivenessNotification, LivenessProcessStatus, LivenessResponse, LivenessStatus }
112
+ import { LivenessNotification, LivenessProcessStatus } from './liveness/liveness_notification'
113
+ import { ErrorResponse } from './liveness/error_response'
114
+ import { EnrollmentResponse } from './liveness/enrollment_response'
115
+ import { VerifyMatchResponse } from './liveness/verify_match_response'
116
+ import { VerificationResponse } from './liveness/verification_response'
117
+ export {
118
+ LivenessBackendException,
119
+ LivenessBackendErrorCode,
120
+ LivenessConfig,
121
+ RecordingProcess,
122
+ LivenessType,
123
+ LivenessSkipStep,
124
+ LivenessException,
125
+ LivenessErrorCode,
126
+ LivenessNotification,
127
+ LivenessProcessStatus,
128
+ LivenessResponse,
129
+ LivenessStatus,
130
+ EnrollmentConfig,
131
+ EnrollmentRequest,
132
+ VerificationConfig,
133
+ ErrorResponse,
134
+ EnrollmentResponse,
135
+ VerifyMatchResponse,
136
+ VerificationResponse,
137
+ }
64
138
 
65
139
  import { ComparedFace } from './match_faces/compared_face'
66
140
  import { ComparedFacesPair } from './match_faces/compared_faces_pair'
@@ -73,8 +147,21 @@ import { MatchFacesException, MatchFacesErrorCode } from './match_faces/match_fa
73
147
  import { MatchFacesImage } from './match_faces/match_faces_image'
74
148
  import { MatchFacesRequest } from './match_faces/match_faces_request'
75
149
  import { MatchFacesResponse } from './match_faces/match_faces_response'
76
-
77
- export { ComparedFace, ComparedFacesPair, ComparedFacesSplit, MatchFacesBackendException, MatchFacesConfig, ProcessingMode, MatchFacesDetectionFace, MatchFacesDetection, MatchFacesException, MatchFacesErrorCode, MatchFacesImage, MatchFacesRequest, MatchFacesResponse }
150
+ export {
151
+ ComparedFace,
152
+ ComparedFacesPair,
153
+ ComparedFacesSplit,
154
+ MatchFacesBackendException,
155
+ MatchFacesConfig,
156
+ ProcessingMode,
157
+ MatchFacesDetectionFace,
158
+ MatchFacesDetection,
159
+ MatchFacesException,
160
+ MatchFacesErrorCode,
161
+ MatchFacesImage,
162
+ MatchFacesRequest,
163
+ MatchFacesResponse,
164
+ }
78
165
 
79
166
  import { EditGroupPersonsRequest } from './person_database/edit_group_persons_request'
80
167
  import { ImageUpload } from './person_database/image_upload'
@@ -87,8 +174,19 @@ import { SearchPersonDetection } from './person_database/search_person_detection
87
174
  import { SearchPersonImage } from './person_database/search_person_image'
88
175
  import { SearchPersonRequest } from './person_database/search_person_request'
89
176
  import { SearchPerson } from './person_database/search_person'
90
-
91
- export { EditGroupPersonsRequest, ImageUpload, PageableItemList, PersonDatabase, PersonGroup, PersonImage, Person, SearchPersonDetection, SearchPersonImage, SearchPersonRequest, SearchPerson }
177
+ export {
178
+ EditGroupPersonsRequest,
179
+ ImageUpload,
180
+ PageableItemList,
181
+ PersonDatabase,
182
+ PersonGroup,
183
+ PersonImage,
184
+ Person,
185
+ SearchPersonDetection,
186
+ SearchPersonImage,
187
+ SearchPersonRequest,
188
+ SearchPerson,
189
+ }
92
190
 
93
191
 
94
192
  export class FaceSDK {
@@ -162,8 +260,8 @@ export class FaceSDK {
162
260
  return await exec("isInitialized", [])
163
261
  }
164
262
 
165
- async initialize(params) {
166
- var response = await exec("initialize", [params?.config])
263
+ async initialize(options) {
264
+ var response = await exec("initialize", [options?.config])
167
265
 
168
266
  var jsonObject = JSON.parse(response)
169
267
  var success = jsonObject["success"]
@@ -178,9 +276,9 @@ export class FaceSDK {
178
276
  exec("deinitialize", [])
179
277
  }
180
278
 
181
- async startFaceCapture(params) {
182
- _setCameraSwitchCallback(params?.cameraSwitchCallback)
183
- var response = await exec("startFaceCapture", [params?.config])
279
+ async startFaceCapture(options) {
280
+ _setCameraSwitchCallback(options?.cameraSwitchCallback)
281
+ var response = await exec("startFaceCapture", [options?.config])
184
282
  return FaceCaptureResponse.fromJson(JSON.parse(response))
185
283
  }
186
284
 
@@ -188,19 +286,42 @@ export class FaceSDK {
188
286
  exec("stopFaceCapture", [])
189
287
  }
190
288
 
191
- async startLiveness(params) {
192
- _setCameraSwitchCallback(params?.cameraSwitchCallback)
193
- _setLivenessNotificationCompletion(params?.notificationCompletion)
194
- var response = await exec("startLiveness", [params?.config])
289
+ async startLiveness(options) {
290
+ _setCameraSwitchCallback(options?.cameraSwitchCallback)
291
+ _setLivenessNotificationCompletion(options?.notificationCompletion)
292
+ var response = await exec("startLiveness", [options?.config])
195
293
  return LivenessResponse.fromJson(JSON.parse(response))
196
294
  }
197
295
 
296
+ async startEnrollment(config, options) {
297
+ _setCameraSwitchCallback(options?.cameraSwitchCallback)
298
+ _setLivenessNotificationCompletion(options?.notificationCompletion)
299
+ var response = JSON.parse(await exec("startEnrollment", [config]))
300
+ var lr = LivenessResponse.fromJson(response["livenessResponse"]);
301
+ var er = EnrollmentResponse.fromJson(response["enrollmentResponse"]);
302
+ return [lr, er];
303
+ }
304
+
305
+ async startVerification(config, options) {
306
+ _setCameraSwitchCallback(options?.cameraSwitchCallback)
307
+ _setLivenessNotificationCompletion(options?.notificationCompletion)
308
+ var response = JSON.parse(await exec("startVerification", [config]))
309
+ var lr = LivenessResponse.fromJson(response["livenessResponse"]);
310
+ var er = VerificationResponse.fromJson(response["verificationResponse"]);
311
+ return [lr, er];
312
+ }
313
+
314
+ async enrollWithTrustedPhoto(request) {
315
+ var response = await exec("enrollWithTrustedPhoto", [request])
316
+ return EnrollmentResponse.fromJson(JSON.parse(response));
317
+ }
318
+
198
319
  stopLiveness() {
199
320
  exec("stopLiveness", [])
200
321
  }
201
322
 
202
- async matchFaces(request, params) {
203
- var response = await exec("matchFaces", [request, params?.config])
323
+ async matchFaces(request, options) {
324
+ var response = await exec("matchFaces", [request, options?.config])
204
325
  return MatchFacesResponse.fromJson(JSON.parse(response))
205
326
  }
206
327
 
@@ -9,9 +9,9 @@ export class InitConfig {
9
9
  return result
10
10
  }
11
11
 
12
- constructor(license, params) {
12
+ constructor(license, options) {
13
13
  this.license = license
14
- this.licenseUpdate = params?.licenseUpdate
14
+ this.licenseUpdate = options?.licenseUpdate
15
15
  this.useBleDevice = false
16
16
  }
17
17
 
@@ -4,8 +4,8 @@ import { NativeModules, NativeEventEmitter } from 'react-native'
4
4
  const { RNFaceSDK } = NativeModules
5
5
  var eventManager = new NativeEventEmitter(RNFaceSDK)
6
6
 
7
- export async function exec(name, params) {
8
- return RNFaceSDK.exec(name, params)
7
+ export async function exec(name, options) {
8
+ return RNFaceSDK.exec(name, options)
9
9
  }
10
10
 
11
11
  function _setEvent(id, completion, fromJson) {
@@ -0,0 +1,102 @@
1
+ import { CameraPosition } from '../customization/camera_position'
2
+ import { ScreenOrientation } from '../customization/screen_orientation'
3
+ import { RecordingProcess, LivenessType, LivenessSkipStep } from './liveness_config'
4
+
5
+ export class EnrollmentConfig {
6
+ copyright
7
+ cameraSwitchEnabled
8
+ closeButtonEnabled
9
+ torchButtonEnabled
10
+ vibrateOnSteps
11
+ cameraPositionIOS
12
+ cameraPositionAndroid
13
+ screenOrientation
14
+ locationTrackingEnabled
15
+ preventScreenRecording
16
+ attemptsCount
17
+ recordingProcess
18
+ livenessType
19
+ tag
20
+ skipStep
21
+ metadata
22
+ externalId
23
+ groupId
24
+ checkDuplicatesEnabled
25
+ duplicatesThreshold
26
+
27
+ constructor(options) {
28
+ this.copyright = options?.copyright ?? true
29
+ this.cameraSwitchEnabled = options?.cameraSwitchEnabled ?? false
30
+ this.closeButtonEnabled = options?.closeButtonEnabled ?? true
31
+ this.torchButtonEnabled = options?.torchButtonEnabled ?? true
32
+ this.vibrateOnSteps = options?.vibrateOnSteps ?? true
33
+ this.cameraPositionIOS = options?.cameraPositionIOS ?? CameraPosition.FRONT
34
+ this.cameraPositionAndroid = options?.cameraPositionAndroid
35
+ this.screenOrientation = options?.screenOrientation ?? [ScreenOrientation.PORTRAIT]
36
+ this.locationTrackingEnabled = options?.locationTrackingEnabled ?? true
37
+ this.preventScreenRecording = options?.preventScreenRecording ?? false
38
+ this.attemptsCount = options?.attemptsCount ?? 0
39
+ this.recordingProcess = options?.recordingProcess ?? RecordingProcess.ASYNCHRONOUS_UPLOAD
40
+ this.livenessType = options?.livenessType ?? LivenessType.ACTIVE
41
+ this.tag = options?.tag
42
+ this.skipStep = options?.skipStep ?? []
43
+ this.metadata = options?.metadata
44
+ this.externalId = options?.externalId
45
+ this.groupId = options?.groupId
46
+ this.checkDuplicatesEnabled = options?.checkDuplicatesEnabled
47
+ this.duplicatesThreshold = options?.duplicatesThreshold
48
+ }
49
+
50
+ static fromJson(jsonObject) {
51
+ if (jsonObject == null) return null
52
+ const result = new EnrollmentConfig()
53
+
54
+ result.copyright = jsonObject["copyright"]
55
+ result.cameraSwitchEnabled = jsonObject["cameraSwitchEnabled"]
56
+ result.closeButtonEnabled = jsonObject["closeButtonEnabled"]
57
+ result.torchButtonEnabled = jsonObject["torchButtonEnabled"]
58
+ result.vibrateOnSteps = jsonObject["vibrateOnSteps"]
59
+ result.cameraPositionAndroid = jsonObject["cameraPositionAndroid"]
60
+ result.cameraPositionIOS = jsonObject["cameraPositionIOS"]
61
+ result.screenOrientation = jsonObject["screenOrientation"]
62
+ result.locationTrackingEnabled = jsonObject["locationTrackingEnabled"]
63
+ result.preventScreenRecording = jsonObject["preventScreenRecording"]
64
+ result.attemptsCount = jsonObject["attemptsCount"]
65
+ result.recordingProcess = jsonObject["recordingProcess"]
66
+ result.livenessType = jsonObject["livenessType"]
67
+ result.tag = jsonObject["tag"]
68
+ result.skipStep = jsonObject["skipStep"]
69
+ result.metadata = jsonObject["metadata"]
70
+ result.externalId = jsonObject["externalId"]
71
+ result.groupId = jsonObject["groupId"]
72
+ result.checkDuplicatesEnabled = jsonObject["checkDuplicatesEnabled"]
73
+ result.duplicatesThreshold = jsonObject["duplicatesThreshold"]
74
+
75
+ return result
76
+ }
77
+
78
+ toJson() {
79
+ return {
80
+ "copyright": this.copyright,
81
+ "cameraSwitchEnabled": this.cameraSwitchEnabled,
82
+ "closeButtonEnabled": this.closeButtonEnabled,
83
+ "torchButtonEnabled": this.torchButtonEnabled,
84
+ "vibrateOnSteps": this.vibrateOnSteps,
85
+ "cameraPositionAndroid": this.cameraPositionAndroid,
86
+ "cameraPositionIOS": this.cameraPositionIOS,
87
+ "screenOrientation": this.screenOrientation,
88
+ "locationTrackingEnabled": this.locationTrackingEnabled,
89
+ "preventScreenRecording": this.preventScreenRecording,
90
+ "attemptsCount": this.attemptsCount,
91
+ "recordingProcess": this.recordingProcess,
92
+ "livenessType": this.livenessType,
93
+ "tag": this.tag,
94
+ "skipStep": this.skipStep,
95
+ "metadata": this.metadata,
96
+ "externalId": this.externalId,
97
+ "groupId": this.groupId,
98
+ "checkDuplicatesEnabled": this.checkDuplicatesEnabled,
99
+ "duplicatesThreshold": this.duplicatesThreshold,
100
+ }
101
+ }
102
+ }
@@ -0,0 +1,39 @@
1
+ export class EnrollmentRequest {
2
+ externalId
3
+ groupId
4
+ trustedImage
5
+ trustedImageUrl
6
+
7
+ static withImage(externalId, trustedImage, options) {
8
+ this.externalId = externalId
9
+ this.trustedImage = trustedImage
10
+ this.groupId = options?.groupId
11
+ }
12
+
13
+ static withImageUrl(externalId, trustedImageUrl, options) {
14
+ this.externalId = externalId
15
+ this.trustedImageUrl = trustedImageUrl
16
+ this.groupId = options?.groupId
17
+ }
18
+
19
+ static fromJson(jsonObject) {
20
+ if (jsonObject == null) return null
21
+ const result = new EnrollmentRequest()
22
+
23
+ result.externalId = jsonObject["externalId"]
24
+ result.groupId = jsonObject["groupId"]
25
+ result.trustedImage = jsonObject["trustedImage"]
26
+ result.trustedImageUrl = jsonObject["trustedImageUrl"]
27
+
28
+ return result
29
+ }
30
+
31
+ toJson() {
32
+ return {
33
+ "externalId": this.externalId,
34
+ "groupId": this.groupId,
35
+ "trustedImage": this.trustedImage,
36
+ "trustedImageUrl": this.trustedImageUrl,
37
+ }
38
+ }
39
+ }