mindee 5.8.0 → 5.10.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 +12 -0
- package/package.json +103 -95
- package/src/geometry/bbox.d.ts +18 -6
- package/src/geometry/bbox.js +7 -3
- package/src/geometry/boundingBox.d.ts +3 -1
- package/src/geometry/boundingBox.js +3 -1
- package/src/geometry/boundingBoxUtils.d.ts +4 -4
- package/src/geometry/boundingBoxUtils.js +7 -7
- package/src/geometry/minMax.d.ts +9 -3
- package/src/geometry/point.d.ts +3 -1
- package/src/geometry/polygon.d.ts +3 -1
- package/src/geometry/polygon.js +3 -1
- package/src/http/apiCore.js +1 -1
- package/src/http/baseSettings.d.ts +15 -5
- package/src/http/baseSettings.js +4 -2
- package/src/http/dispatcher.js +4 -2
- package/src/image/extractedImage.d.ts +13 -5
- package/src/image/extractedImage.js +3 -3
- package/src/image/extractedImages.d.ts +4 -2
- package/src/image/extractedImages.js +3 -1
- package/src/image/imageCompressor.d.ts +1 -0
- package/src/image/imageCompressor.js +2 -2
- package/src/image/imageExtractor.d.ts +2 -2
- package/src/image/imageExtractor.js +14 -14
- package/src/input/base64Input.d.ts +9 -3
- package/src/input/base64Input.js +9 -3
- package/src/input/bufferInput.d.ts +7 -2
- package/src/input/bufferInput.js +6 -2
- package/src/input/bytesInput.d.ts +10 -3
- package/src/input/bytesInput.js +10 -3
- package/src/input/inputSource.d.ts +4 -2
- package/src/input/inputSource.js +3 -2
- package/src/input/localInputSource.d.ts +20 -7
- package/src/input/localInputSource.js +12 -5
- package/src/input/pageOptions.d.ts +9 -3
- package/src/input/pageOptions.js +6 -2
- package/src/input/pathInput.d.ts +12 -4
- package/src/input/pathInput.js +11 -5
- package/src/input/streamInput.d.ts +14 -5
- package/src/input/streamInput.js +13 -4
- package/src/input/urlInput.d.ts +19 -7
- package/src/input/urlInput.js +20 -12
- package/src/parsing/baseLocalResponse.d.ts +8 -4
- package/src/parsing/baseLocalResponse.js +15 -11
- package/src/parsing/stringDict.d.ts +3 -1
- package/src/pdf/extractedPdf.d.ts +16 -6
- package/src/pdf/extractedPdf.js +5 -3
- package/src/pdf/extractedPdfs.d.ts +4 -2
- package/src/pdf/extractedPdfs.js +3 -1
- package/src/pdf/pdfCompressor.js +14 -14
- package/src/pdf/pdfExtractor.d.ts +1 -1
- package/src/pdf/pdfExtractor.js +3 -3
- package/src/pdf/pdfOperation.d.ts +9 -3
- package/src/pdf/pdfOperation.js +14 -14
- package/src/pdf/pdfUtils.js +1 -1
- package/src/v1/cli.js +1 -1
- package/src/v1/client.d.ts +42 -14
- package/src/v1/client.js +8 -8
- package/src/v1/extraction/invoiceSplitterExtractor/extractedInvoiceSplitterImage.d.ts +6 -2
- package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.d.ts +2 -2
- package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.js +6 -6
- package/src/v1/extraction/multiReceiptsExtractor/extractedMultiReceiptImage.d.ts +6 -2
- package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.d.ts +2 -2
- package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.js +3 -3
- package/src/v1/http/apiSettingsV1.d.ts +15 -5
- package/src/v1/http/apiSettingsV1.js +12 -4
- package/src/v1/http/baseEndpoint.d.ts +7 -3
- package/src/v1/http/endpoint.d.ts +10 -4
- package/src/v1/http/endpoint.js +2 -2
- package/src/v1/http/errors.d.ts +9 -3
- package/src/v1/http/errors.js +6 -2
- package/src/v1/http/httpParams.d.ts +37 -13
- package/src/v1/http/workflowEndpoint.d.ts +2 -2
- package/src/v1/http/workflowEndpoint.js +2 -2
- package/src/v1/parsing/common/apiRequest.d.ts +15 -5
- package/src/v1/parsing/common/apiResponse.d.ts +6 -2
- package/src/v1/parsing/common/asyncPredictResponse.d.ts +21 -7
- package/src/v1/parsing/common/document.d.ts +18 -6
- package/src/v1/parsing/common/document.js +2 -2
- package/src/v1/parsing/common/execution.d.ts +40 -14
- package/src/v1/parsing/common/execution.js +1 -1
- package/src/v1/parsing/common/executionFile.d.ts +6 -2
- package/src/v1/parsing/common/executionPriority.d.ts +12 -4
- package/src/v1/parsing/common/executionPriority.js +12 -4
- package/src/v1/parsing/common/extras/cropperExtra.d.ts +7 -3
- package/src/v1/parsing/common/extras/cropperExtra.js +7 -4
- package/src/v1/parsing/common/extras/extras.d.ts +9 -3
- package/src/v1/parsing/common/extras/extras.js +6 -2
- package/src/v1/parsing/common/extras/fullTextOcrExtra.d.ts +9 -3
- package/src/v1/parsing/common/extras/fullTextOcrExtra.js +3 -1
- package/src/v1/parsing/common/extras/ragExtra.d.ts +3 -1
- package/src/v1/parsing/common/extras/ragExtra.js +3 -1
- package/src/v1/parsing/common/feedback/feedbackResponse.d.ts +3 -1
- package/src/v1/parsing/common/feedback/feedbackResponse.js +0 -1
- package/src/v1/parsing/common/inference.d.ts +24 -8
- package/src/v1/parsing/common/inference.js +6 -2
- package/src/v1/parsing/common/mvisionV1.d.ts +3 -1
- package/src/v1/parsing/common/mvisionV1.js +3 -1
- package/src/v1/parsing/common/ocr.d.ts +3 -1
- package/src/v1/parsing/common/ocrPage.d.ts +7 -3
- package/src/v1/parsing/common/ocrPage.js +7 -3
- package/src/v1/parsing/common/orientation.d.ts +7 -3
- package/src/v1/parsing/common/orientation.js +1 -1
- package/src/v1/parsing/common/page.d.ts +12 -4
- package/src/v1/parsing/common/predictResponse.d.ts +3 -1
- package/src/v1/parsing/common/prediction.d.ts +3 -1
- package/src/v1/parsing/common/prediction.js +3 -1
- package/src/v1/parsing/generated/generatedList.d.ts +7 -3
- package/src/v1/parsing/generated/generatedList.js +1 -1
- package/src/v1/parsing/generated/generatedObject.d.ts +26 -10
- package/src/v1/parsing/generated/generatedObject.js +14 -8
- package/src/v1/parsing/localResponse.d.ts +4 -2
- package/src/v1/parsing/localResponse.js +4 -2
- package/src/v1/parsing/standard/addressField.d.ts +24 -8
- package/src/v1/parsing/standard/amount.d.ts +3 -1
- package/src/v1/parsing/standard/amount.js +4 -2
- package/src/v1/parsing/standard/base.d.ts +27 -9
- package/src/v1/parsing/standard/base.js +6 -2
- package/src/v1/parsing/standard/boolean.d.ts +3 -1
- package/src/v1/parsing/standard/classification.d.ts +6 -2
- package/src/v1/parsing/standard/companyRegistration.d.ts +9 -3
- package/src/v1/parsing/standard/companyRegistration.js +4 -2
- package/src/v1/parsing/standard/date.d.ts +12 -4
- package/src/v1/parsing/standard/date.js +3 -1
- package/src/v1/parsing/standard/field.d.ts +7 -5
- package/src/v1/parsing/standard/field.js +4 -4
- package/src/v1/parsing/standard/locale.d.ts +15 -5
- package/src/v1/parsing/standard/paymentDetails.d.ts +15 -5
- package/src/v1/parsing/standard/position.d.ts +15 -5
- package/src/v1/parsing/standard/tax.d.ts +19 -7
- package/src/v1/parsing/standard/tax.js +16 -6
- package/src/v1/parsing/standard/text.d.ts +6 -2
- package/src/v1/parsing/standard/word.d.ts +9 -3
- package/src/v1/parsing/standard/word.js +3 -1
- package/src/v1/product/barcodeReader/barcodeReaderV1.d.ts +13 -5
- package/src/v1/product/barcodeReader/barcodeReaderV1.js +10 -4
- package/src/v1/product/barcodeReader/barcodeReaderV1Document.d.ts +8 -4
- package/src/v1/product/barcodeReader/barcodeReaderV1Document.js +8 -4
- 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 +13 -5
- package/src/v1/product/cropper/cropperV1.js +10 -4
- package/src/v1/product/cropper/cropperV1Document.d.ts +1 -1
- package/src/v1/product/cropper/cropperV1Page.d.ts +5 -3
- package/src/v1/product/cropper/cropperV1Page.js +5 -3
- package/src/v1/product/driverLicense/driverLicenseV1.d.ts +13 -5
- package/src/v1/product/driverLicense/driverLicenseV1.js +10 -4
- package/src/v1/product/driverLicense/driverLicenseV1Document.d.ts +41 -15
- package/src/v1/product/driverLicense/driverLicenseV1Document.js +2 -2
- package/src/v1/product/financialDocument/financialDocumentV1.d.ts +13 -5
- package/src/v1/product/financialDocument/financialDocumentV1.js +10 -4
- package/src/v1/product/financialDocument/financialDocumentV1Document.d.ts +98 -34
- package/src/v1/product/financialDocument/financialDocumentV1Document.js +17 -7
- package/src/v1/product/financialDocument/financialDocumentV1LineItem.d.ts +30 -10
- package/src/v1/product/financialDocument/financialDocumentV1LineItem.js +4 -2
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +13 -5
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.js +10 -4
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +11 -5
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +2 -2
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +13 -5
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.js +10 -4
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +18 -6
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.js +3 -1
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +14 -6
- package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +2 -2
- package/src/v1/product/fr/carteGrise/carteGriseV1.d.ts +13 -5
- package/src/v1/product/fr/carteGrise/carteGriseV1.js +10 -4
- package/src/v1/product/fr/carteGrise/carteGriseV1Document.d.ts +125 -43
- package/src/v1/product/fr/carteGrise/carteGriseV1Document.js +2 -2
- package/src/v1/product/fr/idCard/idCardV2.d.ts +13 -5
- package/src/v1/product/fr/idCard/idCardV2.js +10 -4
- package/src/v1/product/fr/idCard/idCardV2Document.d.ts +47 -17
- package/src/v1/product/fr/idCard/idCardV2Document.js +5 -3
- package/src/v1/product/fr/idCard/idCardV2Page.d.ts +8 -4
- package/src/v1/product/fr/idCard/idCardV2Page.js +2 -2
- package/src/v1/product/generated/generatedV1.d.ts +13 -5
- package/src/v1/product/generated/generatedV1.js +10 -4
- 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 +9 -5
- package/src/v1/product/generated/generatedV1Prediction.js +6 -4
- package/src/v1/product/internationalId/internationalIdV2.d.ts +13 -5
- package/src/v1/product/internationalId/internationalIdV2.js +10 -4
- package/src/v1/product/internationalId/internationalIdV2Document.d.ts +53 -19
- package/src/v1/product/internationalId/internationalIdV2Document.js +8 -4
- package/src/v1/product/invoice/invoiceV4.d.ts +13 -5
- package/src/v1/product/invoice/invoiceV4.js +10 -4
- package/src/v1/product/invoice/invoiceV4Document.d.ts +89 -31
- package/src/v1/product/invoice/invoiceV4Document.js +17 -7
- package/src/v1/product/invoice/invoiceV4LineItem.d.ts +30 -10
- package/src/v1/product/invoice/invoiceV4LineItem.js +4 -2
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1.d.ts +13 -5
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1.js +10 -4
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +4 -2
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.js +4 -2
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.d.ts +9 -3
- package/src/v1/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.js +3 -1
- package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.d.ts +13 -5
- package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +10 -4
- package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +5 -3
- package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +5 -3
- package/src/v1/product/passport/passportV1.d.ts +13 -5
- package/src/v1/product/passport/passportV1.js +10 -4
- package/src/v1/product/passport/passportV1Document.d.ts +35 -13
- package/src/v1/product/passport/passportV1Document.js +5 -3
- package/src/v1/product/receipt/receiptV5.d.ts +13 -5
- package/src/v1/product/receipt/receiptV5.js +10 -4
- package/src/v1/product/receipt/receiptV5Document.d.ts +53 -19
- package/src/v1/product/receipt/receiptV5Document.js +8 -4
- package/src/v1/product/receipt/receiptV5LineItem.d.ts +18 -6
- package/src/v1/product/receipt/receiptV5LineItem.js +4 -2
- package/src/v1/product/resume/resumeV1.d.ts +13 -5
- package/src/v1/product/resume/resumeV1.js +10 -4
- package/src/v1/product/resume/resumeV1Certificate.d.ts +18 -6
- package/src/v1/product/resume/resumeV1Certificate.js +4 -2
- package/src/v1/product/resume/resumeV1Document.d.ts +53 -19
- package/src/v1/product/resume/resumeV1Document.js +29 -11
- package/src/v1/product/resume/resumeV1Education.d.ts +27 -9
- package/src/v1/product/resume/resumeV1Education.js +4 -2
- package/src/v1/product/resume/resumeV1Language.d.ts +12 -4
- package/src/v1/product/resume/resumeV1Language.js +4 -2
- package/src/v1/product/resume/resumeV1ProfessionalExperience.d.ts +33 -11
- package/src/v1/product/resume/resumeV1ProfessionalExperience.js +4 -2
- package/src/v1/product/resume/resumeV1SocialNetworksUrl.d.ts +12 -4
- package/src/v1/product/resume/resumeV1SocialNetworksUrl.js +4 -2
- package/src/v1/product/us/bankCheck/bankCheckV1.d.ts +13 -5
- package/src/v1/product/us/bankCheck/bankCheckV1.js +10 -4
- package/src/v1/product/us/bankCheck/bankCheckV1Document.d.ts +20 -8
- package/src/v1/product/us/bankCheck/bankCheckV1Document.js +5 -3
- package/src/v1/product/us/bankCheck/bankCheckV1Page.d.ts +8 -4
- package/src/v1/product/us/bankCheck/bankCheckV1Page.js +5 -3
- package/src/v2/cli.js +2 -2
- package/src/v2/client.d.ts +103 -21
- 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/clientOptions/pollingOptions.d.ts +30 -10
- package/src/v2/clientOptions/pollingOptions.js +6 -2
- 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 +36 -7
- package/src/v2/http/mindeeApiV2.js +80 -4
- 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/errorDetails.d.ts +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/baseInference.d.ts +6 -2
- package/src/v2/parsing/inference/baseInference.js +6 -2
- 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/baseField.d.ts +9 -3
- package/src/v2/parsing/inference/field/fieldConfidence.d.ts +12 -4
- package/src/v2/parsing/inference/field/fieldConfidence.js +12 -4
- package/src/v2/parsing/inference/field/fieldLocation.d.ts +9 -3
- package/src/v2/parsing/inference/field/fieldLocation.js +3 -1
- package/src/v2/parsing/inference/field/inferenceFields.d.ts +15 -5
- package/src/v2/parsing/inference/field/inferenceFields.js +12 -4
- package/src/v2/parsing/inference/field/listField.d.ts +6 -2
- package/src/v2/parsing/inference/field/listField.js +6 -2
- package/src/v2/parsing/inference/field/objectField.d.ts +19 -11
- package/src/v2/parsing/inference/field/objectField.js +22 -34
- package/src/v2/parsing/inference/field/ragMetadata.d.ts +3 -1
- package/src/v2/parsing/inference/field/ragMetadata.js +3 -1
- package/src/v2/parsing/inference/field/rawText.d.ts +6 -2
- package/src/v2/parsing/inference/field/rawText.js +6 -2
- package/src/v2/parsing/inference/field/simpleField.d.ts +6 -2
- package/src/v2/parsing/inference/field/simpleField.js +8 -4
- package/src/v2/parsing/inference/inferenceFile.d.ts +6 -2
- package/src/v2/parsing/inference/inferenceFile.js +6 -2
- package/src/v2/parsing/inference/inferenceModel.d.ts +6 -2
- package/src/v2/parsing/inference/inferenceModel.js +6 -2
- 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 +10 -4
- package/src/v2/product/classification/classification.js +10 -4
- package/src/v2/product/classification/classificationClassifier.d.ts +7 -3
- package/src/v2/product/classification/classificationClassifier.js +7 -3
- package/src/v2/product/classification/classificationInference.d.ts +7 -3
- package/src/v2/product/classification/classificationInference.js +7 -3
- package/src/v2/product/classification/classificationResponse.d.ts +4 -2
- package/src/v2/product/classification/classificationResponse.js +4 -2
- package/src/v2/product/classification/classificationResult.d.ts +6 -2
- package/src/v2/product/classification/classificationResult.js +6 -2
- 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 +10 -4
- package/src/v2/product/crop/crop.js +10 -4
- package/src/v2/product/crop/cropInference.d.ts +8 -4
- package/src/v2/product/crop/cropInference.js +8 -4
- package/src/v2/product/crop/cropItem.d.ts +8 -4
- package/src/v2/product/crop/cropItem.js +9 -5
- package/src/v2/product/crop/cropResponse.d.ts +4 -2
- package/src/v2/product/crop/cropResponse.js +4 -2
- package/src/v2/product/crop/cropResult.d.ts +7 -3
- package/src/v2/product/crop/cropResult.js +8 -4
- 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/dataSchemaActiveOption.d.ts +3 -1
- package/src/v2/product/extraction/dataSchemaActiveOption.js +3 -1
- package/src/v2/product/extraction/extraction.d.ts +25 -5
- package/src/v2/product/extraction/extraction.js +32 -6
- package/src/v2/product/extraction/extractionActiveOptions.d.ts +6 -2
- package/src/v2/product/extraction/extractionActiveOptions.js +6 -2
- package/src/v2/product/extraction/extractionInference.d.ts +7 -3
- package/src/v2/product/extraction/extractionInference.js +7 -3
- package/src/v2/product/extraction/extractionResponse.d.ts +4 -2
- package/src/v2/product/extraction/extractionResponse.js +4 -2
- package/src/v2/product/extraction/extractionResult.d.ts +9 -5
- package/src/v2/product/extraction/extractionResult.js +9 -5
- 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/dataSchema.d.ts +12 -4
- package/src/v2/product/extraction/params/dataSchema.js +6 -2
- package/src/v2/product/extraction/params/dataSchemaField.d.ts +39 -13
- package/src/v2/product/extraction/params/dataSchemaField.js +9 -3
- package/src/v2/product/extraction/params/dataSchemaReplace.d.ts +12 -4
- package/src/v2/product/extraction/params/dataSchemaReplace.js +6 -2
- package/src/v2/product/extraction/params/extractionParameters.d.ts +1 -1
- package/src/v2/product/extraction/params/extractionParameters.js +4 -4
- 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 +26 -0
- package/src/v2/product/extraction/ragDocuments/annotatedListField.js +69 -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 +10 -4
- package/src/v2/product/ocr/ocr.js +10 -4
- package/src/v2/product/ocr/ocrInference.d.ts +8 -4
- package/src/v2/product/ocr/ocrInference.js +8 -4
- package/src/v2/product/ocr/ocrPage.d.ts +6 -2
- package/src/v2/product/ocr/ocrPage.js +6 -2
- package/src/v2/product/ocr/ocrResponse.d.ts +4 -2
- package/src/v2/product/ocr/ocrResponse.js +4 -2
- package/src/v2/product/ocr/ocrResult.d.ts +3 -1
- package/src/v2/product/ocr/ocrResult.js +3 -1
- package/src/v2/product/ocr/ocrWord.d.ts +6 -2
- package/src/v2/product/ocr/ocrWord.js +6 -2
- 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 +10 -4
- package/src/v2/product/split/split.js +10 -4
- package/src/v2/product/split/splitInference.d.ts +7 -3
- package/src/v2/product/split/splitInference.js +7 -3
- package/src/v2/product/split/splitRange.d.ts +4 -2
- package/src/v2/product/split/splitRange.js +5 -3
- package/src/v2/product/split/splitResponse.d.ts +4 -2
- package/src/v2/product/split/splitResponse.js +4 -2
- package/src/v2/product/split/splitResult.d.ts +3 -1
- package/src/v2/product/split/splitResult.js +4 -2
- package/src/v2/search/baseSearch.d.ts +11 -5
- package/src/v2/search/baseSearch.js +9 -3
- package/src/v2/search/models/modelSearch.d.ts +12 -6
- package/src/v2/search/models/modelSearch.js +12 -6
- package/src/v2/search/models/modelSearchParameters.d.ts +4 -2
- package/src/v2/search/models/modelSearchParameters.js +4 -2
- 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 +12 -6
- package/src/v2/search/ragDocuments/ragDocumentSearch.js +12 -6
- package/src/v2/search/ragDocuments/ragDocumentSearchParameters.d.ts +4 -2
- package/src/v2/search/ragDocuments/ragDocumentSearchParameters.js +4 -2
- package/src/v2/search/ragDocuments/ragDocumentSearchResponse.d.ts +2 -2
- package/src/v2/search/ragDocuments/ragDocumentSearchResponse.js +2 -2
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Execution priority levels available for workflow requests.
|
|
3
|
+
*/
|
|
2
4
|
export var ExecutionPriority;
|
|
3
5
|
(function (ExecutionPriority) {
|
|
4
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Low-priority background processing.
|
|
8
|
+
*/
|
|
5
9
|
ExecutionPriority["low"] = "low";
|
|
6
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Standard processing priority.
|
|
12
|
+
*/
|
|
7
13
|
ExecutionPriority["medium"] = "medium";
|
|
8
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* High-priority processing.
|
|
16
|
+
*/
|
|
9
17
|
ExecutionPriority["high"] = "high";
|
|
10
18
|
})(ExecutionPriority || (ExecutionPriority = {}));
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { PositionField } from "../../../../v1/parsing/standard/position.js";
|
|
2
1
|
import { StringDict } from "../../../../parsing/stringDict.js";
|
|
2
|
+
import { PositionField } from "../../standard/position.js";
|
|
3
3
|
import { ExtraField } from "./extras.js";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Cropper extra payload returned by compatible APIs.
|
|
6
|
+
*/
|
|
5
7
|
export declare class CropperExtra extends ExtraField {
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Cropped regions detected on the page.
|
|
10
|
+
*/
|
|
7
11
|
cropping: PositionField[];
|
|
8
12
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
9
13
|
/**
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { PositionField } from "
|
|
2
|
-
// eslint-disable-next-line no-restricted-imports
|
|
1
|
+
import { PositionField } from "../../standard/position.js";
|
|
3
2
|
import { cleanOutString } from "../summaryHelper.js";
|
|
4
3
|
import { ExtraField } from "./extras.js";
|
|
5
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Cropper extra payload returned by compatible APIs.
|
|
6
|
+
*/
|
|
6
7
|
export class CropperExtra extends ExtraField {
|
|
7
8
|
constructor(rawPrediction, pageId) {
|
|
8
9
|
super();
|
|
9
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Cropped regions detected on the page.
|
|
12
|
+
*/
|
|
10
13
|
this.cropping = [];
|
|
11
14
|
if (rawPrediction["cropping"] !== undefined) {
|
|
12
15
|
rawPrediction["cropping"].forEach((crop) => {
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Base class for optional extras attached to predictions.
|
|
3
|
+
*/
|
|
2
4
|
export declare abstract class ExtraField {
|
|
3
5
|
}
|
|
4
6
|
interface ExtraDict<T extends ExtraField> {
|
|
5
7
|
[key: string]: T | (() => string);
|
|
6
8
|
}
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Dictionary-like container for extra fields.
|
|
11
|
+
*/
|
|
8
12
|
export declare class Extras<ExtraT extends ExtraField = ExtraField> implements ExtraDict<ExtraT> {
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Dynamic map of extra values keyed by extra name.
|
|
15
|
+
*/
|
|
10
16
|
[key: string]: ExtraT | (() => string);
|
|
11
17
|
constructor(fields: Record<string, ExtraT>);
|
|
12
18
|
/**
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Base class for optional extras attached to predictions.
|
|
3
|
+
*/
|
|
2
4
|
export class ExtraField {
|
|
3
5
|
}
|
|
4
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Dictionary-like container for extra fields.
|
|
8
|
+
*/
|
|
5
9
|
export class Extras {
|
|
6
10
|
constructor(fields) {
|
|
7
11
|
if (Object.keys(fields).length > 0) {
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { StringDict } from "../../../../parsing/stringDict.js";
|
|
2
2
|
import { ExtraField } from "./extras.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Full-text OCR extra payload returned by compatible APIs.
|
|
5
|
+
*/
|
|
4
6
|
export declare class FullTextOcrExtra extends ExtraField {
|
|
5
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Concatenated OCR content.
|
|
9
|
+
*/
|
|
6
10
|
content?: string;
|
|
7
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* OCR language hints associated with the content.
|
|
13
|
+
*/
|
|
8
14
|
languages?: string;
|
|
9
15
|
constructor(rawPrediction: StringDict);
|
|
10
16
|
/**
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ExtraField } from "./extras.js";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Full-text OCR extra payload returned by compatible APIs.
|
|
4
|
+
*/
|
|
3
5
|
export class FullTextOcrExtra extends ExtraField {
|
|
4
6
|
constructor(rawPrediction) {
|
|
5
7
|
super();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExtraField } from "./extras.js";
|
|
2
2
|
import { StringDict } from "../../../../parsing/stringDict.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* RAG extra payload returned by compatible APIs.
|
|
5
|
+
*/
|
|
4
6
|
export declare class RAGExtra extends ExtraField {
|
|
5
7
|
/**
|
|
6
8
|
* ID reference of the document matched by the Retrieval-Augmented Generation.
|
|
@@ -6,7 +6,9 @@ import { StringDict } from "../../../../parsing/stringDict.js";
|
|
|
6
6
|
* @category Synchronous
|
|
7
7
|
*/
|
|
8
8
|
export declare class FeedbackResponse extends ApiResponse {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* A document feedback response.
|
|
11
|
+
*/
|
|
10
12
|
feedback: StringDict;
|
|
11
13
|
/**
|
|
12
14
|
* @param serverResponse JSON response from the server.
|
|
@@ -12,25 +12,41 @@ import { Extras } from "./extras/index.js";
|
|
|
12
12
|
* if a document's pages have specific implementation.
|
|
13
13
|
*/
|
|
14
14
|
export declare abstract class Inference<DocT extends Prediction = Prediction, PageT extends DocT = DocT> {
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* A boolean denoting whether a given inference result was rotated.
|
|
17
|
+
*/
|
|
16
18
|
isRotationApplied?: boolean;
|
|
17
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Name and version of a given product.
|
|
21
|
+
*/
|
|
18
22
|
product: Product;
|
|
19
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Wrapper for a document's pages prediction.
|
|
25
|
+
*/
|
|
20
26
|
pages: Page<PageT>[];
|
|
21
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A document's top-level `Prediction`.
|
|
29
|
+
*/
|
|
22
30
|
prediction: DocT;
|
|
23
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Extraneous fields relating to specific tools for some APIs.
|
|
33
|
+
*/
|
|
24
34
|
extras?: Extras;
|
|
25
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Name of a document's endpoint. Has a default value for OTS APIs.
|
|
37
|
+
*/
|
|
26
38
|
endpointName?: string;
|
|
27
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* A document's version. Has a default value for OTS APIs.
|
|
41
|
+
*/
|
|
28
42
|
endpointVersion?: string;
|
|
29
43
|
constructor(rawPrediction: StringDict);
|
|
30
44
|
/**
|
|
31
45
|
* Default string representation.
|
|
32
46
|
*/
|
|
33
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Returns a human-readable representation of the inference payload.
|
|
49
|
+
*/
|
|
34
50
|
toString(): string;
|
|
35
51
|
/**
|
|
36
52
|
* Takes in an input string and replaces line breaks with `\n`.
|
|
@@ -10,7 +10,9 @@ import { MindeeConfigurationError } from "../../../errors/index.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export class Inference {
|
|
12
12
|
constructor(rawPrediction) {
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Wrapper for a document's pages prediction.
|
|
15
|
+
*/
|
|
14
16
|
this.pages = [];
|
|
15
17
|
this.isRotationApplied = rawPrediction?.is_rotation_applied ?? undefined;
|
|
16
18
|
this.product = rawPrediction?.product;
|
|
@@ -36,7 +38,9 @@ export class Inference {
|
|
|
36
38
|
/**
|
|
37
39
|
* Default string representation.
|
|
38
40
|
*/
|
|
39
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Returns a human-readable representation of the inference payload.
|
|
43
|
+
*/
|
|
40
44
|
toString() {
|
|
41
45
|
let pages = "";
|
|
42
46
|
if (this.pages.toString().length > 0) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
2
|
import { OcrPage } from "./ocrPage.js";
|
|
3
3
|
export declare class MvisionV1 {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* List of words found on the page.
|
|
6
|
+
*/
|
|
5
7
|
pages: OcrPage[];
|
|
6
8
|
constructor(rawPrediction: StringDict);
|
|
7
9
|
/**
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { OcrPage } from "./ocrPage.js";
|
|
2
2
|
export class MvisionV1 {
|
|
3
3
|
constructor(rawPrediction) {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* List of words found on the page.
|
|
6
|
+
*/
|
|
5
7
|
this.pages = [];
|
|
6
8
|
rawPrediction["pages"].map((page) => {
|
|
7
9
|
this.pages.push(new OcrPage(page));
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
2
|
import { MvisionV1 } from "./mvisionV1.js";
|
|
3
3
|
export declare class Ocr {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Default Mindee OCR
|
|
6
|
+
*/
|
|
5
7
|
mVisionV1: MvisionV1;
|
|
6
8
|
constructor(rawPrediction: StringDict);
|
|
7
9
|
/**
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Word } from "
|
|
1
|
+
import { Word } from "../standard/index.js";
|
|
2
2
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
3
3
|
export declare class OcrPage {
|
|
4
4
|
#private;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Flat list of all words read
|
|
7
|
+
*/
|
|
6
8
|
allWords: Word[];
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* List of words by which line they are on
|
|
11
|
+
*/
|
|
8
12
|
allLines: Word[][];
|
|
9
13
|
constructor(rawPrediction: StringDict);
|
|
10
14
|
/**
|
|
@@ -5,13 +5,17 @@ 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);
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Flat list of all words read
|
|
14
|
+
*/
|
|
13
15
|
this.allWords = [];
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* List of words by which line they are on
|
|
18
|
+
*/
|
|
15
19
|
this.allLines = [];
|
|
16
20
|
const allWords = [];
|
|
17
21
|
if (rawPrediction["all_words"]) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseField, BaseFieldConstructor } from "
|
|
1
|
+
import { BaseField, BaseFieldConstructor } from "../standard/index.js";
|
|
2
2
|
interface OrientationFieldConstructor extends BaseFieldConstructor {
|
|
3
3
|
pageId: number;
|
|
4
4
|
}
|
|
@@ -6,9 +6,13 @@ interface OrientationFieldConstructor extends BaseFieldConstructor {
|
|
|
6
6
|
* The clockwise rotation to apply (in degrees) to make the image upright.
|
|
7
7
|
*/
|
|
8
8
|
export declare class OrientationField extends BaseField {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Degrees of the rotation.
|
|
11
|
+
*/
|
|
10
12
|
value: number;
|
|
11
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Page id.
|
|
15
|
+
*/
|
|
12
16
|
pageId: number;
|
|
13
17
|
/**
|
|
14
18
|
* @param {OrientationFieldConstructor} constructor Constructor parameters.
|
|
@@ -8,13 +8,21 @@ import { StringDict } from "../../../parsing/stringDict.js";
|
|
|
8
8
|
* @typeParam T an extension of an `Prediction`. Mandatory in order to properly create a page-level prediction.
|
|
9
9
|
*/
|
|
10
10
|
export declare class Page<T extends Prediction> {
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The page's index (identifier).
|
|
13
|
+
*/
|
|
12
14
|
id: number;
|
|
13
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The page's orientation
|
|
17
|
+
*/
|
|
14
18
|
orientation?: OrientationField;
|
|
15
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* A page-level prediction. Can either be specific to pages or identical to the document prediction.
|
|
21
|
+
*/
|
|
16
22
|
prediction: T;
|
|
17
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Potential `Extras` fields sent back along with the prediction.
|
|
25
|
+
*/
|
|
18
26
|
extras?: Extras;
|
|
19
27
|
/**
|
|
20
28
|
* @param predictionType constructor signature for an inference.
|
|
@@ -8,7 +8,9 @@ import { StringDict } from "../../../parsing/stringDict.js";
|
|
|
8
8
|
* @category Synchronous
|
|
9
9
|
*/
|
|
10
10
|
export declare class PredictResponse<T extends Inference> extends ApiResponse {
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* A document prediction response.
|
|
13
|
+
*/
|
|
12
14
|
document: Document<T>;
|
|
13
15
|
/**
|
|
14
16
|
*
|
|
@@ -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[];
|
|
@@ -9,9 +9,13 @@ export interface GeneratedListFieldConstructor {
|
|
|
9
9
|
* A list of values or objects, used in generated APIs.
|
|
10
10
|
*/
|
|
11
11
|
export declare class GeneratedListField {
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Id of the page the object was found on.
|
|
14
|
+
*/
|
|
13
15
|
pageId?: number;
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* List of word values.
|
|
18
|
+
*/
|
|
15
19
|
values: Array<GeneratedObjectField | StringField>;
|
|
16
20
|
constructor({ prediction, pageId, }: GeneratedListFieldConstructor);
|
|
17
21
|
/**
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
|
-
import { BaseFieldConstructor } from "
|
|
3
|
-
/**
|
|
2
|
+
import { BaseFieldConstructor } from "../standard/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* A JSON-like object, with miscellaneous values.
|
|
5
|
+
*/
|
|
4
6
|
export declare class GeneratedObjectField {
|
|
5
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The document page on which the information was found.
|
|
9
|
+
*/
|
|
6
10
|
pageId?: number;
|
|
7
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Confidence with which the value was assessed.
|
|
13
|
+
*/
|
|
8
14
|
confidence?: number;
|
|
9
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Raw unprocessed value, as it was sent by the server.
|
|
17
|
+
*/
|
|
10
18
|
rawValue?: string;
|
|
11
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* List of all printable field names.
|
|
21
|
+
*/
|
|
12
22
|
private printableValues;
|
|
13
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* All potentially present fields.
|
|
25
|
+
*/
|
|
14
26
|
[key: string]: string | number | boolean | object | undefined;
|
|
15
27
|
constructor({ prediction, pageId, }: BaseFieldConstructor);
|
|
16
28
|
private static readonly positionFieldNames;
|
|
@@ -19,7 +31,7 @@ export declare class GeneratedObjectField {
|
|
|
19
31
|
private assignScalarField;
|
|
20
32
|
/**
|
|
21
33
|
* ReSTructured-compliant string representation.
|
|
22
|
-
Takes into account level of indentation & displays elements as list elements.
|
|
34
|
+
* Takes into account level of indentation & displays elements as list elements.
|
|
23
35
|
* @param level Level of indentation. 0 by default.
|
|
24
36
|
*/
|
|
25
37
|
toStringLevel(level?: number): string;
|
|
@@ -29,9 +41,13 @@ export declare class GeneratedObjectField {
|
|
|
29
41
|
* @returns
|
|
30
42
|
*/
|
|
31
43
|
private toNumberString;
|
|
32
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Returns the default string representation.
|
|
46
|
+
*/
|
|
33
47
|
toString(): string;
|
|
34
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Returns a field value by key from this generated object.
|
|
50
|
+
*/
|
|
35
51
|
get(fieldName: string): string | number | boolean | object | undefined;
|
|
36
52
|
}
|
|
37
53
|
/**
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { PositionField } from "
|
|
2
|
-
/**
|
|
1
|
+
import { PositionField } from "../standard/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* A JSON-like object, with miscellaneous values.
|
|
4
|
+
*/
|
|
3
5
|
export class GeneratedObjectField {
|
|
4
6
|
constructor({ prediction = {}, pageId, }) {
|
|
5
7
|
let itemPageId = null;
|
|
@@ -54,7 +56,7 @@ export class GeneratedObjectField {
|
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* ReSTructured-compliant string representation.
|
|
57
|
-
Takes into account level of indentation & displays elements as list elements.
|
|
59
|
+
* Takes into account level of indentation & displays elements as list elements.
|
|
58
60
|
* @param level Level of indentation. 0 by default.
|
|
59
61
|
*/
|
|
60
62
|
toStringLevel(level = 0) {
|
|
@@ -77,11 +79,15 @@ export class GeneratedObjectField {
|
|
|
77
79
|
}
|
|
78
80
|
return n.toString();
|
|
79
81
|
}
|
|
80
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Returns the default string representation.
|
|
84
|
+
*/
|
|
81
85
|
toString() {
|
|
82
86
|
return this.toStringLevel();
|
|
83
87
|
}
|
|
84
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Returns a field value by key from this generated object.
|
|
90
|
+
*/
|
|
85
91
|
get(fieldName) {
|
|
86
92
|
return this[fieldName];
|
|
87
93
|
}
|
|
@@ -94,7 +100,7 @@ GeneratedObjectField.positionFieldNames = new Set([
|
|
|
94
100
|
* @param strDict input dictionary to check.
|
|
95
101
|
*/
|
|
96
102
|
export function isGeneratedObject(strDict) {
|
|
97
|
-
const commonKeys = [
|
|
103
|
+
const commonKeys = new Set([
|
|
98
104
|
"value",
|
|
99
105
|
"polygon",
|
|
100
106
|
"rectangle",
|
|
@@ -103,9 +109,9 @@ export function isGeneratedObject(strDict) {
|
|
|
103
109
|
"quadrangle",
|
|
104
110
|
"values",
|
|
105
111
|
"raw_value",
|
|
106
|
-
];
|
|
112
|
+
]);
|
|
107
113
|
for (const key in strDict) {
|
|
108
|
-
if (Object.prototype.hasOwnProperty.call(strDict, key) && !commonKeys.
|
|
114
|
+
if (Object.prototype.hasOwnProperty.call(strDict, key) && !commonKeys.has(key)) {
|
|
109
115
|
return true;
|
|
110
116
|
}
|
|
111
117
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
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.
|
|
6
6
|
* Note: Has to be initialized through init() before use.
|
|
7
7
|
*/
|
|
8
8
|
export declare class LocalResponse extends BaseLocalResponse {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Loads a local JSON payload into a typed prediction response wrapper.
|
|
11
|
+
*/
|
|
10
12
|
loadPrediction<T extends Inference>(productClass: new (httpResponse: StringDict) => T): Promise<AsyncPredictResponse<T> | PredictResponse<T>>;
|
|
11
13
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
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.
|
|
6
6
|
* Note: Has to be initialized through init() before use.
|
|
7
7
|
*/
|
|
8
8
|
export class LocalResponse extends BaseLocalResponse {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Loads a local JSON payload into a typed prediction response wrapper.
|
|
11
|
+
*/
|
|
10
12
|
async loadPrediction(productClass) {
|
|
11
13
|
/**
|
|
12
14
|
* Load a prediction.
|
|
@@ -5,21 +5,37 @@ import { StringField, FieldConstructor } from "./text.js";
|
|
|
5
5
|
* address string through {@link StringField.value}.
|
|
6
6
|
*/
|
|
7
7
|
export declare class AddressField extends StringField {
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Street number.
|
|
10
|
+
*/
|
|
9
11
|
streetNumber?: string;
|
|
10
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Street name.
|
|
14
|
+
*/
|
|
11
15
|
streetName?: string;
|
|
12
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* PO-box number.
|
|
18
|
+
*/
|
|
13
19
|
poBox?: string;
|
|
14
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Additional address complement.
|
|
22
|
+
*/
|
|
15
23
|
addressComplement?: string;
|
|
16
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* City or locality.
|
|
26
|
+
*/
|
|
17
27
|
city?: string;
|
|
18
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Postal / ZIP code.
|
|
30
|
+
*/
|
|
19
31
|
postalCode?: string;
|
|
20
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* State, province or region.
|
|
34
|
+
*/
|
|
21
35
|
state?: string;
|
|
22
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Country.
|
|
38
|
+
*/
|
|
23
39
|
country?: string;
|
|
24
40
|
constructor({ prediction, valueKey, reconstructed, pageId, }: FieldConstructor);
|
|
25
41
|
}
|
|
@@ -4,7 +4,9 @@ import { BaseFieldConstructor } from "./base.js";
|
|
|
4
4
|
* A field containing an amount value.
|
|
5
5
|
*/
|
|
6
6
|
export declare class AmountField extends Field {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The value.
|
|
9
|
+
*/
|
|
8
10
|
value?: number;
|
|
9
11
|
/**
|
|
10
12
|
* @param {BaseFieldConstructor} constructor Constructor parameters.
|