mindee 5.8.0 → 5.9.0
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/CHANGELOG.md +6 -0
- package/package.json +104 -95
- package/src/geometry/bbox.js +1 -1
- package/src/image/extractedImages.d.ts +1 -1
- package/src/image/imageExtractor.d.ts +1 -1
- package/src/image/imageExtractor.js +2 -2
- package/src/input/localInputSource.d.ts +1 -1
- package/src/parsing/baseLocalResponse.d.ts +1 -1
- package/src/pdf/extractedPdfs.d.ts +1 -1
- package/src/pdf/pdfExtractor.d.ts +1 -1
- package/src/pdf/pdfExtractor.js +2 -2
- package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.d.ts +2 -2
- package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.js +2 -2
- package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.d.ts +2 -2
- package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.js +1 -1
- package/src/v1/http/baseEndpoint.d.ts +1 -1
- package/src/v1/http/endpoint.d.ts +1 -1
- package/src/v1/http/endpoint.js +1 -1
- package/src/v1/http/httpParams.d.ts +1 -1
- package/src/v1/http/workflowEndpoint.d.ts +2 -2
- package/src/v1/http/workflowEndpoint.js +1 -1
- package/src/v1/parsing/common/execution.d.ts +1 -1
- package/src/v1/parsing/common/execution.js +1 -1
- package/src/v1/parsing/common/extras/cropperExtra.d.ts +1 -1
- package/src/v1/parsing/common/extras/cropperExtra.js +1 -1
- package/src/v1/parsing/common/ocrPage.d.ts +1 -1
- package/src/v1/parsing/common/ocrPage.js +1 -1
- package/src/v1/parsing/common/orientation.d.ts +1 -1
- package/src/v1/parsing/common/orientation.js +1 -1
- package/src/v1/parsing/generated/generatedList.d.ts +1 -1
- package/src/v1/parsing/generated/generatedList.js +1 -1
- package/src/v1/parsing/generated/generatedObject.d.ts +1 -1
- package/src/v1/parsing/generated/generatedObject.js +1 -1
- package/src/v1/parsing/localResponse.d.ts +1 -1
- package/src/v1/parsing/localResponse.js +1 -1
- package/src/v1/parsing/standard/amount.js +1 -1
- package/src/v1/parsing/standard/companyRegistration.js +1 -1
- package/src/v1/parsing/standard/tax.d.ts +1 -1
- package/src/v1/parsing/standard/tax.js +1 -1
- package/src/v1/product/barcodeReader/barcodeReaderV1.d.ts +1 -1
- package/src/v1/product/barcodeReader/barcodeReaderV1.js +1 -1
- package/src/v1/product/barcodeReader/barcodeReaderV1Document.d.ts +2 -2
- package/src/v1/product/barcodeReader/barcodeReaderV1Document.js +2 -2
- package/src/v1/product/cliProducts.d.ts +2 -2
- package/src/v1/product/cliProducts.js +1 -1
- package/src/v1/product/cropper/cropperV1.d.ts +1 -1
- package/src/v1/product/cropper/cropperV1.js +1 -1
- package/src/v1/product/cropper/cropperV1Document.d.ts +1 -1
- package/src/v1/product/cropper/cropperV1Page.d.ts +2 -2
- package/src/v1/product/cropper/cropperV1Page.js +2 -2
- package/src/v1/product/driverLicense/driverLicenseV1.d.ts +1 -1
- package/src/v1/product/driverLicense/driverLicenseV1.js +1 -1
- package/src/v1/product/driverLicense/driverLicenseV1Document.d.ts +2 -2
- package/src/v1/product/driverLicense/driverLicenseV1Document.js +2 -2
- package/src/v1/product/financialDocument/financialDocumentV1.d.ts +1 -1
- package/src/v1/product/financialDocument/financialDocumentV1.js +1 -1
- package/src/v1/product/financialDocument/financialDocumentV1Document.d.ts +2 -2
- package/src/v1/product/financialDocument/financialDocumentV1Document.js +2 -2
- package/src/v1/product/financialDocument/financialDocumentV1LineItem.js +1 -1
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +1 -1
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.js +1 -1
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +2 -2
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +2 -2
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +1 -1
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.js +1 -1
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +2 -2
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +2 -2
- package/src/v1/product/fr/carteGrise/carteGriseV1.d.ts +1 -1
- package/src/v1/product/fr/carteGrise/carteGriseV1.js +1 -1
- package/src/v1/product/fr/carteGrise/carteGriseV1Document.d.ts +2 -2
- package/src/v1/product/fr/carteGrise/carteGriseV1Document.js +2 -2
- package/src/v1/product/fr/idCard/idCardV2.d.ts +1 -1
- package/src/v1/product/fr/idCard/idCardV2.js +1 -1
- package/src/v1/product/fr/idCard/idCardV2Document.d.ts +2 -2
- package/src/v1/product/fr/idCard/idCardV2Document.js +2 -2
- package/src/v1/product/fr/idCard/idCardV2Page.d.ts +2 -2
- package/src/v1/product/fr/idCard/idCardV2Page.js +2 -2
- package/src/v1/product/generated/generatedV1.d.ts +1 -1
- package/src/v1/product/generated/generatedV1.js +1 -1
- package/src/v1/product/generated/generatedV1Document.js +2 -2
- package/src/v1/product/generated/generatedV1Page.js +2 -2
- package/src/v1/product/generated/generatedV1Prediction.d.ts +3 -3
- package/src/v1/product/generated/generatedV1Prediction.js +3 -3
- package/src/v1/product/internationalId/internationalIdV2.d.ts +1 -1
- package/src/v1/product/internationalId/internationalIdV2.js +1 -1
- package/src/v1/product/internationalId/internationalIdV2Document.d.ts +2 -2
- package/src/v1/product/internationalId/internationalIdV2Document.js +2 -2
- package/src/v1/product/invoice/invoiceV4.d.ts +1 -1
- package/src/v1/product/invoice/invoiceV4.js +1 -1
- package/src/v1/product/invoice/invoiceV4Document.d.ts +2 -2
- package/src/v1/product/invoice/invoiceV4Document.js +2 -2
- package/src/v1/product/invoice/invoiceV4LineItem.js +1 -1
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1.d.ts +1 -1
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1.js +1 -1
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +1 -1
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.js +1 -1
- package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.d.ts +1 -1
- package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +1 -1
- package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +2 -2
- package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +2 -2
- package/src/v1/product/passport/passportV1.d.ts +1 -1
- package/src/v1/product/passport/passportV1.js +1 -1
- package/src/v1/product/passport/passportV1Document.d.ts +2 -2
- package/src/v1/product/passport/passportV1Document.js +2 -2
- package/src/v1/product/receipt/receiptV5.d.ts +1 -1
- package/src/v1/product/receipt/receiptV5.js +1 -1
- package/src/v1/product/receipt/receiptV5Document.d.ts +2 -2
- package/src/v1/product/receipt/receiptV5Document.js +2 -2
- package/src/v1/product/receipt/receiptV5LineItem.js +1 -1
- package/src/v1/product/resume/resumeV1.d.ts +1 -1
- package/src/v1/product/resume/resumeV1.js +1 -1
- package/src/v1/product/resume/resumeV1Certificate.js +1 -1
- package/src/v1/product/resume/resumeV1Document.d.ts +2 -2
- package/src/v1/product/resume/resumeV1Document.js +2 -2
- package/src/v1/product/resume/resumeV1Education.js +1 -1
- package/src/v1/product/resume/resumeV1Language.js +1 -1
- package/src/v1/product/resume/resumeV1ProfessionalExperience.js +1 -1
- package/src/v1/product/resume/resumeV1SocialNetworksUrl.js +1 -1
- package/src/v1/product/us/bankCheck/bankCheckV1.d.ts +1 -1
- package/src/v1/product/us/bankCheck/bankCheckV1.js +1 -1
- package/src/v1/product/us/bankCheck/bankCheckV1Document.d.ts +2 -2
- package/src/v1/product/us/bankCheck/bankCheckV1Document.js +2 -2
- package/src/v1/product/us/bankCheck/bankCheckV1Page.d.ts +2 -2
- package/src/v1/product/us/bankCheck/bankCheckV1Page.js +2 -2
- package/src/v2/cli.js +1 -1
- package/src/v2/client.d.ts +94 -18
- package/src/v2/client.js +171 -27
- package/src/v2/clientOptions/baseAnnotationParameters.d.ts +23 -0
- package/src/v2/clientOptions/baseAnnotationParameters.js +17 -0
- package/src/v2/clientOptions/baseProductParameters.js +3 -2
- package/src/v2/clientOptions/baseRagDocumentUploadParameters.d.ts +23 -0
- package/src/v2/clientOptions/baseRagDocumentUploadParameters.js +24 -0
- package/src/v2/clientOptions/index.d.ts +2 -0
- package/src/v2/clientOptions/index.js +2 -0
- package/src/v2/fileOperations/crop.d.ts +1 -1
- package/src/v2/http/errors.d.ts +1 -1
- package/src/v2/http/mindeeApiV2.d.ts +35 -6
- package/src/v2/http/mindeeApiV2.js +79 -3
- package/src/v2/parsing/baseRagAnnotationResponse.d.ts +28 -0
- package/src/v2/parsing/baseRagAnnotationResponse.js +14 -0
- package/src/v2/parsing/baseResponse.d.ts +6 -2
- package/src/v2/parsing/baseResponse.js +3 -1
- package/src/v2/parsing/error/errorResponse.d.ts +1 -1
- package/src/v2/parsing/error/errorResponse.js +1 -1
- package/src/v2/parsing/index.d.ts +2 -0
- package/src/v2/parsing/index.js +1 -0
- package/src/v2/parsing/inference/failedInferenceResponse.d.ts +2 -2
- package/src/v2/parsing/inference/failedInferenceResponse.js +2 -2
- package/src/v2/parsing/inference/field/inferenceFields.d.ts +9 -3
- package/src/v2/parsing/inference/field/inferenceFields.js +9 -3
- package/src/v2/parsing/inference/field/objectField.d.ts +13 -9
- package/src/v2/parsing/inference/field/objectField.js +19 -33
- package/src/v2/parsing/job/job.d.ts +8 -8
- package/src/v2/parsing/job/job.js +1 -1
- package/src/v2/parsing/job/jobResponse.d.ts +1 -1
- package/src/v2/parsing/job/jobResponse.js +1 -1
- package/src/v2/parsing/job/jobWebhook.d.ts +1 -1
- package/src/v2/parsing/job/jobWebhook.js +1 -1
- package/src/v2/parsing/search/baseSearchResponse.d.ts +1 -1
- package/src/v2/parsing/search/baseSearchResponse.js +1 -1
- package/src/v2/parsing/search/searchModels.d.ts +1 -1
- package/src/v2/parsing/search/searchModels.js +1 -1
- package/src/v2/parsing/search/searchRagDocuments.d.ts +1 -1
- package/src/v2/parsing/search/searchRagDocuments.js +1 -1
- package/src/v2/parsing/search/searchResponse.d.ts +1 -1
- package/src/v2/parsing/search/searchResponse.js +1 -1
- package/src/v2/product/baseProduct.d.ts +26 -6
- package/src/v2/product/baseProduct.js +31 -7
- package/src/v2/product/classification/classification.d.ts +1 -1
- package/src/v2/product/classification/classification.js +1 -1
- package/src/v2/product/classification/classificationClassifier.d.ts +1 -1
- package/src/v2/product/classification/classificationClassifier.js +1 -1
- package/src/v2/product/classification/classificationInference.d.ts +1 -1
- package/src/v2/product/classification/classificationInference.js +1 -1
- package/src/v2/product/classification/classificationResponse.d.ts +1 -1
- package/src/v2/product/classification/classificationResponse.js +1 -1
- package/src/v2/product/classification/params/classificationParameters.d.ts +1 -1
- package/src/v2/product/classification/params/classificationParameters.js +1 -1
- package/src/v2/product/crop/crop.d.ts +1 -1
- package/src/v2/product/crop/crop.js +1 -1
- package/src/v2/product/crop/cropInference.d.ts +2 -2
- package/src/v2/product/crop/cropInference.js +2 -2
- package/src/v2/product/crop/cropItem.d.ts +2 -2
- package/src/v2/product/crop/cropItem.js +3 -3
- package/src/v2/product/crop/cropResponse.d.ts +1 -1
- package/src/v2/product/crop/cropResponse.js +1 -1
- package/src/v2/product/crop/cropResult.d.ts +1 -1
- package/src/v2/product/crop/cropResult.js +2 -2
- package/src/v2/product/crop/params/cropParameters.d.ts +1 -1
- package/src/v2/product/crop/params/cropParameters.js +1 -1
- package/src/v2/product/extraction/extraction.d.ts +10 -2
- package/src/v2/product/extraction/extraction.js +17 -3
- package/src/v2/product/extraction/extractionInference.d.ts +1 -1
- package/src/v2/product/extraction/extractionInference.js +1 -1
- package/src/v2/product/extraction/extractionResponse.d.ts +1 -1
- package/src/v2/product/extraction/extractionResponse.js +1 -1
- package/src/v2/product/extraction/extractionResult.d.ts +3 -3
- package/src/v2/product/extraction/extractionResult.js +3 -3
- package/src/v2/product/extraction/index.d.ts +1 -0
- package/src/v2/product/extraction/index.js +1 -0
- package/src/v2/product/extraction/params/extractionParameters.d.ts +1 -1
- package/src/v2/product/extraction/params/extractionParameters.js +1 -1
- package/src/v2/product/extraction/ragDocuments/annotatedBaseField.d.ts +20 -0
- package/src/v2/product/extraction/ragDocuments/annotatedBaseField.js +15 -0
- package/src/v2/product/extraction/ragDocuments/annotatedFields.d.ts +27 -0
- package/src/v2/product/extraction/ragDocuments/annotatedFields.js +57 -0
- package/src/v2/product/extraction/ragDocuments/annotatedListField.d.ts +24 -0
- package/src/v2/product/extraction/ragDocuments/annotatedListField.js +67 -0
- package/src/v2/product/extraction/ragDocuments/annotatedObjectField.d.ts +43 -0
- package/src/v2/product/extraction/ragDocuments/annotatedObjectField.js +47 -0
- package/src/v2/product/extraction/ragDocuments/annotatedSimpleField.d.ts +15 -0
- package/src/v2/product/extraction/ragDocuments/annotatedSimpleField.js +13 -0
- package/src/v2/product/extraction/ragDocuments/extractionRagAnnotationResponse.d.ts +25 -0
- package/src/v2/product/extraction/ragDocuments/extractionRagAnnotationResponse.js +17 -0
- package/src/v2/product/extraction/ragDocuments/fieldFactory.d.ts +12 -0
- package/src/v2/product/extraction/ragDocuments/fieldFactory.js +23 -0
- package/src/v2/product/extraction/ragDocuments/index.d.ts +7 -0
- package/src/v2/product/extraction/ragDocuments/index.js +7 -0
- package/src/v2/product/extraction/ragDocuments/params/index.d.ts +2 -0
- package/src/v2/product/extraction/ragDocuments/params/index.js +2 -0
- package/src/v2/product/extraction/ragDocuments/params/ragDocumentAnnotationParameters.d.ts +27 -0
- package/src/v2/product/extraction/ragDocuments/params/ragDocumentAnnotationParameters.js +43 -0
- package/src/v2/product/extraction/ragDocuments/params/ragDocumentUploadParameters.d.ts +7 -0
- package/src/v2/product/extraction/ragDocuments/params/ragDocumentUploadParameters.js +9 -0
- package/src/v2/product/extraction/ragDocuments/ragAnnotation.d.ts +12 -0
- package/src/v2/product/extraction/ragDocuments/ragAnnotation.js +9 -0
- package/src/v2/product/ocr/ocr.d.ts +1 -1
- package/src/v2/product/ocr/ocr.js +1 -1
- package/src/v2/product/ocr/ocrInference.d.ts +2 -2
- package/src/v2/product/ocr/ocrInference.js +2 -2
- package/src/v2/product/ocr/ocrResponse.d.ts +1 -1
- package/src/v2/product/ocr/ocrResponse.js +1 -1
- package/src/v2/product/ocr/params/ocrParameters.d.ts +1 -1
- package/src/v2/product/ocr/params/ocrParameters.js +1 -1
- package/src/v2/product/split/params/splitParameters.d.ts +1 -1
- package/src/v2/product/split/params/splitParameters.js +1 -1
- package/src/v2/product/split/split.d.ts +1 -1
- package/src/v2/product/split/split.js +1 -1
- package/src/v2/product/split/splitInference.d.ts +1 -1
- package/src/v2/product/split/splitInference.js +1 -1
- package/src/v2/product/split/splitRange.d.ts +1 -1
- package/src/v2/product/split/splitRange.js +2 -2
- package/src/v2/product/split/splitResponse.d.ts +1 -1
- package/src/v2/product/split/splitResponse.js +1 -1
- package/src/v2/product/split/splitResult.js +1 -1
- package/src/v2/search/baseSearch.d.ts +2 -2
- package/src/v2/search/models/modelSearch.d.ts +3 -3
- package/src/v2/search/models/modelSearch.js +3 -3
- package/src/v2/search/models/modelSearchParameters.d.ts +1 -1
- package/src/v2/search/models/modelSearchParameters.js +1 -1
- package/src/v2/search/models/modelSearchResponse.d.ts +2 -2
- package/src/v2/search/models/modelSearchResponse.js +2 -2
- package/src/v2/search/ragDocuments/ragDocumentSearch.d.ts +3 -3
- package/src/v2/search/ragDocuments/ragDocumentSearch.js +3 -3
- package/src/v2/search/ragDocuments/ragDocumentSearchParameters.d.ts +1 -1
- package/src/v2/search/ragDocuments/ragDocumentSearchParameters.js +1 -1
- package/src/v2/search/ragDocuments/ragDocumentSearchResponse.d.ts +2 -2
- package/src/v2/search/ragDocuments/ragDocumentSearchResponse.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Mindee Node.js API Library Changelog
|
|
2
2
|
|
|
3
|
+
## v5.9.0 - 2026-09-18
|
|
4
|
+
### Changes
|
|
5
|
+
* :sparkles: add RAG document CRUD
|
|
6
|
+
* :wrench: add package.json exports field for proper ESM resolution
|
|
7
|
+
|
|
8
|
+
|
|
3
9
|
## v5.8.0 - 2026-09-17
|
|
4
10
|
### Changes
|
|
5
11
|
* :sparkles: better logging of errors
|
package/package.json
CHANGED
|
@@ -1,98 +1,107 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"name": "mindee",
|
|
3
|
+
"version": "5.9.0",
|
|
4
|
+
"description": "Mindee Client Library for Node.js",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Mindee",
|
|
7
|
+
"email": "opensource@mindee.com",
|
|
8
|
+
"url": "https://mindee.com/"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/mindee/mindee-api-nodejs.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/mindee/mindee-api-nodejs/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://mindee.com/",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"main": "src/index.js",
|
|
21
|
+
"types": "src/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./src/index.d.ts",
|
|
25
|
+
"import": "./src/index.js",
|
|
26
|
+
"default": "./src/index.js"
|
|
9
27
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"keywords": [
|
|
90
|
-
"typescript",
|
|
91
|
-
"mindee",
|
|
92
|
-
"api",
|
|
93
|
-
"client",
|
|
94
|
-
"client library",
|
|
95
|
-
"nodejs",
|
|
96
|
-
"sdk"
|
|
97
|
-
]
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"bin": {
|
|
31
|
+
"mindeeV1": "bin/mindeeV1.js",
|
|
32
|
+
"mindeeV2": "bin/mindeeV2.js"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc --build && tsc-alias",
|
|
36
|
+
"build:dist": "tsc --build && tsc-alias && cp LICENSE README.md CHANGELOG.md package.json ./dist",
|
|
37
|
+
"clean": "rm -rf ./dist ./docs/_build",
|
|
38
|
+
"test": "node tests/runner.mjs spec",
|
|
39
|
+
"test:light": "node tests/runner.mjs spec",
|
|
40
|
+
"test:integration": "node tests/runner.mjs integration",
|
|
41
|
+
"test:integration:light": "node tests/runner.mjs integration",
|
|
42
|
+
"test:v2": "tsc --noEmit && node tests/runner.mjs spec v2",
|
|
43
|
+
"lint": "tsc --noEmit && eslint --report-unused-disable-directives './src/**/*.ts' './tests/**/*.ts'",
|
|
44
|
+
"lint:fix": "tsc --noEmit && eslint --fix --report-unused-disable-directives './src/**/*.ts' './tests/**/*.ts'",
|
|
45
|
+
"lint:package": "npm run build:dist && publint ./dist && attw --pack ./dist --profile esm-only",
|
|
46
|
+
"lint:secrets": "secretlint '**/*'",
|
|
47
|
+
"license:check": "license-checker-rseidelsohn --onlyAllow \"MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;LGPL-3.0-or-later;Python-2.0;BlueOak-1.0.0;CC-BY-3.0;CC0-1.0;0BSD;LGPL-3.0-only;WTFPL;Artistic-2.0;Unlicense\"",
|
|
48
|
+
"docs": "typedoc --out docs/_build ./src/index.ts",
|
|
49
|
+
"docs:dist": "typedoc --out docs/_build ./src/index.ts && cp -r ./docs/code_samples ./docs/_build/",
|
|
50
|
+
"prepare": "husky"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"src/*",
|
|
54
|
+
"bin/*",
|
|
55
|
+
"LICENSE",
|
|
56
|
+
"README.md",
|
|
57
|
+
"CHANGELOG.md"
|
|
58
|
+
],
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">= 20.1"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"commander": "^14.0.3",
|
|
64
|
+
"file-type": "^21.3.4",
|
|
65
|
+
"tmp": "^0.2.7",
|
|
66
|
+
"undici": ">=6.24.0 <7.0.0 || >=7.24.0 <8.0.0"
|
|
67
|
+
},
|
|
68
|
+
"optionalDependencies": {
|
|
69
|
+
"@cantoo/pdf-lib": "^2.5.3",
|
|
70
|
+
"node-poppler": "^9.1.1",
|
|
71
|
+
"pdf.js-extract": "~0.2.1",
|
|
72
|
+
"sharp": "^0.35.3"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
76
|
+
"eslint": "^10.8.1",
|
|
77
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
78
|
+
"@eslint/js": "^10.0.1",
|
|
79
|
+
"eslint-plugin-jsdoc": "^62.7.1",
|
|
80
|
+
"eslint-plugin-security": "^4.0.1",
|
|
81
|
+
"eslint-plugin-sonarjs": "^4.2.0",
|
|
82
|
+
"@secretlint/secretlint-rule-preset-recommend": "^13.0.4",
|
|
83
|
+
"@types/node": "^20.19.37",
|
|
84
|
+
"@types/tmp": "^0.2.6",
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
86
|
+
"@typescript-eslint/parser": "^8.58.1",
|
|
87
|
+
"globals": "^17.4.0",
|
|
88
|
+
"husky": "^9.1.7",
|
|
89
|
+
"license-checker-rseidelsohn": "^4.4.2",
|
|
90
|
+
"publint": "^0.3.22",
|
|
91
|
+
"secretlint": "^13.0.4",
|
|
92
|
+
"tsc-alias": "^1.9.5",
|
|
93
|
+
"tslib": "^2.8.1",
|
|
94
|
+
"tsx": "^4.21.0",
|
|
95
|
+
"typedoc": "^0.28.18",
|
|
96
|
+
"typescript": "^5.9.3"
|
|
97
|
+
},
|
|
98
|
+
"keywords": [
|
|
99
|
+
"typescript",
|
|
100
|
+
"mindee",
|
|
101
|
+
"api",
|
|
102
|
+
"client",
|
|
103
|
+
"client library",
|
|
104
|
+
"nodejs",
|
|
105
|
+
"sdk"
|
|
106
|
+
]
|
|
98
107
|
}
|
package/src/geometry/bbox.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Polygon } from "../geometry/index.js";
|
|
2
|
-
import { ExtractedImages } from "
|
|
2
|
+
import { ExtractedImages } from "./extractedImages.js";
|
|
3
3
|
import { LocalInputSource } from "../input/index.js";
|
|
4
4
|
import type * as pdfLibTypes from "@cantoo/pdf-lib";
|
|
5
5
|
/**
|
|
@@ -2,8 +2,8 @@ import { loadOptionalDependency } from "../dependency/index.js";
|
|
|
2
2
|
import { MindeeImageError } from "../errors/index.js";
|
|
3
3
|
import { getMinMaxX, getMinMaxY } from "../geometry/index.js";
|
|
4
4
|
import { adjustForRotation } from "../geometry/polygonUtils.js";
|
|
5
|
-
import { ExtractedImage } from "
|
|
6
|
-
import { ExtractedImages } from "
|
|
5
|
+
import { ExtractedImage } from "./extractedImage.js";
|
|
6
|
+
import { ExtractedImages } from "./extractedImages.js";
|
|
7
7
|
import { logger } from "../logger.js";
|
|
8
8
|
import { createPdfFromInputSource } from "../pdf/pdfOperation.js";
|
|
9
9
|
import { rasterizePage } from "../pdf/pdfUtils.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PageOptions } from "
|
|
1
|
+
import { PageOptions } from "./pageOptions.js";
|
|
2
2
|
import { InputSource, InputConstructor } from "./inputSource.js";
|
|
3
3
|
export declare const MIMETYPES: Map<string, string>;
|
|
4
4
|
export declare abstract class LocalInputSource extends InputSource {
|
package/src/pdf/pdfExtractor.js
CHANGED
|
@@ -3,8 +3,8 @@ import { logger } from "../logger.js";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { loadOptionalDependency } from "../dependency/index.js";
|
|
5
5
|
import { MindeeInputSourceError, MindeePdfError } from "../errors/index.js";
|
|
6
|
-
import { ExtractedPdf } from "
|
|
7
|
-
import { createPdfFromInputSource, extractPages } from "
|
|
6
|
+
import { ExtractedPdf } from "./extractedPdf.js";
|
|
7
|
+
import { createPdfFromInputSource, extractPages } from "./pdfOperation.js";
|
|
8
8
|
let pdfLib = null;
|
|
9
9
|
/**
|
|
10
10
|
* Load the PDF library if not already loaded.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InvoiceSplitterV1 } from "
|
|
1
|
+
import { InvoiceSplitterV1 } from "../../product/index.js";
|
|
2
2
|
import { LocalInputSource } from "../../../input/index.js";
|
|
3
|
-
import { ExtractedInvoiceSplitterImage } from "
|
|
3
|
+
import { ExtractedInvoiceSplitterImage } from "../index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Extracts & cuts the pages of a main document invoice according to the provided indexes.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MindeeError, MindeeInputSourceError } from "../../../errors/index.js";
|
|
2
|
-
import { InvoiceSplitterV1 } from "
|
|
3
|
-
import { ExtractedInvoiceSplitterImage } from "
|
|
2
|
+
import { InvoiceSplitterV1 } from "../../product/index.js";
|
|
3
|
+
import { ExtractedInvoiceSplitterImage } from "../index.js";
|
|
4
4
|
import { loadOptionalDependency } from "../../../dependency/index.js";
|
|
5
5
|
let pdfLib = null;
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MultiReceiptsDetectorV1 } from "
|
|
2
|
-
import { ExtractedMultiReceiptImage } from "
|
|
1
|
+
import { MultiReceiptsDetectorV1 } from "../../product/index.js";
|
|
2
|
+
import { ExtractedMultiReceiptImage } from "../index.js";
|
|
3
3
|
import { LocalInputSource } from "../../../input/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Extracts individual receipts from multi-receipts documents.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MindeeError } from "../../../errors/index.js";
|
|
2
2
|
import { createPdfFromInputSource } from "../../../pdf/pdfOperation.js";
|
|
3
|
-
import { ExtractedMultiReceiptImage } from "
|
|
3
|
+
import { ExtractedMultiReceiptImage } from "../index.js";
|
|
4
4
|
import { extractFromPage } from "../../../image/index.js";
|
|
5
5
|
import { loadOptionalDependency } from "../../../dependency/index.js";
|
|
6
6
|
let pdfLib = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputSource, PageOptions } from "../../input/index.js";
|
|
2
|
-
import { ApiSettingsV1 } from "
|
|
2
|
+
import { ApiSettingsV1 } from "./apiSettingsV1.js";
|
|
3
3
|
export declare abstract class BaseEndpoint {
|
|
4
4
|
/** Settings relating to the API. */
|
|
5
5
|
settings: ApiSettingsV1;
|
|
@@ -3,7 +3,7 @@ import { StringDict } from "../../parsing/stringDict.js";
|
|
|
3
3
|
import { BaseHttpResponse } from "../../http/apiCore.js";
|
|
4
4
|
import { ApiSettingsV1 } from "./apiSettingsV1.js";
|
|
5
5
|
import { PredictParams } from "./httpParams.js";
|
|
6
|
-
import { BaseEndpoint } from "
|
|
6
|
+
import { BaseEndpoint } from "./baseEndpoint.js";
|
|
7
7
|
/**
|
|
8
8
|
* Endpoint for a product (OTS or Custom).
|
|
9
9
|
*/
|
package/src/v1/http/endpoint.js
CHANGED
|
@@ -10,7 +10,7 @@ import { LocalInputSource } from "../../input/index.js";
|
|
|
10
10
|
import { sendRequestAndReadResponse, } from "../../http/apiCore.js";
|
|
11
11
|
import { handleError } from "./errors.js";
|
|
12
12
|
import { isValidAsyncResponse, isValidSyncResponse } from "./responseValidation.js";
|
|
13
|
-
import { BaseEndpoint } from "
|
|
13
|
+
import { BaseEndpoint } from "./baseEndpoint.js";
|
|
14
14
|
/**
|
|
15
15
|
* Endpoint for a product (OTS or Custom).
|
|
16
16
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputSource, PageOptions } from "../../input/index.js";
|
|
2
|
-
import { ExecutionPriority } from "
|
|
2
|
+
import { ExecutionPriority } from "../parsing/common/index.js";
|
|
3
3
|
interface HTTPParams {
|
|
4
4
|
/** Input source to submit to the API. */
|
|
5
5
|
inputDoc: InputSource;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InputSource } from "../../input/index.js";
|
|
2
|
-
import { ExecutionPriority } from "
|
|
2
|
+
import { ExecutionPriority } from "../parsing/common/index.js";
|
|
3
3
|
import { BaseHttpResponse } from "../../http/apiCore.js";
|
|
4
4
|
import { ApiSettingsV1 } from "./apiSettingsV1.js";
|
|
5
5
|
import { WorkflowParams } from "./httpParams.js";
|
|
6
|
-
import { BaseEndpoint } from "
|
|
6
|
+
import { BaseEndpoint } from "./baseEndpoint.js";
|
|
7
7
|
/**
|
|
8
8
|
* Endpoint for a workflow.
|
|
9
9
|
*/
|
|
@@ -10,7 +10,7 @@ import { LocalInputSource } from "../../input/index.js";
|
|
|
10
10
|
import { sendRequestAndReadResponse, } from "../../http/apiCore.js";
|
|
11
11
|
import { handleError } from "./errors.js";
|
|
12
12
|
import { isValidSyncResponse } from "./responseValidation.js";
|
|
13
|
-
import { BaseEndpoint } from "
|
|
13
|
+
import { BaseEndpoint } from "./baseEndpoint.js";
|
|
14
14
|
/**
|
|
15
15
|
* Endpoint for a workflow.
|
|
16
16
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Inference } from "./inference.js";
|
|
2
|
-
import { GeneratedV1Document } from "
|
|
2
|
+
import { GeneratedV1Document } from "../../product/generated/generatedV1Document.js";
|
|
3
3
|
import { ExecutionFile } from "./executionFile.js";
|
|
4
4
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
5
5
|
import { ExecutionPriority } from "./executionPriority.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeneratedV1Document } from "
|
|
1
|
+
import { GeneratedV1Document } from "../../product/generated/generatedV1Document.js";
|
|
2
2
|
import { parseDate } from "../../../parsing/dateParser.js";
|
|
3
3
|
/**
|
|
4
4
|
* Representation of an execution for a workflow.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PositionField } from "
|
|
1
|
+
import { PositionField } from "../../standard/position.js";
|
|
2
2
|
import { StringDict } from "../../../../parsing/stringDict.js";
|
|
3
3
|
import { ExtraField } from "./extras.js";
|
|
4
4
|
/** Cropper extra payload returned by compatible APIs. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PositionField } from "
|
|
1
|
+
import { PositionField } from "../../standard/position.js";
|
|
2
2
|
// eslint-disable-next-line no-restricted-imports
|
|
3
3
|
import { cleanOutString } from "../summaryHelper.js";
|
|
4
4
|
import { ExtraField } from "./extras.js";
|
|
@@ -5,7 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _OcrPage_instances, _OcrPage_areWordsOnSameLine, _OcrPage_toLines;
|
|
7
7
|
import { compareOnX, compareOnY, isPointInPolygonY, } from "../../../geometry/index.js";
|
|
8
|
-
import { Word } from "
|
|
8
|
+
import { Word } from "../standard/index.js";
|
|
9
9
|
export class OcrPage {
|
|
10
10
|
constructor(rawPrediction) {
|
|
11
11
|
_OcrPage_instances.add(this);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
|
-
import { StringField } from "
|
|
2
|
+
import { StringField } from "../standard/index.js";
|
|
3
3
|
import { GeneratedObjectField } from "./generatedObject.js";
|
|
4
4
|
export interface GeneratedListFieldConstructor {
|
|
5
5
|
prediction: StringDict[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
|
-
import { BaseFieldConstructor } from "
|
|
2
|
+
import { BaseFieldConstructor } from "../standard/index.js";
|
|
3
3
|
/** A JSON-like object, with miscellaneous values. */
|
|
4
4
|
export declare class GeneratedObjectField {
|
|
5
5
|
/** The document page on which the information was found. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseLocalResponse } from "../../parsing/baseLocalResponse.js";
|
|
2
|
-
import { AsyncPredictResponse, Inference, PredictResponse } from "
|
|
2
|
+
import { AsyncPredictResponse, Inference, PredictResponse } from "../index.js";
|
|
3
3
|
import { StringDict } from "../../parsing/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Local response loaded from a file.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseLocalResponse } from "../../parsing/baseLocalResponse.js";
|
|
2
|
-
import { AsyncPredictResponse, PredictResponse } from "
|
|
2
|
+
import { AsyncPredictResponse, PredictResponse } from "../index.js";
|
|
3
3
|
import { MindeeError } from "../../errors/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Local response loaded from a file.
|
|
@@ -4,7 +4,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _TaxField_instances, _TaxField_printableValues, _Taxes_instances, _Taxes_lineSeparator;
|
|
7
|
-
import { floatToString } from "
|
|
7
|
+
import { floatToString } from "../common/index.js";
|
|
8
8
|
import { Field } from "./field.js";
|
|
9
9
|
/**
|
|
10
10
|
* Represent a single tax line.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Inference, StringDict, Page } from "
|
|
1
|
+
import { Inference, StringDict, Page } from "../../parsing/common/index.js";
|
|
2
2
|
import { BarcodeReaderV1Document } from "./barcodeReaderV1Document.js";
|
|
3
3
|
/**
|
|
4
4
|
* Barcode Reader API version 1 inference prediction.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Inference, Page } from "
|
|
1
|
+
import { Inference, Page } from "../../parsing/common/index.js";
|
|
2
2
|
import { BarcodeReaderV1Document } from "./barcodeReaderV1Document.js";
|
|
3
3
|
/**
|
|
4
4
|
* Barcode Reader API version 1 inference prediction.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Prediction, StringDict } from "
|
|
2
|
-
import { StringField } from "
|
|
1
|
+
import { Prediction, StringDict } from "../../parsing/common/index.js";
|
|
2
|
+
import { StringField } from "../../parsing/standard/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Barcode Reader API version 1.0 document data.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cleanOutString, } from "
|
|
2
|
-
import { StringField } from "
|
|
1
|
+
import { cleanOutString, } from "../../parsing/common/index.js";
|
|
2
|
+
import { StringField } from "../../parsing/standard/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Barcode Reader API version 1.0 document data.
|
|
5
5
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Inference, StringDict } from "
|
|
1
|
+
import { Inference, StringDict } from "../parsing/common/index.js";
|
|
2
2
|
export declare const COMMAND_GENERATED = "generated";
|
|
3
3
|
export interface ProductConfig<T extends Inference = Inference> {
|
|
4
4
|
displayName: string;
|
|
@@ -7,4 +7,4 @@ export interface ProductConfig<T extends Inference = Inference> {
|
|
|
7
7
|
async: boolean;
|
|
8
8
|
sync: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare const CLI_COMMAND_CONFIG: Map<string, ProductConfig<Inference<import("
|
|
10
|
+
export declare const CLI_COMMAND_CONFIG: Map<string, ProductConfig<Inference<import("../parsing/common/index.js").Prediction, import("../parsing/common/index.js").Prediction>>>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// The Map's key is the command name as it will appear on the console.
|
|
5
5
|
//
|
|
6
|
-
import * as product from "
|
|
6
|
+
import * as product from "./index.js";
|
|
7
7
|
export const COMMAND_GENERATED = "generated";
|
|
8
8
|
export const CLI_COMMAND_CONFIG = new Map([
|
|
9
9
|
[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Inference, StringDict, Page } from "
|
|
1
|
+
import { Inference, StringDict, Page } from "../../parsing/common/index.js";
|
|
2
2
|
import { CropperV1Document } from "./cropperV1Document.js";
|
|
3
3
|
import { CropperV1Page } from "./cropperV1Page.js";
|
|
4
4
|
/**
|