mindee 5.4.0 → 5.6.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 +24 -2
- package/package.json +26 -14
- package/src/geometry/bbox.d.ts +5 -0
- package/src/geometry/bbox.js +1 -0
- package/src/geometry/minMax.d.ts +3 -0
- package/src/geometry/polygonUtils.d.ts +23 -0
- package/src/geometry/polygonUtils.js +23 -0
- package/src/http/apiCore.d.ts +1 -0
- package/src/http/apiCore.js +21 -3
- package/src/http/baseSettings.d.ts +5 -0
- package/src/http/baseSettings.js +2 -0
- package/src/image/extractedImage.d.ts +9 -5
- package/src/image/extractedImage.js +2 -2
- package/src/image/extractedImages.d.ts +1 -0
- package/src/image/extractedImages.js +1 -0
- package/src/image/imageCompressor.d.ts +1 -1
- package/src/image/imageExtractor.d.ts +7 -8
- package/src/image/imageExtractor.js +74 -75
- package/src/input/base64Input.d.ts +3 -0
- package/src/input/base64Input.js +3 -0
- package/src/input/bufferInput.d.ts +2 -0
- package/src/input/bufferInput.js +2 -0
- package/src/input/bytesInput.d.ts +3 -0
- package/src/input/bytesInput.js +3 -0
- package/src/input/inputSource.d.ts +15 -0
- package/src/input/inputSource.js +15 -0
- package/src/input/localInputSource.d.ts +6 -0
- package/src/input/localInputSource.js +3 -0
- package/src/input/pathInput.d.ts +4 -0
- package/src/input/pathInput.js +3 -0
- package/src/input/streamInput.d.ts +4 -0
- package/src/input/streamInput.js +4 -0
- package/src/input/urlInput.d.ts +12 -0
- package/src/input/urlInput.js +52 -10
- package/src/logger.js +1 -1
- package/src/parsing/dateParser.d.ts +4 -0
- package/src/parsing/dateParser.js +5 -1
- package/src/parsing/localResponseBase.d.ts +2 -0
- package/src/parsing/localResponseBase.js +2 -0
- package/src/parsing/stringDict.d.ts +1 -0
- package/src/pdf/extractedPdf.d.ts +8 -2
- package/src/pdf/extractedPdf.js +5 -3
- package/src/pdf/extractedPdfs.d.ts +1 -0
- package/src/pdf/extractedPdfs.js +1 -0
- package/src/pdf/pdfCompressor.js +12 -0
- package/src/pdf/pdfExtractor.d.ts +2 -2
- package/src/pdf/pdfExtractor.js +4 -1
- package/src/pdf/pdfOperation.d.ts +3 -0
- package/src/pdf/pdfOperation.js +3 -0
- package/src/pdf/pdfUtils.js +5 -0
- package/src/v1/cli.d.ts +3 -0
- package/src/v1/cli.js +84 -26
- package/src/v1/client.d.ts +16 -16
- package/src/v1/extraction/invoiceSplitterExtractor/extractedInvoiceSplitterImage.d.ts +5 -3
- package/src/v1/extraction/invoiceSplitterExtractor/extractedInvoiceSplitterImage.js +4 -4
- package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.js +14 -0
- package/src/v1/extraction/multiReceiptsExtractor/extractedMultiReceiptImage.d.ts +2 -0
- package/src/v1/extraction/multiReceiptsExtractor/extractedMultiReceiptImage.js +1 -1
- package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.js +3 -0
- package/src/v1/http/apiSettingsV1.d.ts +5 -0
- package/src/v1/http/apiSettingsV1.js +4 -0
- package/src/v1/http/errors.d.ts +7 -1
- package/src/v1/http/errors.js +65 -86
- package/src/v1/http/httpParams.d.ts +12 -0
- package/src/v1/parsing/common/asyncPredictResponse.d.ts +4 -0
- package/src/v1/parsing/common/asyncPredictResponse.js +5 -2
- package/src/v1/parsing/common/executionPriority.d.ts +4 -0
- package/src/v1/parsing/common/executionPriority.js +4 -0
- package/src/v1/parsing/common/extras/cropperExtra.d.ts +2 -0
- package/src/v1/parsing/common/extras/cropperExtra.js +3 -0
- package/src/v1/parsing/common/extras/extras.d.ts +3 -0
- package/src/v1/parsing/common/extras/extras.js +2 -0
- package/src/v1/parsing/common/extras/fullTextOcrExtra.d.ts +3 -0
- package/src/v1/parsing/common/extras/fullTextOcrExtra.js +1 -0
- package/src/v1/parsing/common/extras/ragExtra.d.ts +1 -0
- package/src/v1/parsing/common/extras/ragExtra.js +1 -0
- package/src/v1/parsing/common/feedback/feedbackResponse.js +1 -0
- package/src/v1/parsing/common/index.d.ts +1 -1
- package/src/v1/parsing/common/index.js +1 -1
- package/src/v1/parsing/common/inference.d.ts +2 -0
- package/src/v1/parsing/common/inference.js +2 -0
- package/src/v1/parsing/common/prediction.d.ts +1 -0
- package/src/v1/parsing/common/prediction.js +1 -0
- package/src/v1/parsing/common/summaryHelper.d.ts +12 -1
- package/src/v1/parsing/common/summaryHelper.js +18 -1
- package/src/v1/parsing/generated/generatedObject.d.ts +6 -0
- package/src/v1/parsing/generated/generatedObject.js +38 -27
- package/src/v1/parsing/localResponse.d.ts +1 -0
- package/src/v1/parsing/localResponse.js +1 -0
- package/src/v1/parsing/standard/base.d.ts +6 -0
- package/src/v1/parsing/standard/base.js +1 -0
- package/src/v1/parsing/standard/boolean.d.ts +1 -1
- package/src/v1/parsing/standard/companyRegistration.d.ts +1 -0
- package/src/v1/parsing/standard/companyRegistration.js +1 -0
- package/src/v1/parsing/standard/date.d.ts +1 -0
- package/src/v1/parsing/standard/date.js +1 -0
- package/src/v1/parsing/standard/paymentDetails.d.ts +5 -5
- package/src/v1/parsing/standard/position.d.ts +2 -2
- package/src/v1/parsing/standard/tax.d.ts +1 -0
- package/src/v1/parsing/standard/tax.js +1 -0
- package/src/v1/parsing/standard/text.d.ts +1 -1
- package/src/v1/parsing/standard/word.d.ts +3 -0
- package/src/v1/parsing/standard/word.js +1 -0
- package/src/v1/product/financialDocument/financialDocumentV1LineItem.js +16 -58
- package/src/v1/product/generated/generatedV1Prediction.d.ts +1 -0
- package/src/v1/product/generated/generatedV1Prediction.js +2 -1
- package/src/v1/product/invoice/invoiceV4LineItem.js +5 -16
- package/src/v1/product/receipt/receiptV5LineItem.js +2 -6
- package/src/v1/product/resume/resumeV1Certificate.js +5 -21
- package/src/v1/product/resume/resumeV1Education.js +8 -36
- package/src/v1/product/resume/resumeV1Language.js +3 -11
- package/src/v1/product/resume/resumeV1ProfessionalExperience.js +10 -46
- package/src/v1/product/resume/resumeV1SocialNetworksUrl.js +3 -11
- package/src/v2/cli.d.ts +3 -0
- package/src/v2/cli.js +21 -0
- package/src/v2/client.d.ts +10 -1
- package/src/v2/client.js +18 -8
- package/src/v2/clientOptions/baseParameters.d.ts +3 -2
- package/src/v2/clientOptions/pollingOptions.d.ts +6 -1
- package/src/v2/clientOptions/pollingOptions.js +4 -2
- package/src/v2/fileOperations/crop.js +1 -3
- package/src/v2/fileOperations/split.js +1 -1
- package/src/v2/http/mindeeApiV2.d.ts +23 -10
- package/src/v2/http/mindeeApiV2.js +79 -68
- package/src/v2/parsing/baseResponse.d.ts +2 -0
- package/src/v2/parsing/baseResponse.js +1 -0
- package/src/v2/parsing/error/errorDetails.d.ts +1 -0
- package/src/v2/parsing/index.d.ts +1 -1
- package/src/v2/parsing/index.js +1 -1
- package/src/v2/parsing/inference/baseInference.d.ts +2 -0
- package/src/v2/parsing/inference/baseInference.js +2 -0
- package/src/v2/parsing/inference/failedInferenceResponse.d.ts +33 -0
- package/src/v2/parsing/inference/failedInferenceResponse.js +17 -0
- package/src/v2/parsing/inference/field/baseField.d.ts +3 -0
- package/src/v2/parsing/inference/field/fieldConfidence.d.ts +4 -0
- package/src/v2/parsing/inference/field/fieldConfidence.js +4 -0
- package/src/v2/parsing/inference/field/fieldFactory.d.ts +5 -0
- package/src/v2/parsing/inference/field/fieldFactory.js +5 -0
- package/src/v2/parsing/inference/field/fieldLocation.d.ts +1 -0
- package/src/v2/parsing/inference/field/fieldLocation.js +1 -0
- package/src/v2/parsing/inference/field/inferenceFields.d.ts +5 -0
- package/src/v2/parsing/inference/field/inferenceFields.js +4 -0
- package/src/v2/parsing/inference/field/listField.d.ts +2 -0
- package/src/v2/parsing/inference/field/listField.js +2 -0
- package/src/v2/parsing/inference/field/objectField.d.ts +4 -0
- package/src/v2/parsing/inference/field/objectField.js +3 -0
- package/src/v2/parsing/inference/field/ragMetadata.d.ts +1 -0
- package/src/v2/parsing/inference/field/ragMetadata.js +1 -0
- package/src/v2/parsing/inference/field/rawText.d.ts +2 -0
- package/src/v2/parsing/inference/field/rawText.js +2 -0
- package/src/v2/parsing/inference/field/simpleField.d.ts +2 -0
- package/src/v2/parsing/inference/field/simpleField.js +2 -0
- package/src/v2/parsing/inference/inferenceFile.d.ts +2 -0
- package/src/v2/parsing/inference/inferenceFile.js +2 -0
- package/src/v2/parsing/inference/inferenceModel.d.ts +2 -0
- package/src/v2/parsing/inference/inferenceModel.js +2 -0
- package/src/v2/parsing/job/job.d.ts +1 -1
- package/src/v2/parsing/job/job.js +1 -3
- package/src/v2/parsing/job/jobResponse.d.ts +3 -0
- package/src/v2/parsing/job/jobResponse.js +3 -0
- package/src/v2/parsing/search/index.d.ts +4 -0
- package/src/v2/parsing/search/index.js +4 -0
- package/src/v2/parsing/search/modelWebhook.d.ts +19 -0
- package/src/v2/parsing/search/modelWebhook.js +10 -0
- package/src/v2/parsing/search/paginationMetadata.d.ts +24 -0
- package/src/v2/parsing/search/paginationMetadata.js +19 -0
- package/src/v2/parsing/search/searchModel.d.ts +25 -0
- package/src/v2/parsing/search/searchModel.js +19 -0
- package/src/v2/parsing/search/searchResponse.d.ts +19 -0
- package/src/v2/parsing/search/searchResponse.js +24 -0
- package/src/v2/product/classification/classification.d.ts +3 -0
- package/src/v2/product/classification/classification.js +3 -0
- package/src/v2/product/classification/classificationClassifier.d.ts +2 -0
- package/src/v2/product/classification/classificationClassifier.js +2 -0
- package/src/v2/product/classification/classificationInference.d.ts +2 -0
- package/src/v2/product/classification/classificationInference.js +2 -0
- package/src/v2/product/classification/classificationResponse.d.ts +1 -0
- package/src/v2/product/classification/classificationResponse.js +1 -0
- package/src/v2/product/classification/classificationResult.d.ts +2 -0
- package/src/v2/product/classification/classificationResult.js +2 -0
- package/src/v2/product/crop/crop.d.ts +3 -0
- package/src/v2/product/crop/crop.js +3 -0
- package/src/v2/product/crop/cropInference.d.ts +2 -0
- package/src/v2/product/crop/cropInference.js +2 -0
- package/src/v2/product/crop/cropItem.d.ts +2 -0
- package/src/v2/product/crop/cropItem.js +2 -0
- package/src/v2/product/crop/cropResponse.d.ts +1 -0
- package/src/v2/product/crop/cropResponse.js +1 -0
- package/src/v2/product/crop/cropResult.d.ts +2 -0
- package/src/v2/product/crop/cropResult.js +2 -0
- package/src/v2/product/extraction/dataSchemaActiveOption.d.ts +1 -0
- package/src/v2/product/extraction/dataSchemaActiveOption.js +1 -0
- package/src/v2/product/extraction/extraction.d.ts +3 -0
- package/src/v2/product/extraction/extraction.js +3 -0
- package/src/v2/product/extraction/extractionActiveOptions.d.ts +2 -0
- package/src/v2/product/extraction/extractionActiveOptions.js +2 -0
- package/src/v2/product/extraction/extractionInference.d.ts +2 -0
- package/src/v2/product/extraction/extractionInference.js +2 -0
- package/src/v2/product/extraction/extractionResponse.d.ts +1 -0
- package/src/v2/product/extraction/extractionResponse.js +1 -0
- package/src/v2/product/extraction/extractionResult.d.ts +2 -0
- package/src/v2/product/extraction/extractionResult.js +2 -0
- package/src/v2/product/extraction/params/dataSchema.d.ts +9 -6
- package/src/v2/product/extraction/params/dataSchema.js +2 -0
- package/src/v2/product/extraction/params/dataSchemaField.d.ts +25 -1
- package/src/v2/product/extraction/params/dataSchemaField.js +3 -0
- package/src/v2/product/extraction/params/dataSchemaReplace.d.ts +9 -4
- package/src/v2/product/extraction/params/dataSchemaReplace.js +2 -0
- package/src/v2/product/ocr/ocr.d.ts +3 -0
- package/src/v2/product/ocr/ocr.js +3 -0
- package/src/v2/product/ocr/ocrInference.d.ts +2 -0
- package/src/v2/product/ocr/ocrInference.js +2 -0
- package/src/v2/product/ocr/ocrPage.d.ts +2 -0
- package/src/v2/product/ocr/ocrPage.js +2 -0
- package/src/v2/product/ocr/ocrResponse.d.ts +1 -0
- package/src/v2/product/ocr/ocrResponse.js +1 -0
- package/src/v2/product/ocr/ocrResult.d.ts +1 -0
- package/src/v2/product/ocr/ocrResult.js +1 -0
- package/src/v2/product/ocr/ocrWord.d.ts +2 -0
- package/src/v2/product/ocr/ocrWord.js +2 -0
- package/src/v2/product/split/split.d.ts +3 -0
- package/src/v2/product/split/split.js +3 -0
- package/src/v2/product/split/splitInference.d.ts +2 -0
- package/src/v2/product/split/splitInference.js +2 -0
- package/src/v2/product/split/splitRange.d.ts +1 -0
- package/src/v2/product/split/splitRange.js +1 -0
- package/src/v2/product/split/splitResponse.d.ts +1 -0
- package/src/v2/product/split/splitResponse.js +1 -0
- package/src/v2/product/split/splitResult.d.ts +1 -0
- package/src/v2/product/split/splitResult.js +1 -0
|
@@ -7,9 +7,7 @@ import { JobWebhook } from "./jobWebhook.js";
|
|
|
7
7
|
export class Job {
|
|
8
8
|
constructor(serverResponse) {
|
|
9
9
|
this.id = serverResponse["id"];
|
|
10
|
-
|
|
11
|
-
this.status = serverResponse["status"];
|
|
12
|
-
}
|
|
10
|
+
this.status = serverResponse["status"];
|
|
13
11
|
if (serverResponse["error"]) {
|
|
14
12
|
this.error = new ErrorResponse(serverResponse["error"]);
|
|
15
13
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BaseResponse } from "../../../v2/parsing/baseResponse.js";
|
|
2
2
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
3
3
|
import { Job } from "./job.js";
|
|
4
|
+
/**
|
|
5
|
+
* Job response class.
|
|
6
|
+
*/
|
|
4
7
|
export declare class JobResponse extends BaseResponse {
|
|
5
8
|
/**
|
|
6
9
|
* Job for the polling.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Model webhook info.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ModelWebhook {
|
|
6
|
+
/**
|
|
7
|
+
* ID of the webhook.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Name of the webhook.
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* URL of the webhook.
|
|
16
|
+
*/
|
|
17
|
+
url: string;
|
|
18
|
+
constructor(serverResponse: StringDict);
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* PaginationMetadata data associated with model search.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PaginationMetadata {
|
|
6
|
+
/**
|
|
7
|
+
* Number of items per page.
|
|
8
|
+
*/
|
|
9
|
+
perPage: number;
|
|
10
|
+
/**
|
|
11
|
+
* 1-indexed page number.
|
|
12
|
+
*/
|
|
13
|
+
page: number;
|
|
14
|
+
/**
|
|
15
|
+
* Total items.
|
|
16
|
+
*/
|
|
17
|
+
totalItems: number;
|
|
18
|
+
/**
|
|
19
|
+
* Total number of pages.
|
|
20
|
+
*/
|
|
21
|
+
totalPages: number;
|
|
22
|
+
constructor(serverResponse: StringDict);
|
|
23
|
+
toString(): string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PaginationMetadata data associated with model search.
|
|
3
|
+
*/
|
|
4
|
+
export class PaginationMetadata {
|
|
5
|
+
constructor(serverResponse) {
|
|
6
|
+
this.perPage = serverResponse["per_page"];
|
|
7
|
+
this.page = serverResponse["page"];
|
|
8
|
+
this.totalItems = serverResponse["total_items"];
|
|
9
|
+
this.totalPages = serverResponse["total_pages"];
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return [
|
|
13
|
+
`:Per Page: ${this.perPage}`,
|
|
14
|
+
`:Page: ${this.page}`,
|
|
15
|
+
`:Total Items: ${this.totalItems}`,
|
|
16
|
+
`:Total Pages: ${this.totalPages}`,
|
|
17
|
+
].join("\n");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/index.js";
|
|
2
|
+
import { ModelWebhook } from "./modelWebhook.js";
|
|
3
|
+
/**
|
|
4
|
+
* Models search response.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SearchModel {
|
|
7
|
+
/**
|
|
8
|
+
* ID of the model.
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Name of the model.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Type of the model.
|
|
17
|
+
*/
|
|
18
|
+
modelType: string;
|
|
19
|
+
/**
|
|
20
|
+
* Webhooks associated with the model.
|
|
21
|
+
*/
|
|
22
|
+
webhooks: ModelWebhook[];
|
|
23
|
+
constructor(serverResponse: StringDict);
|
|
24
|
+
toString(): string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ModelWebhook } from "./modelWebhook.js";
|
|
2
|
+
/**
|
|
3
|
+
* Models search response.
|
|
4
|
+
*/
|
|
5
|
+
export class SearchModel {
|
|
6
|
+
constructor(serverResponse) {
|
|
7
|
+
this.id = serverResponse["id"];
|
|
8
|
+
this.name = serverResponse["name"];
|
|
9
|
+
this.modelType = serverResponse["model_type"];
|
|
10
|
+
this.webhooks = (serverResponse["webhooks"] ?? []).map((webhook) => new ModelWebhook(webhook));
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
return [
|
|
14
|
+
`:Name: ${this.name}`,
|
|
15
|
+
`:ID: ${this.id}`,
|
|
16
|
+
`:Model Type: ${this.modelType}`,
|
|
17
|
+
].join("\n");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/index.js";
|
|
2
|
+
import { BaseResponse } from "../../../v2/parsing/baseResponse.js";
|
|
3
|
+
import { PaginationMetadata } from "./paginationMetadata.js";
|
|
4
|
+
import { SearchModel } from "./searchModel.js";
|
|
5
|
+
/**
|
|
6
|
+
* Models search response.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SearchResponse extends BaseResponse {
|
|
9
|
+
/**
|
|
10
|
+
* List of models returned by the search.
|
|
11
|
+
*/
|
|
12
|
+
models: SearchModel[];
|
|
13
|
+
/**
|
|
14
|
+
* Pagination metadata.
|
|
15
|
+
*/
|
|
16
|
+
pagination: PaginationMetadata;
|
|
17
|
+
constructor(serverResponse: StringDict);
|
|
18
|
+
toString(): string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseResponse } from "../../../v2/parsing/baseResponse.js";
|
|
2
|
+
import { PaginationMetadata } from "./paginationMetadata.js";
|
|
3
|
+
import { SearchModel } from "./searchModel.js";
|
|
4
|
+
/**
|
|
5
|
+
* Models search response.
|
|
6
|
+
*/
|
|
7
|
+
export class SearchResponse extends BaseResponse {
|
|
8
|
+
constructor(serverResponse) {
|
|
9
|
+
super(serverResponse);
|
|
10
|
+
this.models = (serverResponse["models"] ?? []).map((model) => new SearchModel(model));
|
|
11
|
+
this.pagination = new PaginationMetadata(serverResponse["pagination"]);
|
|
12
|
+
}
|
|
13
|
+
toString() {
|
|
14
|
+
const lines = ["Models", "#######"];
|
|
15
|
+
for (const model of this.models) {
|
|
16
|
+
lines.push(`* :Name: ${model.name}`);
|
|
17
|
+
lines.push(` :ID: ${model.id}`);
|
|
18
|
+
lines.push(` :Model Type: ${model.modelType}`);
|
|
19
|
+
}
|
|
20
|
+
lines.push("Pagination", "##########");
|
|
21
|
+
lines.push(this.pagination.toString());
|
|
22
|
+
return lines.join("\n");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -5,7 +5,10 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Automatically sort any image or scanned document into categories.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Classification extends BaseProduct {
|
|
8
|
+
/** Parameter class accepted by this product. */
|
|
8
9
|
static get parametersClass(): typeof ClassificationParameters;
|
|
10
|
+
/** Response class returned by this product. */
|
|
9
11
|
static get responseClass(): typeof ClassificationResponse;
|
|
12
|
+
/** API slug for this product. */
|
|
10
13
|
static get slug(): string;
|
|
11
14
|
}
|
|
@@ -5,12 +5,15 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Automatically sort any image or scanned document into categories.
|
|
6
6
|
*/
|
|
7
7
|
export class Classification extends BaseProduct {
|
|
8
|
+
/** Parameter class accepted by this product. */
|
|
8
9
|
static get parametersClass() {
|
|
9
10
|
return ClassificationParameters;
|
|
10
11
|
}
|
|
12
|
+
/** Response class returned by this product. */
|
|
11
13
|
static get responseClass() {
|
|
12
14
|
return ClassificationResponse;
|
|
13
15
|
}
|
|
16
|
+
/** API slug for this product. */
|
|
14
17
|
static get slug() {
|
|
15
18
|
return "classification";
|
|
16
19
|
}
|
|
@@ -3,6 +3,7 @@ import { ExtractionResponse } from "../../../v2/product/index.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Document level classification.
|
|
5
5
|
*/
|
|
6
|
+
/** Classifier output for document-level classification. */
|
|
6
7
|
export declare class ClassificationClassifier {
|
|
7
8
|
/**
|
|
8
9
|
* The document type, as identified on given classification values.
|
|
@@ -13,5 +14,6 @@ export declare class ClassificationClassifier {
|
|
|
13
14
|
*/
|
|
14
15
|
extractionResponse?: ExtractionResponse;
|
|
15
16
|
constructor(serverResponse: StringDict);
|
|
17
|
+
/** Returns a readable classifier summary. */
|
|
16
18
|
toString(): string;
|
|
17
19
|
}
|
|
@@ -2,6 +2,7 @@ import { ExtractionResponse } from "../../../v2/product/index.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Document level classification.
|
|
4
4
|
*/
|
|
5
|
+
/** Classifier output for document-level classification. */
|
|
5
6
|
export class ClassificationClassifier {
|
|
6
7
|
constructor(serverResponse) {
|
|
7
8
|
this.documentType = serverResponse["document_type"];
|
|
@@ -9,6 +10,7 @@ export class ClassificationClassifier {
|
|
|
9
10
|
? new ExtractionResponse(serverResponse["extraction_response"])
|
|
10
11
|
: undefined;
|
|
11
12
|
}
|
|
13
|
+
/** Returns a readable classifier summary. */
|
|
12
14
|
toString() {
|
|
13
15
|
return `Document Type: ${this.documentType}`;
|
|
14
16
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/index.js";
|
|
2
2
|
import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
|
|
3
3
|
import { ClassificationResult } from "./classificationResult.js";
|
|
4
|
+
/** Inference payload for classification responses. */
|
|
4
5
|
export declare class ClassificationInference extends BaseInference {
|
|
5
6
|
/**
|
|
6
7
|
* Result of a classification inference.
|
|
7
8
|
*/
|
|
8
9
|
result: ClassificationResult;
|
|
9
10
|
constructor(serverResponse: StringDict);
|
|
11
|
+
/** Returns a readable representation of the inference. */
|
|
10
12
|
toString(): string;
|
|
11
13
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
|
|
2
2
|
import { ClassificationResult } from "./classificationResult.js";
|
|
3
|
+
/** Inference payload for classification responses. */
|
|
3
4
|
export class ClassificationInference extends BaseInference {
|
|
4
5
|
constructor(serverResponse) {
|
|
5
6
|
super(serverResponse);
|
|
6
7
|
this.result = new ClassificationResult(serverResponse["result"]);
|
|
7
8
|
}
|
|
9
|
+
/** Returns a readable representation of the inference. */
|
|
8
10
|
toString() {
|
|
9
11
|
return (super.toString() +
|
|
10
12
|
this.result.toString() + "\n");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
2
|
import { ClassificationInference } from "./classificationInference.js";
|
|
3
3
|
import { BaseResponse } from "../../../v2/parsing/index.js";
|
|
4
|
+
/** Response wrapper for classification product calls. */
|
|
4
5
|
export declare class ClassificationResponse extends BaseResponse {
|
|
5
6
|
/**
|
|
6
7
|
* The inference result for a classification utility request.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ClassificationInference } from "./classificationInference.js";
|
|
2
2
|
import { BaseResponse } from "../../../v2/parsing/index.js";
|
|
3
|
+
/** Response wrapper for classification product calls. */
|
|
3
4
|
export class ClassificationResponse extends BaseResponse {
|
|
4
5
|
/**
|
|
5
6
|
* @param serverResponse JSON response from the server.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
2
|
import { ClassificationClassifier } from "./classificationClassifier.js";
|
|
3
|
+
/** Classification section of a classification inference result. */
|
|
3
4
|
export declare class ClassificationResult {
|
|
4
5
|
/**
|
|
5
6
|
* Fields contained in the inference.
|
|
6
7
|
*/
|
|
7
8
|
classification: ClassificationClassifier;
|
|
8
9
|
constructor(serverResponse: StringDict);
|
|
10
|
+
/** Returns a readable classification summary. */
|
|
9
11
|
toString(): string;
|
|
10
12
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ClassificationClassifier } from "./classificationClassifier.js";
|
|
2
|
+
/** Classification section of a classification inference result. */
|
|
2
3
|
export class ClassificationResult {
|
|
3
4
|
constructor(serverResponse) {
|
|
4
5
|
this.classification = new ClassificationClassifier(serverResponse["classification"]);
|
|
5
6
|
}
|
|
7
|
+
/** Returns a readable classification summary. */
|
|
6
8
|
toString() {
|
|
7
9
|
return `Classification\n==============\n${this.classification}`;
|
|
8
10
|
}
|
|
@@ -5,7 +5,10 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Identify the borders of documents on each page, matching each one to a category.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Crop extends BaseProduct {
|
|
8
|
+
/** Parameter class accepted by this product. */
|
|
8
9
|
static get parametersClass(): typeof CropParameters;
|
|
10
|
+
/** Response class returned by this product. */
|
|
9
11
|
static get responseClass(): typeof CropResponse;
|
|
12
|
+
/** API slug for this product. */
|
|
10
13
|
static get slug(): string;
|
|
11
14
|
}
|
|
@@ -5,12 +5,15 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Identify the borders of documents on each page, matching each one to a category.
|
|
6
6
|
*/
|
|
7
7
|
export class Crop extends BaseProduct {
|
|
8
|
+
/** Parameter class accepted by this product. */
|
|
8
9
|
static get parametersClass() {
|
|
9
10
|
return CropParameters;
|
|
10
11
|
}
|
|
12
|
+
/** Response class returned by this product. */
|
|
11
13
|
static get responseClass() {
|
|
12
14
|
return CropResponse;
|
|
13
15
|
}
|
|
16
|
+
/** API slug for this product. */
|
|
14
17
|
static get slug() {
|
|
15
18
|
return "crop";
|
|
16
19
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/index.js";
|
|
2
2
|
import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
|
|
3
3
|
import { CropResult } from "../../../v2/product/crop/cropResult.js";
|
|
4
|
+
/** Inference payload for crop responses. */
|
|
4
5
|
export declare class CropInference extends BaseInference {
|
|
5
6
|
/**
|
|
6
7
|
* Result of a crop utility inference.
|
|
7
8
|
*/
|
|
8
9
|
result: CropResult;
|
|
9
10
|
constructor(serverResponse: StringDict);
|
|
11
|
+
/** Returns a readable representation of the inference. */
|
|
10
12
|
toString(): string;
|
|
11
13
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
|
|
2
2
|
import { CropResult } from "../../../v2/product/crop/cropResult.js";
|
|
3
|
+
/** Inference payload for crop responses. */
|
|
3
4
|
export class CropInference extends BaseInference {
|
|
4
5
|
constructor(serverResponse) {
|
|
5
6
|
super(serverResponse);
|
|
6
7
|
this.result = new CropResult(serverResponse["result"]);
|
|
7
8
|
}
|
|
9
|
+
/** Returns a readable representation of the inference. */
|
|
8
10
|
toString() {
|
|
9
11
|
return (super.toString() +
|
|
10
12
|
this.result.toString() + "\n");
|
|
@@ -3,6 +3,7 @@ import { StringDict } from "../../../parsing/index.js";
|
|
|
3
3
|
import { LocalInputSource } from "../../../input/index.js";
|
|
4
4
|
import { ExtractedImage } from "../../../image/index.js";
|
|
5
5
|
import { ExtractionResponse } from "../../../v2/product/index.js";
|
|
6
|
+
/** Single crop detection returned by the crop product. */
|
|
6
7
|
export declare class CropItem {
|
|
7
8
|
/**
|
|
8
9
|
* Type or classification of the detected object.
|
|
@@ -17,6 +18,7 @@ export declare class CropItem {
|
|
|
17
18
|
*/
|
|
18
19
|
extractionResponse?: ExtractionResponse;
|
|
19
20
|
constructor(serverResponse: StringDict);
|
|
21
|
+
/** Returns a readable crop item summary. */
|
|
20
22
|
toString(): string;
|
|
21
23
|
/**
|
|
22
24
|
* Extracts a single crop from an input.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FieldLocation } from "../../../v2/parsing/inference/field/index.js";
|
|
2
2
|
import { extractSingleCrop } from "../../../v2/fileOperations/crop.js";
|
|
3
3
|
import { ExtractionResponse } from "../../../v2/product/index.js";
|
|
4
|
+
/** Single crop detection returned by the crop product. */
|
|
4
5
|
export class CropItem {
|
|
5
6
|
constructor(serverResponse) {
|
|
6
7
|
this.objectType = serverResponse["object_type"];
|
|
@@ -9,6 +10,7 @@ export class CropItem {
|
|
|
9
10
|
? new ExtractionResponse(serverResponse["extraction_response"])
|
|
10
11
|
: undefined;
|
|
11
12
|
}
|
|
13
|
+
/** Returns a readable crop item summary. */
|
|
12
14
|
toString() {
|
|
13
15
|
return `* :Location: ${this.location}\n :Object Type: ${this.objectType}`;
|
|
14
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
2
|
import { BaseResponse } from "../../../v2/parsing/index.js";
|
|
3
3
|
import { CropInference } from "./cropInference.js";
|
|
4
|
+
/** Response wrapper for crop product calls. */
|
|
4
5
|
export declare class CropResponse extends BaseResponse {
|
|
5
6
|
/**
|
|
6
7
|
* Response for a crop utility inference.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseResponse } from "../../../v2/parsing/index.js";
|
|
2
2
|
import { CropInference } from "./cropInference.js";
|
|
3
|
+
/** Response wrapper for crop product calls. */
|
|
3
4
|
export class CropResponse extends BaseResponse {
|
|
4
5
|
/**
|
|
5
6
|
* @param serverResponse JSON response from the server.
|
|
@@ -2,12 +2,14 @@ import { StringDict } from "../../../parsing/stringDict.js";
|
|
|
2
2
|
import { CropItem } from "../../../v2/product/crop/cropItem.js";
|
|
3
3
|
import { LocalInputSource } from "../../../input/index.js";
|
|
4
4
|
import { ExtractedImages } from "../../../image/extractedImages.js";
|
|
5
|
+
/** Crop section of a crop inference result. */
|
|
5
6
|
export declare class CropResult {
|
|
6
7
|
/**
|
|
7
8
|
* Fields contained in the inference.
|
|
8
9
|
*/
|
|
9
10
|
crops: CropItem[];
|
|
10
11
|
constructor(serverResponse: StringDict);
|
|
12
|
+
/** Returns a readable list of detected crops. */
|
|
11
13
|
toString(): string;
|
|
12
14
|
/**
|
|
13
15
|
* Extracts a single crop from an input.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CropItem } from "../../../v2/product/crop/cropItem.js";
|
|
2
2
|
import { extractMultipleCrops } from "../../../v2/fileOperations/crop.js";
|
|
3
|
+
/** Crop section of a crop inference result. */
|
|
3
4
|
export class CropResult {
|
|
4
5
|
constructor(serverResponse) {
|
|
5
6
|
/**
|
|
@@ -8,6 +9,7 @@ export class CropResult {
|
|
|
8
9
|
this.crops = [];
|
|
9
10
|
this.crops = serverResponse["crops"].map((cropItem) => new CropItem(cropItem));
|
|
10
11
|
}
|
|
12
|
+
/** Returns a readable list of detected crops. */
|
|
11
13
|
toString() {
|
|
12
14
|
const crops = this.crops.map(item => item.toString()).join("\n");
|
|
13
15
|
return `Crops\n=====\n${crops}`;
|
|
@@ -5,6 +5,7 @@ export class DataSchemaActiveOption {
|
|
|
5
5
|
constructor(serverResponse) {
|
|
6
6
|
this.replace = serverResponse["replace"];
|
|
7
7
|
}
|
|
8
|
+
/** Returns a readable representation of active data schema options. */
|
|
8
9
|
toString() {
|
|
9
10
|
return `Data Schema\n-----------\n:Replace: ${this.replace ? "True" : "False"}`;
|
|
10
11
|
}
|
|
@@ -5,7 +5,10 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Automatically extract structured data from any image or scanned document.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Extraction extends BaseProduct {
|
|
8
|
+
/** Parameter class accepted by this product. */
|
|
8
9
|
static get parametersClass(): typeof ExtractionParameters;
|
|
10
|
+
/** Response class returned by this product. */
|
|
9
11
|
static get responseClass(): typeof ExtractionResponse;
|
|
12
|
+
/** API slug for this product. */
|
|
10
13
|
static get slug(): string;
|
|
11
14
|
}
|
|
@@ -5,12 +5,15 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Automatically extract structured data from any image or scanned document.
|
|
6
6
|
*/
|
|
7
7
|
export class Extraction extends BaseProduct {
|
|
8
|
+
/** Parameter class accepted by this product. */
|
|
8
9
|
static get parametersClass() {
|
|
9
10
|
return ExtractionParameters;
|
|
10
11
|
}
|
|
12
|
+
/** Response class returned by this product. */
|
|
11
13
|
static get responseClass() {
|
|
12
14
|
return ExtractionResponse;
|
|
13
15
|
}
|
|
16
|
+
/** API slug for this product. */
|
|
14
17
|
static get slug() {
|
|
15
18
|
return "extraction";
|
|
16
19
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
2
2
|
import { DataSchemaActiveOption } from "./dataSchemaActiveOption.js";
|
|
3
|
+
/** Active extraction options echoed by the API. */
|
|
3
4
|
export declare class ExtractionActiveOptions {
|
|
4
5
|
/**
|
|
5
6
|
* Whether the RAG feature was activated.
|
|
@@ -26,5 +27,6 @@ export declare class ExtractionActiveOptions {
|
|
|
26
27
|
*/
|
|
27
28
|
dataSchema: DataSchemaActiveOption;
|
|
28
29
|
constructor(serverResponse: StringDict);
|
|
30
|
+
/** Returns a readable representation of active options. */
|
|
29
31
|
toString(): string;
|
|
30
32
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DataSchemaActiveOption } from "./dataSchemaActiveOption.js";
|
|
2
|
+
/** Active extraction options echoed by the API. */
|
|
2
3
|
export class ExtractionActiveOptions {
|
|
3
4
|
constructor(serverResponse) {
|
|
4
5
|
this.rag = serverResponse["rag"];
|
|
@@ -8,6 +9,7 @@ export class ExtractionActiveOptions {
|
|
|
8
9
|
this.textContext = serverResponse["text_context"];
|
|
9
10
|
this.dataSchema = new DataSchemaActiveOption(serverResponse["data_schema"]);
|
|
10
11
|
}
|
|
12
|
+
/** Returns a readable representation of active options. */
|
|
11
13
|
toString() {
|
|
12
14
|
return "Active Options\n" +
|
|
13
15
|
"==============\n" +
|
|
@@ -2,6 +2,7 @@ import { StringDict } from "../../../parsing/stringDict.js";
|
|
|
2
2
|
import { ExtractionResult } from "./extractionResult.js";
|
|
3
3
|
import { ExtractionActiveOptions } from "./extractionActiveOptions.js";
|
|
4
4
|
import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
|
|
5
|
+
/** Inference payload for extraction responses. */
|
|
5
6
|
export declare class ExtractionInference extends BaseInference {
|
|
6
7
|
/**
|
|
7
8
|
* Result of the inference.
|
|
@@ -12,5 +13,6 @@ export declare class ExtractionInference extends BaseInference {
|
|
|
12
13
|
*/
|
|
13
14
|
activeOptions: ExtractionActiveOptions;
|
|
14
15
|
constructor(serverResponse: StringDict);
|
|
16
|
+
/** Returns a readable representation of the inference. */
|
|
15
17
|
toString(): string;
|
|
16
18
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ExtractionResult } from "./extractionResult.js";
|
|
2
2
|
import { ExtractionActiveOptions } from "./extractionActiveOptions.js";
|
|
3
3
|
import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
|
|
4
|
+
/** Inference payload for extraction responses. */
|
|
4
5
|
export class ExtractionInference extends BaseInference {
|
|
5
6
|
constructor(serverResponse) {
|
|
6
7
|
super(serverResponse);
|
|
7
8
|
this.result = new ExtractionResult(serverResponse["result"]);
|
|
8
9
|
this.activeOptions = new ExtractionActiveOptions(serverResponse["active_options"]);
|
|
9
10
|
}
|
|
11
|
+
/** Returns a readable representation of the inference. */
|
|
10
12
|
toString() {
|
|
11
13
|
return (super.toString() +
|
|
12
14
|
this.activeOptions.toString() + "\n" +
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExtractionInference } from "./extractionInference.js";
|
|
2
2
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
3
3
|
import { BaseResponse } from "../../../v2/parsing/index.js";
|
|
4
|
+
/** Response wrapper for extraction product calls. */
|
|
4
5
|
export declare class ExtractionResponse extends BaseResponse {
|
|
5
6
|
/**
|
|
6
7
|
* The inference result for an extraction request.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExtractionInference } from "./extractionInference.js";
|
|
2
2
|
import { BaseResponse } from "../../../v2/parsing/index.js";
|
|
3
|
+
/** Response wrapper for extraction product calls. */
|
|
3
4
|
export class ExtractionResponse extends BaseResponse {
|
|
4
5
|
/**
|
|
5
6
|
* @param serverResponse JSON response from the server.
|
|
@@ -2,6 +2,7 @@ import { InferenceFields } from "../../../v2/parsing/inference/field/index.js";
|
|
|
2
2
|
import { StringDict } from "../../../parsing/stringDict.js";
|
|
3
3
|
import { RawText } from "../../../v2/parsing/inference/field/rawText.js";
|
|
4
4
|
import { RagMetadata } from "../../../v2/parsing/inference/field/ragMetadata.js";
|
|
5
|
+
/** Extraction result payload containing fields and optional extras. */
|
|
5
6
|
export declare class ExtractionResult {
|
|
6
7
|
/**
|
|
7
8
|
* Fields contained in the inference.
|
|
@@ -16,5 +17,6 @@ export declare class ExtractionResult {
|
|
|
16
17
|
*/
|
|
17
18
|
rag?: RagMetadata;
|
|
18
19
|
constructor(serverResponse: StringDict);
|
|
20
|
+
/** Returns a readable representation of extracted fields. */
|
|
19
21
|
toString(): string;
|
|
20
22
|
}
|