scandoc-ai-components 0.0.46 → 0.0.47

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.
Files changed (3) hide show
  1. package/README.md +26 -10
  2. package/dist/index.js +1 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -50,11 +50,19 @@ An example HTML page integration:
50
50
  SHOULD_RETURN_FACE_IF_DETECTED: true,
51
51
  SHOULD_RETURN_SIGNATURE_IF_DETECTED: true,
52
52
  SKIP_DOCUMENT_SIZE_CHECK: true,
53
+ MAX_SCAN_DURATION_MS: 15000,
54
+ MAX_UNSUPPORTED_ATTEMPTS: 5,
53
55
  });
54
56
 
55
- const extractionVideo = getExtractionVideo(function (data) {
56
- console.log("Extraction result:", data);
57
- // extractionVideo.stopVideo();
57
+ const extractionVideo = getExtractionVideo(function (result) {
58
+ console.log("Extraction Result:", result);
59
+ if (result.success) {
60
+ extractionVideo.reset();
61
+ extractionVideo.startVideo();
62
+ } else {
63
+ extractionVideo.reset();
64
+ extractionVideo.startVideo();
65
+ }
58
66
  });
59
67
 
60
68
  const html = extractionVideo.getHTML();
@@ -77,15 +85,23 @@ import "scandoc-ai-components/dist/index"
77
85
  const key = ""; // Use the key provided by our team
78
86
  window.createScanDocAIConfig(key, "test");
79
87
  window.setScanDocAIConfig({
80
- SHOULD_RETURN_DOCUMENT_IMAGE: true,
81
- SHOULD_RETURN_FACE_IF_DETECTED: true,
82
- SHOULD_RETURN_SIGNATURE_IF_DETECTED: true,
83
- SKIP_DOCUMENT_SIZE_CHECK: true,
88
+ SHOULD_RETURN_DOCUMENT_IMAGE: true,
89
+ SHOULD_RETURN_FACE_IF_DETECTED: true,
90
+ SHOULD_RETURN_SIGNATURE_IF_DETECTED: true,
91
+ SKIP_DOCUMENT_SIZE_CHECK: true,
92
+ MAX_SCAN_DURATION_MS: 15000,
93
+ MAX_UNSUPPORTED_ATTEMPTS: 4,
84
94
  });
85
95
 
86
- const extractionVideo = window.getExtractionVideo(data=>console.log(data));const extractionVideo = window.getExtractionVideo(data => {
87
- console.log("Extracted:", data);
88
- // extractionVideo.stopVideo(); // Stop automatically after first result
96
+ const extractionVideo = window.getExtractionVideo(result => {
97
+ console.log("Extraction Result:", result);
98
+ if (result.success) {
99
+ extractionVideo.reset();
100
+ extractionVideo.startVideo();
101
+ } else {
102
+ extractionVideo.reset();
103
+ extractionVideo.startVideo();
104
+ }
89
105
  });
90
106
 
91
107
  function App() {
package/dist/index.js CHANGED
@@ -11277,6 +11277,7 @@ class ExtractorVideo {
11277
11277
  };
11278
11278
  //
11279
11279
  if (Object.keys(extractionImages).length === 1) {
11280
+ this.scanStartTime = Date.now();
11280
11281
  this.showMessage("Turn to the other side");
11281
11282
  }
11282
11283
  if (Object.keys(extractionImages).length === 2) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "scandoc-ai-components",
3
3
  "author": "ScanDoc-AI",
4
- "version": "0.0.46",
4
+ "version": "0.0.47",
5
5
  "private": false,
6
6
  "description": "Pure JavaScript package for integrating ScanDoc-AI services.",
7
7
  "keywords": [