UNPKG

mindee

Version:

Mindee Client Library for Node.js

28 lines (27 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InvoiceV4 = void 0; const common_1 = require("../../parsing/common"); const invoiceV4Document_1 = require("./invoiceV4Document"); /** * Invoice API version 4 inference prediction. */ class InvoiceV4 extends common_1.Inference { constructor(rawPrediction) { super(rawPrediction); /** The endpoint's name. */ this.endpointName = "invoices"; /** The endpoint's version. */ this.endpointVersion = "4"; /** The document's pages. */ this.pages = []; this.prediction = new invoiceV4Document_1.InvoiceV4Document(rawPrediction["prediction"]); rawPrediction["pages"].forEach((page) => { if (page.prediction !== undefined && page.prediction !== null && Object.keys(page.prediction).length > 0) { this.pages.push(new common_1.Page(invoiceV4Document_1.InvoiceV4Document, page, page["id"], page["orientation"])); } }); } } exports.InvoiceV4 = InvoiceV4;