vishwam-react-ent-sdk 1.0.3 → 1.0.5
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 +6 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +6 -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);
|
|
@@ -983,9 +984,11 @@ function ReadDocument(_ref) {
|
|
|
983
984
|
return Promise.resolve(function () {
|
|
984
985
|
if (videoElement != null) {
|
|
985
986
|
var _temp4 = function _temp4() {
|
|
987
|
+
console.log('Returing captured image: ' + _imageStr);
|
|
986
988
|
stopCamera();
|
|
987
989
|
return _imageStr;
|
|
988
990
|
};
|
|
991
|
+
console.log('Initiating capture');
|
|
989
992
|
window.removeEventListener('deviceorientation', handleOrientation, true);
|
|
990
993
|
var videoHeight = videoElement.offsetWidth * aspectRatios[docType];
|
|
991
994
|
var hiddenCanvas = document.getElementById('hidden-canvas');
|
|
@@ -1003,6 +1006,7 @@ function ReadDocument(_ref) {
|
|
|
1003
1006
|
ctx.translate(ctx.canvas.width, 0);
|
|
1004
1007
|
ctx.scale(-1, 1);
|
|
1005
1008
|
}
|
|
1009
|
+
console.log('Capturing the document with aspect ratio');
|
|
1006
1010
|
if (docType === 'pwd' || docType === 'others') {
|
|
1007
1011
|
destWidth = destWidth * 0.5;
|
|
1008
1012
|
destHeight = destWidth * aspectRatios[docType];
|
|
@@ -1099,6 +1103,7 @@ function ReadDocument(_ref) {
|
|
|
1099
1103
|
var capture = React.useCallback(function () {
|
|
1100
1104
|
try {
|
|
1101
1105
|
var _temp2 = function _temp2(imgStr) {
|
|
1106
|
+
console.log('Image capture succeeded');
|
|
1102
1107
|
var img = imgStr.split(',')[1];
|
|
1103
1108
|
var mimeString = imgStr.split(',')[0].split(':')[1].split(';')[0];
|
|
1104
1109
|
return Promise.resolve(resizeImage(imgStr, 224, 224)).then(function (img2Str) {
|
|
@@ -1111,6 +1116,7 @@ function ReadDocument(_ref) {
|
|
|
1111
1116
|
});
|
|
1112
1117
|
});
|
|
1113
1118
|
};
|
|
1119
|
+
console.log('Capture clicked');
|
|
1114
1120
|
setLoading(true);
|
|
1115
1121
|
return Promise.resolve(reactDeviceDetect.isMobile ? Promise.resolve(captureSnapshot()).then(_temp2) : _temp2(webcamRef.current.getScreenshot()));
|
|
1116
1122
|
} catch (e) {
|