UNPKG

mindee

Version:

Mindee Client Library for Node.js

29 lines (28 loc) 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IdCardV2 = void 0; const common_1 = require("../../../parsing/common"); const idCardV2Document_1 = require("./idCardV2Document"); const idCardV2Page_1 = require("./idCardV2Page"); /** * Carte Nationale d'Identité API version 2 inference prediction. */ class IdCardV2 extends common_1.Inference { constructor(rawPrediction) { super(rawPrediction); /** The endpoint's name. */ this.endpointName = "idcard_fr"; /** The endpoint's version. */ this.endpointVersion = "2"; /** The document's pages. */ this.pages = []; this.prediction = new idCardV2Document_1.IdCardV2Document(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(idCardV2Page_1.IdCardV2Page, page, page["id"], page["orientation"])); } }); } } exports.IdCardV2 = IdCardV2;