mindee 4.24.1 → 4.25.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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v4.25.0 - 2025-04-08
4
+ ### Changes
5
+ * :sparkles: add support for Financial Document V1.12
6
+ * :sparkles: add support for Invoices V4.10
7
+ * :sparkles: add support for US Healthcare Cards V1.2
8
+ ### Fixes
9
+ * :arrow_up: upgrade mocha dependency
10
+
11
+
3
12
  ## v4.24.1 - 2025-03-27
4
13
  ### Fixes
5
14
  * :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.24.1",
3
+ "version": "4.25.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.9",
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": "^10.8.2",
52
+ "mocha": "^11.1.0",
53
53
  "nock": "^13.5.6",
54
54
  "ts-node": "^10.9.2",
55
55
  "typedoc": "~0.26.11",
@@ -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.11 document data.
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.11 document data.
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.9 document data.
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.9 document data.
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(12) +
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 <= 12 ?
66
+ this.serviceName.length <= 20 ?
67
67
  (0, common_1.cleanSpecialChars)(this.serviceName) :
68
- (0, common_1.cleanSpecialChars)(this.serviceName).slice(0, 9) + "..." :
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.1 document data.
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.1 document data.
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, 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}