UNPKG

mindee

Version:

Mindee Client Library for Node.js

25 lines (24 loc) 975 B
import { Inference, Page } from "../../../../v1/parsing/common/index.js"; import { BankCheckV1Document } from "./bankCheckV1Document.js"; import { BankCheckV1Page } from "./bankCheckV1Page.js"; /** * Bank Check API version 1 inference prediction. */ export class BankCheckV1 extends Inference { constructor(rawPrediction) { super(rawPrediction); /** The endpoint's name. */ this.endpointName = "bank_check"; /** The endpoint's version. */ this.endpointVersion = "1"; /** The document's pages. */ this.pages = []; this.prediction = new BankCheckV1Document(rawPrediction["prediction"]); rawPrediction["pages"].forEach((page) => { if (page.prediction !== undefined && page.prediction !== null && Object.keys(page.prediction).length > 0) { this.pages.push(new Page(BankCheckV1Page, page, page["id"], page["orientation"])); } }); } }