vishwam-react-ent-sdk 1.0.2 → 1.0.4
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/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +8 -0
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -903,6 +903,7 @@ function SvgCam(props) {
|
|
|
903
903
|
var _templateObject$1, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6;
|
|
904
904
|
var readDocumentCall = function readDocumentCall(url, appId, referenceId, userId, decision, isBack, expiryIn, docType, documentType, img, img2, type) {
|
|
905
905
|
try {
|
|
906
|
+
console.log('Initiating API calls');
|
|
906
907
|
var formData = new FormData();
|
|
907
908
|
formData.append('app_id', appId);
|
|
908
909
|
formData.append('referenceId', referenceId);
|
|
@@ -928,6 +929,7 @@ var aspectRatios = {
|
|
|
928
929
|
pan: 0.625,
|
|
929
930
|
passport: 0.67,
|
|
930
931
|
voter: 1.2,
|
|
932
|
+
dl: 0.625,
|
|
931
933
|
pwd: 1.414,
|
|
932
934
|
others: 1.414
|
|
933
935
|
};
|
|
@@ -982,9 +984,11 @@ function ReadDocument(_ref) {
|
|
|
982
984
|
return Promise.resolve(function () {
|
|
983
985
|
if (videoElement != null) {
|
|
984
986
|
var _temp4 = function _temp4() {
|
|
987
|
+
console.log('Returing captured image: ' + _imageStr);
|
|
985
988
|
stopCamera();
|
|
986
989
|
return _imageStr;
|
|
987
990
|
};
|
|
991
|
+
console.log('Initiating capture');
|
|
988
992
|
window.removeEventListener('deviceorientation', handleOrientation, true);
|
|
989
993
|
var videoHeight = videoElement.offsetWidth * aspectRatios[docType];
|
|
990
994
|
var hiddenCanvas = document.getElementById('hidden-canvas');
|
|
@@ -1002,6 +1006,7 @@ function ReadDocument(_ref) {
|
|
|
1002
1006
|
ctx.translate(ctx.canvas.width, 0);
|
|
1003
1007
|
ctx.scale(-1, 1);
|
|
1004
1008
|
}
|
|
1009
|
+
console.log('Capturing the document with aspect ratio');
|
|
1005
1010
|
if (docType === 'pwd' || docType === 'others') {
|
|
1006
1011
|
destWidth = destWidth * 0.5;
|
|
1007
1012
|
destHeight = destWidth * aspectRatios[docType];
|
|
@@ -1098,6 +1103,7 @@ function ReadDocument(_ref) {
|
|
|
1098
1103
|
var capture = React.useCallback(function () {
|
|
1099
1104
|
try {
|
|
1100
1105
|
var _temp2 = function _temp2(imgStr) {
|
|
1106
|
+
console.log('Image capture succeeded');
|
|
1101
1107
|
var img = imgStr.split(',')[1];
|
|
1102
1108
|
var mimeString = imgStr.split(',')[0].split(':')[1].split(';')[0];
|
|
1103
1109
|
return Promise.resolve(resizeImage(imgStr, 224, 224)).then(function (img2Str) {
|
|
@@ -1442,6 +1448,8 @@ function getDocType(docType) {
|
|
|
1442
1448
|
return '3';
|
|
1443
1449
|
case 'pwd':
|
|
1444
1450
|
return 'pwd';
|
|
1451
|
+
case 'dl':
|
|
1452
|
+
return '5';
|
|
1445
1453
|
case 'others':
|
|
1446
1454
|
return 'others';
|
|
1447
1455
|
default:
|