@regulaforensics/face-sdk 8.4.1338-nightly → 8.4.1343-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.
- package/RNFaceSDK.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/cordova.gradle +1 -1
- package/android/src/main/{java → kotlin}/com/regula/plugin/facesdk/Config.kt +94 -90
- package/android/src/main/{java/com/regula/plugin/facesdk/Main.kt → kotlin/com/regula/plugin/facesdk/Implementation.kt} +63 -41
- package/android/src/main/{java → kotlin}/com/regula/plugin/facesdk/JSONConstructor.kt +123 -75
- package/android/src/main/{java → kotlin}/com/regula/plugin/facesdk/Utils.kt +18 -2
- package/examples/capacitor/package.json +2 -2
- package/examples/ionic/package.json +2 -2
- package/examples/react_native/package.json +2 -2
- package/ios/Config.swift +100 -104
- package/ios/Decoder.swift +85 -64
- package/ios/Utils.swift +3 -0
- package/package.json +1 -1
- package/plugin.xml +7 -7
- package/test/json.tsx +73 -61
- package/test/test.tsx +8 -11
- package/www/capacitor/index.js +4 -11
- package/www/capacitor/liveness/enrollment_config.js +10 -16
- package/www/capacitor/liveness/enrollment_response.js +14 -10
- package/www/capacitor/liveness/liveness_exception.js +3 -3
- package/www/capacitor/liveness/verification_config.js +16 -4
- package/www/capacitor/liveness/{verify_match_response.js → verification_match_response.js} +5 -5
- package/www/capacitor/liveness/verification_response.js +9 -9
- package/www/capacitor/person_database/person.js +16 -7
- package/www/capacitor/person_database/search_person.js +9 -0
- package/www/capacitor/person_database/search_person_filter.js +44 -0
- package/www/cordova.js +238 -245
- package/www/react-native/index.js +4 -11
- package/www/react-native/liveness/enrollment_config.js +10 -16
- package/www/react-native/liveness/enrollment_response.js +14 -10
- package/www/react-native/liveness/liveness_exception.js +3 -3
- package/www/react-native/liveness/verification_config.js +16 -4
- package/www/react-native/liveness/{verify_match_response.js → verification_match_response.js} +5 -5
- package/www/react-native/liveness/verification_response.js +9 -9
- package/www/react-native/person_database/person.js +16 -7
- package/www/react-native/person_database/search_person.js +9 -0
- package/www/react-native/person_database/search_person_filter.js +44 -0
- package/www/types/index.d.ts +4 -8
- package/www/types/liveness/enrollment_config.d.ts +4 -6
- package/www/types/liveness/enrollment_response.d.ts +5 -4
- package/www/types/liveness/liveness_exception.d.ts +2 -2
- package/www/types/liveness/verification_config.d.ts +49 -5
- package/www/types/liveness/verification_match_response.d.ts +6 -0
- package/www/types/liveness/verification_response.d.ts +5 -5
- package/www/types/person_database/person.d.ts +12 -8
- package/www/types/person_database/search_person.d.ts +6 -0
- package/www/types/person_database/search_person_filter.d.ts +16 -0
- package/www/capacitor/liveness/enrollment_request.js +0 -39
- package/www/capacitor/liveness/error_response.js +0 -21
- package/www/react-native/liveness/enrollment_request.js +0 -39
- package/www/react-native/liveness/error_response.js +0 -21
- package/www/types/liveness/enrollment_request.d.ts +0 -24
- package/www/types/liveness/error_response.d.ts +0 -6
- package/www/types/liveness/verify_match_response.d.ts +0 -6
- /package/android/src/main/{java → kotlin}/com/regula/plugin/facesdk/RNFaceApiModule.kt +0 -0
- /package/ios/{Main.swift → Implementation.swift} +0 -0
package/test/json.tsx
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
var img1 =
|
|
2
|
-
|
|
3
|
-
var
|
|
1
|
+
export var img1 =
|
|
2
|
+
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAAGgAwAEAAAAAQAAAAEAAAAAChjw/QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAxJREFUCB1j+P//PwAF/gL+n8otEwAAAABJRU5ErkJggg==";
|
|
3
|
+
export var img2 =
|
|
4
|
+
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAAGgAwAEAAAAAQAAAAEAAAAAChjw/QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAtJREFUCB1jYAACAAAFAAGNu5vzAAAAAElFTkSuQmCC";
|
|
5
|
+
export var img3 =
|
|
6
|
+
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAAGgAwAEAAAAAQAAAAEAAAAAChjw/QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAA1JREFUCB1j+M/AUA8ABIABfzhDTCYAAAAASUVORK5CYII=";
|
|
4
7
|
|
|
5
|
-
var customJson = {"test1": true, "test2": 1, "test3": "test"};
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var font2 = {"name": "Copperplate-Light", "size": 20, "style": 1};
|
|
8
|
+
export var customJson = {"test1": true, "test2": 1, "test3": "test"};
|
|
9
|
+
export var font1 = {"name": "AppleSDGothicNeo-Thin", "size": 10, "style": 2};
|
|
10
|
+
export var font2 = {"name": "Copperplate-Light", "size": 20, "style": 1};
|
|
9
11
|
|
|
10
12
|
export var customizationColors = {
|
|
11
13
|
"100": 0xff000000,
|
|
@@ -94,7 +96,7 @@ export var outputImageCrop = {
|
|
|
94
96
|
"type": 0,
|
|
95
97
|
"size": size,
|
|
96
98
|
"padColor": 0xff000000,
|
|
97
|
-
"returnOriginalRect": true
|
|
99
|
+
"returnOriginalRect": true,
|
|
98
100
|
};
|
|
99
101
|
export var outputImageParams = {
|
|
100
102
|
"crop": outputImageCrop,
|
|
@@ -126,11 +128,7 @@ export var detectFacesAttributeResult = {
|
|
|
126
128
|
export var detectFaceResult = {
|
|
127
129
|
"quality": [imageQualityResult, imageQualityResult, imageQualityResult],
|
|
128
130
|
"crop": img1,
|
|
129
|
-
"attributes": [
|
|
130
|
-
detectFacesAttributeResult,
|
|
131
|
-
detectFacesAttributeResult,
|
|
132
|
-
detectFacesAttributeResult
|
|
133
|
-
],
|
|
131
|
+
"attributes": [detectFacesAttributeResult, detectFacesAttributeResult, detectFacesAttributeResult],
|
|
134
132
|
"landmarks": [point, point, point],
|
|
135
133
|
"faceRect": rect,
|
|
136
134
|
"originalRect": rect,
|
|
@@ -138,11 +136,7 @@ export var detectFaceResult = {
|
|
|
138
136
|
};
|
|
139
137
|
export var detectFacesConfig = {
|
|
140
138
|
"attributes": ["Age", "EyeRight", "EyeLeft"],
|
|
141
|
-
"customQuality": [
|
|
142
|
-
imageQualityCharacteristic,
|
|
143
|
-
imageQualityCharacteristic,
|
|
144
|
-
imageQualityCharacteristic
|
|
145
|
-
],
|
|
139
|
+
"customQuality": [imageQualityCharacteristic, imageQualityCharacteristic, imageQualityCharacteristic],
|
|
146
140
|
"outputImageParams": outputImageParams,
|
|
147
141
|
"onlyCentralFace": true,
|
|
148
142
|
};
|
|
@@ -214,7 +208,7 @@ export var licenseException = {
|
|
|
214
208
|
export var initException = {
|
|
215
209
|
"code": 0,
|
|
216
210
|
"message": "In process already.",
|
|
217
|
-
"underlyingError": licenseException
|
|
211
|
+
"underlyingError": licenseException,
|
|
218
212
|
};
|
|
219
213
|
|
|
220
214
|
export var livenessConfig = {
|
|
@@ -235,7 +229,7 @@ export var livenessConfig = {
|
|
|
235
229
|
"skipStep": [0, 1],
|
|
236
230
|
"metadata": customJson,
|
|
237
231
|
};
|
|
238
|
-
export var
|
|
232
|
+
export var verificationConfig = {
|
|
239
233
|
"copyright": true,
|
|
240
234
|
"cameraSwitchEnabled": false,
|
|
241
235
|
"closeButtonEnabled": true,
|
|
@@ -252,12 +246,10 @@ export var enrollmentConfig = {
|
|
|
252
246
|
"tag": "test",
|
|
253
247
|
"skipStep": [0, 1],
|
|
254
248
|
"metadata": customJson,
|
|
255
|
-
"
|
|
256
|
-
"
|
|
257
|
-
"checkDuplicatesEnabled": true,
|
|
258
|
-
"duplicatesThreshold": 0.5,
|
|
249
|
+
"personId": "test0",
|
|
250
|
+
"threshold": 0.5,
|
|
259
251
|
};
|
|
260
|
-
export var
|
|
252
|
+
export var verificationConfig2 = {
|
|
261
253
|
"copyright": true,
|
|
262
254
|
"cameraSwitchEnabled": false,
|
|
263
255
|
"closeButtonEnabled": true,
|
|
@@ -274,20 +266,9 @@ export var verificationConfig = {
|
|
|
274
266
|
"tag": "test",
|
|
275
267
|
"skipStep": [0, 1],
|
|
276
268
|
"metadata": customJson,
|
|
277
|
-
"
|
|
278
|
-
"groupId": "test1",
|
|
269
|
+
"externalId": "test1",
|
|
279
270
|
"threshold": 0.5,
|
|
280
271
|
};
|
|
281
|
-
export var enrollmentRequest = {
|
|
282
|
-
"externalId": "test0",
|
|
283
|
-
"groupId": "test1",
|
|
284
|
-
"trustedImage": img1,
|
|
285
|
-
};
|
|
286
|
-
export var enrollmentRequest2 = {
|
|
287
|
-
"externalId": "test0",
|
|
288
|
-
"groupId": "test1",
|
|
289
|
-
"trustedImageUrl": "test2",
|
|
290
|
-
};
|
|
291
272
|
export var livenessBackendException = {
|
|
292
273
|
"code": 200,
|
|
293
274
|
"message": "No license",
|
|
@@ -309,24 +290,10 @@ export var livenessNotification = {
|
|
|
309
290
|
"status": 0,
|
|
310
291
|
"response": livenessResponse,
|
|
311
292
|
};
|
|
312
|
-
export var
|
|
313
|
-
"
|
|
314
|
-
"message": "test0",
|
|
315
|
-
};
|
|
316
|
-
export var enrollmentResponse = {
|
|
317
|
-
"personId": "test0",
|
|
318
|
-
"externalId": "test1",
|
|
319
|
-
"error": errorResponse,
|
|
320
|
-
};
|
|
321
|
-
export var verifyMatchResponse = {
|
|
322
|
-
"passed": true,
|
|
293
|
+
export var verificationMatchResponse = {
|
|
294
|
+
"verified": true,
|
|
323
295
|
"similarity": 0.5,
|
|
324
296
|
};
|
|
325
|
-
export var verificationResponse = {
|
|
326
|
-
"passed": true,
|
|
327
|
-
"match": verifyMatchResponse,
|
|
328
|
-
"error": errorResponse,
|
|
329
|
-
};
|
|
330
297
|
|
|
331
298
|
export var matchFacesConfig = {
|
|
332
299
|
"processingMode": 0,
|
|
@@ -336,7 +303,7 @@ export var matchFacesImage = {
|
|
|
336
303
|
"image": img1,
|
|
337
304
|
"imageType": 1,
|
|
338
305
|
"detectAll": true,
|
|
339
|
-
"identifier": "test"
|
|
306
|
+
"identifier": "test",
|
|
340
307
|
};
|
|
341
308
|
export var matchFacesRequest = {
|
|
342
309
|
"images": [matchFacesImage, matchFacesImage, matchFacesImage],
|
|
@@ -352,7 +319,10 @@ export var matchFacesDetectionFace = {
|
|
|
352
319
|
"originalRect": rect,
|
|
353
320
|
"crop": img1,
|
|
354
321
|
};
|
|
355
|
-
export var matchFacesBackendException = {
|
|
322
|
+
export var matchFacesBackendException = {
|
|
323
|
+
"code": 0,
|
|
324
|
+
"message": "Image is empty.",
|
|
325
|
+
};
|
|
356
326
|
export var matchFacesException = {
|
|
357
327
|
"code": 0,
|
|
358
328
|
"message": "Image is empty.",
|
|
@@ -361,11 +331,7 @@ export var matchFacesException = {
|
|
|
361
331
|
export var matchFacesDetection = {
|
|
362
332
|
"imageIndex": 0,
|
|
363
333
|
"image": matchFacesImage,
|
|
364
|
-
"faces": [
|
|
365
|
-
matchFacesDetectionFace,
|
|
366
|
-
matchFacesDetectionFace,
|
|
367
|
-
matchFacesDetectionFace
|
|
368
|
-
],
|
|
334
|
+
"faces": [matchFacesDetectionFace, matchFacesDetectionFace, matchFacesDetectionFace],
|
|
369
335
|
"error": matchFacesException,
|
|
370
336
|
};
|
|
371
337
|
export var comparedFace = {
|
|
@@ -396,7 +362,9 @@ export var editGroupPersonsRequest = {
|
|
|
396
362
|
"personIdsToAdd": ["test1", "test2", "test3"],
|
|
397
363
|
"personIdsToRemove": ["test4", "test5", "test6"],
|
|
398
364
|
};
|
|
399
|
-
export var imageUpload = {
|
|
365
|
+
export var imageUpload = {
|
|
366
|
+
"imageData": img1,
|
|
367
|
+
};
|
|
400
368
|
export var person = {
|
|
401
369
|
"name": "test1",
|
|
402
370
|
"updatedAt": "1969-07-20 20:18:04.000",
|
|
@@ -404,6 +372,9 @@ export var person = {
|
|
|
404
372
|
"id": "test3",
|
|
405
373
|
"metadata": customJson,
|
|
406
374
|
"createdAt": "1969-07-20 20:18:05.000",
|
|
375
|
+
"externalId": "test4",
|
|
376
|
+
"ttl": 1,
|
|
377
|
+
"expireAt": "1969-07-20 20:18:06.000",
|
|
407
378
|
};
|
|
408
379
|
export var personGroup = {
|
|
409
380
|
"name": "test1",
|
|
@@ -444,6 +415,9 @@ export var searchPerson = {
|
|
|
444
415
|
"id": "test3",
|
|
445
416
|
"metadata": customJson,
|
|
446
417
|
"createdAt": "1969-07-20 20:18:05.000",
|
|
418
|
+
"externalId": "test4",
|
|
419
|
+
"ttl": 1,
|
|
420
|
+
"expireAt": "1969-07-20 20:18:06.000",
|
|
447
421
|
};
|
|
448
422
|
export var searchPersonRequest = {
|
|
449
423
|
"imageUpload": imageUpload,
|
|
@@ -454,3 +428,41 @@ export var searchPersonRequest = {
|
|
|
454
428
|
"detectAll": true,
|
|
455
429
|
"outputImageParams": outputImageParams,
|
|
456
430
|
};
|
|
431
|
+
export var searchPersonFilter = {
|
|
432
|
+
"groups": ["test1", "test2", "test3"],
|
|
433
|
+
"threshold": 0.5,
|
|
434
|
+
"limit": 1,
|
|
435
|
+
"fieldName": "test0",
|
|
436
|
+
"fieldValues": ["test4", "test5", "test6"],
|
|
437
|
+
"exclude": true,
|
|
438
|
+
};
|
|
439
|
+
export var enrollmentConfig = {
|
|
440
|
+
"copyright": true,
|
|
441
|
+
"cameraSwitchEnabled": false,
|
|
442
|
+
"closeButtonEnabled": true,
|
|
443
|
+
"torchButtonEnabled": false,
|
|
444
|
+
"vibrateOnSteps": true,
|
|
445
|
+
"cameraPositionAndroid": -1,
|
|
446
|
+
"cameraPositionIOS": 1,
|
|
447
|
+
"screenOrientation": [0, 1],
|
|
448
|
+
"locationTrackingEnabled": true,
|
|
449
|
+
"preventScreenRecording": false,
|
|
450
|
+
"attemptsCount": 2,
|
|
451
|
+
"recordingProcess": 0,
|
|
452
|
+
"livenessType": 1,
|
|
453
|
+
"tag": "test",
|
|
454
|
+
"skipStep": [0, 1],
|
|
455
|
+
"metadata": customJson,
|
|
456
|
+
"person": person,
|
|
457
|
+
"searchFilter": searchPersonFilter,
|
|
458
|
+
};
|
|
459
|
+
export var enrollmentResponse = {
|
|
460
|
+
"enrolled": true,
|
|
461
|
+
"person": person,
|
|
462
|
+
"searchPersons": [searchPerson, searchPerson, searchPerson],
|
|
463
|
+
};
|
|
464
|
+
export var verificationResponse = {
|
|
465
|
+
"verified": true,
|
|
466
|
+
"person": person,
|
|
467
|
+
"match": verificationMatchResponse,
|
|
468
|
+
};
|
package/test/test.tsx
CHANGED
|
@@ -51,11 +51,10 @@ import {
|
|
|
51
51
|
Size,
|
|
52
52
|
EnrollmentConfig,
|
|
53
53
|
VerificationConfig,
|
|
54
|
-
EnrollmentRequest,
|
|
55
|
-
ErrorResponse,
|
|
56
54
|
EnrollmentResponse,
|
|
57
|
-
|
|
55
|
+
VerificationMatchResponse,
|
|
58
56
|
VerificationResponse,
|
|
57
|
+
SearchPersonFilter,
|
|
59
58
|
} from '@regulaforensics/face-sdk/www/capacitor'
|
|
60
59
|
import {
|
|
61
60
|
comparedFace,
|
|
@@ -109,12 +108,11 @@ import {
|
|
|
109
108
|
size,
|
|
110
109
|
enrollmentConfig,
|
|
111
110
|
verificationConfig,
|
|
112
|
-
|
|
113
|
-
enrollmentRequest2,
|
|
114
|
-
errorResponse,
|
|
111
|
+
verificationConfig2,
|
|
115
112
|
enrollmentResponse,
|
|
116
|
-
|
|
113
|
+
verificationMatchResponse,
|
|
117
114
|
verificationResponse,
|
|
115
|
+
searchPersonFilter,
|
|
118
116
|
} from './json'
|
|
119
117
|
|
|
120
118
|
compare('customization', customization, Customization.fromJson);
|
|
@@ -150,15 +148,13 @@ compare('faceCaptureResponse', faceCaptureResponse, FaceCaptureResponse.fromJson
|
|
|
150
148
|
compare('livenessConfig', livenessConfig, LivenessConfig.fromJson);
|
|
151
149
|
compare('enrollmentConfig', enrollmentConfig, EnrollmentConfig.fromJson);
|
|
152
150
|
compare('verificationConfig', verificationConfig, VerificationConfig.fromJson);
|
|
153
|
-
compare('
|
|
154
|
-
compare('enrollmentRequest2', enrollmentRequest2, EnrollmentRequest.fromJson);
|
|
151
|
+
compare('verificationConfig2', verificationConfig2, VerificationConfig.fromJson);
|
|
155
152
|
compare('livenessBackendException', livenessBackendException, LivenessBackendException.fromJson);
|
|
156
153
|
compare('livenessException', livenessException, LivenessException.fromJson);
|
|
157
154
|
compare('livenessResponse', livenessResponse, LivenessResponse.fromJson);
|
|
158
155
|
compare('livenessNotification', livenessNotification, LivenessNotification.fromJson);
|
|
159
|
-
compare('errorResponse', errorResponse, ErrorResponse.fromJson);
|
|
160
156
|
compare('enrollmentResponse', enrollmentResponse, EnrollmentResponse.fromJson);
|
|
161
|
-
compare('
|
|
157
|
+
compare('verificationMatchResponse', verificationMatchResponse, VerificationMatchResponse.fromJson);
|
|
162
158
|
compare('verificationResponse', verificationResponse, VerificationResponse.fromJson);
|
|
163
159
|
|
|
164
160
|
compare('matchFacesConfig', matchFacesConfig, MatchFacesConfig.fromJson);
|
|
@@ -182,3 +178,4 @@ compare('searchPersonDetection', searchPersonDetection, SearchPersonDetection.fr
|
|
|
182
178
|
compare('searchPersonImage', searchPersonImage, SearchPersonImage.fromJson);
|
|
183
179
|
compare('searchPerson', searchPerson, SearchPerson.fromJson);
|
|
184
180
|
compare('searchPersonRequest', searchPersonRequest, SearchPersonRequest.fromJson);
|
|
181
|
+
compare('searchPersonFilter', searchPersonFilter, SearchPersonFilter.fromJson);
|
package/www/capacitor/index.js
CHANGED
|
@@ -104,15 +104,13 @@ export {
|
|
|
104
104
|
|
|
105
105
|
import { LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep } from './liveness/liveness_config'
|
|
106
106
|
import { EnrollmentConfig } from './liveness/enrollment_config'
|
|
107
|
-
import { EnrollmentRequest } from './liveness/enrollment_request'
|
|
108
107
|
import { VerificationConfig } from './liveness/verification_config'
|
|
109
108
|
import { LivenessBackendException, LivenessBackendErrorCode } from './liveness/liveness_backend_exception'
|
|
110
109
|
import { LivenessException, LivenessErrorCode } from './liveness/liveness_exception'
|
|
111
110
|
import { LivenessResponse, LivenessStatus } from './liveness/liveness_response'
|
|
112
111
|
import { LivenessNotification, LivenessProcessStatus } from './liveness/liveness_notification'
|
|
113
|
-
import { ErrorResponse } from './liveness/error_response'
|
|
114
112
|
import { EnrollmentResponse } from './liveness/enrollment_response'
|
|
115
|
-
import {
|
|
113
|
+
import { VerificationMatchResponse } from './liveness/verification_match_response'
|
|
116
114
|
import { VerificationResponse } from './liveness/verification_response'
|
|
117
115
|
export {
|
|
118
116
|
LivenessBackendException,
|
|
@@ -128,11 +126,9 @@ export {
|
|
|
128
126
|
LivenessResponse,
|
|
129
127
|
LivenessStatus,
|
|
130
128
|
EnrollmentConfig,
|
|
131
|
-
EnrollmentRequest,
|
|
132
129
|
VerificationConfig,
|
|
133
|
-
ErrorResponse,
|
|
134
130
|
EnrollmentResponse,
|
|
135
|
-
|
|
131
|
+
VerificationMatchResponse,
|
|
136
132
|
VerificationResponse,
|
|
137
133
|
}
|
|
138
134
|
|
|
@@ -173,6 +169,7 @@ import { Person } from './person_database/person'
|
|
|
173
169
|
import { SearchPersonDetection } from './person_database/search_person_detection'
|
|
174
170
|
import { SearchPersonImage } from './person_database/search_person_image'
|
|
175
171
|
import { SearchPersonRequest } from './person_database/search_person_request'
|
|
172
|
+
import { SearchPersonFilter } from './person_database/search_person_filter'
|
|
176
173
|
import { SearchPerson } from './person_database/search_person'
|
|
177
174
|
export {
|
|
178
175
|
EditGroupPersonsRequest,
|
|
@@ -185,6 +182,7 @@ export {
|
|
|
185
182
|
SearchPersonDetection,
|
|
186
183
|
SearchPersonImage,
|
|
187
184
|
SearchPersonRequest,
|
|
185
|
+
SearchPersonFilter,
|
|
188
186
|
SearchPerson,
|
|
189
187
|
}
|
|
190
188
|
|
|
@@ -311,11 +309,6 @@ export class FaceSDK {
|
|
|
311
309
|
return [lr, er];
|
|
312
310
|
}
|
|
313
311
|
|
|
314
|
-
async enrollWithTrustedPhoto(request) {
|
|
315
|
-
var response = await exec("enrollWithTrustedPhoto", [request])
|
|
316
|
-
return EnrollmentResponse.fromJson(JSON.parse(response));
|
|
317
|
-
}
|
|
318
|
-
|
|
319
312
|
stopLiveness() {
|
|
320
313
|
exec("stopLiveness", [])
|
|
321
314
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CameraPosition } from '../customization/camera_position'
|
|
2
2
|
import { ScreenOrientation } from '../customization/screen_orientation'
|
|
3
3
|
import { RecordingProcess, LivenessType, LivenessSkipStep } from './liveness_config'
|
|
4
|
+
import { Person } from '../person_database/person'
|
|
5
|
+
import { SearchPersonFilter } from '../person_database/search_person_filter'
|
|
4
6
|
|
|
5
7
|
export class EnrollmentConfig {
|
|
6
8
|
copyright
|
|
@@ -19,10 +21,8 @@ export class EnrollmentConfig {
|
|
|
19
21
|
tag
|
|
20
22
|
skipStep
|
|
21
23
|
metadata
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
checkDuplicatesEnabled
|
|
25
|
-
duplicatesThreshold
|
|
24
|
+
person
|
|
25
|
+
searchFilter
|
|
26
26
|
|
|
27
27
|
constructor(options) {
|
|
28
28
|
this.copyright = options?.copyright ?? true
|
|
@@ -41,10 +41,8 @@ export class EnrollmentConfig {
|
|
|
41
41
|
this.tag = options?.tag
|
|
42
42
|
this.skipStep = options?.skipStep ?? []
|
|
43
43
|
this.metadata = options?.metadata
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.checkDuplicatesEnabled = options?.checkDuplicatesEnabled
|
|
47
|
-
this.duplicatesThreshold = options?.duplicatesThreshold
|
|
44
|
+
this.person = Person.fromJson(options?.person)
|
|
45
|
+
this.searchFilter = SearchPersonFilter.fromJson(options?.searchFilter)
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
static fromJson(jsonObject) {
|
|
@@ -67,10 +65,8 @@ export class EnrollmentConfig {
|
|
|
67
65
|
result.tag = jsonObject["tag"]
|
|
68
66
|
result.skipStep = jsonObject["skipStep"]
|
|
69
67
|
result.metadata = jsonObject["metadata"]
|
|
70
|
-
result.
|
|
71
|
-
result.
|
|
72
|
-
result.checkDuplicatesEnabled = jsonObject["checkDuplicatesEnabled"]
|
|
73
|
-
result.duplicatesThreshold = jsonObject["duplicatesThreshold"]
|
|
68
|
+
result.person = Person.fromJson(jsonObject["person"])
|
|
69
|
+
result.searchFilter = SearchPersonFilter.fromJson(jsonObject["searchFilter"])
|
|
74
70
|
|
|
75
71
|
return result
|
|
76
72
|
}
|
|
@@ -93,10 +89,8 @@ export class EnrollmentConfig {
|
|
|
93
89
|
"tag": this.tag,
|
|
94
90
|
"skipStep": this.skipStep,
|
|
95
91
|
"metadata": this.metadata,
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"checkDuplicatesEnabled": this.checkDuplicatesEnabled,
|
|
99
|
-
"duplicatesThreshold": this.duplicatesThreshold,
|
|
92
|
+
"person": this.person?.toJson(),
|
|
93
|
+
"searchFilter": this.searchFilter?.toJson(),
|
|
100
94
|
}
|
|
101
95
|
}
|
|
102
96
|
}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Person } from '../person_database/person'
|
|
2
|
+
import { SearchPerson } from '../person_database/search_person'
|
|
2
3
|
|
|
3
4
|
export class EnrollmentResponse {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
enrolled
|
|
6
|
+
person
|
|
7
|
+
searchPersons
|
|
7
8
|
|
|
8
9
|
static fromJson(jsonObject) {
|
|
9
10
|
if (jsonObject == null) return null
|
|
10
11
|
const result = new EnrollmentResponse()
|
|
11
12
|
|
|
12
|
-
result.
|
|
13
|
-
result.
|
|
14
|
-
result.
|
|
13
|
+
result.enrolled = jsonObject["enrolled"]
|
|
14
|
+
result.person = Person.fromJson(jsonObject["person"])
|
|
15
|
+
result.searchPersons = []
|
|
16
|
+
if (jsonObject["searchPersons"] != null)
|
|
17
|
+
for (const item of jsonObject["searchPersons"])
|
|
18
|
+
result.searchPersons.push(SearchPerson.fromJson(item))
|
|
15
19
|
|
|
16
20
|
return result
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
toJson() {
|
|
20
24
|
return {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
25
|
+
"enrolled": this.enrolled,
|
|
26
|
+
"person": this.person?.toJson(),
|
|
27
|
+
"searchPersons": this.searchPersons?.map(e => e.toJson()),
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -36,9 +36,9 @@ export const LivenessErrorCode = {
|
|
|
36
36
|
PROCESSING_FRAME_FAILED: 7,
|
|
37
37
|
APPLICATION_INACTIVE: 8,
|
|
38
38
|
BAD_FACE_QUALITY: 9,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
CAMERA_NOT_AVAILABLE: 10,
|
|
40
|
+
CAMERA_NO_PERMISSION: 11,
|
|
41
|
+
BAD_FRAME_SIZE: 12,
|
|
42
42
|
CONTEXT_IS_NULL: 13,
|
|
43
43
|
IN_PROGRESS_ALREADY: 14,
|
|
44
44
|
ZOOM_NOT_SUPPORTED: 15,
|
|
@@ -20,7 +20,7 @@ export class VerificationConfig {
|
|
|
20
20
|
skipStep
|
|
21
21
|
metadata
|
|
22
22
|
personId
|
|
23
|
-
|
|
23
|
+
externalId
|
|
24
24
|
threshold
|
|
25
25
|
|
|
26
26
|
constructor(options) {
|
|
@@ -41,10 +41,22 @@ export class VerificationConfig {
|
|
|
41
41
|
this.skipStep = options?.skipStep ?? []
|
|
42
42
|
this.metadata = options?.metadata
|
|
43
43
|
this.personId = options?.personId
|
|
44
|
-
this.
|
|
44
|
+
this.externalId = options?.externalId
|
|
45
45
|
this.threshold = options?.threshold
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
static withPersonId(personId, options) {
|
|
49
|
+
const result = new VerificationConfig(options)
|
|
50
|
+
result.personId = personId
|
|
51
|
+
return result
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static withExternalId(externalId, options) {
|
|
55
|
+
const result = new VerificationConfig(options)
|
|
56
|
+
result.externalId = externalId
|
|
57
|
+
return result
|
|
58
|
+
}
|
|
59
|
+
|
|
48
60
|
static fromJson(jsonObject) {
|
|
49
61
|
if (jsonObject == null) return null
|
|
50
62
|
const result = new VerificationConfig()
|
|
@@ -66,7 +78,7 @@ export class VerificationConfig {
|
|
|
66
78
|
result.skipStep = jsonObject["skipStep"]
|
|
67
79
|
result.metadata = jsonObject["metadata"]
|
|
68
80
|
result.personId = jsonObject["personId"]
|
|
69
|
-
result.
|
|
81
|
+
result.externalId = jsonObject["externalId"]
|
|
70
82
|
result.threshold = jsonObject["threshold"]
|
|
71
83
|
|
|
72
84
|
return result
|
|
@@ -91,7 +103,7 @@ export class VerificationConfig {
|
|
|
91
103
|
"skipStep": this.skipStep,
|
|
92
104
|
"metadata": this.metadata,
|
|
93
105
|
"personId": this.personId,
|
|
94
|
-
"
|
|
106
|
+
"externalId": this.externalId,
|
|
95
107
|
"threshold": this.threshold,
|
|
96
108
|
}
|
|
97
109
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export class
|
|
2
|
-
|
|
1
|
+
export class VerificationMatchResponse {
|
|
2
|
+
verified
|
|
3
3
|
similarity
|
|
4
4
|
|
|
5
5
|
static fromJson(jsonObject) {
|
|
6
6
|
if (jsonObject == null) return null
|
|
7
|
-
const result = new
|
|
7
|
+
const result = new VerificationMatchResponse()
|
|
8
8
|
|
|
9
|
-
result.
|
|
9
|
+
result.verified = jsonObject["verified"]
|
|
10
10
|
result.similarity = jsonObject["similarity"]
|
|
11
11
|
|
|
12
12
|
return result
|
|
@@ -14,7 +14,7 @@ export class VerifyMatchResponse {
|
|
|
14
14
|
|
|
15
15
|
toJson() {
|
|
16
16
|
return {
|
|
17
|
-
"
|
|
17
|
+
"verified": this.verified,
|
|
18
18
|
"similarity": this.similarity,
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { VerificationMatchResponse } from './verification_match_response'
|
|
2
|
+
import { Person } from '../person_database/person'
|
|
3
3
|
|
|
4
4
|
export class VerificationResponse {
|
|
5
|
-
|
|
5
|
+
verified
|
|
6
|
+
person
|
|
6
7
|
match
|
|
7
|
-
error
|
|
8
8
|
|
|
9
9
|
static fromJson(jsonObject) {
|
|
10
10
|
if (jsonObject == null) return null
|
|
11
11
|
const result = new VerificationResponse()
|
|
12
12
|
|
|
13
|
-
result.
|
|
14
|
-
result.
|
|
15
|
-
result.
|
|
13
|
+
result.verified = jsonObject["verified"]
|
|
14
|
+
result.person = Person.fromJson(jsonObject["person"])
|
|
15
|
+
result.match = VerificationMatchResponse.fromJson(jsonObject["match"])
|
|
16
16
|
|
|
17
17
|
return result
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
toJson() {
|
|
21
21
|
return {
|
|
22
|
-
"
|
|
22
|
+
"verified": this.verified,
|
|
23
|
+
"person": this.person?.toJson(),
|
|
23
24
|
"match": this.match?.toJson(),
|
|
24
|
-
"error": this.error?.toJson(),
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,35 +1,44 @@
|
|
|
1
1
|
import { dateToString } from '../internal/bridge'
|
|
2
2
|
|
|
3
3
|
export class Person {
|
|
4
|
+
id
|
|
5
|
+
createdAt
|
|
4
6
|
name
|
|
5
7
|
updatedAt
|
|
6
8
|
groups
|
|
7
|
-
id
|
|
8
9
|
metadata
|
|
9
|
-
|
|
10
|
+
externalId
|
|
11
|
+
expireAt
|
|
12
|
+
ttl
|
|
10
13
|
|
|
11
14
|
static fromJson(jsonObject) {
|
|
12
15
|
if (jsonObject == null) return null
|
|
13
16
|
var result = new Person()
|
|
14
17
|
|
|
18
|
+
result.id = jsonObject["id"]
|
|
19
|
+
result.createdAt = jsonObject["createdAt"] === null ? null : new Date(jsonObject["createdAt"]);
|
|
15
20
|
result.name = jsonObject["name"]
|
|
16
|
-
result.updatedAt = new Date(jsonObject["updatedAt"])
|
|
21
|
+
result.updatedAt = jsonObject["updatedAt"] === null ? null : new Date(jsonObject["updatedAt"]);
|
|
17
22
|
result.groups = jsonObject["groups"]
|
|
18
|
-
result.id = jsonObject["id"]
|
|
19
23
|
result.metadata = jsonObject["metadata"]
|
|
20
|
-
result.
|
|
24
|
+
result.externalId = jsonObject["externalId"]
|
|
25
|
+
result.expireAt = jsonObject["expireAt"] === null ? null : new Date(jsonObject["expireAt"]);
|
|
26
|
+
result.ttl = jsonObject["ttl"]
|
|
21
27
|
|
|
22
28
|
return result
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
toJson() {
|
|
26
32
|
return {
|
|
33
|
+
"id": this.id,
|
|
34
|
+
"createdAt": dateToString(this.createdAt),
|
|
27
35
|
"name": this.name,
|
|
28
36
|
"updatedAt": dateToString(this.updatedAt),
|
|
29
37
|
"groups": this.groups,
|
|
30
|
-
"id": this.id,
|
|
31
38
|
"metadata": this.metadata,
|
|
32
|
-
"
|
|
39
|
+
"externalId": this.externalId,
|
|
40
|
+
"expireAt": dateToString(this.expireAt),
|
|
41
|
+
"ttl": this.ttl,
|
|
33
42
|
}
|
|
34
43
|
}
|
|
35
44
|
}
|
|
@@ -11,6 +11,9 @@ export class SearchPerson {
|
|
|
11
11
|
id
|
|
12
12
|
metadata
|
|
13
13
|
createdAt
|
|
14
|
+
externalId
|
|
15
|
+
expireAt
|
|
16
|
+
ttl
|
|
14
17
|
|
|
15
18
|
static fromJson(jsonObject) {
|
|
16
19
|
if (jsonObject == null) return null
|
|
@@ -26,6 +29,9 @@ export class SearchPerson {
|
|
|
26
29
|
result.id = jsonObject["id"]
|
|
27
30
|
result.metadata = jsonObject["metadata"]
|
|
28
31
|
result.createdAt = new Date(jsonObject["createdAt"])
|
|
32
|
+
result.externalId = jsonObject["externalId"]
|
|
33
|
+
result.expireAt = new Date(jsonObject["expireAt"])
|
|
34
|
+
result.ttl = jsonObject["ttl"]
|
|
29
35
|
|
|
30
36
|
return result
|
|
31
37
|
}
|
|
@@ -40,6 +46,9 @@ export class SearchPerson {
|
|
|
40
46
|
"id": this.id,
|
|
41
47
|
"metadata": this.metadata,
|
|
42
48
|
"createdAt": dateToString(this.createdAt),
|
|
49
|
+
"externalId": this.externalId,
|
|
50
|
+
"expireAt": dateToString(this.expireAt),
|
|
51
|
+
"ttl": this.ttl,
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
54
|
}
|