Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mindee

Package Overview
Dependencies
Maintainers
6
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mindee - npm Package Compare versions

Comparing version 3.9.0 to 3.10.0

src/documents/fr/bankAccountDetails/bankAccountDetailsV2.d.ts

7

CHANGELOG.md
# CHANGELOG
## v3.10.0 - 2023-07-04
### Changes
* :sparkles: add support for FR Bank Account Details V2
* :recycle: update printing syntax & unit test for Receipt v5
## v3.9.0 - 2023-06-06

@@ -8,2 +14,3 @@ ### Changes

### Fixes

@@ -10,0 +17,0 @@ * :bug: fix typing in PaymentDetails

2

package.json
{
"name": "mindee",
"version": "3.9.0",
"version": "3.10.0",
"description": "Mindee Client Library for Node.js",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -152,12 +152,2 @@ "use strict";

[
"shipping-container",
{
displayName: "Shipping Container",
docClass: _1.ShippingContainerV1,
fullText: false,
async: false,
sync: true,
},
],
[
"mvision",

@@ -164,0 +154,0 @@ {

@@ -157,2 +157,5 @@ "use strict";

]));
this.docConfigs.set([api_1.STANDARD_API_OWNER, documents_1.fr.BankAccountDetailsV2.name], new documentConfig_1.DocumentConfig(documents_1.fr.BankAccountDetailsV2, [
new api_1.StandardEndpoint("bank_account_details", "2", this.apiKey),
]));
this.docConfigs.set([api_1.STANDARD_API_OWNER, documents_1.fr.CarteVitaleV1.name], new documentConfig_1.DocumentConfig(documents_1.fr.CarteVitaleV1, [

@@ -164,5 +167,2 @@ new api_1.StandardEndpoint("carte_vitale", "1", this.apiKey),

]));
this.docConfigs.set([api_1.STANDARD_API_OWNER, documents_1.ShippingContainerV1.name], new documentConfig_1.DocumentConfig(documents_1.ShippingContainerV1, [
new api_1.StandardEndpoint("shipping_containers", "1", this.apiKey),
]));
this.docConfigs.set([api_1.STANDARD_API_OWNER, documents_1.MindeeVisionV1.name], new documentConfig_1.DocumentConfig(documents_1.MindeeVisionV1, [

@@ -169,0 +169,0 @@ new api_1.StandardEndpoint("mindee_vision", "1", this.apiKey),

export { IdCardV1 } from "./idCard/idCardV1";
export { BankAccountDetailsV1 } from "./bankAccountDetails/bankAccountDetailsV1";
export { BankAccountDetailsV2 } from "./bankAccountDetails/bankAccountDetailsV2";
export { CarteVitaleV1 } from "./carteVitale/carteVitaleV1";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CarteVitaleV1 = exports.BankAccountDetailsV1 = exports.IdCardV1 = void 0;
exports.CarteVitaleV1 = exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1 = exports.IdCardV1 = void 0;
var idCardV1_1 = require("./idCard/idCardV1");

@@ -8,3 +8,5 @@ Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return idCardV1_1.IdCardV1; } });

Object.defineProperty(exports, "BankAccountDetailsV1", { enumerable: true, get: function () { return bankAccountDetailsV1_1.BankAccountDetailsV1; } });
var bankAccountDetailsV2_1 = require("./bankAccountDetails/bankAccountDetailsV2");
Object.defineProperty(exports, "BankAccountDetailsV2", { enumerable: true, get: function () { return bankAccountDetailsV2_1.BankAccountDetailsV2; } });
var carteVitaleV1_1 = require("./carteVitale/carteVitaleV1");
Object.defineProperty(exports, "CarteVitaleV1", { enumerable: true, get: function () { return carteVitaleV1_1.CarteVitaleV1; } });

@@ -15,3 +15,2 @@ export { InvoiceV3 } from "./invoice/invoiceV3";

export { ProofOfAddressV1 } from "./proofOfAddress/proofOfAddressV1";
export { ShippingContainerV1 } from "./shippingContainer/shippingContainerV1";
export { Document, DocumentConstructorProps, DocumentSig } from "./document";

@@ -18,0 +17,0 @@ export * as fr from "./fr";

@@ -26,3 +26,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.eu = exports.us = exports.fr = exports.Document = exports.ShippingContainerV1 = exports.ProofOfAddressV1 = exports.MindeeVisionV1 = exports.CropperV1 = exports.getLineItems = exports.CustomV1 = exports.FinancialDocumentV1 = exports.FinancialDocumentV0 = exports.PassportV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ReceiptV3 = exports.PageGroup = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InvoiceV3 = void 0;
exports.eu = exports.us = exports.fr = exports.Document = exports.ProofOfAddressV1 = exports.MindeeVisionV1 = exports.CropperV1 = exports.getLineItems = exports.CustomV1 = exports.FinancialDocumentV1 = exports.FinancialDocumentV0 = exports.PassportV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ReceiptV3 = exports.PageGroup = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InvoiceV3 = void 0;
var invoiceV3_1 = require("./invoice/invoiceV3");

@@ -57,4 +57,2 @@ Object.defineProperty(exports, "InvoiceV3", { enumerable: true, get: function () { return invoiceV3_1.InvoiceV3; } });

Object.defineProperty(exports, "ProofOfAddressV1", { enumerable: true, get: function () { return proofOfAddressV1_1.ProofOfAddressV1; } });
var shippingContainerV1_1 = require("./shippingContainer/shippingContainerV1");
Object.defineProperty(exports, "ShippingContainerV1", { enumerable: true, get: function () { return shippingContainerV1_1.ShippingContainerV1; } });
var document_1 = require("./document");

@@ -61,0 +59,0 @@ Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return document_1.Document; } });

@@ -5,40 +5,40 @@ import { Document, DocumentConstructorProps } from "../document";

/**
* Document data for Receipt, API version 5.
* Document data for Expense Receipt, API version 5.
*/
export declare class ReceiptV5 extends Document {
#private;
/** The locale identifier in BCP 47 (RFC 5646) format: ISO language code, '-', ISO country code. */
locale: Locale;
/** The receipt category among predefined classes. */
/** The purchase category among predefined classes. */
category: ClassificationField;
/** The receipt sub category among predefined classes for transport and food. */
subcategory: ClassificationField;
/** The receipt document type provides the information whether the document is an expense receipt or a credit card receipt. */
documentType: ClassificationField;
/** The date the purchase was made. */
date: DateField;
/** Time of purchase with 24 hours formatting (HH:MM). */
/** One of: 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'. */
documentType: ClassificationField;
/** List of line item details. */
lineItems: ReceiptV5LineItem[];
/** The locale detected on the document. */
locale: Locale;
/** The purchase subcategory among predefined classes for transport and food. */
subcategory: ClassificationField;
/** The address of the supplier or merchant. */
supplierAddress: TextField;
/** List of company registrations associated to the supplier. */
supplierCompanyRegistrations: CompanyRegistration[];
/** The name of the supplier or merchant. */
supplierName: TextField;
/** The phone number of the supplier or merchant. */
supplierPhoneNumber: TextField;
/** List of tax lines information. */
taxes: TaxField[];
/** The time the purchase was made. */
time: TextField;
/** The total amount paid including taxes, discounts, fees, tips, and gratuity. */
/** The total amount of tip and gratuity. */
tip: Amount;
/** The total amount paid: includes taxes, discounts, fees, tips, and gratuity. */
totalAmount: Amount;
/** The total amount excluding taxes. */
/** The net amount paid: does not include taxes, fees, and discounts. */
totalNet: Amount;
/** The total amount of taxes. */
totalTax: Amount;
/** The total amount of tip and gratuity. */
tip: Amount;
/** List of tax lines information including: Amount, tax rate, tax base amount and tax code. */
taxes: TaxField[];
/** The name of the supplier or merchant. */
supplierName: TextField;
/** List of supplier company registrations or identifiers. */
supplierCompanyRegistrations: CompanyRegistration[];
/** The address of the supplier or merchant returned as a single string. */
supplierAddress: TextField;
/** The Phone number of the supplier or merchant returned as a single string. */
supplierPhoneNumber: TextField;
/** Full extraction of lines, including: description, quantity, unit price and total. */
lineItems: ReceiptV5LineItem[];
constructor({ prediction, orientation, extras, inputSource, fullText, pageId, }: DocumentConstructorProps);
toString(): string;
}

@@ -14,3 +14,3 @@ "use strict";

/**
* Document data for Receipt, API version 5.
* Document data for Expense Receipt, API version 5.
*/

@@ -27,14 +27,12 @@ class ReceiptV5 extends document_1.Document {

_ReceiptV5_instances.add(this);
/** List of supplier company registrations or identifiers. */
/** List of line item details. */
this.lineItems = [];
/** List of company registrations associated to the supplier. */
this.supplierCompanyRegistrations = [];
/** Full extraction of lines, including: description, quantity, unit price and total. */
this.lineItems = [];
this.locale = new fields_1.Locale({
prediction: prediction["locale"],
});
this.category = new fields_1.ClassificationField({
prediction: prediction["category"],
});
this.subcategory = new fields_1.ClassificationField({
prediction: prediction["subcategory"],
this.date = new fields_1.DateField({
prediction: prediction["date"],
pageId: pageId,
});

@@ -44,20 +42,31 @@ this.documentType = new fields_1.ClassificationField({

});
this.date = new fields_1.DateField({
prediction: prediction["date"],
prediction["line_items"].map((itemPrediction) => this.lineItems.push(new receiptV5LineItem_1.ReceiptV5LineItem({
prediction: itemPrediction,
pageId: pageId,
})));
this.locale = new fields_1.Locale({
prediction: prediction["locale"],
});
this.time = new fields_1.TextField({
prediction: prediction["time"],
this.subcategory = new fields_1.ClassificationField({
prediction: prediction["subcategory"],
});
this.supplierAddress = new fields_1.TextField({
prediction: prediction["supplier_address"],
pageId: pageId,
});
this.totalAmount = new fields_1.Amount({
prediction: prediction["total_amount"],
prediction["supplier_company_registrations"].map((itemPrediction) => this.supplierCompanyRegistrations.push(new fields_1.CompanyRegistration({
prediction: itemPrediction,
pageId: pageId,
})));
this.supplierName = new fields_1.TextField({
prediction: prediction["supplier_name"],
pageId: pageId,
});
this.totalNet = new fields_1.Amount({
prediction: prediction["total_net"],
this.supplierPhoneNumber = new fields_1.TextField({
prediction: prediction["supplier_phone_number"],
pageId: pageId,
});
this.totalTax = new fields_1.Amount({
prediction: prediction["total_tax"],
this.taxes = new fields_1.Taxes().init(prediction["taxes"], pageId);
this.time = new fields_1.TextField({
prediction: prediction["time"],
pageId: pageId,

@@ -69,28 +78,16 @@ });

});
this.taxes = new fields_1.Taxes().init(prediction["taxes"], pageId);
this.supplierName = new fields_1.TextField({
prediction: prediction["supplier_name"],
this.totalAmount = new fields_1.Amount({
prediction: prediction["total_amount"],
pageId: pageId,
});
prediction["supplier_company_registrations"].map((itemPrediction) => this.supplierCompanyRegistrations.push(new fields_1.CompanyRegistration({
prediction: itemPrediction,
this.totalNet = new fields_1.Amount({
prediction: prediction["total_net"],
pageId: pageId,
})));
this.supplierAddress = new fields_1.TextField({
prediction: prediction["supplier_address"],
pageId: pageId,
});
this.supplierPhoneNumber = new fields_1.TextField({
prediction: prediction["supplier_phone_number"],
this.totalTax = new fields_1.Amount({
prediction: prediction["total_tax"],
pageId: pageId,
});
prediction["line_items"].map((itemPrediction) => this.lineItems.push(new receiptV5LineItem_1.ReceiptV5LineItem({
prediction: itemPrediction,
pageId: pageId,
})));
}
toString() {
const supplierCompanyRegistrations = this.supplierCompanyRegistrations
.map((item) => item.toString())
.join("; ");
const outStr = `Receipt V5 Prediction

@@ -100,4 +97,4 @@ =====================

:Expense Locale: ${this.locale}
:Expense Category: ${this.category}
:Expense Sub Category: ${this.subcategory}
:Purchase Category: ${this.category}
:Purchase Subcategory: ${this.subcategory}
:Document Type: ${this.documentType}

@@ -107,3 +104,3 @@ :Purchase Date: ${this.date}

:Total Amount: ${this.totalAmount}
:Total Excluding Taxes: ${this.totalNet}
:Total Net: ${this.totalNet}
:Total Tax: ${this.totalTax}

@@ -113,3 +110,3 @@ :Tip and Gratuity: ${this.tip}

:Supplier Name: ${this.supplierName}
:Supplier Company Registrations: ${supplierCompanyRegistrations}
:Supplier Company Registrations: ${this.supplierCompanyRegistrations.join(`${" ".repeat(32)}`)}
:Supplier Address: ${this.supplierAddress}

@@ -131,3 +128,3 @@ :Supplier Phone Number: ${this.supplierPhoneNumber}

}, _ReceiptV5_lineItemsToString = function _ReceiptV5_lineItemsToString() {
if (this.lineItems.length === 0) {
if (!this.lineItems || this.lineItems.length === 0) {
return "";

@@ -134,0 +131,0 @@ }

import { StringDict } from "../../fields";
import { Polygon } from "../../geometry";
/**
* Full extraction of lines, including: description, quantity, unit price and total.
* List of line item details.
*/

@@ -6,0 +6,0 @@ export declare class ReceiptV5LineItem {

@@ -12,3 +12,3 @@ "use strict";

/**
* Full extraction of lines, including: description, quantity, unit price and total.
* List of line item details.
*/

@@ -15,0 +15,0 @@ class ReceiptV5LineItem {

import { Field, FieldConstructor } from "./field";
export declare function floatToString(value: number): string;
/**
* A field containing an amount value.
*/
export declare class Amount extends Field {

@@ -4,0 +7,0 @@ /** The value. */

@@ -13,2 +13,5 @@ "use strict";

exports.floatToString = floatToString;
/**
* A field containing an amount value.
*/
class Amount extends field_1.Field {

@@ -15,0 +18,0 @@ /**

@@ -9,2 +9,5 @@ export type StringDict = {

}
/**
* Base class for most fields.
*/
export declare class BaseField {

@@ -11,0 +14,0 @@ /** The value. */

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseField = void 0;
/**
* Base class for most fields.
*/
class BaseField {

@@ -5,0 +8,0 @@ /**

import { BaseField, BaseFieldConstructor } from "./base";
/**
* Represents a classifier value.
*/
export declare class ClassificationField extends BaseField {

@@ -3,0 +6,0 @@ /** The confidence score of the prediction. */

@@ -5,2 +5,5 @@ "use strict";

const base_1 = require("./base");
/**
* Represents a classifier value.
*/
class ClassificationField extends base_1.BaseField {

@@ -7,0 +10,0 @@ constructor({ prediction, valueKey = "value", reconstructed = false, }) {

import { Field, FieldConstructor } from "./field";
/**
* A company registration item.
*/
export declare class CompanyRegistration extends Field {

@@ -3,0 +6,0 @@ /** Registration identifier. */

@@ -5,2 +5,5 @@ "use strict";

const field_1 = require("./field");
/**
* A company registration item.
*/
class CompanyRegistration extends field_1.Field {

@@ -7,0 +10,0 @@ constructor({ prediction, valueKey = "value", reconstructed = false, pageId, }) {

import { Field, FieldConstructor } from "./field";
/**
* A field containing a date value.
*/
export declare class DateField extends Field {

@@ -3,0 +6,0 @@ /** Date string in ISO format. */

@@ -5,2 +5,5 @@ "use strict";

const field_1 = require("./field");
/**
* A field containing a date value.
*/
class DateField extends field_1.Field {

@@ -7,0 +10,0 @@ /**

@@ -9,2 +9,5 @@ import { StringDict, BaseField } from "./base";

}
/**
* A basic field with position and page information.
*/
export declare class Field extends BaseField {

@@ -11,0 +14,0 @@ /**

@@ -6,2 +6,5 @@ "use strict";

const geometry_1 = require("../geometry");
/**
* A basic field with position and page information.
*/
class Field extends base_1.BaseField {

@@ -8,0 +11,0 @@ /**

@@ -12,2 +12,5 @@ import * as geometry from "../geometry";

type Line = Word[];
/**
* OCR extraction from the entire document.
*/
export declare class FullText {

@@ -14,0 +17,0 @@ words: Word[];

@@ -65,2 +65,5 @@ "use strict";

}
/**
* OCR extraction from the entire document.
*/
class FullText {

@@ -67,0 +70,0 @@ constructor() {

import { BaseField, BaseFieldConstructor } from "./base";
/**
* The locale detected on the document.
*/
export declare class Locale extends BaseField {

@@ -3,0 +6,0 @@ /** Locale in ISO format. */

@@ -5,2 +5,5 @@ "use strict";

const base_1 = require("./base");
/**
* The locale detected on the document.
*/
class Locale extends base_1.BaseField {

@@ -7,0 +10,0 @@ /**

@@ -5,2 +5,5 @@ import { BaseField, BaseFieldConstructor } from "./base";

}
/**
* The clockwise rotation to apply (in degrees) to make the image upright.
*/
export declare class OrientationField extends BaseField {

@@ -7,0 +10,0 @@ /** Degrees of the rotation. */

@@ -5,2 +5,5 @@ "use strict";

const base_1 = require("./base");
/**
* The clockwise rotation to apply (in degrees) to make the image upright.
*/
class OrientationField extends base_1.BaseField {

@@ -7,0 +10,0 @@ /**

@@ -13,2 +13,5 @@ import { StringDict } from "./base";

}
/**
* Information on a single payment.
*/
export declare class PaymentDetails extends Field {

@@ -15,0 +18,0 @@ #private;

@@ -11,2 +11,5 @@ "use strict";

const field_1 = require("./field");
/**
* Information on a single payment.
*/
class PaymentDetails extends field_1.Field {

@@ -13,0 +16,0 @@ /**

@@ -8,2 +8,5 @@ import { StringDict } from "./base";

}
/**
* A field indicating a position or area on the document.
*/
export declare class PositionField {

@@ -10,0 +13,0 @@ /** Straight rectangle. */

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PositionField = void 0;
/**
* A field indicating a position or area on the document.
*/
class PositionField {

@@ -5,0 +8,0 @@ constructor({ prediction, pageId }) {

@@ -9,2 +9,5 @@ import { StringDict } from "./base";

}
/**
* A field containing a text value.
*/
export declare class TextField extends Field {

@@ -11,0 +14,0 @@ /** The value. */

@@ -5,2 +5,5 @@ "use strict";

const field_1 = require("./field");
/**
* A field containing a text value.
*/
class TextField extends field_1.Field {

@@ -7,0 +10,0 @@ constructor({ prediction, valueKey = "value", reconstructed = false, pageId, }) {

@@ -1,4 +0,4 @@

export { CustomV1, Document, FinancialDocumentV0, FinancialDocumentV1, InvoiceV3, InvoiceV4, InvoiceSplitterV1, PassportV1, ReceiptV3, ReceiptV4, ReceiptV5, CropperV1, ShippingContainerV1, MindeeVisionV1, ProofOfAddressV1, fr, us, eu, } from "./documents";
export { CustomV1, Document, FinancialDocumentV0, FinancialDocumentV1, InvoiceV3, InvoiceV4, InvoiceSplitterV1, PassportV1, ReceiptV3, ReceiptV4, ReceiptV5, CropperV1, MindeeVisionV1, ProofOfAddressV1, fr, us, eu, } from "./documents";
export { Client, ClientOptions, CustomConfigParams, DocumentClient, PredictOptions, } from "./client";
export { ResponseSig, Response, AsyncPredictResponse } from "./api";
export { InputSource, PageOptionsOperation } from "./inputs";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PageOptionsOperation = exports.InputSource = exports.AsyncPredictResponse = exports.Response = exports.DocumentClient = exports.Client = exports.eu = exports.us = exports.fr = exports.ProofOfAddressV1 = exports.MindeeVisionV1 = exports.ShippingContainerV1 = exports.CropperV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ReceiptV3 = exports.PassportV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InvoiceV3 = exports.FinancialDocumentV1 = exports.FinancialDocumentV0 = exports.Document = exports.CustomV1 = void 0;
exports.PageOptionsOperation = exports.InputSource = exports.AsyncPredictResponse = exports.Response = exports.DocumentClient = exports.Client = exports.eu = exports.us = exports.fr = exports.ProofOfAddressV1 = exports.MindeeVisionV1 = exports.CropperV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ReceiptV3 = exports.PassportV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InvoiceV3 = exports.FinancialDocumentV1 = exports.FinancialDocumentV0 = exports.Document = exports.CustomV1 = void 0;
var documents_1 = require("./documents");

@@ -17,3 +17,2 @@ Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return documents_1.CustomV1; } });

Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return documents_1.CropperV1; } });
Object.defineProperty(exports, "ShippingContainerV1", { enumerable: true, get: function () { return documents_1.ShippingContainerV1; } });
Object.defineProperty(exports, "MindeeVisionV1", { enumerable: true, get: function () { return documents_1.MindeeVisionV1; } });

@@ -20,0 +19,0 @@ Object.defineProperty(exports, "ProofOfAddressV1", { enumerable: true, get: function () { return documents_1.ProofOfAddressV1; } });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc