@authme/id-recognition 2.7.4 → 2.8.1-patch.1
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/index.cjs +112 -53
- package/index.js +111 -53
- package/package.json +4 -4
- package/src/lib/data-access/api.d.ts +52 -10
- package/src/lib/model/dto.model.d.ts +1 -0
package/index.cjs
CHANGED
|
@@ -374,15 +374,15 @@ const twoWayAuthmeCardClassMap = (() => {
|
|
|
374
374
|
})();
|
|
375
375
|
|
|
376
376
|
var name = "authme/sdk";
|
|
377
|
-
var version$1 = "2.
|
|
378
|
-
var date = "
|
|
377
|
+
var version$1 = "2.8.1-patch.1";
|
|
378
|
+
var date = "2025-06-12T13:55:46+0000";
|
|
379
379
|
var packageInfo = {
|
|
380
380
|
name: name,
|
|
381
381
|
version: version$1,
|
|
382
382
|
date: date
|
|
383
383
|
};
|
|
384
384
|
|
|
385
|
-
function
|
|
385
|
+
function initScan(type, country, needConfirm, cardTypes) {
|
|
386
386
|
// let useCardTypes: any = getCardSubTypes(type, country).map((c) =>
|
|
387
387
|
// twoWayAuthmeCardClassMap.toServer(c)
|
|
388
388
|
// );
|
|
@@ -394,32 +394,48 @@ function init(type, country, needConfirm, cardTypes, encrypt = true) {
|
|
|
394
394
|
scanType: type === exports.IdRecognitionCardType.Passport ? `ALL_Passport` : `${country}_${type}`,
|
|
395
395
|
cardTypes: useCardTypes,
|
|
396
396
|
needConfirm,
|
|
397
|
-
encrypt,
|
|
397
|
+
encrypt: true,
|
|
398
398
|
clientInfo: {
|
|
399
399
|
os: 'web',
|
|
400
400
|
os_ver: util.osVersion(),
|
|
401
401
|
client_ver: packageInfo.version
|
|
402
402
|
}
|
|
403
403
|
};
|
|
404
|
+
const customParameters = util.Storage.getItem('customParameters');
|
|
405
|
+
if (customParameters) {
|
|
406
|
+
body['customParameters'] = customParameters;
|
|
407
|
+
}
|
|
404
408
|
return core.sendRequest('/api/identity-verification/id-recognition/v3/init-scan', 'POST', {
|
|
405
409
|
body: JSON.stringify(body)
|
|
406
410
|
});
|
|
407
411
|
}
|
|
408
|
-
function initScanDocument(
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
// export function initScanDocument(
|
|
413
|
+
// scanId: string,
|
|
414
|
+
// cardType: string
|
|
415
|
+
// ): Promise<InitScanDocumentParams> {
|
|
416
|
+
function initScanDocument(body) {
|
|
417
|
+
// const body = {
|
|
418
|
+
// scanId,
|
|
419
|
+
// cardType,
|
|
420
|
+
// };
|
|
421
|
+
let encryptApiPath = '';
|
|
422
|
+
if (body.encryptedBase64String) {
|
|
423
|
+
encryptApiPath = `/encrypted`;
|
|
424
|
+
}
|
|
425
|
+
return core.sendRequest(`/api/identity-verification/id-recognition/v3/init-scan-doc${encryptApiPath}`, 'POST', {
|
|
414
426
|
body: JSON.stringify(body)
|
|
415
427
|
});
|
|
416
428
|
}
|
|
417
|
-
function initScanDocumentResourceBase64(
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
429
|
+
// export function initScanDocumentResourceBase64(
|
|
430
|
+
// scanId: string,
|
|
431
|
+
// ResourceId: string
|
|
432
|
+
// ): Promise<InitScanDocumentResourceBase64Params> {
|
|
433
|
+
function initScanDocumentResourceBase64(body) {
|
|
434
|
+
let encryptApiPath = '';
|
|
435
|
+
if (body.encryptedBase64String) {
|
|
436
|
+
encryptApiPath = `/encrypted`;
|
|
437
|
+
}
|
|
438
|
+
return core.sendRequest(`/api/identity-verification/id-recognition/v3/init-scan-doc/resource/base64${encryptApiPath}`, 'POST', {
|
|
423
439
|
body: JSON.stringify(body)
|
|
424
440
|
});
|
|
425
441
|
}
|
|
@@ -441,16 +457,19 @@ function recognition(documentId, file) {
|
|
|
441
457
|
throw error;
|
|
442
458
|
});
|
|
443
459
|
}
|
|
444
|
-
function
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
460
|
+
// export function recognizeBase64(
|
|
461
|
+
// documentId: string,
|
|
462
|
+
// base64Text: string,
|
|
463
|
+
// report: string,
|
|
464
|
+
// fileType: RecognitionFileType
|
|
465
|
+
// ): Promise<{ retry?: boolean; details: { [key: string]: string | null } }> {
|
|
466
|
+
function recognizeBase64(body) {
|
|
467
|
+
let encryptApiPath = '';
|
|
468
|
+
if (body.encryptedBase64String) {
|
|
469
|
+
encryptApiPath = `/encrypted`;
|
|
470
|
+
}
|
|
471
|
+
return core.sendRequest(`/api/identity-verification/id-recognition/v3/recognize-base64${encryptApiPath}`, 'POST', {
|
|
472
|
+
body: JSON.stringify(body),
|
|
454
473
|
contentType: 'application/json'
|
|
455
474
|
}).catch(error => {
|
|
456
475
|
var _a, _b, _c;
|
|
@@ -463,18 +482,27 @@ function recognitionEncrypt(documentId, base64Text, report, fileType) {
|
|
|
463
482
|
throw error;
|
|
464
483
|
});
|
|
465
484
|
}
|
|
466
|
-
function uploadFrameBase64(
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
485
|
+
// export function uploadFrameBase64(
|
|
486
|
+
// documentId: string,
|
|
487
|
+
// base64Text: string,
|
|
488
|
+
// index: number,
|
|
489
|
+
// type: ResourceImageType = ResourceImageType.Recognition,
|
|
490
|
+
// report?: string
|
|
491
|
+
// ): Promise<{ retry?: boolean; details: { [key: string]: string | null } }> {
|
|
492
|
+
function uploadFrameBase64(body) {
|
|
493
|
+
let encryptApiPath = '';
|
|
494
|
+
if (body.encryptedBase64String) {
|
|
495
|
+
encryptApiPath = `/encrypted`;
|
|
496
|
+
}
|
|
497
|
+
return core.sendRequest(`/api/identity-verification/id-recognition/v3/upload-frame-base64${encryptApiPath}`, 'POST', {
|
|
498
|
+
// body: JSON.stringify({
|
|
499
|
+
// scanDocumentId: documentId,
|
|
500
|
+
// image: base64Text,
|
|
501
|
+
// type,
|
|
502
|
+
// // fileType: 'image/jpeg',
|
|
503
|
+
// info: { report, index },
|
|
504
|
+
// }),
|
|
505
|
+
body: JSON.stringify(body),
|
|
478
506
|
contentType: 'application/json'
|
|
479
507
|
}).catch(error => {
|
|
480
508
|
var _a, _b, _c;
|
|
@@ -497,22 +525,39 @@ function saveResourceImage(documentId, type, file) {
|
|
|
497
525
|
contentType: 'multipart/form-data'
|
|
498
526
|
});
|
|
499
527
|
}
|
|
500
|
-
function finishScanDocument(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
528
|
+
// export function finishScanDocument(
|
|
529
|
+
// documentId: string,
|
|
530
|
+
// details: { [key: string]: string | null },
|
|
531
|
+
// fraud: boolean | null
|
|
532
|
+
// ) {
|
|
533
|
+
function finishScanDocument(body) {
|
|
534
|
+
// const body = {
|
|
535
|
+
// scanDocumentId: documentId,
|
|
536
|
+
// details,
|
|
537
|
+
// fraud,
|
|
538
|
+
// };
|
|
539
|
+
let encryptApiPath = '';
|
|
540
|
+
if (body.encryptedBase64String) {
|
|
541
|
+
encryptApiPath = `/encrypted`;
|
|
542
|
+
}
|
|
543
|
+
return core.sendRequest(`/api/identity-verification/id-recognition/v3/finish-scan-doc${encryptApiPath}`, 'POST', {
|
|
507
544
|
body: JSON.stringify(body)
|
|
508
545
|
});
|
|
509
546
|
}
|
|
510
|
-
function confirmScan(
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
547
|
+
// export function confirmScan(
|
|
548
|
+
// scanId: string,
|
|
549
|
+
// details: { [key: string]: string | null }
|
|
550
|
+
// ) {
|
|
551
|
+
function confirmScan(body) {
|
|
552
|
+
// const body = {
|
|
553
|
+
// scanId,
|
|
554
|
+
// details,
|
|
555
|
+
// };
|
|
556
|
+
let encryptApiPath = '';
|
|
557
|
+
if (body.encryptedBase64String) {
|
|
558
|
+
encryptApiPath = `/encrypted`;
|
|
559
|
+
}
|
|
560
|
+
return core.sendRequest(`/api/identity-verification/id-recognition/v3/confirm-scan${encryptApiPath}`, 'POST', {
|
|
516
561
|
body: JSON.stringify(body)
|
|
517
562
|
});
|
|
518
563
|
}
|
|
@@ -528,6 +573,19 @@ function saveExtraDoc(params) {
|
|
|
528
573
|
contentType: 'multipart/form-data'
|
|
529
574
|
});
|
|
530
575
|
}
|
|
576
|
+
function logCollect(message, stackTrace) {
|
|
577
|
+
const body = {
|
|
578
|
+
message: message,
|
|
579
|
+
stack_trace: stackTrace,
|
|
580
|
+
metadata: {
|
|
581
|
+
platform: 'web',
|
|
582
|
+
sdkVersion: packageInfo.version
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
return core.sendRequest('/api/identity-verification/v1/logs/collect', 'POST', {
|
|
586
|
+
body: JSON.stringify(body)
|
|
587
|
+
});
|
|
588
|
+
}
|
|
531
589
|
|
|
532
590
|
var _a;
|
|
533
591
|
var _b, _c;
|
|
@@ -575,12 +633,13 @@ exports.finishScanDocument = finishScanDocument;
|
|
|
575
633
|
exports.getCardSubTypes = getCardSubTypes;
|
|
576
634
|
exports.getCardTypes = getCardTypes;
|
|
577
635
|
exports.getRecognitionColumnOrder = getRecognitionColumnOrder;
|
|
578
|
-
exports.
|
|
636
|
+
exports.initScan = initScan;
|
|
579
637
|
exports.initScanDocument = initScanDocument;
|
|
580
638
|
exports.initScanDocumentResourceBase64 = initScanDocumentResourceBase64;
|
|
639
|
+
exports.logCollect = logCollect;
|
|
581
640
|
exports.mapCardtypeToAuthmeClass = mapCardtypeToAuthmeClass;
|
|
582
641
|
exports.recognition = recognition;
|
|
583
|
-
exports.
|
|
642
|
+
exports.recognizeBase64 = recognizeBase64;
|
|
584
643
|
exports.saveExtraDoc = saveExtraDoc;
|
|
585
644
|
exports.saveResourceImage = saveResourceImage;
|
|
586
645
|
exports.thicknessDefaultConfig = thicknessDefaultConfig;
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import 'core-js/modules/es.array.iterator.js';
|
|
|
5
5
|
import 'core-js/modules/es.object.from-entries.js';
|
|
6
6
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
7
|
import { sendRequest, AuthmeError } from '@authme/core';
|
|
8
|
-
import { osVersion } from '@authme/util';
|
|
8
|
+
import { osVersion, Storage } from '@authme/util';
|
|
9
9
|
import 'core-js/modules/es.symbol.description.js';
|
|
10
10
|
|
|
11
11
|
var ResourceImageType;
|
|
@@ -371,15 +371,15 @@ const twoWayAuthmeCardClassMap = (() => {
|
|
|
371
371
|
})();
|
|
372
372
|
|
|
373
373
|
var name = "authme/sdk";
|
|
374
|
-
var version$1 = "2.
|
|
375
|
-
var date = "
|
|
374
|
+
var version$1 = "2.8.1-patch.1";
|
|
375
|
+
var date = "2025-06-12T13:55:46+0000";
|
|
376
376
|
var packageInfo = {
|
|
377
377
|
name: name,
|
|
378
378
|
version: version$1,
|
|
379
379
|
date: date
|
|
380
380
|
};
|
|
381
381
|
|
|
382
|
-
function
|
|
382
|
+
function initScan(type, country, needConfirm, cardTypes) {
|
|
383
383
|
// let useCardTypes: any = getCardSubTypes(type, country).map((c) =>
|
|
384
384
|
// twoWayAuthmeCardClassMap.toServer(c)
|
|
385
385
|
// );
|
|
@@ -391,32 +391,48 @@ function init(type, country, needConfirm, cardTypes, encrypt = true) {
|
|
|
391
391
|
scanType: type === IdRecognitionCardType.Passport ? `ALL_Passport` : `${country}_${type}`,
|
|
392
392
|
cardTypes: useCardTypes,
|
|
393
393
|
needConfirm,
|
|
394
|
-
encrypt,
|
|
394
|
+
encrypt: true,
|
|
395
395
|
clientInfo: {
|
|
396
396
|
os: 'web',
|
|
397
397
|
os_ver: osVersion(),
|
|
398
398
|
client_ver: packageInfo.version
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
+
const customParameters = Storage.getItem('customParameters');
|
|
402
|
+
if (customParameters) {
|
|
403
|
+
body['customParameters'] = customParameters;
|
|
404
|
+
}
|
|
401
405
|
return sendRequest('/api/identity-verification/id-recognition/v3/init-scan', 'POST', {
|
|
402
406
|
body: JSON.stringify(body)
|
|
403
407
|
});
|
|
404
408
|
}
|
|
405
|
-
function initScanDocument(
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
// export function initScanDocument(
|
|
410
|
+
// scanId: string,
|
|
411
|
+
// cardType: string
|
|
412
|
+
// ): Promise<InitScanDocumentParams> {
|
|
413
|
+
function initScanDocument(body) {
|
|
414
|
+
// const body = {
|
|
415
|
+
// scanId,
|
|
416
|
+
// cardType,
|
|
417
|
+
// };
|
|
418
|
+
let encryptApiPath = '';
|
|
419
|
+
if (body.encryptedBase64String) {
|
|
420
|
+
encryptApiPath = `/encrypted`;
|
|
421
|
+
}
|
|
422
|
+
return sendRequest(`/api/identity-verification/id-recognition/v3/init-scan-doc${encryptApiPath}`, 'POST', {
|
|
411
423
|
body: JSON.stringify(body)
|
|
412
424
|
});
|
|
413
425
|
}
|
|
414
|
-
function initScanDocumentResourceBase64(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
426
|
+
// export function initScanDocumentResourceBase64(
|
|
427
|
+
// scanId: string,
|
|
428
|
+
// ResourceId: string
|
|
429
|
+
// ): Promise<InitScanDocumentResourceBase64Params> {
|
|
430
|
+
function initScanDocumentResourceBase64(body) {
|
|
431
|
+
let encryptApiPath = '';
|
|
432
|
+
if (body.encryptedBase64String) {
|
|
433
|
+
encryptApiPath = `/encrypted`;
|
|
434
|
+
}
|
|
435
|
+
return sendRequest(`/api/identity-verification/id-recognition/v3/init-scan-doc/resource/base64${encryptApiPath}`, 'POST', {
|
|
420
436
|
body: JSON.stringify(body)
|
|
421
437
|
});
|
|
422
438
|
}
|
|
@@ -438,16 +454,19 @@ function recognition(documentId, file) {
|
|
|
438
454
|
throw error;
|
|
439
455
|
});
|
|
440
456
|
}
|
|
441
|
-
function
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
457
|
+
// export function recognizeBase64(
|
|
458
|
+
// documentId: string,
|
|
459
|
+
// base64Text: string,
|
|
460
|
+
// report: string,
|
|
461
|
+
// fileType: RecognitionFileType
|
|
462
|
+
// ): Promise<{ retry?: boolean; details: { [key: string]: string | null } }> {
|
|
463
|
+
function recognizeBase64(body) {
|
|
464
|
+
let encryptApiPath = '';
|
|
465
|
+
if (body.encryptedBase64String) {
|
|
466
|
+
encryptApiPath = `/encrypted`;
|
|
467
|
+
}
|
|
468
|
+
return sendRequest(`/api/identity-verification/id-recognition/v3/recognize-base64${encryptApiPath}`, 'POST', {
|
|
469
|
+
body: JSON.stringify(body),
|
|
451
470
|
contentType: 'application/json'
|
|
452
471
|
}).catch(error => {
|
|
453
472
|
var _a, _b, _c;
|
|
@@ -460,18 +479,27 @@ function recognitionEncrypt(documentId, base64Text, report, fileType) {
|
|
|
460
479
|
throw error;
|
|
461
480
|
});
|
|
462
481
|
}
|
|
463
|
-
function uploadFrameBase64(
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
482
|
+
// export function uploadFrameBase64(
|
|
483
|
+
// documentId: string,
|
|
484
|
+
// base64Text: string,
|
|
485
|
+
// index: number,
|
|
486
|
+
// type: ResourceImageType = ResourceImageType.Recognition,
|
|
487
|
+
// report?: string
|
|
488
|
+
// ): Promise<{ retry?: boolean; details: { [key: string]: string | null } }> {
|
|
489
|
+
function uploadFrameBase64(body) {
|
|
490
|
+
let encryptApiPath = '';
|
|
491
|
+
if (body.encryptedBase64String) {
|
|
492
|
+
encryptApiPath = `/encrypted`;
|
|
493
|
+
}
|
|
494
|
+
return sendRequest(`/api/identity-verification/id-recognition/v3/upload-frame-base64${encryptApiPath}`, 'POST', {
|
|
495
|
+
// body: JSON.stringify({
|
|
496
|
+
// scanDocumentId: documentId,
|
|
497
|
+
// image: base64Text,
|
|
498
|
+
// type,
|
|
499
|
+
// // fileType: 'image/jpeg',
|
|
500
|
+
// info: { report, index },
|
|
501
|
+
// }),
|
|
502
|
+
body: JSON.stringify(body),
|
|
475
503
|
contentType: 'application/json'
|
|
476
504
|
}).catch(error => {
|
|
477
505
|
var _a, _b, _c;
|
|
@@ -494,22 +522,39 @@ function saveResourceImage(documentId, type, file) {
|
|
|
494
522
|
contentType: 'multipart/form-data'
|
|
495
523
|
});
|
|
496
524
|
}
|
|
497
|
-
function finishScanDocument(
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
525
|
+
// export function finishScanDocument(
|
|
526
|
+
// documentId: string,
|
|
527
|
+
// details: { [key: string]: string | null },
|
|
528
|
+
// fraud: boolean | null
|
|
529
|
+
// ) {
|
|
530
|
+
function finishScanDocument(body) {
|
|
531
|
+
// const body = {
|
|
532
|
+
// scanDocumentId: documentId,
|
|
533
|
+
// details,
|
|
534
|
+
// fraud,
|
|
535
|
+
// };
|
|
536
|
+
let encryptApiPath = '';
|
|
537
|
+
if (body.encryptedBase64String) {
|
|
538
|
+
encryptApiPath = `/encrypted`;
|
|
539
|
+
}
|
|
540
|
+
return sendRequest(`/api/identity-verification/id-recognition/v3/finish-scan-doc${encryptApiPath}`, 'POST', {
|
|
504
541
|
body: JSON.stringify(body)
|
|
505
542
|
});
|
|
506
543
|
}
|
|
507
|
-
function confirmScan(
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
544
|
+
// export function confirmScan(
|
|
545
|
+
// scanId: string,
|
|
546
|
+
// details: { [key: string]: string | null }
|
|
547
|
+
// ) {
|
|
548
|
+
function confirmScan(body) {
|
|
549
|
+
// const body = {
|
|
550
|
+
// scanId,
|
|
551
|
+
// details,
|
|
552
|
+
// };
|
|
553
|
+
let encryptApiPath = '';
|
|
554
|
+
if (body.encryptedBase64String) {
|
|
555
|
+
encryptApiPath = `/encrypted`;
|
|
556
|
+
}
|
|
557
|
+
return sendRequest(`/api/identity-verification/id-recognition/v3/confirm-scan${encryptApiPath}`, 'POST', {
|
|
513
558
|
body: JSON.stringify(body)
|
|
514
559
|
});
|
|
515
560
|
}
|
|
@@ -525,6 +570,19 @@ function saveExtraDoc(params) {
|
|
|
525
570
|
contentType: 'multipart/form-data'
|
|
526
571
|
});
|
|
527
572
|
}
|
|
573
|
+
function logCollect(message, stackTrace) {
|
|
574
|
+
const body = {
|
|
575
|
+
message: message,
|
|
576
|
+
stack_trace: stackTrace,
|
|
577
|
+
metadata: {
|
|
578
|
+
platform: 'web',
|
|
579
|
+
sdkVersion: packageInfo.version
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
return sendRequest('/api/identity-verification/v1/logs/collect', 'POST', {
|
|
583
|
+
body: JSON.stringify(body)
|
|
584
|
+
});
|
|
585
|
+
}
|
|
528
586
|
|
|
529
587
|
var _a;
|
|
530
588
|
var _b, _c;
|
|
@@ -532,4 +590,4 @@ const version = packageInfo.version;
|
|
|
532
590
|
(_a = (_b = window)[_c = Symbol.for('authme-sdk')]) !== null && _a !== void 0 ? _a : _b[_c] = {};
|
|
533
591
|
window[Symbol.for('authme-sdk')][packageInfo.name] = version;
|
|
534
592
|
|
|
535
|
-
export { CardOCR, CountryCode, IdCardAntiFraudService, IdRecognitionCardName, IdRecognitionCardType, IdType, IdTypeConfig, MRZService, RecognitionFileType, ResourceImageType, ServerSideEAuthMeCardClass, cardTypeConfirmTitle, cardTypeHeader, cardTypeTitle, confirmScan, finishScanDocument, getCardSubTypes, getCardTypes, getRecognitionColumnOrder,
|
|
593
|
+
export { CardOCR, CountryCode, IdCardAntiFraudService, IdRecognitionCardName, IdRecognitionCardType, IdType, IdTypeConfig, MRZService, RecognitionFileType, ResourceImageType, ServerSideEAuthMeCardClass, cardTypeConfirmTitle, cardTypeHeader, cardTypeTitle, confirmScan, finishScanDocument, getCardSubTypes, getCardTypes, getRecognitionColumnOrder, initScan, initScanDocument, initScanDocumentResourceBase64, logCollect, mapCardtypeToAuthmeClass, recognition, recognizeBase64, saveExtraDoc, saveResourceImage, thicknessDefaultConfig, twoWayAuthmeCardClassMap, uploadFrameBase64, version };
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authme/id-recognition",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.1-patch.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"core-js": "^3.6.0",
|
|
6
|
-
"@authme/core": "2.
|
|
7
|
-
"@authme/util": "2.
|
|
8
|
-
"@authme/engine": "2.
|
|
6
|
+
"@authme/core": "2.8.1-patch.1",
|
|
7
|
+
"@authme/util": "2.8.1-patch.1",
|
|
8
|
+
"@authme/engine": "2.8.1-patch.1"
|
|
9
9
|
},
|
|
10
10
|
"module": "./index.js",
|
|
11
11
|
"main": "./index.cjs",
|
|
@@ -11,33 +11,74 @@ interface InitScanDocumentResourceBase64Params {
|
|
|
11
11
|
fileId: string;
|
|
12
12
|
data: string;
|
|
13
13
|
}
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function initScanDocument(
|
|
16
|
-
|
|
14
|
+
export declare function initScan(type: IdRecognitionCardType, country: CountryCode, needConfirm: boolean, cardTypes: string[]): Promise<InitScanResponse>;
|
|
15
|
+
export declare function initScanDocument(body: {
|
|
16
|
+
scanId?: string;
|
|
17
|
+
cardType?: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
encryptedBase64String?: string;
|
|
20
|
+
}): Promise<InitScanDocumentParams>;
|
|
21
|
+
export declare function initScanDocumentResourceBase64(body: {
|
|
22
|
+
scanId?: string;
|
|
23
|
+
ResourceId?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
encryptedBase64String?: string;
|
|
26
|
+
}): Promise<InitScanDocumentResourceBase64Params>;
|
|
17
27
|
export declare function recognition(documentId: string, file: Blob): Promise<{
|
|
18
28
|
retry?: boolean;
|
|
19
29
|
details: {
|
|
20
30
|
[key: string]: string | null;
|
|
21
31
|
};
|
|
22
32
|
}>;
|
|
23
|
-
export declare function
|
|
33
|
+
export declare function recognizeBase64(body: {
|
|
34
|
+
scanDocumentId?: string;
|
|
35
|
+
image?: string;
|
|
36
|
+
fileType?: RecognitionFileType;
|
|
37
|
+
info?: {
|
|
38
|
+
report: string;
|
|
39
|
+
};
|
|
40
|
+
id?: string;
|
|
41
|
+
encryptedBase64String?: string;
|
|
42
|
+
}): Promise<{
|
|
24
43
|
retry?: boolean;
|
|
25
44
|
details: {
|
|
26
45
|
[key: string]: string | null;
|
|
27
46
|
};
|
|
47
|
+
detectCardResult: boolean;
|
|
28
48
|
}>;
|
|
29
|
-
export declare function uploadFrameBase64(
|
|
49
|
+
export declare function uploadFrameBase64(body: {
|
|
50
|
+
scanDocumentId?: string;
|
|
51
|
+
image?: string;
|
|
52
|
+
type?: ResourceImageType;
|
|
53
|
+
info?: {
|
|
54
|
+
report?: string;
|
|
55
|
+
index: number;
|
|
56
|
+
};
|
|
57
|
+
id?: string;
|
|
58
|
+
encryptedBase64String?: string;
|
|
59
|
+
}): Promise<{
|
|
30
60
|
retry?: boolean;
|
|
31
61
|
details: {
|
|
32
62
|
[key: string]: string | null;
|
|
33
63
|
};
|
|
34
64
|
}>;
|
|
35
65
|
export declare function saveResourceImage(documentId: string, type: ResourceImageType, file: Blob): Promise<any>;
|
|
36
|
-
export declare function finishScanDocument(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
66
|
+
export declare function finishScanDocument(body: {
|
|
67
|
+
scanDocumentId?: string;
|
|
68
|
+
details?: {
|
|
69
|
+
[key: string]: string | null;
|
|
70
|
+
};
|
|
71
|
+
fraud?: boolean | null;
|
|
72
|
+
id?: string;
|
|
73
|
+
encryptedBase64String?: string;
|
|
74
|
+
}): Promise<any>;
|
|
75
|
+
export declare function confirmScan(body: {
|
|
76
|
+
scanId?: string;
|
|
77
|
+
details?: {
|
|
78
|
+
[key: string]: string | null;
|
|
79
|
+
};
|
|
80
|
+
id?: string;
|
|
81
|
+
encryptedBase64String?: string;
|
|
41
82
|
}): Promise<any>;
|
|
42
83
|
export declare function saveExtraDoc(params: {
|
|
43
84
|
file: Blob;
|
|
@@ -45,4 +86,5 @@ export declare function saveExtraDoc(params: {
|
|
|
45
86
|
[key: string]: string | null;
|
|
46
87
|
};
|
|
47
88
|
}): Promise<any>;
|
|
89
|
+
export declare function logCollect(message: string, stackTrace: string): Promise<any>;
|
|
48
90
|
export {};
|