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.modern.js
CHANGED
|
@@ -900,6 +900,7 @@ function SvgCam(props) {
|
|
|
900
900
|
var _templateObject$1, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6;
|
|
901
901
|
var readDocumentCall = function readDocumentCall(url, appId, referenceId, userId, decision, isBack, expiryIn, docType, documentType, img, img2, type) {
|
|
902
902
|
try {
|
|
903
|
+
console.log('Initiating API calls');
|
|
903
904
|
var formData = new FormData();
|
|
904
905
|
formData.append('app_id', appId);
|
|
905
906
|
formData.append('referenceId', referenceId);
|
|
@@ -925,6 +926,7 @@ var aspectRatios = {
|
|
|
925
926
|
pan: 0.625,
|
|
926
927
|
passport: 0.67,
|
|
927
928
|
voter: 1.2,
|
|
929
|
+
dl: 0.625,
|
|
928
930
|
pwd: 1.414,
|
|
929
931
|
others: 1.414
|
|
930
932
|
};
|
|
@@ -979,9 +981,11 @@ function ReadDocument(_ref) {
|
|
|
979
981
|
return Promise.resolve(function () {
|
|
980
982
|
if (videoElement != null) {
|
|
981
983
|
var _temp4 = function _temp4() {
|
|
984
|
+
console.log('Returing captured image: ' + _imageStr);
|
|
982
985
|
stopCamera();
|
|
983
986
|
return _imageStr;
|
|
984
987
|
};
|
|
988
|
+
console.log('Initiating capture');
|
|
985
989
|
window.removeEventListener('deviceorientation', handleOrientation, true);
|
|
986
990
|
var videoHeight = videoElement.offsetWidth * aspectRatios[docType];
|
|
987
991
|
var hiddenCanvas = document.getElementById('hidden-canvas');
|
|
@@ -999,6 +1003,7 @@ function ReadDocument(_ref) {
|
|
|
999
1003
|
ctx.translate(ctx.canvas.width, 0);
|
|
1000
1004
|
ctx.scale(-1, 1);
|
|
1001
1005
|
}
|
|
1006
|
+
console.log('Capturing the document with aspect ratio');
|
|
1002
1007
|
if (docType === 'pwd' || docType === 'others') {
|
|
1003
1008
|
destWidth = destWidth * 0.5;
|
|
1004
1009
|
destHeight = destWidth * aspectRatios[docType];
|
|
@@ -1095,6 +1100,7 @@ function ReadDocument(_ref) {
|
|
|
1095
1100
|
var capture = useCallback(function () {
|
|
1096
1101
|
try {
|
|
1097
1102
|
var _temp2 = function _temp2(imgStr) {
|
|
1103
|
+
console.log('Image capture succeeded');
|
|
1098
1104
|
var img = imgStr.split(',')[1];
|
|
1099
1105
|
var mimeString = imgStr.split(',')[0].split(':')[1].split(';')[0];
|
|
1100
1106
|
return Promise.resolve(resizeImage(imgStr, 224, 224)).then(function (img2Str) {
|
|
@@ -1439,6 +1445,8 @@ function getDocType(docType) {
|
|
|
1439
1445
|
return '3';
|
|
1440
1446
|
case 'pwd':
|
|
1441
1447
|
return 'pwd';
|
|
1448
|
+
case 'dl':
|
|
1449
|
+
return '5';
|
|
1442
1450
|
case 'others':
|
|
1443
1451
|
return 'others';
|
|
1444
1452
|
default:
|