scandoc-ai-components 0.0.96 → 0.0.98
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 +31 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11297,9 +11297,7 @@ class ExtractorVideo {
|
|
|
11297
11297
|
this.hasShownTurnMessage = false;
|
|
11298
11298
|
this.showMessage("Validation successful", true);
|
|
11299
11299
|
console.log(this.extractionImages);
|
|
11300
|
-
const [isExtractionOk, extractionData] = await (0,_requests_extraction__WEBPACK_IMPORTED_MODULE_2__["default"])(this.extractionImages["FRONT"], this.extractionImages["BACK"],
|
|
11301
|
-
IgnoreBackImage: false
|
|
11302
|
-
});
|
|
11300
|
+
const [isExtractionOk, extractionData] = await (0,_requests_extraction__WEBPACK_IMPORTED_MODULE_2__["default"])(this.extractionImages["FRONT"], this.extractionImages["BACK"], false);
|
|
11303
11301
|
this.onExtraction(isExtractionOk, extractionData);
|
|
11304
11302
|
return;
|
|
11305
11303
|
}
|
|
@@ -11309,9 +11307,7 @@ class ExtractorVideo {
|
|
|
11309
11307
|
this.showMessage("Validation successful");
|
|
11310
11308
|
this.showMessage("Extracting data");
|
|
11311
11309
|
const image = images[imageId].fullImg;
|
|
11312
|
-
const [isExtractionOk, extractionData] = await (0,_requests_extraction__WEBPACK_IMPORTED_MODULE_2__["default"])(image, undefined,
|
|
11313
|
-
IgnoreBackImage: true
|
|
11314
|
-
});
|
|
11310
|
+
const [isExtractionOk, extractionData] = await (0,_requests_extraction__WEBPACK_IMPORTED_MODULE_2__["default"])(image, undefined, true);
|
|
11315
11311
|
this.onExtraction(isExtractionOk, extractionData);
|
|
11316
11312
|
return;
|
|
11317
11313
|
}
|
|
@@ -11716,13 +11712,13 @@ let internalConfig = {
|
|
|
11716
11712
|
SHOULD_RETURN_DOCUMENT_IMAGE: null,
|
|
11717
11713
|
SHOULD_RETURN_FACE_IF_DETECTED: null,
|
|
11718
11714
|
SHOULD_RETURN_SIGNATURE_IF_DETECTED: null,
|
|
11719
|
-
SKIP_DOCUMENT_SIZE_CHECK:
|
|
11720
|
-
SKIP_IMAGE_SIZE_CHECK:
|
|
11721
|
-
CAN_STORE_IMAGES:
|
|
11722
|
-
ENFORCE_DOCS_SAME_COUNTRY_TYPE_SERIES:
|
|
11723
|
-
CASE_SENSITIVE_OUTPUT:
|
|
11724
|
-
STORE_FACE_IMAGE:
|
|
11725
|
-
DONT_USE_VALIDATION:
|
|
11715
|
+
SKIP_DOCUMENT_SIZE_CHECK: true,
|
|
11716
|
+
SKIP_IMAGE_SIZE_CHECK: true,
|
|
11717
|
+
CAN_STORE_IMAGES: false,
|
|
11718
|
+
ENFORCE_DOCS_SAME_COUNTRY_TYPE_SERIES: false,
|
|
11719
|
+
CASE_SENSITIVE_OUTPUT: false,
|
|
11720
|
+
STORE_FACE_IMAGE: false,
|
|
11721
|
+
DONT_USE_VALIDATION: true,
|
|
11726
11722
|
SEGMENTED_IMAGE_RESIZE: null,
|
|
11727
11723
|
SIGNATURE_IMAGE_RESIZE: null,
|
|
11728
11724
|
FACE_IMAGE_RESIZE: null,
|
|
@@ -11965,6 +11961,11 @@ async function callDocumentExtraction(frontImage, backImage, ignoreBackImage) {
|
|
|
11965
11961
|
FaceImageResize: cfgValues.FACE_IMAGE_RESIZE
|
|
11966
11962
|
};
|
|
11967
11963
|
const currentSettings = (0,_utility_utils__WEBPACK_IMPORTED_MODULE_1__.removeNullFields)(settings);
|
|
11964
|
+
console.log("Starting document extraction...");
|
|
11965
|
+
console.log("Ignore back image:", ignoreBackImage);
|
|
11966
|
+
console.log("Front image (first 100 chars):", frontImage?.substring(0, 100));
|
|
11967
|
+
console.log("Back image (first 100 chars):", backImage?.substring(0, 100));
|
|
11968
|
+
console.log("Sending settings:", currentSettings);
|
|
11968
11969
|
const response = await fetch(`${cfgValues.SCAN_APP_URL}extraction/`, {
|
|
11969
11970
|
method: "POST",
|
|
11970
11971
|
headers: {
|
|
@@ -11988,6 +11989,23 @@ async function callDocumentExtraction(frontImage, backImage, ignoreBackImage) {
|
|
|
11988
11989
|
Browser: browser
|
|
11989
11990
|
})
|
|
11990
11991
|
});
|
|
11992
|
+
const requestBody = {
|
|
11993
|
+
AcceptTermsAndConditions: true,
|
|
11994
|
+
DataFields: {
|
|
11995
|
+
BackImage: ignoreBackImage ? "" : backImage,
|
|
11996
|
+
BackImageCropped: false,
|
|
11997
|
+
BackImageType: "base64",
|
|
11998
|
+
FrontImage: frontImage,
|
|
11999
|
+
FrontImageCropped: false,
|
|
12000
|
+
FrontImageType: "base64"
|
|
12001
|
+
},
|
|
12002
|
+
Settings: currentSettings,
|
|
12003
|
+
OS: os,
|
|
12004
|
+
Device: device,
|
|
12005
|
+
Browser: browser
|
|
12006
|
+
};
|
|
12007
|
+
console.log("Extraction request body:", requestBody);
|
|
12008
|
+
|
|
11991
12009
|
//
|
|
11992
12010
|
if (response.status === 200) {
|
|
11993
12011
|
const data = await response.json();
|