uqudosdk-capacitor 2.5.4 → 2.6.0

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.
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
12
12
  s.source = { :http => 'https://uqudo.com' }
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '12.0'
15
- s.dependency 'UqudoSDK', '2.5.4'
15
+ s.dependency 'UqudoSDK', '2.6.0'
16
16
  s.dependency 'OpenSSL-Universal', '1.1.1700'
17
17
  s.dependency 'Capacitor'
18
18
  s.swift_version = '5.1'
@@ -56,7 +56,7 @@ repositories {
56
56
  dependencies {
57
57
  implementation fileTree(dir: 'libs', include: ['*.jar'])
58
58
  implementation project(':capacitor-android')
59
- implementation "io.uqudo.sdk:Uqudo:2.5.4"
59
+ implementation "io.uqudo.sdk:Uqudo:2.6.0"
60
60
 
61
61
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
62
62
  testImplementation "junit:junit:$junitVersion"
@@ -34,6 +34,9 @@ import io.uqudo.sdk.core.domain.model.BackgroundCheckType;
34
34
  import io.uqudo.sdk.core.domain.model.Document;
35
35
  import io.uqudo.sdk.core.domain.model.DocumentType;
36
36
 
37
+ import java.text.SimpleDateFormat;
38
+ import java.util.TimeZone;
39
+
37
40
  @CapacitorPlugin(name = "UqudoId")
38
41
  public class UqudoIdPlugin extends Plugin {
39
42
 
@@ -55,7 +58,9 @@ public class UqudoIdPlugin extends Plugin {
55
58
  json.put("statusCode", trace.getStatusCode());
56
59
  json.put("status", trace.getStatus());
57
60
  json.put("statusMessage", trace.getStatusMessage());
58
- json.put("timestamp", trace.getTimestamp());
61
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
62
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
63
+ json.put("timestamp", dateFormat.format(trace.getTimestamp()));
59
64
  json.put("documentType", trace.getDocumentType());
60
65
  String data = json.toString();
61
66
  bridge.triggerWindowJSEvent("TraceEvent", data);
@@ -84,9 +89,6 @@ public class UqudoIdPlugin extends Plugin {
84
89
  if (json.has("isSecuredWindowsDisabled") && json.getBoolean("isSecuredWindowsDisabled")) {
85
90
  enrollment.disableSecureWindow();
86
91
  }
87
- if (json.has("isRootedDeviceAllowed") && json.getBoolean("isRootedDeviceAllowed")) {
88
- enrollment.enableRootedDeviceUsage();
89
- }
90
92
  if (json.has("nonce")) {
91
93
  enrollment.setNonce(json.getString("nonce"));
92
94
  }
@@ -118,22 +120,22 @@ public class UqudoIdPlugin extends Plugin {
118
120
  }
119
121
 
120
122
  if (json.has("lookupConfiguration")) {
121
- JSONObject lookupObject = json.getJSONObject("lookupConfiguration");
122
- if (lookupObject.has("documentList")) {
123
- JSONArray lookupDocuments = lookupObject.getJSONArray("documentList");
124
- if (lookupDocuments.length() > 0) {
125
- DocumentType[] documents = new DocumentType[lookupDocuments.length()];
126
- for (int i = 0; i < lookupDocuments.length(); i++) {
127
- String parsedDocument = lookupDocuments.getString(i);
128
- documents[i] = DocumentType.valueOf(parsedDocument);
129
- }
130
- enrollment.enableLookup(documents);
131
- } else {
132
- enrollment.enableLookup();
133
- }
134
- } else {
135
- enrollment.enableLookup();
136
- }
123
+ JSONObject lookupObject = json.getJSONObject("lookupConfiguration");
124
+ if (lookupObject.has("documentList")) {
125
+ JSONArray lookupDocuments = lookupObject.getJSONArray("documentList");
126
+ if (lookupDocuments.length() > 0) {
127
+ DocumentType[] documents = new DocumentType[lookupDocuments.length()];
128
+ for (int i = 0; i < lookupDocuments.length(); i++) {
129
+ String parsedDocument = lookupDocuments.getString(i);
130
+ documents[i] = DocumentType.valueOf(parsedDocument);
131
+ }
132
+ enrollment.enableLookup(documents);
133
+ } else {
134
+ enrollment.enableLookup();
135
+ }
136
+ } else {
137
+ enrollment.enableLookup();
138
+ }
137
139
  }
138
140
 
139
141
  if (json.has("backgroundCheckConfiguration")) {
@@ -215,7 +217,7 @@ public class UqudoIdPlugin extends Plugin {
215
217
  } else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
216
218
  AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
217
219
  }
218
- }else{
220
+ } else {
219
221
  AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
220
222
  }
221
223
  call.setKeepAlive(true);
@@ -243,10 +245,7 @@ public class UqudoIdPlugin extends Plugin {
243
245
  if (json.has("nonce")) {
244
246
  recovery.setNonce(json.getString("nonce"));
245
247
  }
246
- if (json.has("isRootedDeviceAllowed")) {
247
- recovery.enableRootedDeviceUsage();
248
- }
249
- if (json.has("isSecuredWindowsDisabled")) {
248
+ if (json.has("isSecuredWindowsDisabled") && json.getBoolean("isSecuredWindowsDisabled")) {
250
249
  recovery.disableSecureWindow();
251
250
  }
252
251
  if (json.has("minimumMatchLevel") && json.getInt("minimumMatchLevel") > 0) {
@@ -259,15 +258,15 @@ public class UqudoIdPlugin extends Plugin {
259
258
  recovery.returnDataForIncompleteSession();
260
259
  }
261
260
  if (json.has("appearanceMode")) {
262
- if ("LIGHT".equals(json.getString("appearanceMode"))) {
263
- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
264
- } else if ("DARK".equals(json.getString("appearanceMode"))) {
265
- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
266
- } else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
267
- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
268
- }
269
- }else{
270
- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
261
+ if ("LIGHT".equals(json.getString("appearanceMode"))) {
262
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
263
+ } else if ("DARK".equals(json.getString("appearanceMode"))) {
264
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
265
+ } else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
266
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
267
+ }
268
+ } else {
269
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
271
270
  }
272
271
  call.setKeepAlive(true);
273
272
  Intent intent = recovery.build(getContext());
@@ -294,10 +293,7 @@ public class UqudoIdPlugin extends Plugin {
294
293
  if (json.has("nonce")) {
295
294
  faceSessionBuilder.setNonce(json.getString("nonce"));
296
295
  }
297
- if (json.has("isRootedDeviceAllowed")) {
298
- faceSessionBuilder.enableRootedDeviceUsage();
299
- }
300
- if (json.has("isSecuredWindowsDisabled")) {
296
+ if (json.has("isSecuredWindowsDisabled") && json.getBoolean("isSecuredWindowsDisabled")) {
301
297
  faceSessionBuilder.disableSecureWindow();
302
298
  }
303
299
  if (json.has("minimumMatchLevel") && json.getInt("minimumMatchLevel") > 0) {
@@ -317,7 +313,7 @@ public class UqudoIdPlugin extends Plugin {
317
313
  } else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
318
314
  AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
319
315
  }
320
- }else{
316
+ } else {
321
317
  AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
322
318
  }
323
319
  call.setKeepAlive(true);
@@ -333,32 +329,153 @@ public class UqudoIdPlugin extends Plugin {
333
329
  }
334
330
 
335
331
  @PluginMethod
336
- public void isReadingSupported(PluginCall call) {
337
- try {
338
- String documentType = call.getString("value");
339
- if (documentType != null) {
340
- JSObject ret = new JSObject();
341
- ret.put("value", DocumentType.valueOf(documentType).getReadingSupported());
342
- call.resolve(ret);
332
+ public void lookup(PluginCall call) {
333
+ String message = call.getString("value");
334
+ if (message != null && message.length() > 0) {
335
+ try {
336
+ JSONObject json = new JSONObject(message);
337
+ UqudoBuilder.Lookup lookup = new UqudoBuilder.Lookup();
338
+ if (json.has("isSecuredWindowsDisabled") && json.getBoolean("isSecuredWindowsDisabled")) {
339
+ lookup.disableSecureWindow();
340
+ }
341
+ if (json.has("nonce")) {
342
+ lookup.setNonce(json.getString("nonce"));
343
+ }
344
+ if (json.has("sessionId")) {
345
+ lookup.setSessionId(json.getString("sessionId"));
346
+ }
347
+ if (json.has("userIdentifier")) {
348
+ lookup.setUserIdentifier(UUID.fromString(json.getString("userIdentifier")));
349
+ }
350
+ if (json.has("isReturnDataForIncompleteSession") && json.getBoolean("isReturnDataForIncompleteSession")) {
351
+ lookup.returnDataForIncompleteSession();
352
+ }
353
+ if (json.has("facialRecognitionSpecification")) {
354
+ FacialRecognitionConfigurationBuilder faceBuilder = new FacialRecognitionConfigurationBuilder();
355
+ JSONObject faceObject = json.getJSONObject("facialRecognitionSpecification");
356
+ if (faceObject.has("enrollFace") && faceObject.getBoolean("enrollFace")) {
357
+ faceBuilder.enrollFace();
358
+ }
359
+ if (faceObject.has("lookupMinimumMatchLevel") && faceObject.getInt("lookupMinimumMatchLevel") > 0) {
360
+ faceBuilder.setLookupMinimumMatchLevel(faceObject.getInt("lookupMinimumMatchLevel"));
361
+ }
362
+ if (faceObject.has("maxAttempts") && faceObject.getInt("maxAttempts") > 0) {
363
+ faceBuilder.setMaxAttempts(faceObject.getInt("maxAttempts"));
364
+ }
365
+ lookup.enableFacialRecognition(faceBuilder.build());
366
+ }
367
+ if (json.has("backgroundCheckConfiguration")) {
368
+ BackgroundCheckConfigurationBuilder backgroundCheckConfigurationBuilder = new BackgroundCheckConfigurationBuilder();
369
+ JSONObject backgroundObject = json.getJSONObject("backgroundCheckConfiguration");
370
+ if (backgroundObject.has("disableConsent") && backgroundObject.getBoolean("disableConsent")) {
371
+ backgroundCheckConfigurationBuilder.disableConsent();
372
+ }
373
+ if (backgroundObject.has("backgroundCheckType")) {
374
+ backgroundCheckConfigurationBuilder.setBackgroundCheckType(BackgroundCheckType.valueOf(backgroundObject.getString("backgroundCheckType")));
375
+ }
376
+ if (backgroundObject.has("monitoringEnabled") && backgroundObject.getBoolean("monitoringEnabled")) {
377
+ backgroundCheckConfigurationBuilder.enableMonitoring();
378
+ }
379
+ if (backgroundObject.has("skipView") && backgroundObject.getBoolean("skipView")) {
380
+ backgroundCheckConfigurationBuilder.skipView();
381
+ }
382
+ lookup.enableBackgroundCheck(backgroundCheckConfigurationBuilder.build());
343
383
  }
344
- } catch (Exception e) {
345
- sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected document type as argument.", null);
346
- }
347
- }
384
+ lookup.setToken(json.getString("authorizationToken"));
385
+ lookup.setDocumentType(DocumentType.valueOf(json.getString("documentType")));
386
+ if (json.has("appearanceMode")) {
387
+ if ("LIGHT".equals(json.getString("appearanceMode"))) {
388
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
389
+ } else if ("DARK".equals(json.getString("appearanceMode"))) {
390
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
391
+ } else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
392
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
393
+ }
394
+ } else {
395
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
396
+ }
397
+ call.setKeepAlive(true);
398
+ Intent intent = lookup.build(getContext());
399
+
400
+ startActivityForResult(call, intent, "handleActivityResult");
401
+ } catch (Exception e) {
402
+ Log.d("UqudoPlugin", e.getMessage(), e);
403
+ sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
404
+ }
405
+ } else {
406
+ sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected enrollment object as argument.", null);
407
+ }
408
+ }
348
409
 
349
410
  @PluginMethod
350
- public void isFacialRecognitionSupported(PluginCall call) {
351
- try {
352
- String documentType = call.getString("value");
353
- if (documentType != null) {
354
- JSObject ret = new JSObject();
355
- ret.put("value", DocumentType.valueOf(documentType).getFacialRecognitionSupported());
356
- call.resolve(ret);
357
- }
358
- } catch (Exception e) {
359
- sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected document type as argument.", null);
360
- }
361
- }
411
+ public void isReadingSupported(PluginCall call) {
412
+ try {
413
+ String documentType = call.getString("value");
414
+ if (documentType != null) {
415
+ JSObject ret = new JSObject();
416
+ ret.put("value", DocumentType.valueOf(documentType).getReadingSupported());
417
+ call.resolve(ret);
418
+ }
419
+ } catch (Exception e) {
420
+ sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected valid document type as argument", null);
421
+ }
422
+ }
423
+
424
+ @PluginMethod
425
+ public void isFacialRecognitionSupported(PluginCall call) {
426
+ try {
427
+ String documentType = call.getString("value");
428
+ if (documentType != null) {
429
+ JSObject ret = new JSObject();
430
+ ret.put("value", DocumentType.valueOf(documentType).getFacialRecognitionSupported());
431
+ call.resolve(ret);
432
+ }
433
+ } catch (Exception e) {
434
+ sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected valid document type as argument", null);
435
+ }
436
+ }
437
+
438
+ @PluginMethod
439
+ public void isLookupSupported(PluginCall call) {
440
+ try {
441
+ String documentType = call.getString("value");
442
+ if (documentType != null) {
443
+ JSObject ret = new JSObject();
444
+ ret.put("value", DocumentType.valueOf(documentType).getLookupSupported());
445
+ call.resolve(ret);
446
+ }
447
+ } catch (Exception e) {
448
+ sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected valid document type as argument", null);
449
+ }
450
+ }
451
+
452
+ @PluginMethod
453
+ public void isLookupFacialRecognitionSupported(PluginCall call) {
454
+ try {
455
+ String documentType = call.getString("value");
456
+ if (documentType != null) {
457
+ JSObject ret = new JSObject();
458
+ ret.put("value", DocumentType.valueOf(documentType).getLookupFacialRecognitionSupported());
459
+ call.resolve(ret);
460
+ }
461
+ } catch (Exception e) {
462
+ sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected valid document type as argument", null);
463
+ }
464
+ }
465
+
466
+ @PluginMethod
467
+ public void isEnrollmentSupported(PluginCall call) {
468
+ try {
469
+ String documentType = call.getString("value");
470
+ if (documentType != null) {
471
+ JSObject ret = new JSObject();
472
+ ret.put("value", DocumentType.valueOf(documentType).getEnrollmentSupported());
473
+ call.resolve(ret);
474
+ }
475
+ } catch (Exception e) {
476
+ sendError(call, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected valid document type as argument", null);
477
+ }
478
+ }
362
479
 
363
480
  private void sendError(PluginCall call, String code, String message, String task) {
364
481
  sendError(call, code, message, task, null);
@@ -374,7 +491,7 @@ public class UqudoIdPlugin extends Plugin {
374
491
  } catch (Exception e) {
375
492
  e.printStackTrace();
376
493
  }
377
- call.reject(error.toString(),"");
494
+ call.reject("", error.toString());
378
495
  }
379
496
 
380
497
  @ActivityCallback
@@ -18,6 +18,11 @@ export interface UqudoIdPlugin {
18
18
  }): Promise<{
19
19
  value: string;
20
20
  }>;
21
+ lookup(options: {
22
+ value: string;
23
+ }): Promise<{
24
+ value: string;
25
+ }>;
21
26
  isFacialRecognitionSupported(options: {
22
27
  value: string;
23
28
  }): Promise<{
@@ -28,4 +33,19 @@ export interface UqudoIdPlugin {
28
33
  }): Promise<{
29
34
  value: boolean;
30
35
  }>;
36
+ isLookupSupported(options: {
37
+ value: string;
38
+ }): Promise<{
39
+ value: boolean;
40
+ }>;
41
+ isLookupFacialRecognitionSupported(options: {
42
+ value: string;
43
+ }): Promise<{
44
+ value: boolean;
45
+ }>;
46
+ isEnrollmentSupported(options: {
47
+ value: string;
48
+ }): Promise<{
49
+ value: boolean;
50
+ }>;
31
51
  }
@@ -21,7 +21,7 @@ export declare class EnrollmentBuilder {
21
21
  setUserIdentifier(userIdentifier: string): EnrollmentBuilder;
22
22
  enableRootedDeviceUsage(): EnrollmentBuilder;
23
23
  disableSecureWindow(): EnrollmentBuilder;
24
- enableFacialRecognition(facialRecognitionConfigurationBuilder?: FacialRecognitionConfiguration): EnrollmentBuilder;
24
+ enableFacialRecognition(facialRecognitionConfiguration?: FacialRecognitionConfiguration): EnrollmentBuilder;
25
25
  enableBackgroundCheck(backgroundCheckConfiguration: BackgroundCheckConfiguration): EnrollmentBuilder;
26
26
  returnDataForIncompleteSession(): EnrollmentBuilder;
27
27
  enableLookup(documents?: DocumentType[]): EnrollmentBuilder;
@@ -49,11 +49,13 @@ export declare class FacialRecognitionConfigurationBuilder {
49
49
  private isEnrollFace?;
50
50
  private scanMinimumMatchLevel?;
51
51
  private readMinimumMatchLevel?;
52
+ private lookupMinimumMatchLevel?;
52
53
  private maxAttempts?;
53
54
  disableHelpPage(): FacialRecognitionConfigurationBuilder;
54
55
  enrollFace(): FacialRecognitionConfigurationBuilder;
55
56
  setScanMinimumMatchLevel(scanMinimumMatchLevel: number): FacialRecognitionConfigurationBuilder;
56
57
  setReadMinimumMatchLevel(readMinimumMatchLevel: number): FacialRecognitionConfigurationBuilder;
58
+ setLookupMinimumMatchLevel(lookupMinimumMatchLevel: number): FacialRecognitionConfigurationBuilder;
57
59
  setMaxAttempts(maxAttempts: number): FacialRecognitionConfigurationBuilder;
58
60
  build(): FacialRecognitionConfiguration;
59
61
  }
@@ -62,8 +64,9 @@ export declare class FacialRecognitionConfiguration {
62
64
  private enrollFace?;
63
65
  private scanMinimumMatchLevel?;
64
66
  private readMinimumMatchLevel?;
67
+ private lookupMinimumMatchLevel?;
65
68
  private maxAttempts?;
66
- constructor(isHelpPageDisabled?: boolean, enrollFace?: boolean, scanMinimumMatchLevel?: number, readMinimumMatchLevel?: number, maxAttempts?: number);
69
+ constructor(isHelpPageDisabled?: boolean, enrollFace?: boolean, scanMinimumMatchLevel?: number, readMinimumMatchLevel?: number, lookupMinimumMatchLevel?: number, maxAttempts?: number);
67
70
  }
68
71
  export declare class BackgroundCheckConfigurationBuilder {
69
72
  private isDisableConsent?;
@@ -143,6 +146,7 @@ export declare class ReadingConfigurationBuilder {
143
146
  forceReadingTimeout(value: number): ReadingConfigurationBuilder;
144
147
  build(): ReadingConfiguration;
145
148
  }
149
+ export { AccountRecoveryConfigurationBuilder as AccountRecoveryBuilder };
146
150
  export declare class AccountRecoveryConfigurationBuilder {
147
151
  private authorizationToken?;
148
152
  private enrollmentIdentifier?;
@@ -199,6 +203,7 @@ export declare class AccountRecoveryConfiguration {
199
203
  private appearanceMode?;
200
204
  constructor(token?: string, enrollmentIdentifier?: string, nonce?: string, isRootedDeviceAllowed?: boolean, isSecuredWindowsDisabled?: boolean, minimumMatchLevel?: number, maxAttempts?: number, isReturnDataForIncompleteSession?: boolean, appearanceMode?: AppearanceMode);
201
205
  }
206
+ export { FaceSessionConfigurationBuilder as FaceSessionBuilder };
202
207
  export declare class FaceSessionConfigurationBuilder {
203
208
  private authorizationToken?;
204
209
  private sessionId?;
@@ -255,6 +260,42 @@ export declare class FaceSessionConfiguration {
255
260
  private appearanceMode?;
256
261
  constructor(token?: string, sessionId?: string, nonce?: string, isRootedDeviceAllowed?: boolean, isSecuredWindowsDisabled?: boolean, minimumMatchLevel?: number, maxAttempts?: number, isReturnDataForIncompleteSession?: boolean, appearanceMode?: AppearanceMode);
257
262
  }
263
+ export declare class LookupBuilder {
264
+ private documentType?;
265
+ private authorizationToken?;
266
+ private nonce?;
267
+ private isSecuredWindowsDisabled?;
268
+ private facialRecognitionSpecification?;
269
+ private backgroundCheckConfiguration?;
270
+ private sessionId?;
271
+ private userIdentifier?;
272
+ private isReturnDataForIncompleteSession?;
273
+ private appearanceMode;
274
+ setToken(token: string): LookupBuilder;
275
+ setNonce(nonce: string): LookupBuilder;
276
+ setSessionId(sessionId: string): LookupBuilder;
277
+ setUserIdentifier(userIdentifier: string): LookupBuilder;
278
+ disableSecureWindow(): LookupBuilder;
279
+ enableFacialRecognition(facialRecognitionConfiguration?: FacialRecognitionConfiguration): LookupBuilder;
280
+ enableBackgroundCheck(backgroundCheckConfiguration: BackgroundCheckConfiguration): LookupBuilder;
281
+ returnDataForIncompleteSession(): LookupBuilder;
282
+ setDocumentType(documentType: DocumentType): LookupBuilder;
283
+ setAppearanceMode(appearanceMode: AppearanceMode): LookupBuilder;
284
+ build(): Lookup;
285
+ }
286
+ export declare class Lookup {
287
+ private documentType?;
288
+ private authorizationToken?;
289
+ private nonce?;
290
+ private isSecuredWindowsDisabled?;
291
+ private facialRecognitionSpecification?;
292
+ private backgroundCheckConfiguration?;
293
+ private sessionId?;
294
+ private userIdentifier?;
295
+ private isReturnDataForIncompleteSession?;
296
+ private appearanceMode?;
297
+ constructor(documentType?: DocumentType, authorizationToken?: string, nonce?: string, isSecuredWindowsDisabled?: boolean, facialRecognitionSpecification?: FacialRecognitionConfiguration, backgroundCheckConfiguration?: BackgroundCheckConfiguration, sessionId?: string, userIdentifier?: string, isReturnDataForIncompleteSession?: boolean, appearanceMode?: AppearanceMode);
298
+ }
258
299
  export declare enum DocumentType {
259
300
  BHR_ID = "BHR_ID",
260
301
  GENERIC_ID = "GENERIC_ID",
@@ -307,7 +348,8 @@ export declare enum DocumentType {
307
348
  RSL_ID = "RSL_ID",
308
349
  IND_PAN = "IND_PAN",
309
350
  SAU_ID_NATIONAL = "SAU_ID_NATIONAL",
310
- SAU_ID_RESIDENT = "SAU_ID_RESIDENT"
351
+ SAU_ID_RESIDENT = "SAU_ID_RESIDENT",
352
+ NGA_BVN = "NGA_BVN"
311
353
  }
312
354
  export declare enum BackgroundCheckType {
313
355
  RDC = "RDC",
@@ -330,6 +372,12 @@ export declare class UqudoPlugin {
330
372
  faceSession(faceSessionObj: FaceSessionConfiguration): Promise<{
331
373
  value: string;
332
374
  }>;
375
+ lookup(lookup: Lookup): Promise<{
376
+ value: string;
377
+ }>;
333
378
  isFacialRecognitionSupported(documentType: string): Promise<boolean>;
334
379
  isReadingSupported(documentType: string): Promise<boolean>;
380
+ isLookupSupported(documentType: string): Promise<boolean>;
381
+ isLookupFacialRecognitionSupported(documentType: string): Promise<boolean>;
382
+ isEnrollmentSupported(documentType: string): Promise<boolean>;
335
383
  }
package/dist/esm/index.js CHANGED
@@ -31,12 +31,12 @@ export class EnrollmentBuilder {
31
31
  this.isSecuredWindowsDisabled = true;
32
32
  return this;
33
33
  }
34
- enableFacialRecognition(facialRecognitionConfigurationBuilder) {
35
- if (facialRecognitionConfigurationBuilder === null) {
34
+ enableFacialRecognition(facialRecognitionConfiguration) {
35
+ if (facialRecognitionConfiguration === undefined) {
36
36
  this.facialRecognitionSpecification = new FacialRecognitionConfigurationBuilder().build();
37
37
  }
38
38
  else {
39
- this.facialRecognitionSpecification = facialRecognitionConfigurationBuilder;
39
+ this.facialRecognitionSpecification = facialRecognitionConfiguration;
40
40
  }
41
41
  return this;
42
42
  }
@@ -102,20 +102,25 @@ export class FacialRecognitionConfigurationBuilder {
102
102
  this.readMinimumMatchLevel = readMinimumMatchLevel;
103
103
  return this;
104
104
  }
105
+ setLookupMinimumMatchLevel(lookupMinimumMatchLevel) {
106
+ this.lookupMinimumMatchLevel = lookupMinimumMatchLevel;
107
+ return this;
108
+ }
105
109
  setMaxAttempts(maxAttempts) {
106
110
  this.maxAttempts = maxAttempts;
107
111
  return this;
108
112
  }
109
113
  build() {
110
- return new FacialRecognitionConfiguration(this.isHelpPageDisabled, this.isEnrollFace, this.scanMinimumMatchLevel, this.readMinimumMatchLevel, this.maxAttempts);
114
+ return new FacialRecognitionConfiguration(this.isHelpPageDisabled, this.isEnrollFace, this.scanMinimumMatchLevel, this.readMinimumMatchLevel, this.lookupMinimumMatchLevel, this.maxAttempts);
111
115
  }
112
116
  }
113
117
  export class FacialRecognitionConfiguration {
114
- constructor(isHelpPageDisabled, enrollFace, scanMinimumMatchLevel, readMinimumMatchLevel, maxAttempts) {
118
+ constructor(isHelpPageDisabled, enrollFace, scanMinimumMatchLevel, readMinimumMatchLevel, lookupMinimumMatchLevel, maxAttempts) {
115
119
  this.isHelpPageDisabled = isHelpPageDisabled;
116
120
  this.enrollFace = enrollFace;
117
121
  this.scanMinimumMatchLevel = scanMinimumMatchLevel;
118
122
  this.readMinimumMatchLevel = readMinimumMatchLevel;
123
+ this.lookupMinimumMatchLevel = lookupMinimumMatchLevel;
119
124
  this.maxAttempts = maxAttempts;
120
125
  }
121
126
  }
@@ -249,6 +254,7 @@ export class ReadingConfigurationBuilder {
249
254
  return new ReadingConfiguration(this.forceReadingValue, this.forceReadingIfSupportedValue, this.timeoutInSeconds);
250
255
  }
251
256
  }
257
+ export { AccountRecoveryConfigurationBuilder as AccountRecoveryBuilder };
252
258
  export class AccountRecoveryConfigurationBuilder {
253
259
  constructor() {
254
260
  this.appearanceMode = AppearanceMode.SYSTEM;
@@ -330,7 +336,7 @@ export class AccountRecoveryConfiguration {
330
336
  this.appearanceMode = appearanceMode;
331
337
  }
332
338
  }
333
- ///
339
+ export { FaceSessionConfigurationBuilder as FaceSessionBuilder };
334
340
  export class FaceSessionConfigurationBuilder {
335
341
  constructor() {
336
342
  this.appearanceMode = AppearanceMode.SYSTEM;
@@ -412,6 +418,73 @@ export class FaceSessionConfiguration {
412
418
  this.appearanceMode = appearanceMode;
413
419
  }
414
420
  }
421
+ export class LookupBuilder {
422
+ constructor() {
423
+ this.appearanceMode = AppearanceMode.SYSTEM;
424
+ }
425
+ setToken(token) {
426
+ this.authorizationToken = token;
427
+ return this;
428
+ }
429
+ setNonce(nonce) {
430
+ this.nonce = nonce;
431
+ return this;
432
+ }
433
+ setSessionId(sessionId) {
434
+ this.sessionId = sessionId;
435
+ return this;
436
+ }
437
+ setUserIdentifier(userIdentifier) {
438
+ this.userIdentifier = userIdentifier;
439
+ return this;
440
+ }
441
+ disableSecureWindow() {
442
+ this.isSecuredWindowsDisabled = true;
443
+ return this;
444
+ }
445
+ enableFacialRecognition(facialRecognitionConfiguration) {
446
+ if (facialRecognitionConfiguration === undefined) {
447
+ this.facialRecognitionSpecification = new FacialRecognitionConfigurationBuilder().build();
448
+ }
449
+ else {
450
+ this.facialRecognitionSpecification = facialRecognitionConfiguration;
451
+ }
452
+ return this;
453
+ }
454
+ enableBackgroundCheck(backgroundCheckConfiguration) {
455
+ this.backgroundCheckConfiguration = backgroundCheckConfiguration;
456
+ return this;
457
+ }
458
+ returnDataForIncompleteSession() {
459
+ this.isReturnDataForIncompleteSession = true;
460
+ return this;
461
+ }
462
+ setDocumentType(documentType) {
463
+ this.documentType = documentType;
464
+ return this;
465
+ }
466
+ setAppearanceMode(appearanceMode) {
467
+ this.appearanceMode = appearanceMode;
468
+ return this;
469
+ }
470
+ build() {
471
+ return new Lookup(this.documentType, this.authorizationToken, this.nonce, this.isSecuredWindowsDisabled, this.facialRecognitionSpecification, this.backgroundCheckConfiguration, this.sessionId, this.userIdentifier, this.isReturnDataForIncompleteSession, this.appearanceMode);
472
+ }
473
+ }
474
+ export class Lookup {
475
+ constructor(documentType, authorizationToken, nonce, isSecuredWindowsDisabled, facialRecognitionSpecification, backgroundCheckConfiguration, sessionId, userIdentifier, isReturnDataForIncompleteSession, appearanceMode) {
476
+ this.documentType = documentType;
477
+ this.authorizationToken = authorizationToken;
478
+ this.nonce = nonce;
479
+ this.isSecuredWindowsDisabled = isSecuredWindowsDisabled;
480
+ this.facialRecognitionSpecification = facialRecognitionSpecification;
481
+ this.backgroundCheckConfiguration = backgroundCheckConfiguration;
482
+ this.sessionId = sessionId;
483
+ this.userIdentifier = userIdentifier;
484
+ this.isReturnDataForIncompleteSession = isReturnDataForIncompleteSession;
485
+ this.appearanceMode = appearanceMode;
486
+ }
487
+ }
415
488
  export var DocumentType;
416
489
  (function (DocumentType) {
417
490
  DocumentType["BHR_ID"] = "BHR_ID";
@@ -466,6 +539,7 @@ export var DocumentType;
466
539
  DocumentType["IND_PAN"] = "IND_PAN";
467
540
  DocumentType["SAU_ID_NATIONAL"] = "SAU_ID_NATIONAL";
468
541
  DocumentType["SAU_ID_RESIDENT"] = "SAU_ID_RESIDENT";
542
+ DocumentType["NGA_BVN"] = "NGA_BVN";
469
543
  })(DocumentType || (DocumentType = {}));
470
544
  export var BackgroundCheckType;
471
545
  (function (BackgroundCheckType) {
@@ -500,6 +574,11 @@ export class UqudoPlugin {
500
574
  const response = await UqudoId.faceSession({ value: faceSession });
501
575
  return response;
502
576
  }
577
+ async lookup(lookup) {
578
+ const lookupSession = JSON.stringify(lookup);
579
+ const response = await UqudoId.lookup({ value: lookupSession });
580
+ return response;
581
+ }
503
582
  async isFacialRecognitionSupported(documentType) {
504
583
  const response = await UqudoId.isFacialRecognitionSupported({ value: documentType });
505
584
  return response.value == true;
@@ -508,5 +587,17 @@ export class UqudoPlugin {
508
587
  const response = await UqudoId.isReadingSupported({ value: documentType });
509
588
  return response.value == true;
510
589
  }
590
+ async isLookupSupported(documentType) {
591
+ const response = await UqudoId.isLookupSupported({ value: documentType });
592
+ return response.value == true;
593
+ }
594
+ async isLookupFacialRecognitionSupported(documentType) {
595
+ const response = await UqudoId.isLookupFacialRecognitionSupported({ value: documentType });
596
+ return response.value == true;
597
+ }
598
+ async isEnrollmentSupported(documentType) {
599
+ const response = await UqudoId.isEnrollmentSupported({ value: documentType });
600
+ return response.value == true;
601
+ }
511
602
  }
512
603
  //# sourceMappingURL=index.js.map