@regulaforensics/face-sdk 8.3.1171-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
@@ -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 './cordova'
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) {
@@ -1,8 +1,8 @@
1
- var _exec = (completion, params) => cordova.exec(completion, null, "FaceSDK", "exec", params)
1
+ var _exec = (completion, options) => cordova.exec(completion, null, "FaceSDK", "exec", options)
2
2
 
3
3
  export const NativeModules = {
4
4
  RNFaceSDK: {
5
- exec: async (name, params) => new Promise((resolve, _) => _exec(data => resolve(data), [name, ...params]))
5
+ exec: async (name, options) => new Promise((resolve, _) => _exec(data => resolve(data), [name, ...options]))
6
6
  }
7
7
  }
8
8
 
@@ -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
+ }
@@ -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
+ }
@@ -19,23 +19,23 @@ export class LivenessConfig {
19
19
  skipStep
20
20
  metadata
21
21
 
22
- constructor(params) {
23
- this.copyright = params?.copyright ?? true
24
- this.cameraSwitchEnabled = params?.cameraSwitchEnabled ?? false
25
- this.closeButtonEnabled = params?.closeButtonEnabled ?? true
26
- this.torchButtonEnabled = params?.torchButtonEnabled ?? true
27
- this.vibrateOnSteps = params?.vibrateOnSteps ?? true
28
- this.cameraPositionIOS = params?.cameraPositionIOS ?? CameraPosition.FRONT
29
- this.cameraPositionAndroid = params?.cameraPositionAndroid
30
- this.screenOrientation = params?.screenOrientation ?? [ScreenOrientation.PORTRAIT]
31
- this.locationTrackingEnabled = params?.locationTrackingEnabled ?? true
32
- this.preventScreenRecording = params?.preventScreenRecording ?? false
33
- this.attemptsCount = params?.attemptsCount ?? 0
34
- this.recordingProcess = params?.recordingProcess ?? RecordingProcess.ASYNCHRONOUS_UPLOAD
35
- this.livenessType = params?.livenessType ?? LivenessType.ACTIVE
36
- this.tag = params?.tag
37
- this.skipStep = params?.skipStep ?? []
38
- this.metadata = params?.metadata
22
+ constructor(options) {
23
+ this.copyright = options?.copyright ?? true
24
+ this.cameraSwitchEnabled = options?.cameraSwitchEnabled ?? false
25
+ this.closeButtonEnabled = options?.closeButtonEnabled ?? true
26
+ this.torchButtonEnabled = options?.torchButtonEnabled ?? true
27
+ this.vibrateOnSteps = options?.vibrateOnSteps ?? true
28
+ this.cameraPositionIOS = options?.cameraPositionIOS ?? CameraPosition.FRONT
29
+ this.cameraPositionAndroid = options?.cameraPositionAndroid
30
+ this.screenOrientation = options?.screenOrientation ?? [ScreenOrientation.PORTRAIT]
31
+ this.locationTrackingEnabled = options?.locationTrackingEnabled ?? true
32
+ this.preventScreenRecording = options?.preventScreenRecording ?? false
33
+ this.attemptsCount = options?.attemptsCount ?? 0
34
+ this.recordingProcess = options?.recordingProcess ?? RecordingProcess.ASYNCHRONOUS_UPLOAD
35
+ this.livenessType = options?.livenessType ?? LivenessType.ACTIVE
36
+ this.tag = options?.tag
37
+ this.skipStep = options?.skipStep ?? []
38
+ this.metadata = options?.metadata
39
39
  }
40
40
 
41
41
  static fromJson(jsonObject) {
@@ -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,11 @@ 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,
38
+ BAD_FACE_QUALITY: 9,
39
+ BAD_FRAME_SIZE: 10,
40
+ CAMERA_NOT_AVAILABLE: 11,
41
41
  CAMERA_NO_PERMISSION: 12,
42
- CAMERA_NOT_AVAILABLE: 13,
43
- }
42
+ CONTEXT_IS_NULL: 13,
43
+ IN_PROGRESS_ALREADY: 14,
44
+ ZOOM_NOT_SUPPORTED: 15,
45
+ }
@@ -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(options) {
27
+ this.copyright = options?.copyright ?? true
28
+ this.cameraSwitchEnabled = options?.cameraSwitchEnabled ?? false
29
+ this.closeButtonEnabled = options?.closeButtonEnabled ?? true
30
+ this.torchButtonEnabled = options?.torchButtonEnabled ?? true
31
+ this.vibrateOnSteps = options?.vibrateOnSteps ?? true
32
+ this.cameraPositionIOS = options?.cameraPositionIOS ?? CameraPosition.FRONT
33
+ this.cameraPositionAndroid = options?.cameraPositionAndroid
34
+ this.screenOrientation = options?.screenOrientation ?? [ScreenOrientation.PORTRAIT]
35
+ this.locationTrackingEnabled = options?.locationTrackingEnabled ?? true
36
+ this.preventScreenRecording = options?.preventScreenRecording ?? false
37
+ this.attemptsCount = options?.attemptsCount ?? 0
38
+ this.recordingProcess = options?.recordingProcess ?? RecordingProcess.ASYNCHRONOUS_UPLOAD
39
+ this.livenessType = options?.livenessType ?? LivenessType.ACTIVE
40
+ this.tag = options?.tag
41
+ this.skipStep = options?.skipStep ?? []
42
+ this.metadata = options?.metadata
43
+ this.personId = options?.personId
44
+ this.groupId = options?.groupId
45
+ this.threshold = options?.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
+ }