mindee 4.24.1 → 4.26.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 +14 -0
- package/package.json +3 -3
- package/src/client.d.ts +4 -0
- package/src/http/httpParams.d.ts +1 -0
- package/src/http/workflowEndpoint.d.ts +1 -1
- package/src/http/workflowEndpoint.js +8 -5
- package/src/product/financialDocument/financialDocumentV1Document.d.ts +3 -1
- package/src/product/financialDocument/financialDocumentV1Document.js +5 -1
- package/src/product/invoice/invoiceV4Document.d.ts +3 -1
- package/src/product/invoice/invoiceV4Document.js +5 -1
- package/src/product/us/healthcareCard/healthcareCardV1Copay.js +3 -3
- package/src/product/us/healthcareCard/healthcareCardV1Document.d.ts +3 -1
- package/src/product/us/healthcareCard/healthcareCardV1Document.js +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v4.26.0 - 2025-04-16
|
|
4
|
+
### Changes
|
|
5
|
+
* :sparkles: add support for rag param in workflow executions
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## v4.25.0 - 2025-04-08
|
|
9
|
+
### Changes
|
|
10
|
+
* :sparkles: add support for Financial Document V1.12
|
|
11
|
+
* :sparkles: add support for Invoices V4.10
|
|
12
|
+
* :sparkles: add support for US Healthcare Cards V1.2
|
|
13
|
+
### Fixes
|
|
14
|
+
* :arrow_up: upgrade mocha dependency
|
|
15
|
+
|
|
16
|
+
|
|
3
17
|
## v4.24.1 - 2025-03-27
|
|
4
18
|
### Fixes
|
|
5
19
|
* :bug: fix null objects being return in extras
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindee",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.26.0",
|
|
4
4
|
"description": "Mindee Client Library for Node.js",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": "bin/mindee.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"homepage": "https://mindee.com/",
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/chai": "^4.3.4",
|
|
44
|
-
"@types/mocha": "^10.0.
|
|
44
|
+
"@types/mocha": "^10.0.10",
|
|
45
45
|
"@types/node": "^18.15.11",
|
|
46
46
|
"@types/tmp": "^0.2.6",
|
|
47
47
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"chai": "^4.3.10",
|
|
50
50
|
"eslint": "^9.15.0",
|
|
51
51
|
"eslint-plugin-jsdoc": "^50.5.0",
|
|
52
|
-
"mocha": "^
|
|
52
|
+
"mocha": "^11.1.0",
|
|
53
53
|
"nock": "^13.5.6",
|
|
54
54
|
"ts-node": "^10.9.2",
|
|
55
55
|
"typedoc": "~0.26.11",
|
package/src/client.d.ts
CHANGED
|
@@ -52,6 +52,10 @@ export interface WorkflowOptions extends BaseOptions {
|
|
|
52
52
|
* A unique, encrypted URL for accessing the document validation interface without requiring authentication.
|
|
53
53
|
*/
|
|
54
54
|
publicUrl?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether to enable Retrieval-Augmented Generation.
|
|
57
|
+
*/
|
|
58
|
+
rag?: boolean;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* Asynchronous polling parameters.
|
package/src/http/httpParams.d.ts
CHANGED
|
@@ -25,5 +25,5 @@ export declare class WorkflowEndpoint extends BaseEndpoint {
|
|
|
25
25
|
* @param fullText
|
|
26
26
|
* @param publicUrl
|
|
27
27
|
*/
|
|
28
|
-
protected sendFileForPrediction(input: InputSource, alias?: string | null, priority?: ExecutionPriority | null, fullText?: boolean, publicUrl?: string | null): Promise<EndpointResponse>;
|
|
28
|
+
protected sendFileForPrediction(input: InputSource, alias?: string | null, priority?: ExecutionPriority | null, fullText?: boolean, publicUrl?: string | null, rag?: boolean | null): Promise<EndpointResponse>;
|
|
29
29
|
}
|
|
@@ -11,9 +11,9 @@ var _WorkflowEndpoint_instances, _WorkflowEndpoint_workflowReqPost;
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.WorkflowEndpoint = void 0;
|
|
13
13
|
const baseEndpoint_1 = require("./baseEndpoint");
|
|
14
|
+
const input_1 = require("../input");
|
|
14
15
|
const url_1 = require("url");
|
|
15
16
|
const form_data_1 = __importDefault(require("form-data"));
|
|
16
|
-
const input_1 = require("../input");
|
|
17
17
|
const responseValidation_1 = require("./responseValidation");
|
|
18
18
|
const error_1 = require("./error");
|
|
19
19
|
/**
|
|
@@ -36,7 +36,7 @@ class WorkflowEndpoint extends baseEndpoint_1.BaseEndpoint {
|
|
|
36
36
|
if (params.pageOptions !== undefined) {
|
|
37
37
|
await super.cutDocPages(params.inputDoc, params.pageOptions);
|
|
38
38
|
}
|
|
39
|
-
const response = await __classPrivateFieldGet(this, _WorkflowEndpoint_instances, "m", _WorkflowEndpoint_workflowReqPost).call(this, params
|
|
39
|
+
const response = await __classPrivateFieldGet(this, _WorkflowEndpoint_instances, "m", _WorkflowEndpoint_workflowReqPost).call(this, params);
|
|
40
40
|
if (!(0, responseValidation_1.isValidSyncResponse)(response)) {
|
|
41
41
|
(0, error_1.handleError)(this.urlRoot, response, response.messageObj?.statusMessage);
|
|
42
42
|
}
|
|
@@ -50,12 +50,15 @@ class WorkflowEndpoint extends baseEndpoint_1.BaseEndpoint {
|
|
|
50
50
|
* @param fullText
|
|
51
51
|
* @param publicUrl
|
|
52
52
|
*/
|
|
53
|
-
sendFileForPrediction(input, alias = null, priority = null, fullText = false, publicUrl = null) {
|
|
53
|
+
sendFileForPrediction(input, alias = null, priority = null, fullText = false, publicUrl = null, rag = null) {
|
|
54
54
|
return new Promise((resolve, reject) => {
|
|
55
55
|
const searchParams = new url_1.URLSearchParams();
|
|
56
56
|
if (fullText) {
|
|
57
57
|
searchParams.append("full_text_ocr", "true");
|
|
58
58
|
}
|
|
59
|
+
if (rag) {
|
|
60
|
+
searchParams.append("rag", "true");
|
|
61
|
+
}
|
|
59
62
|
const form = new form_data_1.default();
|
|
60
63
|
if (input instanceof input_1.LocalInputSource && input.fileObject instanceof Buffer) {
|
|
61
64
|
form.append("document", input.fileObject, {
|
|
@@ -94,6 +97,6 @@ class WorkflowEndpoint extends baseEndpoint_1.BaseEndpoint {
|
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
exports.WorkflowEndpoint = WorkflowEndpoint;
|
|
97
|
-
_WorkflowEndpoint_instances = new WeakSet(), _WorkflowEndpoint_workflowReqPost = function _WorkflowEndpoint_workflowReqPost(
|
|
98
|
-
return this.sendFileForPrediction(
|
|
100
|
+
_WorkflowEndpoint_instances = new WeakSet(), _WorkflowEndpoint_workflowReqPost = function _WorkflowEndpoint_workflowReqPost(params) {
|
|
101
|
+
return this.sendFileForPrediction(params.inputDoc, params.alias, params.priority, params.fullText, params.publicUrl, params.rag);
|
|
99
102
|
};
|
|
@@ -2,7 +2,7 @@ import { Prediction, StringDict } from "../../parsing/common";
|
|
|
2
2
|
import { FinancialDocumentV1LineItem } from "./financialDocumentV1LineItem";
|
|
3
3
|
import { AmountField, ClassificationField, CompanyRegistrationField, DateField, LocaleField, PaymentDetailsField, StringField, Taxes } from "../../parsing/standard";
|
|
4
4
|
/**
|
|
5
|
-
* Financial Document API version 1.
|
|
5
|
+
* Financial Document API version 1.12 document data.
|
|
6
6
|
*/
|
|
7
7
|
export declare class FinancialDocumentV1Document implements Prediction {
|
|
8
8
|
/** The customer's address used for billing. */
|
|
@@ -26,6 +26,8 @@ export declare class FinancialDocumentV1Document implements Prediction {
|
|
|
26
26
|
* is a receipt.
|
|
27
27
|
*/
|
|
28
28
|
documentType: ClassificationField;
|
|
29
|
+
/** Document type extended. */
|
|
30
|
+
documentTypeExtended: ClassificationField;
|
|
29
31
|
/** The date on which the payment is due. */
|
|
30
32
|
dueDate: DateField;
|
|
31
33
|
/** The invoice number or identifier only if document is an invoice. */
|
|
@@ -5,7 +5,7 @@ const common_1 = require("../../parsing/common");
|
|
|
5
5
|
const financialDocumentV1LineItem_1 = require("./financialDocumentV1LineItem");
|
|
6
6
|
const standard_1 = require("../../parsing/standard");
|
|
7
7
|
/**
|
|
8
|
-
* Financial Document API version 1.
|
|
8
|
+
* Financial Document API version 1.12 document data.
|
|
9
9
|
*/
|
|
10
10
|
class FinancialDocumentV1Document {
|
|
11
11
|
constructor(rawPrediction, pageId) {
|
|
@@ -54,6 +54,9 @@ class FinancialDocumentV1Document {
|
|
|
54
54
|
this.documentType = new standard_1.ClassificationField({
|
|
55
55
|
prediction: rawPrediction["document_type"],
|
|
56
56
|
});
|
|
57
|
+
this.documentTypeExtended = new standard_1.ClassificationField({
|
|
58
|
+
prediction: rawPrediction["document_type_extended"],
|
|
59
|
+
});
|
|
57
60
|
this.dueDate = new standard_1.DateField({
|
|
58
61
|
prediction: rawPrediction["due_date"],
|
|
59
62
|
pageId: pageId,
|
|
@@ -195,6 +198,7 @@ class FinancialDocumentV1Document {
|
|
|
195
198
|
:Shipping Address: ${this.shippingAddress}
|
|
196
199
|
:Billing Address: ${this.billingAddress}
|
|
197
200
|
:Document Type: ${this.documentType}
|
|
201
|
+
:Document Type Extended: ${this.documentTypeExtended}
|
|
198
202
|
:Purchase Subcategory: ${this.subcategory}
|
|
199
203
|
:Purchase Category: ${this.category}
|
|
200
204
|
:Total Tax: ${this.totalTax}
|
|
@@ -2,7 +2,7 @@ import { Prediction, StringDict } from "../../parsing/common";
|
|
|
2
2
|
import { InvoiceV4LineItem } from "./invoiceV4LineItem";
|
|
3
3
|
import { AmountField, ClassificationField, CompanyRegistrationField, DateField, LocaleField, PaymentDetailsField, StringField, Taxes } from "../../parsing/standard";
|
|
4
4
|
/**
|
|
5
|
-
* Invoice API version 4.
|
|
5
|
+
* Invoice API version 4.10 document data.
|
|
6
6
|
*/
|
|
7
7
|
export declare class InvoiceV4Document implements Prediction {
|
|
8
8
|
/** The customer billing address. */
|
|
@@ -19,6 +19,8 @@ export declare class InvoiceV4Document implements Prediction {
|
|
|
19
19
|
date: DateField;
|
|
20
20
|
/** Document type: INVOICE or CREDIT NOTE. */
|
|
21
21
|
documentType: ClassificationField;
|
|
22
|
+
/** Document type extended. */
|
|
23
|
+
documentTypeExtended: ClassificationField;
|
|
22
24
|
/** The date on which the payment is due. */
|
|
23
25
|
dueDate: DateField;
|
|
24
26
|
/** The invoice number or identifier. */
|
|
@@ -5,7 +5,7 @@ const common_1 = require("../../parsing/common");
|
|
|
5
5
|
const invoiceV4LineItem_1 = require("./invoiceV4LineItem");
|
|
6
6
|
const standard_1 = require("../../parsing/standard");
|
|
7
7
|
/**
|
|
8
|
-
* Invoice API version 4.
|
|
8
|
+
* Invoice API version 4.10 document data.
|
|
9
9
|
*/
|
|
10
10
|
class InvoiceV4Document {
|
|
11
11
|
constructor(rawPrediction, pageId) {
|
|
@@ -47,6 +47,9 @@ class InvoiceV4Document {
|
|
|
47
47
|
this.documentType = new standard_1.ClassificationField({
|
|
48
48
|
prediction: rawPrediction["document_type"],
|
|
49
49
|
});
|
|
50
|
+
this.documentTypeExtended = new standard_1.ClassificationField({
|
|
51
|
+
prediction: rawPrediction["document_type_extended"],
|
|
52
|
+
});
|
|
50
53
|
this.dueDate = new standard_1.DateField({
|
|
51
54
|
prediction: rawPrediction["due_date"],
|
|
52
55
|
pageId: pageId,
|
|
@@ -172,6 +175,7 @@ class InvoiceV4Document {
|
|
|
172
175
|
:Shipping Address: ${this.shippingAddress}
|
|
173
176
|
:Billing Address: ${this.billingAddress}
|
|
174
177
|
:Document Type: ${this.documentType}
|
|
178
|
+
:Document Type Extended: ${this.documentTypeExtended}
|
|
175
179
|
:Line Items: ${lineItemsSummary}`.trimEnd();
|
|
176
180
|
return (0, common_1.cleanOutString)(outStr);
|
|
177
181
|
}
|
|
@@ -54,7 +54,7 @@ class HealthcareCardV1Copay {
|
|
|
54
54
|
return ("| " +
|
|
55
55
|
printable.serviceFees.padEnd(12) +
|
|
56
56
|
" | " +
|
|
57
|
-
printable.serviceName.padEnd(
|
|
57
|
+
printable.serviceName.padEnd(20) +
|
|
58
58
|
" |");
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -63,9 +63,9 @@ _HealthcareCardV1Copay_instances = new WeakSet(), _HealthcareCardV1Copay_printab
|
|
|
63
63
|
return {
|
|
64
64
|
serviceFees: this.serviceFees !== undefined ? (0, common_1.floatToString)(this.serviceFees) : "",
|
|
65
65
|
serviceName: this.serviceName ?
|
|
66
|
-
this.serviceName.length <=
|
|
66
|
+
this.serviceName.length <= 20 ?
|
|
67
67
|
(0, common_1.cleanSpecialChars)(this.serviceName) :
|
|
68
|
-
(0, common_1.cleanSpecialChars)(this.serviceName).slice(0,
|
|
68
|
+
(0, common_1.cleanSpecialChars)(this.serviceName).slice(0, 17) + "..." :
|
|
69
69
|
"",
|
|
70
70
|
};
|
|
71
71
|
};
|
|
@@ -2,7 +2,7 @@ import { Prediction, StringDict } from "../../../parsing/common";
|
|
|
2
2
|
import { HealthcareCardV1Copay } from "./healthcareCardV1Copay";
|
|
3
3
|
import { DateField, StringField } from "../../../parsing/standard";
|
|
4
4
|
/**
|
|
5
|
-
* Healthcare Card API version 1.
|
|
5
|
+
* Healthcare Card API version 1.2 document data.
|
|
6
6
|
*/
|
|
7
7
|
export declare class HealthcareCardV1Document implements Prediction {
|
|
8
8
|
/** The name of the company that provides the healthcare plan. */
|
|
@@ -27,6 +27,8 @@ export declare class HealthcareCardV1Document implements Prediction {
|
|
|
27
27
|
rxBin: StringField;
|
|
28
28
|
/** The group number for prescription drug coverage. */
|
|
29
29
|
rxGrp: StringField;
|
|
30
|
+
/** The ID number for prescription drug coverage. */
|
|
31
|
+
rxId: StringField;
|
|
30
32
|
/** The PCN number for prescription drug coverage. */
|
|
31
33
|
rxPcn: StringField;
|
|
32
34
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
@@ -5,7 +5,7 @@ const common_1 = require("../../../parsing/common");
|
|
|
5
5
|
const healthcareCardV1Copay_1 = require("./healthcareCardV1Copay");
|
|
6
6
|
const standard_1 = require("../../../parsing/standard");
|
|
7
7
|
/**
|
|
8
|
-
* Healthcare Card API version 1.
|
|
8
|
+
* Healthcare Card API version 1.2 document data.
|
|
9
9
|
*/
|
|
10
10
|
class HealthcareCardV1Document {
|
|
11
11
|
constructor(rawPrediction, pageId) {
|
|
@@ -59,6 +59,10 @@ class HealthcareCardV1Document {
|
|
|
59
59
|
prediction: rawPrediction["rx_grp"],
|
|
60
60
|
pageId: pageId,
|
|
61
61
|
});
|
|
62
|
+
this.rxId = new standard_1.StringField({
|
|
63
|
+
prediction: rawPrediction["rx_id"],
|
|
64
|
+
pageId: pageId,
|
|
65
|
+
});
|
|
62
66
|
this.rxPcn = new standard_1.StringField({
|
|
63
67
|
prediction: rawPrediction["rx_pcn"],
|
|
64
68
|
pageId: pageId,
|
|
@@ -71,10 +75,10 @@ class HealthcareCardV1Document {
|
|
|
71
75
|
const dependents = this.dependents.join("\n ");
|
|
72
76
|
let copaysSummary = "";
|
|
73
77
|
if (this.copays && this.copays.length > 0) {
|
|
74
|
-
const copaysColSizes = [14,
|
|
78
|
+
const copaysColSizes = [14, 22];
|
|
75
79
|
copaysSummary += "\n" + (0, common_1.lineSeparator)(copaysColSizes, "-") + "\n ";
|
|
76
80
|
copaysSummary += "| Service Fees ";
|
|
77
|
-
copaysSummary += "| Service Name
|
|
81
|
+
copaysSummary += "| Service Name ";
|
|
78
82
|
copaysSummary += "|\n" + (0, common_1.lineSeparator)(copaysColSizes, "=");
|
|
79
83
|
copaysSummary += this.copays.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(copaysColSizes, "-")).join("");
|
|
80
84
|
}
|
|
@@ -86,6 +90,7 @@ class HealthcareCardV1Document {
|
|
|
86
90
|
:Group Number: ${this.groupNumber}
|
|
87
91
|
:Payer ID: ${this.payerId}
|
|
88
92
|
:RX BIN: ${this.rxBin}
|
|
93
|
+
:RX ID: ${this.rxId}
|
|
89
94
|
:RX GRP: ${this.rxGrp}
|
|
90
95
|
:RX PCN: ${this.rxPcn}
|
|
91
96
|
:copays: ${copaysSummary}
|