@regulaforensics/face-sdk 8.3.1105-nightly → 8.3.1107-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 (58) 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/package-lock.json +227 -221
  9. package/examples/capacitor/package.json +5 -2
  10. package/examples/ionic/package-lock.json +1579 -2369
  11. package/examples/ionic/package.json +16 -13
  12. package/examples/react_native/package-lock.json +138 -169
  13. package/examples/react_native/package.json +4 -3
  14. package/ios/Config.swift +109 -1
  15. package/ios/Decoder.swift +71 -3
  16. package/ios/Main.swift +24 -4
  17. package/package.json +1 -1
  18. package/plugin.xml +2 -2
  19. package/test/json.tsx +134 -57
  20. package/test/package-lock.json +1 -1
  21. package/test/test.tsx +68 -60
  22. package/www/capacitor/customization/customization_images.js +40 -0
  23. package/www/capacitor/index.js +33 -12
  24. package/www/capacitor/liveness/enrollment_config.js +102 -0
  25. package/www/capacitor/liveness/enrollment_request.js +34 -0
  26. package/www/capacitor/liveness/enrollment_response.js +26 -0
  27. package/www/capacitor/liveness/error_response.js +21 -0
  28. package/www/capacitor/liveness/liveness_config.js +1 -0
  29. package/www/capacitor/liveness/liveness_exception.js +6 -5
  30. package/www/capacitor/liveness/liveness_notification.js +2 -0
  31. package/www/capacitor/liveness/verification_config.js +98 -0
  32. package/www/capacitor/liveness/verification_response.js +27 -0
  33. package/www/capacitor/liveness/verify_match_response.js +21 -0
  34. package/www/cordova.js +595 -80
  35. package/www/react-native/customization/customization_images.js +40 -0
  36. package/www/react-native/index.js +33 -12
  37. package/www/react-native/liveness/enrollment_config.js +102 -0
  38. package/www/react-native/liveness/enrollment_request.js +34 -0
  39. package/www/react-native/liveness/enrollment_response.js +26 -0
  40. package/www/react-native/liveness/error_response.js +21 -0
  41. package/www/react-native/liveness/liveness_config.js +1 -0
  42. package/www/react-native/liveness/liveness_exception.js +6 -5
  43. package/www/react-native/liveness/liveness_notification.js +2 -0
  44. package/www/react-native/liveness/verification_config.js +98 -0
  45. package/www/react-native/liveness/verification_response.js +27 -0
  46. package/www/react-native/liveness/verify_match_response.js +21 -0
  47. package/www/types/customization/customization_images.d.ts +5 -0
  48. package/www/types/index.d.ts +28 -3
  49. package/www/types/liveness/enrollment_config.d.ts +97 -0
  50. package/www/types/liveness/enrollment_request.d.ts +6 -0
  51. package/www/types/liveness/enrollment_response.d.ts +9 -0
  52. package/www/types/liveness/error_response.d.ts +6 -0
  53. package/www/types/liveness/liveness_config.d.ts +1 -0
  54. package/www/types/liveness/liveness_exception.d.ts +1 -0
  55. package/www/types/liveness/liveness_notification.d.ts +2 -0
  56. package/www/types/liveness/verification_config.d.ts +95 -0
  57. package/www/types/liveness/verification_response.d.ts +10 -0
  58. package/www/types/liveness/verify_match_response.d.ts +6 -0
@@ -73,6 +73,36 @@ 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
+
76
106
  _processingScreenCloseButton
77
107
  set processingScreenCloseButton(val) {
78
108
  this._processingScreenCloseButton = val
@@ -100,6 +130,11 @@ export class CustomizationImages {
100
130
  result._retryScreenHintEnvironment = jsonObject["retryScreenHintEnvironment"]
101
131
  result._retryScreenHintSubject = jsonObject["retryScreenHintSubject"]
102
132
  result._retryScreenHintGeo = jsonObject["retryScreenHintGeo"]
133
+ result._retryScreenHintBadSelfieQuality = jsonObject["retryScreenHintBadSelfieQuality"]
134
+ result._retryScreenHintCleanLens = jsonObject["retryScreenHintCleanLens"]
135
+ result._retryScreenHintAddIllumination = jsonObject["retryScreenHintAddIllumination"]
136
+ result._retryScreenHintChangeBackground = jsonObject["retryScreenHintChangeBackground"]
137
+ result._retryScreenHintFaceOcclusions = jsonObject["retryScreenHintFaceOcclusions"]
103
138
  result._processingScreenCloseButton = jsonObject["processingScreenCloseButton"]
104
139
  result._successScreenImage = jsonObject["successScreenImage"]
105
140
 
@@ -120,6 +155,11 @@ export class CustomizationImages {
120
155
  "retryScreenHintEnvironment": this._retryScreenHintEnvironment,
121
156
  "retryScreenHintSubject": this._retryScreenHintSubject,
122
157
  "retryScreenHintGeo": this._retryScreenHintGeo,
158
+ "retryScreenHintBadSelfieQuality": this._retryScreenHintBadSelfieQuality,
159
+ "retryScreenHintCleanLens": this._retryScreenHintCleanLens,
160
+ "retryScreenHintAddIllumination": this._retryScreenHintAddIllumination,
161
+ "retryScreenHintChangeBackground": this._retryScreenHintChangeBackground,
162
+ "retryScreenHintFaceOcclusions": this._retryScreenHintFaceOcclusions,
123
163
  "processingScreenCloseButton": this._processingScreenCloseButton,
124
164
  "successScreenImage": this._successScreenImage,
125
165
  }
@@ -7,7 +7,6 @@ import { CustomizationImages } from './customization/customization_images'
7
7
  import { Customization } from './customization/customization'
8
8
  import { Font } from './customization/font'
9
9
  import { ScreenOrientation } from './customization/screen_orientation'
10
-
11
10
  export { CameraPosition, CustomizationColors, CustomizationFonts, CustomizationImages, Customization, Font, ScreenOrientation }
12
11
 
13
12
  import { FaceSDKVersion } from './init/face_sdk_version'
@@ -16,7 +15,6 @@ import { InitException } from './init/init_exception'
16
15
  import { InitErrorCode } from './init/init_exception'
17
16
  import { LicenseException } from './init/license_exception'
18
17
  import { LicensingResultCode } from './init/license_exception'
19
-
20
18
  export { FaceSDKVersion, InitConfig, InitException, InitErrorCode, LicenseException, LicensingResultCode }
21
19
 
22
20
  import { DetectFaceResult } from './detect_faces/detect_face_result'
@@ -28,14 +26,12 @@ import { DetectFacesException, DetectFacesErrorCode } from './detect_faces/detec
28
26
  import { DetectFacesRequest } from './detect_faces/detect_faces_request'
29
27
  import { DetectFacesResponse } from './detect_faces/detect_faces_response'
30
28
  import { DetectFacesScenario } from './detect_faces/detect_faces_scenario'
31
-
32
29
  export { DetectFaceResult, DetectFacesAttributeResult, DetectFacesAttribute, DetectFacesBackendException, DetectFacesBackendErrorCode, DetectFacesConfig, DetectFacesException, DetectFacesErrorCode, DetectFacesRequest, DetectFacesResponse, DetectFacesScenario }
33
30
 
34
31
  import { FaceCaptureConfig } from './face_capture/face_capture_config'
35
32
  import { FaceCaptureException, FaceCaptureErrorCode } from './face_capture/face_capture_exception'
36
33
  import { FaceCaptureImage, ImageType } from './face_capture/face_capture_image'
37
34
  import { FaceCaptureResponse } from './face_capture/face_capture_response'
38
-
39
35
  export { FaceCaptureConfig, FaceCaptureException, FaceCaptureErrorCode, FaceCaptureImage, ImageType, FaceCaptureResponse }
40
36
 
41
37
  import { OutputImageCrop, OutputImageCropAspectRatio } from './image_params/output_image_crop'
@@ -43,7 +39,6 @@ import { OutputImageParams } from './image_params/output_image_params'
43
39
  import { Point } from './image_params/point'
44
40
  import { Rect } from './image_params/rect'
45
41
  import { Size } from './image_params/size'
46
-
47
42
  export { OutputImageCrop, OutputImageCropAspectRatio, OutputImageParams, Point, Rect, Size }
48
43
 
49
44
  import { ImageQualityCharacteristicName } from './image_quality/image_quality_characteristic_name'
@@ -51,16 +46,21 @@ import { ImageQualityCharacteristic } from './image_quality/image_quality_charac
51
46
  import { ImageQualityGroup } from './image_quality/image_quality_group'
52
47
  import { ImageQualityRange } from './image_quality/image_quality_range'
53
48
  import { ImageQualityResult, ImageQualityGroupName, ImageQualityResultStatus } from './image_quality/image_quality_result'
54
-
55
49
  export { ImageQualityCharacteristicName, ImageQualityCharacteristic, ImageQualityGroup, ImageQualityRange, ImageQualityResult, ImageQualityGroupName, ImageQualityResultStatus }
56
50
 
57
- import { LivenessBackendException, LivenessBackendErrorCode } from './liveness/liveness_backend_exception'
58
51
  import { LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep } from './liveness/liveness_config'
52
+ import { EnrollmentConfig } from './liveness/enrollment_config'
53
+ import { EnrollmentRequest } from './liveness/enrollment_request'
54
+ import { VerificationConfig } from './liveness/verification_config'
55
+ import { LivenessBackendException, LivenessBackendErrorCode } from './liveness/liveness_backend_exception'
59
56
  import { LivenessException, LivenessErrorCode } from './liveness/liveness_exception'
60
- import { LivenessNotification, LivenessProcessStatus } from './liveness/liveness_notification'
61
57
  import { LivenessResponse, LivenessStatus } from './liveness/liveness_response'
62
-
63
- export { LivenessBackendException, LivenessBackendErrorCode, LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep, LivenessException, LivenessErrorCode, LivenessNotification, LivenessProcessStatus, LivenessResponse, LivenessStatus }
58
+ import { LivenessNotification, LivenessProcessStatus } from './liveness/liveness_notification'
59
+ import { ErrorResponse } from './liveness/error_response'
60
+ import { EnrollmentResponse } from './liveness/enrollment_response'
61
+ import { VerifyMatchResponse } from './liveness/verify_match_response'
62
+ import { VerificationResponse } from './liveness/verification_response'
63
+ export { LivenessBackendException, LivenessBackendErrorCode, LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep, LivenessException, LivenessErrorCode, LivenessNotification, LivenessProcessStatus, LivenessResponse, LivenessStatus, EnrollmentConfig, EnrollmentRequest, VerificationConfig, ErrorResponse, EnrollmentResponse, VerifyMatchResponse, VerificationResponse }
64
64
 
65
65
  import { ComparedFace } from './match_faces/compared_face'
66
66
  import { ComparedFacesPair } from './match_faces/compared_faces_pair'
@@ -73,7 +73,6 @@ import { MatchFacesException, MatchFacesErrorCode } from './match_faces/match_fa
73
73
  import { MatchFacesImage } from './match_faces/match_faces_image'
74
74
  import { MatchFacesRequest } from './match_faces/match_faces_request'
75
75
  import { MatchFacesResponse } from './match_faces/match_faces_response'
76
-
77
76
  export { ComparedFace, ComparedFacesPair, ComparedFacesSplit, MatchFacesBackendException, MatchFacesConfig, ProcessingMode, MatchFacesDetectionFace, MatchFacesDetection, MatchFacesException, MatchFacesErrorCode, MatchFacesImage, MatchFacesRequest, MatchFacesResponse }
78
77
 
79
78
  import { EditGroupPersonsRequest } from './person_database/edit_group_persons_request'
@@ -87,7 +86,6 @@ import { SearchPersonDetection } from './person_database/search_person_detection
87
86
  import { SearchPersonImage } from './person_database/search_person_image'
88
87
  import { SearchPersonRequest } from './person_database/search_person_request'
89
88
  import { SearchPerson } from './person_database/search_person'
90
-
91
89
  export { EditGroupPersonsRequest, ImageUpload, PageableItemList, PersonDatabase, PersonGroup, PersonImage, Person, SearchPersonDetection, SearchPersonImage, SearchPersonRequest, SearchPerson }
92
90
 
93
91
 
@@ -195,6 +193,29 @@ export class FaceSDK {
195
193
  return LivenessResponse.fromJson(JSON.parse(response))
196
194
  }
197
195
 
196
+ async startEnrollment(params) {
197
+ _setCameraSwitchCallback(params?.cameraSwitchCallback)
198
+ _setLivenessNotificationCompletion(params?.notificationCompletion)
199
+ var response = JSON.parse(await exec("startEnrollment", [params.config]))
200
+ var lr = LivenessResponse.fromJson(response["livenessResponse"]);
201
+ var er = EnrollmentResponse.fromJson(response["enrollmentResponse"]);
202
+ return [lr, er];
203
+ }
204
+
205
+ async startVerification(params) {
206
+ _setCameraSwitchCallback(params?.cameraSwitchCallback)
207
+ _setLivenessNotificationCompletion(params?.notificationCompletion)
208
+ var response = JSON.parse(await exec("startVerification", [params.config]))
209
+ var lr = LivenessResponse.fromJson(response["livenessResponse"]);
210
+ var er = VerificationResponse.fromJson(response["verificationResponse"]);
211
+ return [lr, er];
212
+ }
213
+
214
+ async enrollWithTrustedPhoto(request) {
215
+ var response = await exec("enrollWithTrustedPhoto", [request])
216
+ return EnrollmentResponse.fromJson(JSON.parse(response));
217
+ }
218
+
198
219
  stopLiveness() {
199
220
  exec("stopLiveness", [])
200
221
  }
@@ -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(params) {
28
+ this.copyright = params?.copyright ?? true
29
+ this.cameraSwitchEnabled = params?.cameraSwitchEnabled ?? false
30
+ this.closeButtonEnabled = params?.closeButtonEnabled ?? true
31
+ this.torchButtonEnabled = params?.torchButtonEnabled ?? true
32
+ this.vibrateOnSteps = params?.vibrateOnSteps ?? true
33
+ this.cameraPositionIOS = params?.cameraPositionIOS ?? CameraPosition.FRONT
34
+ this.cameraPositionAndroid = params?.cameraPositionAndroid
35
+ this.screenOrientation = params?.screenOrientation ?? [ScreenOrientation.PORTRAIT]
36
+ this.locationTrackingEnabled = params?.locationTrackingEnabled ?? true
37
+ this.preventScreenRecording = params?.preventScreenRecording ?? false
38
+ this.attemptsCount = params?.attemptsCount ?? 0
39
+ this.recordingProcess = params?.recordingProcess ?? RecordingProcess.ASYNCHRONOUS_UPLOAD
40
+ this.livenessType = params?.livenessType ?? LivenessType.ACTIVE
41
+ this.tag = params?.tag
42
+ this.skipStep = params?.skipStep ?? []
43
+ this.metadata = params?.metadata
44
+ this.externalId = params?.externalId
45
+ this.groupId = params?.groupId
46
+ this.checkDuplicatesEnabled = params?.checkDuplicatesEnabled
47
+ this.duplicatesThreshold = params?.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,34 @@
1
+ export class EnrollmentRequest {
2
+ externalId
3
+ groupId
4
+ trustedImage
5
+ trustedImageUrl
6
+
7
+ constructor(params) {
8
+ this.externalId = params?.externalId
9
+ this.groupId = params?.groupId
10
+ this.trustedImage = params?.trustedImage
11
+ this.trustedImageUrl = params?.trustedImageUrl
12
+ }
13
+
14
+ static fromJson(jsonObject) {
15
+ if (jsonObject == null) return null
16
+ const result = new EnrollmentRequest()
17
+
18
+ result.externalId = jsonObject["externalId"]
19
+ result.groupId = jsonObject["groupId"]
20
+ result.trustedImage = jsonObject["trustedImage"]
21
+ result.trustedImageUrl = jsonObject["trustedImageUrl"]
22
+
23
+ return result
24
+ }
25
+
26
+ toJson() {
27
+ return {
28
+ "externalId": this.externalId,
29
+ "groupId": this.groupId,
30
+ "trustedImage": this.trustedImage,
31
+ "trustedImageUrl": this.trustedImageUrl,
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,26 @@
1
+ import { ErrorResponse } from './error_response'
2
+
3
+ export class EnrollmentResponse {
4
+ personId
5
+ externalId
6
+ error
7
+
8
+ static fromJson(jsonObject) {
9
+ if (jsonObject == null) return null
10
+ const result = new EnrollmentResponse()
11
+
12
+ result.personId = jsonObject["personId"]
13
+ result.externalId = jsonObject["externalId"]
14
+ result.error = ErrorResponse.fromJson(jsonObject["error"])
15
+
16
+ return result
17
+ }
18
+
19
+ toJson() {
20
+ return {
21
+ "personId": this.personId,
22
+ "externalId": this.externalId,
23
+ "error": this.error?.toJson(),
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,21 @@
1
+ export class ErrorResponse {
2
+ code
3
+ message
4
+
5
+ static fromJson(jsonObject) {
6
+ if (jsonObject == null) return null
7
+ const result = new ErrorResponse()
8
+
9
+ result.code = jsonObject["code"]
10
+ result.message = jsonObject["message"]
11
+
12
+ return result
13
+ }
14
+
15
+ toJson() {
16
+ return {
17
+ "code": this.code,
18
+ "message": this.message,
19
+ }
20
+ }
21
+ }
@@ -93,6 +93,7 @@ export const RecordingProcess = {
93
93
  export const LivenessType = {
94
94
  ACTIVE: 0,
95
95
  PASSIVE: 1,
96
+ PASSIVE_WITH_BLINK: 2,
96
97
  }
97
98
 
98
99
  export const LivenessSkipStep = {
@@ -35,9 +35,10 @@ export const LivenessErrorCode = {
35
35
  PROCESSING_FAILED: 6,
36
36
  PROCESSING_FRAME_FAILED: 7,
37
37
  APPLICATION_INACTIVE: 8,
38
- CONTEXT_IS_NULL: 9,
39
- IN_PROGRESS_ALREADY: 10,
40
- ZOOM_NOT_SUPPORTED: 11,
41
- CAMERA_NO_PERMISSION: 12,
42
- CAMERA_NOT_AVAILABLE: 13,
38
+ BAD_FACE_QUALITY: 9,
39
+ CONTEXT_IS_NULL: 10,
40
+ IN_PROGRESS_ALREADY: 11,
41
+ ZOOM_NOT_SUPPORTED: 12,
42
+ CAMERA_NO_PERMISSION: 13,
43
+ CAMERA_NOT_AVAILABLE: 14,
43
44
  }
@@ -38,4 +38,6 @@ export const LivenessProcessStatus = {
38
38
  FAILED: 12,
39
39
  RETRY: 13,
40
40
  SUCCESS: 14,
41
+ BLINK: 15,
42
+ BAD_FACE_QUALITY: 16,
41
43
  }
@@ -0,0 +1,98 @@
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 VerificationConfig {
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
+ personId
23
+ groupId
24
+ threshold
25
+
26
+ constructor(params) {
27
+ this.copyright = params?.copyright ?? true
28
+ this.cameraSwitchEnabled = params?.cameraSwitchEnabled ?? false
29
+ this.closeButtonEnabled = params?.closeButtonEnabled ?? true
30
+ this.torchButtonEnabled = params?.torchButtonEnabled ?? true
31
+ this.vibrateOnSteps = params?.vibrateOnSteps ?? true
32
+ this.cameraPositionIOS = params?.cameraPositionIOS ?? CameraPosition.FRONT
33
+ this.cameraPositionAndroid = params?.cameraPositionAndroid
34
+ this.screenOrientation = params?.screenOrientation ?? [ScreenOrientation.PORTRAIT]
35
+ this.locationTrackingEnabled = params?.locationTrackingEnabled ?? true
36
+ this.preventScreenRecording = params?.preventScreenRecording ?? false
37
+ this.attemptsCount = params?.attemptsCount ?? 0
38
+ this.recordingProcess = params?.recordingProcess ?? RecordingProcess.ASYNCHRONOUS_UPLOAD
39
+ this.livenessType = params?.livenessType ?? LivenessType.ACTIVE
40
+ this.tag = params?.tag
41
+ this.skipStep = params?.skipStep ?? []
42
+ this.metadata = params?.metadata
43
+ this.personId = params?.personId
44
+ this.groupId = params?.groupId
45
+ this.threshold = params?.threshold
46
+ }
47
+
48
+ static fromJson(jsonObject) {
49
+ if (jsonObject == null) return null
50
+ const result = new VerificationConfig()
51
+
52
+ result.copyright = jsonObject["copyright"]
53
+ result.cameraSwitchEnabled = jsonObject["cameraSwitchEnabled"]
54
+ result.closeButtonEnabled = jsonObject["closeButtonEnabled"]
55
+ result.torchButtonEnabled = jsonObject["torchButtonEnabled"]
56
+ result.vibrateOnSteps = jsonObject["vibrateOnSteps"]
57
+ result.cameraPositionAndroid = jsonObject["cameraPositionAndroid"]
58
+ result.cameraPositionIOS = jsonObject["cameraPositionIOS"]
59
+ result.screenOrientation = jsonObject["screenOrientation"]
60
+ result.locationTrackingEnabled = jsonObject["locationTrackingEnabled"]
61
+ result.preventScreenRecording = jsonObject["preventScreenRecording"]
62
+ result.attemptsCount = jsonObject["attemptsCount"]
63
+ result.recordingProcess = jsonObject["recordingProcess"]
64
+ result.livenessType = jsonObject["livenessType"]
65
+ result.tag = jsonObject["tag"]
66
+ result.skipStep = jsonObject["skipStep"]
67
+ result.metadata = jsonObject["metadata"]
68
+ result.personId = jsonObject["personId"]
69
+ result.groupId = jsonObject["groupId"]
70
+ result.threshold = jsonObject["threshold"]
71
+
72
+ return result
73
+ }
74
+
75
+ toJson() {
76
+ return {
77
+ "copyright": this.copyright,
78
+ "cameraSwitchEnabled": this.cameraSwitchEnabled,
79
+ "closeButtonEnabled": this.closeButtonEnabled,
80
+ "torchButtonEnabled": this.torchButtonEnabled,
81
+ "vibrateOnSteps": this.vibrateOnSteps,
82
+ "cameraPositionAndroid": this.cameraPositionAndroid,
83
+ "cameraPositionIOS": this.cameraPositionIOS,
84
+ "screenOrientation": this.screenOrientation,
85
+ "locationTrackingEnabled": this.locationTrackingEnabled,
86
+ "preventScreenRecording": this.preventScreenRecording,
87
+ "attemptsCount": this.attemptsCount,
88
+ "recordingProcess": this.recordingProcess,
89
+ "livenessType": this.livenessType,
90
+ "tag": this.tag,
91
+ "skipStep": this.skipStep,
92
+ "metadata": this.metadata,
93
+ "personId": this.personId,
94
+ "groupId": this.groupId,
95
+ "threshold": this.threshold,
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,27 @@
1
+ import { VerifyMatchResponse } from './verify_match_response'
2
+ import { ErrorResponse } from './error_response'
3
+
4
+ export class VerificationResponse {
5
+ passed
6
+ match
7
+ error
8
+
9
+ static fromJson(jsonObject) {
10
+ if (jsonObject == null) return null
11
+ const result = new VerificationResponse()
12
+
13
+ result.passed = jsonObject["passed"]
14
+ result.match = VerifyMatchResponse.fromJson(jsonObject["match"])
15
+ result.error = ErrorResponse.fromJson(jsonObject["error"])
16
+
17
+ return result
18
+ }
19
+
20
+ toJson() {
21
+ return {
22
+ "passed": this.passed,
23
+ "match": this.match?.toJson(),
24
+ "error": this.error?.toJson(),
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,21 @@
1
+ export class VerifyMatchResponse {
2
+ passed
3
+ similarity
4
+
5
+ static fromJson(jsonObject) {
6
+ if (jsonObject == null) return null
7
+ const result = new VerifyMatchResponse()
8
+
9
+ result.passed = jsonObject["passed"]
10
+ result.similarity = jsonObject["similarity"]
11
+
12
+ return result
13
+ }
14
+
15
+ toJson() {
16
+ return {
17
+ "passed": this.passed,
18
+ "similarity": this.similarity,
19
+ }
20
+ }
21
+ }
@@ -11,6 +11,11 @@ export class CustomizationImages {
11
11
  set retryScreenHintEnvironment(val: string)
12
12
  set retryScreenHintSubject(val: string)
13
13
  set retryScreenHintGeo(val: string)
14
+ set retryScreenHintBadSelfieQuality(val: string)
15
+ set retryScreenHintCleanLens(val: string)
16
+ set retryScreenHintAddIllumination(val: string)
17
+ set retryScreenHintChangeBackground(val: string)
18
+ set retryScreenHintFaceOcclusions(val: string)
14
19
  set processingScreenCloseButton(val: string)
15
20
  set successScreenImage(val: string)
16
21
 
@@ -46,12 +46,19 @@ import { ImageQualityRange } from './image_quality/image_quality_range'
46
46
  import { ImageQualityResult, ImageQualityGroupName, ImageQualityResultStatus } from './image_quality/image_quality_result'
47
47
  export { ImageQualityCharacteristicName, ImageQualityCharacteristic, ImageQualityGroup, ImageQualityRange, ImageQualityResult, ImageQualityGroupName, ImageQualityResultStatus }
48
48
 
49
- import { LivenessBackendException, LivenessBackendErrorCode } from './liveness/liveness_backend_exception'
50
49
  import { LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep } from './liveness/liveness_config'
50
+ import { EnrollmentConfig } from './liveness/enrollment_config'
51
+ import { EnrollmentRequest } from './liveness/enrollment_request'
52
+ import { VerificationConfig } from './liveness/verification_config'
53
+ import { LivenessBackendException, LivenessBackendErrorCode } from './liveness/liveness_backend_exception'
51
54
  import { LivenessException, LivenessErrorCode } from './liveness/liveness_exception'
52
- import { LivenessNotification, LivenessProcessStatus, LivenessNotificationCompletion } from './liveness/liveness_notification'
53
55
  import { LivenessResponse, LivenessStatus } from './liveness/liveness_response'
54
- export { LivenessBackendException, LivenessBackendErrorCode, LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep, LivenessException, LivenessErrorCode, LivenessNotification, LivenessProcessStatus, LivenessNotificationCompletion, LivenessResponse, LivenessStatus }
56
+ import { LivenessNotification, LivenessProcessStatus, LivenessNotificationCompletion } from './liveness/liveness_notification'
57
+ import { ErrorResponse } from './liveness/error_response'
58
+ import { EnrollmentResponse } from './liveness/enrollment_response'
59
+ import { VerifyMatchResponse } from './liveness/verify_match_response'
60
+ import { VerificationResponse } from './liveness/verification_response'
61
+ export { LivenessBackendException, LivenessBackendErrorCode, LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep, LivenessException, LivenessErrorCode, LivenessNotification, LivenessProcessStatus, LivenessNotificationCompletion, LivenessResponse, LivenessStatus, EnrollmentConfig, EnrollmentRequest, VerificationConfig, ErrorResponse, EnrollmentResponse, VerifyMatchResponse, VerificationResponse }
55
62
 
56
63
  import { ComparedFace } from './match_faces/compared_face'
57
64
  import { ComparedFacesPair } from './match_faces/compared_faces_pair'
@@ -179,6 +186,24 @@ export class FaceSDK {
179
186
  }
180
187
  ): Promise<LivenessResponse>
181
188
 
189
+ startEnrollment(
190
+ config: EnrollmentConfig,
191
+ params?: {
192
+ notificationCompletion?: LivenessNotificationCompletion,
193
+ cameraSwitchCallback?: CameraSwitchCallback,
194
+ }
195
+ ): Promise<[LivenessResponse, EnrollmentResponse | null]>
196
+
197
+ startVerification(
198
+ config: VerificationConfig,
199
+ params?: {
200
+ notificationCompletion?: LivenessNotificationCompletion,
201
+ cameraSwitchCallback?: CameraSwitchCallback,
202
+ }
203
+ ): Promise<[LivenessResponse, VerificationResponse | null]>
204
+
205
+ enrollWithTrustedPhoto(request: EnrollmentRequest): Promise<EnrollmentResponse>
206
+
182
207
  stopLiveness(): void
183
208
 
184
209
  matchFaces(