From 6aec82a6c71dede12a57073d87de8becf1e96ce3 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:14:17 +0100 Subject: [PATCH 01/15] :bug: fix image extractor dropping quality of extracted PDFs --- src/imageOperations/common/imageExtractor.ts | 10 +- tests/data | 2 +- tests/input/sources.spec.ts | 16 +++ ...multiReceiptsReconstruction.integration.ts | 131 ++++++++++++++++++ 4 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 tests/v1/api/multiReceiptsReconstruction.integration.ts diff --git a/src/imageOperations/common/imageExtractor.ts b/src/imageOperations/common/imageExtractor.ts index 013b68b70..82af4015a 100644 --- a/src/imageOperations/common/imageExtractor.ts +++ b/src/imageOperations/common/imageExtractor.ts @@ -12,6 +12,10 @@ export async function extractFromPage( polygons: Polygon[]) { const { width, height } = pdfPage.getSize(); const extractedElements :Uint8Array[] = []; + // Simulacrum of 72=>300 DPI upscale for when the pages are rasterized. + // Fixes issues with the OCR. + const qualityScale = 300/72; + for (const polygon of polygons) { const tempPdf = await PDFDocument.create(); @@ -23,11 +27,11 @@ export async function extractFromPage( top: height - (getMinMaxY(polygon).min * height), bottom: height - (getMinMaxY(polygon).max * height), }); - const samplePage = tempPdf.addPage([newWidth, newHeight]); + const samplePage = tempPdf.addPage([newWidth * qualityScale, newHeight * qualityScale]); samplePage.drawPage(cropped, { - width: newWidth, - height: newHeight, + width: newWidth * qualityScale, + height: newHeight * qualityScale, }); extractedElements.push(await tempPdf.save()); } diff --git a/tests/data b/tests/data index f86f3eaf5..14b89c741 160000 --- a/tests/data +++ b/tests/data @@ -1 +1 @@ -Subproject commit f86f3eaf540f0babeb3d4f1a458d764856a2170b +Subproject commit 14b89c741ed357f6a88c1ac0d203c7ef309e77ef diff --git a/tests/input/sources.spec.ts b/tests/input/sources.spec.ts index 816cd6628..c9801b2d3 100644 --- a/tests/input/sources.spec.ts +++ b/tests/input/sources.spec.ts @@ -102,6 +102,22 @@ describe("Test different types of input", () => { expect(inputSource.fileObject).to.eqls(expectedResult); }); + it("should accept WEBP from a path", async () => { + const inputSource = new PathInput({ + inputPath: path.join(RESOURCE_PATH, "file_types/receipt.webp"), + }); + await inputSource.init(); + const expectedResult = await fs.promises.readFile( + path.join(RESOURCE_PATH, "file_types/receipt.webp") + ); + expect(inputSource.inputType).to.equals(INPUT_TYPE_PATH); + expect(inputSource.filename).to.equals("receipt.webp"); + expect(inputSource.mimeType).to.equals("image/webp"); + expect(inputSource.isPdf()).to.false; + expect(await inputSource.getPageCount()).to.equals(1); + expect(inputSource.fileObject).to.eqls(expectedResult); + }); + it("should accept read streams", async () => { const filePath = path.join(V1_PRODUCT_PATH, "expense_receipts/default_sample.jpg"); const stream = fs.createReadStream(filePath); diff --git a/tests/v1/api/multiReceiptsReconstruction.integration.ts b/tests/v1/api/multiReceiptsReconstruction.integration.ts new file mode 100644 index 000000000..98eecac14 --- /dev/null +++ b/tests/v1/api/multiReceiptsReconstruction.integration.ts @@ -0,0 +1,131 @@ +import { expect } from "chai"; +import * as path from "path"; +import { Client, PathInput } from "../../../src"; +import { MultiReceiptsDetectorV1, ReceiptV5 } from "../../../src/product"; +import { extractReceipts } from "../../../src/imageOperations"; +import { RESOURCE_PATH, V1_PRODUCT_PATH } from "../../index"; +import { LocalInputSource } from "../../../src/input"; +import { setTimeout } from "node:timers/promises"; + +const apiKey = process.env.MINDEE_API_KEY; +let client: Client; +let sourceDoc: LocalInputSource; + +describe("MindeeV1 - A Multi-Receipt Image", () => { + before(async () => { + sourceDoc = new PathInput({ + inputPath: path.join(V1_PRODUCT_PATH, "multi_receipts_detector/default_sample.jpg"), + }); + await sourceDoc.init(); + client = new Client({ apiKey }); + }); + + it("should send to the server and cut properly", async () => { + const multiReceiptResult = await client.parse(MultiReceiptsDetectorV1, sourceDoc); + expect(multiReceiptResult.document?.inference.prediction.receipts.length).to.be.equals(6); + const receipts = await extractReceipts(sourceDoc, multiReceiptResult.document!.inference); + expect(receipts.length).to.be.equals(6); + const extractedReceipts = await extractReceipts(sourceDoc, multiReceiptResult.document!.inference); + expect(extractedReceipts.length).to.be.equals(6); + const receiptsResults = []; + for (const extractedReceipt of extractedReceipts) { + const localInput = extractedReceipt.asSource(); + receiptsResults.push(await client.parse(ReceiptV5, localInput)); + await setTimeout(1000); + } + + expect(receiptsResults[0].document.inference.prediction.lineItems.length).to.be.equals(0); + + expect(receiptsResults[1].document.inference.prediction.lineItems.length).to.be.equals(1); + expect(receiptsResults[1].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(21.5); + + expect(receiptsResults[2].document.inference.prediction.lineItems.length).to.be.equals(2); + expect(receiptsResults[2].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(11.5); + expect(receiptsResults[2].document.inference.prediction.lineItems[1].totalAmount).to.be.equals(2); + + expect(receiptsResults[3].document.inference.prediction.lineItems.length).to.be.equals(1); + expect(receiptsResults[3].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(16.5); + + expect(receiptsResults[4].document.inference.prediction.lineItems.length).to.be.equals(2); + expect(receiptsResults[4].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(10.5); + expect(receiptsResults[4].document.inference.prediction.lineItems[1].totalAmount).to.be.equals(4); + + expect(receiptsResults[5].document.inference.prediction.lineItems.length).to.be.equals(0); + }).timeout(60000); +}); + + +describe("MindeeV1 - A Multi-Receipt Document", () => { + before(async () => { + sourceDoc = new PathInput({ + inputPath: path.join(V1_PRODUCT_PATH, "multi_receipts_detector/multipage_sample.pdf"), + }); + await sourceDoc.init(); + client = new Client({ apiKey }); + }); + + it("should send to the server and cut properly", async () => { + const multiReceiptResult = await client.parse(MultiReceiptsDetectorV1, sourceDoc); + expect(multiReceiptResult.document?.inference.prediction.receipts.length).to.be.equals(5); + const extractedReceipts = await extractReceipts(sourceDoc, multiReceiptResult.document!.inference); + expect(extractedReceipts.length).to.be.equals(5); + const receiptsResults = []; + for (const extractedReceipt of extractedReceipts) { + const localInput = extractedReceipt.asSource(); + receiptsResults.push(await client.parse(ReceiptV5, localInput)); + await setTimeout(1000); + } + expect(receiptsResults[0].document.inference.prediction.lineItems.length).to.be.equals(5); + expect(receiptsResults[0].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(70); + expect(receiptsResults[0].document.inference.prediction.lineItems[1].totalAmount).to.be.equals(12); + expect(receiptsResults[0].document.inference.prediction.lineItems[2].totalAmount).to.be.equals(14); + expect(receiptsResults[0].document.inference.prediction.lineItems[3].totalAmount).to.be.equals(11); + expect(receiptsResults[0].document.inference.prediction.lineItems[4].totalAmount).to.be.equals(5.6); + + expect(receiptsResults[1].document.inference.prediction.lineItems.length).to.be.equals(7); + expect(receiptsResults[1].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(6); + expect(receiptsResults[1].document.inference.prediction.lineItems[1].totalAmount).to.be.equals(11); + expect(receiptsResults[1].document.inference.prediction.lineItems[2].totalAmount).to.be.equals(67.2); + expect(receiptsResults[1].document.inference.prediction.lineItems[3].totalAmount).to.be.equals(19.2); + expect(receiptsResults[1].document.inference.prediction.lineItems[4].totalAmount).to.be.equals(7); + expect(receiptsResults[1].document.inference.prediction.lineItems[5].totalAmount).to.be.equals(5.5); + expect(receiptsResults[1].document.inference.prediction.lineItems[6].totalAmount).to.be.equals(36); + + expect(receiptsResults[2].document.inference.prediction.lineItems.length).to.be.equals(1); + expect(receiptsResults[2].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(275); + + expect(receiptsResults[3].document.inference.prediction.lineItems.length).to.be.equals(2); + expect(receiptsResults[3].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(11.5); + expect(receiptsResults[3].document.inference.prediction.lineItems[1].totalAmount).to.be.equals(2); + + expect(receiptsResults[4].document.inference.prediction.lineItems.length).to.be.equals(1); + expect(receiptsResults[4].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(16.5); + + + }).timeout(60000); +}); + + +describe("MindeeV1 - A Single-Receipt Image", () => { + before(async () => { + sourceDoc = new PathInput({ + inputPath: path.join(V1_PRODUCT_PATH, "expense_receipts/default_sample.jpg"), + }); + await sourceDoc.init(); + client = new Client({ apiKey }); + }); + + it("should send to the server and cut properly", async () => { + const multiReceiptResult = await client.parse(MultiReceiptsDetectorV1, sourceDoc); + expect(multiReceiptResult.document?.inference.prediction.receipts.length).to.be.equals(1); + const receipts = await extractReceipts(sourceDoc, multiReceiptResult.document!.inference); + expect(receipts.length).to.be.equals(1); + const receiptResult = await client.parse(ReceiptV5, receipts[0].asSource()); + expect(receiptResult.document.inference.prediction.lineItems.length).to.be.equals(1); + expect(receiptResult.document.inference.prediction.lineItems[0].totalAmount).to.be.equals(10.2); + receipts[0].saveToFile(path.join(RESOURCE_PATH, "output/debug_taxes.pdf")); + await receipts[0].saveToFileAsync(path.join(RESOURCE_PATH, "output/debug_taxes.jpg")); + expect(receiptResult.document.inference.prediction.taxes.length).to.be.equals(1); + expect(receiptResult.document.inference.prediction.taxes[0].value).to.be.equals(1.7); + }).timeout(60000); +}); From 825e40182ca86cca90c173c9a28f0d324cfa8356 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:18:53 +0100 Subject: [PATCH 02/15] fix test --- tests/v1/api/multiReceiptsReconstruction.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/v1/api/multiReceiptsReconstruction.spec.ts b/tests/v1/api/multiReceiptsReconstruction.spec.ts index db7350777..35cdd6a28 100644 --- a/tests/v1/api/multiReceiptsReconstruction.spec.ts +++ b/tests/v1/api/multiReceiptsReconstruction.spec.ts @@ -47,7 +47,7 @@ describe("MindeeV1 - A Multi-Receipt Document", () => { const jpgStat = await fs.stat(path.join(RESOURCE_PATH, `output/extracted_receipt_${i}.jpg`)); expect(jpgStat.size).to.be.greaterThan(40000); const pngStat = await fs.stat(path.join(RESOURCE_PATH, `output/extracted_receipt_${i}.png`)); - expect(pngStat.size).to.be.greaterThan(300000); + expect(pngStat.size).to.be.greaterThan(290000); i++; } }).timeout(20000); From e4a1c85d75ba3660af115a9b1917033d08d3aec3 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:27:41 +0100 Subject: [PATCH 03/15] bump uscaling to fix other issues --- src/imageOperations/common/imageExtractor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imageOperations/common/imageExtractor.ts b/src/imageOperations/common/imageExtractor.ts index 82af4015a..8a06c12e9 100644 --- a/src/imageOperations/common/imageExtractor.ts +++ b/src/imageOperations/common/imageExtractor.ts @@ -12,9 +12,9 @@ export async function extractFromPage( polygons: Polygon[]) { const { width, height } = pdfPage.getSize(); const extractedElements :Uint8Array[] = []; - // Simulacrum of 72=>300 DPI upscale for when the pages are rasterized. + // Manual upscale. // Fixes issues with the OCR. - const qualityScale = 300/72; + const qualityScale = 5; for (const polygon of polygons) { const tempPdf = await PDFDocument.create(); From e26b8a5b26e828b4028ac9b7da05b59bc41cf0e5 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:39:44 +0100 Subject: [PATCH 04/15] try poppler fix? --- src/imageOperations/common/extractedImage.ts | 5 ++++- src/pdf/pdfCompressor.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/imageOperations/common/extractedImage.ts b/src/imageOperations/common/extractedImage.ts index 175dde35c..6ecb32253 100644 --- a/src/imageOperations/common/extractedImage.ts +++ b/src/imageOperations/common/extractedImage.ts @@ -7,6 +7,7 @@ import { BufferInput } from "../../input"; import { MIMETYPES } from "../../input/sources/localInputSource"; import { Poppler } from "node-poppler"; import { writeFile } from "fs/promises"; +import * as os from "node:os"; /** * Generic class for image extraction @@ -35,7 +36,9 @@ export class ExtractedImage { try { let outputBuffer: Buffer = this.buffer; if (fileExt !== ".pdf") { - const poppler = new Poppler(); + const popplerPath = os.platform() === "linux" ? "/usr/bin" : undefined; + + const poppler = new Poppler(popplerPath); const options: Record = { firstPageToConvert: 1, lastPageToConvert: 1, diff --git a/src/pdf/pdfCompressor.ts b/src/pdf/pdfCompressor.ts index d9dae77a8..3b9e24a7a 100644 --- a/src/pdf/pdfCompressor.ts +++ b/src/pdf/pdfCompressor.ts @@ -5,6 +5,7 @@ import * as fs from "node:fs"; import { Poppler } from "node-poppler"; import { PDFDocument, PDFFont, PDFPage, rgb, StandardFonts } from "@cantoo/pdf-lib"; import { compressImage } from "../imageOperations"; +import * as os from "node:os"; /** * Compresses each page of a provided PDF buffer. @@ -237,7 +238,9 @@ async function getFontFromName(fontName: string): Promise { * @param quality Quality to apply during rasterization. */ async function rasterizePage(pdfData: Buffer, index: number, quality = 85): Promise { - const poppler = new Poppler(); + const popplerPath = os.platform() === "linux" ? "/usr/bin" : undefined; + + const poppler = new Poppler(popplerPath); const tmpPdf = tmp.fileSync(); const tempPdfPath = tmpPdf.name; const antialiasOption: "fast" | "best" | "default" | "good" | "gray" | "none" | "subpixel" = "best"; From ee224a9d7003d326881483f7cb4f65d8f56df270 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:46:28 +0100 Subject: [PATCH 05/15] test other poppler fix --- .github/workflows/_test-integrations.yml | 1 + src/imageOperations/common/extractedImage.ts | 5 +---- src/pdf/pdfCompressor.ts | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/_test-integrations.yml b/.github/workflows/_test-integrations.yml index b4cda7982..71e7303d6 100644 --- a/.github/workflows/_test-integrations.yml +++ b/.github/workflows/_test-integrations.yml @@ -47,4 +47,5 @@ jobs: MINDEE_V2_API_KEY: ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }} MINDEE_V2_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }} MINDEE_V2_SE_TESTS_BLANK_PDF_URL: ${{ secrets.MINDEE_V2_SE_TESTS_BLANK_PDF_URL }} + POPPLER_BIN_PATH: /usr/bin run: npm run test-integration diff --git a/src/imageOperations/common/extractedImage.ts b/src/imageOperations/common/extractedImage.ts index 6ecb32253..175dde35c 100644 --- a/src/imageOperations/common/extractedImage.ts +++ b/src/imageOperations/common/extractedImage.ts @@ -7,7 +7,6 @@ import { BufferInput } from "../../input"; import { MIMETYPES } from "../../input/sources/localInputSource"; import { Poppler } from "node-poppler"; import { writeFile } from "fs/promises"; -import * as os from "node:os"; /** * Generic class for image extraction @@ -36,9 +35,7 @@ export class ExtractedImage { try { let outputBuffer: Buffer = this.buffer; if (fileExt !== ".pdf") { - const popplerPath = os.platform() === "linux" ? "/usr/bin" : undefined; - - const poppler = new Poppler(popplerPath); + const poppler = new Poppler(); const options: Record = { firstPageToConvert: 1, lastPageToConvert: 1, diff --git a/src/pdf/pdfCompressor.ts b/src/pdf/pdfCompressor.ts index 3b9e24a7a..d9dae77a8 100644 --- a/src/pdf/pdfCompressor.ts +++ b/src/pdf/pdfCompressor.ts @@ -5,7 +5,6 @@ import * as fs from "node:fs"; import { Poppler } from "node-poppler"; import { PDFDocument, PDFFont, PDFPage, rgb, StandardFonts } from "@cantoo/pdf-lib"; import { compressImage } from "../imageOperations"; -import * as os from "node:os"; /** * Compresses each page of a provided PDF buffer. @@ -238,9 +237,7 @@ async function getFontFromName(fontName: string): Promise { * @param quality Quality to apply during rasterization. */ async function rasterizePage(pdfData: Buffer, index: number, quality = 85): Promise { - const popplerPath = os.platform() === "linux" ? "/usr/bin" : undefined; - - const poppler = new Poppler(popplerPath); + const poppler = new Poppler(); const tmpPdf = tmp.fileSync(); const tempPdfPath = tmpPdf.name; const antialiasOption: "fast" | "best" | "default" | "good" | "gray" | "none" | "subpixel" = "best"; From ed505c44ac5d4a6e0a0dd459f455374753c77014 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:52:12 +0100 Subject: [PATCH 06/15] whoopsie --- .github/workflows/_test-integrations.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_test-integrations.yml b/.github/workflows/_test-integrations.yml index 71e7303d6..d9c5901e0 100644 --- a/.github/workflows/_test-integrations.yml +++ b/.github/workflows/_test-integrations.yml @@ -34,6 +34,11 @@ jobs: node-version: ${{ matrix.node-version }} cache: "npm" + - name: Set up Poppler on ubuntu + run: | + sudo apt-get update + sudo apt-get install -y poppler-utils + - name: Install Node.js dependencies run: npm ci @@ -47,5 +52,4 @@ jobs: MINDEE_V2_API_KEY: ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }} MINDEE_V2_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }} MINDEE_V2_SE_TESTS_BLANK_PDF_URL: ${{ secrets.MINDEE_V2_SE_TESTS_BLANK_PDF_URL }} - POPPLER_BIN_PATH: /usr/bin run: npm run test-integration From 769e0a1cdc26664e7b8011446c65b7802cbfb6d6 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:00:37 +0100 Subject: [PATCH 07/15] whopsie 2 --- .github/workflows/_test-integrations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/_test-integrations.yml b/.github/workflows/_test-integrations.yml index d9c5901e0..a9faba09d 100644 --- a/.github/workflows/_test-integrations.yml +++ b/.github/workflows/_test-integrations.yml @@ -35,6 +35,7 @@ jobs: cache: "npm" - name: Set up Poppler on ubuntu + if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y poppler-utils From fa92247f0325557102c7106b61602461afbc7857 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:16:30 +0100 Subject: [PATCH 08/15] add another way? --- .github/workflows/_test-integrations.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_test-integrations.yml b/.github/workflows/_test-integrations.yml index a9faba09d..0dfe949d7 100644 --- a/.github/workflows/_test-integrations.yml +++ b/.github/workflows/_test-integrations.yml @@ -34,14 +34,28 @@ jobs: node-version: ${{ matrix.node-version }} cache: "npm" - - name: Set up Poppler on ubuntu + - name: Install Node.js dependencies + run: npm ci + - name: Install Poppler (Linux) if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y poppler-utils - - name: Install Node.js dependencies - run: npm ci + - name: Install Poppler (macOS) + if: runner.os == 'macOS' + run: | + brew update + brew install poppler + + - name: Install Poppler (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + choco install poppler -y --no-progress + # Chocolatey shims are usually already on PATH, but this makes it explicit: + "$env:ChocolateyInstall\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + pdfinfo -v - name: Compilation run: npm run build From e3e494eb47b1f6ea080ba86bbd7a64d78094e233 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:23:34 +0100 Subject: [PATCH 09/15] fix action, downgrade poppler --- .github/workflows/_test-integrations.yml | 16 +- package-lock.json | 632 ++++++++--------------- package.json | 2 +- 3 files changed, 231 insertions(+), 419 deletions(-) diff --git a/.github/workflows/_test-integrations.yml b/.github/workflows/_test-integrations.yml index 0dfe949d7..248518186 100644 --- a/.github/workflows/_test-integrations.yml +++ b/.github/workflows/_test-integrations.yml @@ -53,10 +53,20 @@ jobs: shell: pwsh run: | choco install poppler -y --no-progress - # Chocolatey shims are usually already on PATH, but this makes it explicit: - "$env:ChocolateyInstall\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - pdfinfo -v + $root = Join-Path $env:ChocolateyInstall 'lib\poppler\tools' + $exe = Get-ChildItem $root -Recurse -Filter pdfinfo.exe | Select-Object -First 1 + if (-not $exe) { throw "pdfinfo.exe not found under $root" } + + $bin = Split-Path $exe.FullName + + # Available immediately in this step: + $env:PATH = "$bin;$env:PATH" + + # Available in later steps: + $bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + pdfinfo -v - name: Compilation run: npm run build diff --git a/package-lock.json b/package-lock.json index 853f9dad3..d927b8727 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "commander": "~9.4.1", "file-type": "~16.5.4", "form-data": "~3.0.1", - "node-poppler": "^9.0.1", + "node-poppler": "^7.2.2", "pdf.js-extract": "^0.2.1", "sharp": "^0.33.5", "tmp": "^0.2.3", @@ -43,16 +43,16 @@ } }, "node_modules/@cantoo/pdf-lib": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@cantoo/pdf-lib/-/pdf-lib-2.4.3.tgz", - "integrity": "sha512-RmGblYllpDf0yVwkZTyrqtSLBGm30Bz02ihXNmS9T3fT4oBcpRnOMQU37G0McdseXyhYmOJrP537AE2Xf6a3nQ==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@cantoo/pdf-lib/-/pdf-lib-2.5.3.tgz", + "integrity": "sha512-SBQp8i/XdWNUhLutn5P67Pwj4X9vU046BRpfOMODJZuYVrgChtsTfgdnlW2O7x8gdXs8j7NoTaWI/b78E2oVmQ==", "license": "MIT", "dependencies": { "@pdf-lib/standard-fonts": "^1.0.0", "@pdf-lib/upng": "^1.0.1", "color": "^4.2.3", "crypto-js": "^4.2.0", - "node-html-better-parser": "^1.4.0", + "node-html-better-parser": ">=1.4.0", "pako": "^1.0.11", "tslib": ">=2" } @@ -98,9 +98,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.8.0.tgz", - "integrity": "sha512-MJQFqrZgcW0UNYLGOuQpey/oTN59vyWwplvCGZztn1cKz9agZPPYpJB7h2OMmuu7VLqkvEjN8feFZJmxNF9D+Q==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "license": "MIT", "dependencies": { @@ -117,9 +117,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", "engines": { @@ -127,13 +127,13 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", - "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.6", + "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -166,19 +166,22 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", - "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -189,9 +192,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", "dev": true, "license": "MIT", "dependencies": { @@ -201,7 +204,7 @@ "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, @@ -247,9 +250,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.34.0.tgz", - "integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==", + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", + "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", "dev": true, "license": "MIT", "engines": { @@ -260,9 +263,9 @@ } }, "node_modules/@eslint/object-schema": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -270,13 +273,13 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.15.2", + "@eslint/core": "^0.17.0", "levn": "^0.4.1" }, "engines": { @@ -284,16 +287,16 @@ } }, "node_modules/@gerrit0/mini-shiki": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.12.2.tgz", - "integrity": "sha512-HKZPmO8OSSAAo20H2B3xgJdxZaLTwtlMwxg0967scnrDlPwe6j5+ULGHyIqwgTbFCn9yv/ff8CmfWZLE9YKBzA==", + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.20.0.tgz", + "integrity": "sha512-Wa57i+bMpK6PGJZ1f2myxo3iO+K/kZikcyvH8NIqNNZhQUbDav7V9LQmWOXhf946mz5c1NZ19WMsGYiDKTryzQ==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/engine-oniguruma": "^3.12.2", - "@shikijs/langs": "^3.12.2", - "@shikijs/themes": "^3.12.2", - "@shikijs/types": "^3.12.2", + "@shikijs/engine-oniguruma": "^3.20.0", + "@shikijs/langs": "^3.20.0", + "@shikijs/themes": "^3.20.0", + "@shikijs/types": "^3.20.0", "@shikijs/vscode-textmate": "^10.0.2" } }, @@ -756,44 +759,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@pdf-lib/standard-fonts": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@pdf-lib/standard-fonts/-/standard-fonts-1.0.0.tgz", @@ -824,40 +789,40 @@ } }, "node_modules/@shikijs/engine-oniguruma": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.12.2.tgz", - "integrity": "sha512-hozwnFHsLvujK4/CPVHNo3Bcg2EsnG8krI/ZQ2FlBlCRpPZW4XAEQmEwqegJsypsTAN9ehu2tEYe30lYKSZW/w==", + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.20.0.tgz", + "integrity": "sha512-Yx3gy7xLzM0ZOjqoxciHjA7dAt5tyzJE3L4uQoM83agahy+PlW244XJSrmJRSBvGYELDhYXPacD4R/cauV5bzQ==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "3.12.2", + "@shikijs/types": "3.20.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "node_modules/@shikijs/langs": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.12.2.tgz", - "integrity": "sha512-bVx5PfuZHDSHoBal+KzJZGheFuyH4qwwcwG/n+MsWno5cTlKmaNtTsGzJpHYQ8YPbB5BdEdKU1rga5/6JGY8ww==", + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.20.0.tgz", + "integrity": "sha512-le+bssCxcSHrygCWuOrYJHvjus6zhQ2K7q/0mgjiffRbkhM4o1EWu2m+29l0yEsHDbWaWPNnDUTRVVBvBBeKaA==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "3.12.2" + "@shikijs/types": "3.20.0" } }, "node_modules/@shikijs/themes": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.12.2.tgz", - "integrity": "sha512-fTR3QAgnwYpfGczpIbzPjlRnxyONJOerguQv1iwpyQZ9QXX4qy/XFQqXlf17XTsorxnHoJGbH/LXBvwtqDsF5A==", + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.20.0.tgz", + "integrity": "sha512-U1NSU7Sl26Q7ErRvJUouArxfM2euWqq1xaSrbqMu2iqa+tSp0D1Yah8216sDYbdDHw4C8b75UpE65eWorm2erQ==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "3.12.2" + "@shikijs/types": "3.20.0" } }, "node_modules/@shikijs/types": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.12.2.tgz", - "integrity": "sha512-K5UIBzxCyv0YoxN3LMrKB9zuhp1bV+LgewxuVwHdl4Gz5oePoUFrr9EfgJlGlDeXCU1b/yhdnXeuRvAnz8HN8Q==", + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.20.0.tgz", + "integrity": "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw==", "dev": true, "license": "MIT", "dependencies": { @@ -879,9 +844,9 @@ "license": "MIT" }, "node_modules/@tsconfig/node10": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", - "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", "dev": true, "license": "MIT" }, @@ -945,9 +910,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "18.19.124", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.124.tgz", - "integrity": "sha512-hY4YWZFLs3ku6D2Gqo3RchTd9VRCcrjqp/I0mmohYeUVA5Y8eCXKJEasHxLAJVZRJuQogfd1GiJ9lgogBgKeuQ==", + "version": "18.19.130", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", + "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", "dev": true, "license": "MIT", "dependencies": { @@ -969,18 +934,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.0.tgz", - "integrity": "sha512-hA8gxBq4ukonVXPy0OKhiaUh/68D0E88GSmtC1iAEnGaieuDi38LhS7jdCHRLi6ErJBNDGCzvh5EnzdPwUc0DA==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.50.0.tgz", + "integrity": "sha512-O7QnmOXYKVtPrfYzMolrCTfkezCJS9+ljLdKW/+DCvRsc3UAz+sbH6Xcsv7p30+0OwUbeWfUDAQE0vpabZ3QLg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.46.0", - "@typescript-eslint/type-utils": "8.46.0", - "@typescript-eslint/utils": "8.46.0", - "@typescript-eslint/visitor-keys": "8.46.0", - "graphemer": "^1.4.0", + "@typescript-eslint/scope-manager": "8.50.0", + "@typescript-eslint/type-utils": "8.50.0", + "@typescript-eslint/utils": "8.50.0", + "@typescript-eslint/visitor-keys": "8.50.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" @@ -993,22 +957,22 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.46.0", + "@typescript-eslint/parser": "^8.50.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.46.0.tgz", - "integrity": "sha512-n1H6IcDhmmUEG7TNVSspGmiHHutt7iVKtZwRppD7e04wha5MrkV1h3pti9xQLcCMt6YWsncpoT0HMjkH1FNwWQ==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.50.0.tgz", + "integrity": "sha512-6/cmF2piao+f6wSxUsJLZjck7OQsYyRtcOZS02k7XINSNlz93v6emM8WutDQSXnroG2xwYlEVHJI+cPA7CPM3Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.46.0", - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/typescript-estree": "8.46.0", - "@typescript-eslint/visitor-keys": "8.46.0", + "@typescript-eslint/scope-manager": "8.50.0", + "@typescript-eslint/types": "8.50.0", + "@typescript-eslint/typescript-estree": "8.50.0", + "@typescript-eslint/visitor-keys": "8.50.0", "debug": "^4.3.4" }, "engines": { @@ -1024,14 +988,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.46.0.tgz", - "integrity": "sha512-OEhec0mH+U5Je2NZOeK1AbVCdm0ChyapAyTeXVIYTPXDJ3F07+cu87PPXcGoYqZ7M9YJVvFnfpGg1UmCIqM+QQ==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.50.0.tgz", + "integrity": "sha512-Cg/nQcL1BcoTijEWyx4mkVC56r8dj44bFDvBdygifuS20f3OZCHmFbjF34DPSi07kwlFvqfv/xOLnJ5DquxSGQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.46.0", - "@typescript-eslint/types": "^8.46.0", + "@typescript-eslint/tsconfig-utils": "^8.50.0", + "@typescript-eslint/types": "^8.50.0", "debug": "^4.3.4" }, "engines": { @@ -1046,14 +1010,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.0.tgz", - "integrity": "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.50.0.tgz", + "integrity": "sha512-xCwfuCZjhIqy7+HKxBLrDVT5q/iq7XBVBXLn57RTIIpelLtEIZHXAF/Upa3+gaCpeV1NNS5Z9A+ID6jn50VD4A==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/visitor-keys": "8.46.0" + "@typescript-eslint/types": "8.50.0", + "@typescript-eslint/visitor-keys": "8.50.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1064,9 +1028,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.0.tgz", - "integrity": "sha512-WrYXKGAHY836/N7zoK/kzi6p8tXFhasHh8ocFL9VZSAkvH956gfeRfcnhs3xzRy8qQ/dq3q44v1jvQieMFg2cw==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.50.0.tgz", + "integrity": "sha512-vxd3G/ybKTSlm31MOA96gqvrRGv9RJ7LGtZCn2Vrc5htA0zCDvcMqUkifcjrWNNKXHUU3WCkYOzzVSFBd0wa2w==", "dev": true, "license": "MIT", "engines": { @@ -1081,15 +1045,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.46.0.tgz", - "integrity": "sha512-hy+lvYV1lZpVs2jRaEYvgCblZxUoJiPyCemwbQZ+NGulWkQRy0HRPYAoef/CNSzaLt+MLvMptZsHXHlkEilaeg==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.50.0.tgz", + "integrity": "sha512-7OciHT2lKCewR0mFoBrvZJ4AXTMe/sYOe87289WAViOocEmDjjv8MvIOT2XESuKj9jp8u3SZYUSh89QA4S1kQw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/typescript-estree": "8.46.0", - "@typescript-eslint/utils": "8.46.0", + "@typescript-eslint/types": "8.50.0", + "@typescript-eslint/typescript-estree": "8.50.0", + "@typescript-eslint/utils": "8.50.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -1106,9 +1070,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.0.tgz", - "integrity": "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.50.0.tgz", + "integrity": "sha512-iX1mgmGrXdANhhITbpp2QQM2fGehBse9LbTf0sidWK6yg/NE+uhV5dfU1g6EYPlcReYmkE9QLPq/2irKAmtS9w==", "dev": true, "license": "MIT", "engines": { @@ -1120,21 +1084,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.0.tgz", - "integrity": "sha512-ekDCUfVpAKWJbRfm8T1YRrCot1KFxZn21oV76v5Fj4tr7ELyk84OS+ouvYdcDAwZL89WpEkEj2DKQ+qg//+ucg==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.50.0.tgz", + "integrity": "sha512-W7SVAGBR/IX7zm1t70Yujpbk+zdPq/u4soeFSknWFdXIFuWsBGBOUu/Tn/I6KHSKvSh91OiMuaSnYp3mtPt5IQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.46.0", - "@typescript-eslint/tsconfig-utils": "8.46.0", - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/visitor-keys": "8.46.0", + "@typescript-eslint/project-service": "8.50.0", + "@typescript-eslint/tsconfig-utils": "8.50.0", + "@typescript-eslint/types": "8.50.0", + "@typescript-eslint/visitor-keys": "8.50.0", "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", + "tinyglobby": "^0.2.15", "ts-api-utils": "^2.1.0" }, "engines": { @@ -1149,16 +1112,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.0.tgz", - "integrity": "sha512-nD6yGWPj1xiOm4Gk0k6hLSZz2XkNXhuYmyIrOWcHoPuAhjT9i5bAG+xbWPgFeNR8HPHHtpNKdYUXJl/D3x7f5g==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.50.0.tgz", + "integrity": "sha512-87KgUXET09CRjGCi2Ejxy3PULXna63/bMYv72tCAlDJC3Yqwln0HiFJ3VJMst2+mEtNtZu5oFvX4qJGjKsnAgg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.0", - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/typescript-estree": "8.46.0" + "@typescript-eslint/scope-manager": "8.50.0", + "@typescript-eslint/types": "8.50.0", + "@typescript-eslint/typescript-estree": "8.50.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1173,13 +1136,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.0.tgz", - "integrity": "sha512-FrvMpAK+hTbFy7vH5j1+tMYHMSKLE6RzluFJlkFNKD0p9YsUT75JlBSmr5so3QRzvMwU5/bIEdeNrxm8du8l3Q==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.50.0.tgz", + "integrity": "sha512-Xzmnb58+Db78gT/CCj/PVCvK+zxbnsw6F+O1oheYszJbBSdEjVhQi3C/Xttzxgi/GLmpvOggRs1RFpiJ8+c34Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/types": "8.50.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -1269,9 +1232,9 @@ } }, "node_modules/ansi-regex": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.0.tgz", - "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, "license": "MIT", "engines": { @@ -1374,19 +1337,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -1704,9 +1654,9 @@ "license": "MIT" }, "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "license": "MIT", "dependencies": { @@ -1764,9 +1714,9 @@ } }, "node_modules/detect-libc": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", - "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "license": "Apache-2.0", "engines": { "node": ">=8" @@ -1898,25 +1848,24 @@ } }, "node_modules/eslint": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.34.0.tgz", - "integrity": "sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==", + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz", + "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.1", - "@eslint/core": "^0.15.2", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.34.0", - "@eslint/plugin-kit": "^0.3.5", + "@eslint/js": "9.39.2", + "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", @@ -2162,36 +2111,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.8" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2206,14 +2125,22 @@ "dev": true, "license": "MIT" }, - "node_modules/fastq": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", - "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } } }, "node_modules/file-entry-cache": { @@ -2246,19 +2173,6 @@ "url": "https://github.com/sindresorhus/file-type?sponsor=1" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2465,13 +2379,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "license": "MIT" - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2605,9 +2512,9 @@ } }, "node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", + "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", "license": "MIT" }, "node_modules/is-extglob": { @@ -2643,16 +2550,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -2899,30 +2796,6 @@ "dev": true, "license": "MIT" }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -2971,9 +2844,9 @@ } }, "node_modules/mocha": { - "version": "11.7.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.4.tgz", - "integrity": "sha512-1jYAaY8x0kAZ0XszLWu14pzsf4KV740Gld4HXkhNTXwcHx4AUEDkPzgEHg9CM5dVcW+zv036tjpsEbLraPJj4w==", + "version": "11.7.5", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", + "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", "dev": true, "license": "MIT", "dependencies": { @@ -3053,47 +2926,25 @@ } }, "node_modules/node-html-better-parser": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/node-html-better-parser/-/node-html-better-parser-1.5.3.tgz", - "integrity": "sha512-rvnbT4FUS+pIQPAs3bBpzeuWdgdjne0LsgrEINdsMfAvjAKHTEGVhknMEqBriGuVRWM8iRL1LKhRhZ9RB6gPVA==", + "version": "1.5.8", + "resolved": "https://registry.npmjs.org/node-html-better-parser/-/node-html-better-parser-1.5.8.tgz", + "integrity": "sha512-t/wAKvaTSKco43X+yf9+76RiMt18MtMmzd4wc7rKj+fWav6DV4ajDEKdWlLzSE8USDF5zr/06uGj0Wr/dGAFtw==", "license": "MIT", "dependencies": { "html-entities": "^2.3.2" } }, "node_modules/node-poppler": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/node-poppler/-/node-poppler-9.0.1.tgz", - "integrity": "sha512-lcfk/3cnUABmwpH3pOrjV1zieb+Wyh9hbEeVWTFusWBbVJBuFOBZquR8CuN4xP74eeYljq97O1GXP6TaZI/D3Q==", + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/node-poppler/-/node-poppler-7.2.4.tgz", + "integrity": "sha512-+YvPbEQ2uxsUVBXDIZiUEu0C3wMOo37D+cIqzWu5gZra3p6MHhBFJtZ/2slzj+5QPmWcHd9SAEjXk2ogBSHg9Q==", "license": "MIT", "dependencies": { "camelcase": "^6.3.0", - "semver": "^7.7.2" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/Fdawgs" + "semver": "^7.6.3" }, - "optionalDependencies": { - "node-poppler-win32": "^1.0.1" - } - }, - "node_modules/node-poppler-win32": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/node-poppler-win32/-/node-poppler-win32-1.0.2.tgz", - "integrity": "sha512-U2YVdM7EEXNE21TD4ajJxfd1pKx7yEF2tcuHc4eCa7uxmw+mfSNPB+yHRtNrdxJqV6dKoz4Rvhuyy5rn6mg3ZA==", - "cpu": [ - "x64" - ], - "license": "GPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], "engines": { - "node": ">=20" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/Fdawgs" @@ -3273,13 +3124,13 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -3334,27 +3185,6 @@ "node": ">=6" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3431,41 +3261,6 @@ "node": ">=4" } }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -3487,9 +3282,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -3584,9 +3379,9 @@ } }, "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", + "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", "license": "MIT", "dependencies": { "is-arrayish": "^0.3.1" @@ -3691,9 +3486,9 @@ } }, "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", "dev": true, "license": "MIT", "dependencies": { @@ -3773,6 +3568,23 @@ "node": ">=8" } }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, "node_modules/tmp": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", @@ -3782,19 +3594,6 @@ "node": ">=14.14" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/token-types": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/token-types/-/token-types-4.2.1.tgz", @@ -3909,13 +3708,13 @@ } }, "node_modules/typedoc": { - "version": "0.28.14", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.14.tgz", - "integrity": "sha512-ftJYPvpVfQvFzpkoSfHLkJybdA/geDJ8BGQt/ZnkkhnBYoYW6lBgPQXu6vqLxO4X75dA55hX8Af847H5KXlEFA==", + "version": "0.28.15", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.15.tgz", + "integrity": "sha512-mw2/2vTL7MlT+BVo43lOsufkkd2CJO4zeOSuWQQsiXoV2VuEn7f6IZp2jsUDPmBMABpgR0R5jlcJ2OGEFYmkyg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@gerrit0/mini-shiki": "^3.12.0", + "@gerrit0/mini-shiki": "^3.17.0", "lunr": "^2.3.9", "markdown-it": "^14.1.0", "minimatch": "^9.0.5", @@ -3933,9 +3732,9 @@ } }, "node_modules/typescript": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", - "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -4013,9 +3812,9 @@ } }, "node_modules/workerpool": { - "version": "9.3.3", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.3.tgz", - "integrity": "sha512-slxCaKbYjEdFT/o2rH9xS1hf4uRDch1w7Uo+apxhZ+sf/1d9e0ZVkn42kPNGP2dgjIx6YFvSevj0zHvbWe2jdw==", + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", "dev": true, "license": "Apache-2.0" }, @@ -4102,9 +3901,9 @@ } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, "license": "MIT", "engines": { @@ -4125,9 +3924,9 @@ } }, "node_modules/yaml": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", - "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", "dev": true, "license": "ISC", "bin": { @@ -4135,6 +3934,9 @@ }, "engines": { "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" } }, "node_modules/yargs": { diff --git a/package.json b/package.json index 1a81b8aa7..903f1dd32 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "commander": "~9.4.1", "file-type": "~16.5.4", "form-data": "~3.0.1", - "node-poppler": "^9.0.1", + "node-poppler": "^7.2.2", "pdf.js-extract": "^0.2.1", "sharp": "^0.33.5", "tmp": "^0.2.3", From 2628d5dd0d164ab8dbcd894babf38789032950a9 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:31:31 +0100 Subject: [PATCH 10/15] more slop --- .github/workflows/_test-integrations.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/_test-integrations.yml b/.github/workflows/_test-integrations.yml index 248518186..08e14d5d4 100644 --- a/.github/workflows/_test-integrations.yml +++ b/.github/workflows/_test-integrations.yml @@ -47,26 +47,30 @@ jobs: run: | brew update brew install poppler - - name: Install Poppler (Windows) if: runner.os == 'Windows' shell: pwsh run: | - choco install poppler -y --no-progress + $headers = @{ "User-Agent" = "github-actions" } + $rel = Invoke-RestMethod -Headers $headers https://api.github.com/repos/oschwartz10612/poppler-windows/releases/latest + $asset = $rel.assets | Where-Object { $_.name -like "Release-*.zip" } | Select-Object -First 1 + if (-not $asset) { throw "No Release-*.zip asset found in latest poppler-windows release." } - $root = Join-Path $env:ChocolateyInstall 'lib\poppler\tools' - $exe = Get-ChildItem $root -Recurse -Filter pdfinfo.exe | Select-Object -First 1 - if (-not $exe) { throw "pdfinfo.exe not found under $root" } + $zip = Join-Path $env:RUNNER_TEMP $asset.name + Invoke-WebRequest -Headers $headers $asset.browser_download_url -OutFile $zip - $bin = Split-Path $exe.FullName + $dest = Join-Path $env:RUNNER_TEMP "poppler" + Expand-Archive -Path $zip -DestinationPath $dest -Force - # Available immediately in this step: - $env:PATH = "$bin;$env:PATH" + $exe = Get-ChildItem $dest -Recurse -Filter pdfinfo.exe | Select-Object -First 1 + if (-not $exe) { throw "pdfinfo.exe not found after extraction." } - # Available in later steps: - $bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $bin = $exe.Directory.FullName + $env:PATH = "$bin;$env:PATH" # for this step + $bin | Out-File $env:GITHUB_PATH -Encoding utf8 -Append # for later steps pdfinfo -v + - name: Compilation run: npm run build From 2cc9cf304d68027bd797449dcc18252e3804d22a Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:39:13 +0100 Subject: [PATCH 11/15] disable expect in test --- .github/workflows/_test-integrations.yml | 1 + src/imageOperations/common/imageExtractor.ts | 2 +- tests/v1/api/multiReceiptsReconstruction.integration.ts | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_test-integrations.yml b/.github/workflows/_test-integrations.yml index 08e14d5d4..968ad15d3 100644 --- a/.github/workflows/_test-integrations.yml +++ b/.github/workflows/_test-integrations.yml @@ -47,6 +47,7 @@ jobs: run: | brew update brew install poppler + - name: Install Poppler (Windows) if: runner.os == 'Windows' shell: pwsh diff --git a/src/imageOperations/common/imageExtractor.ts b/src/imageOperations/common/imageExtractor.ts index 8a06c12e9..fb706be46 100644 --- a/src/imageOperations/common/imageExtractor.ts +++ b/src/imageOperations/common/imageExtractor.ts @@ -14,7 +14,7 @@ export async function extractFromPage( const extractedElements :Uint8Array[] = []; // Manual upscale. // Fixes issues with the OCR. - const qualityScale = 5; + const qualityScale = 300/72; for (const polygon of polygons) { const tempPdf = await PDFDocument.create(); diff --git a/tests/v1/api/multiReceiptsReconstruction.integration.ts b/tests/v1/api/multiReceiptsReconstruction.integration.ts index 98eecac14..d9042c1b2 100644 --- a/tests/v1/api/multiReceiptsReconstruction.integration.ts +++ b/tests/v1/api/multiReceiptsReconstruction.integration.ts @@ -36,8 +36,9 @@ describe("MindeeV1 - A Multi-Receipt Image", () => { expect(receiptsResults[0].document.inference.prediction.lineItems.length).to.be.equals(0); - expect(receiptsResults[1].document.inference.prediction.lineItems.length).to.be.equals(1); - expect(receiptsResults[1].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(21.5); + // NOTE: disabled because flaky? + // expect(receiptsResults[1].document.inference.prediction.lineItems.length).to.be.equals(1); + // expect(receiptsResults[1].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(21.5); expect(receiptsResults[2].document.inference.prediction.lineItems.length).to.be.equals(2); expect(receiptsResults[2].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(11.5); From 8f52ce52ec89e8f6c6019ea9842e838a86a7f44f Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Tue, 16 Dec 2025 10:33:50 +0100 Subject: [PATCH 12/15] fix transparency --- package.json | 2 +- src/imageOperations/common/imageExtractor.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 903f1dd32..a9ae48f5f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "CHANGELOG.md" ], "engines": { - "node": ">= 16" + "node": ">= 18" }, "repository": { "type": "git", diff --git a/src/imageOperations/common/imageExtractor.ts b/src/imageOperations/common/imageExtractor.ts index fb706be46..838f611ac 100644 --- a/src/imageOperations/common/imageExtractor.ts +++ b/src/imageOperations/common/imageExtractor.ts @@ -1,4 +1,4 @@ -import { PDFDocument, PDFPage } from "@cantoo/pdf-lib"; +import { PDFDocument, PDFPage, rgb } from "@cantoo/pdf-lib"; import { getMinMaxX, getMinMaxY, Polygon } from "../../geometry"; /** @@ -28,6 +28,15 @@ export async function extractFromPage( bottom: height - (getMinMaxY(polygon).max * height), }); const samplePage = tempPdf.addPage([newWidth * qualityScale, newHeight * qualityScale]); + + samplePage.drawRectangle({ + x: 0, + y: 0, + width: newWidth * qualityScale, + height: newHeight * qualityScale, + color: rgb(1, 1, 1), + }); + samplePage.drawPage(cropped, { width: newWidth * qualityScale, From 00bd3d9bc510545ddbf2dc50415b36febbd7ba84 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:12:30 +0100 Subject: [PATCH 13/15] add small padding around crop zone? --- src/imageOperations/common/imageExtractor.ts | 22 ++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/imageOperations/common/imageExtractor.ts b/src/imageOperations/common/imageExtractor.ts index 838f611ac..779b0bfe4 100644 --- a/src/imageOperations/common/imageExtractor.ts +++ b/src/imageOperations/common/imageExtractor.ts @@ -15,17 +15,27 @@ export async function extractFromPage( // Manual upscale. // Fixes issues with the OCR. const qualityScale = 300/72; + const padding = 0.02; for (const polygon of polygons) { const tempPdf = await PDFDocument.create(); - const newWidth = width * (getMinMaxX(polygon).max - getMinMaxX(polygon).min); - const newHeight = height * (getMinMaxY(polygon).max - getMinMaxY(polygon).min); + const xLimits = getMinMaxX(polygon); + const yLimits = getMinMaxY(polygon); + + const minX = Math.max(0, xLimits.min - padding); + const maxX = Math.min(1, xLimits.max + padding); + const minY = Math.max(0, yLimits.min - padding); + const maxY = Math.min(1, yLimits.max + padding); + + const newWidth = width * (maxX - minX); + const newHeight = height * (maxY - minY); + const cropped = await tempPdf.embedPage(pdfPage, { - left: getMinMaxX(polygon).min * width, - right: getMinMaxX(polygon).max * width, - top: height - (getMinMaxY(polygon).min * height), - bottom: height - (getMinMaxY(polygon).max * height), + left: minX * width, + right: maxX * width, + top: height - (minY * height), + bottom: height - (maxY * height), }); const samplePage = tempPdf.addPage([newWidth * qualityScale, newHeight * qualityScale]); From 42dc05481c0b90c66d87123397c36837c599950f Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:19:01 +0100 Subject: [PATCH 14/15] remove bloat? --- src/imageOperations/common/imageExtractor.ts | 25 ++++++-------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/imageOperations/common/imageExtractor.ts b/src/imageOperations/common/imageExtractor.ts index 779b0bfe4..7ad77bfa9 100644 --- a/src/imageOperations/common/imageExtractor.ts +++ b/src/imageOperations/common/imageExtractor.ts @@ -14,28 +14,18 @@ export async function extractFromPage( const extractedElements :Uint8Array[] = []; // Manual upscale. // Fixes issues with the OCR. - const qualityScale = 300/72; - const padding = 0.02; + const qualityScale = 5; for (const polygon of polygons) { const tempPdf = await PDFDocument.create(); - const xLimits = getMinMaxX(polygon); - const yLimits = getMinMaxY(polygon); - - const minX = Math.max(0, xLimits.min - padding); - const maxX = Math.min(1, xLimits.max + padding); - const minY = Math.max(0, yLimits.min - padding); - const maxY = Math.min(1, yLimits.max + padding); - - const newWidth = width * (maxX - minX); - const newHeight = height * (maxY - minY); - + const newWidth = width * (getMinMaxX(polygon).max - getMinMaxX(polygon).min); + const newHeight = height * (getMinMaxY(polygon).max - getMinMaxY(polygon).min); const cropped = await tempPdf.embedPage(pdfPage, { - left: minX * width, - right: maxX * width, - top: height - (minY * height), - bottom: height - (maxY * height), + left: getMinMaxX(polygon).min * width, + right: getMinMaxX(polygon).max * width, + top: height - (getMinMaxY(polygon).min * height), + bottom: height - (getMinMaxY(polygon).max * height), }); const samplePage = tempPdf.addPage([newWidth * qualityScale, newHeight * qualityScale]); @@ -44,7 +34,6 @@ export async function extractFromPage( y: 0, width: newWidth * qualityScale, height: newHeight * qualityScale, - color: rgb(1, 1, 1), }); samplePage.drawPage(cropped, From 95cb3ea5ab4d4ec62258f07723ec3452ded2a6c8 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:36:59 +0100 Subject: [PATCH 15/15] fix test? --- src/imageOperations/common/imageExtractor.ts | 4 ++-- .../v1/api/multiReceiptsReconstruction.integration.ts | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/imageOperations/common/imageExtractor.ts b/src/imageOperations/common/imageExtractor.ts index 7ad77bfa9..c47e5d539 100644 --- a/src/imageOperations/common/imageExtractor.ts +++ b/src/imageOperations/common/imageExtractor.ts @@ -1,4 +1,4 @@ -import { PDFDocument, PDFPage, rgb } from "@cantoo/pdf-lib"; +import { PDFDocument, PDFPage } from "@cantoo/pdf-lib"; import { getMinMaxX, getMinMaxY, Polygon } from "../../geometry"; /** @@ -14,7 +14,7 @@ export async function extractFromPage( const extractedElements :Uint8Array[] = []; // Manual upscale. // Fixes issues with the OCR. - const qualityScale = 5; + const qualityScale = 300/72; for (const polygon of polygons) { const tempPdf = await PDFDocument.create(); diff --git a/tests/v1/api/multiReceiptsReconstruction.integration.ts b/tests/v1/api/multiReceiptsReconstruction.integration.ts index d9042c1b2..1fb79eca5 100644 --- a/tests/v1/api/multiReceiptsReconstruction.integration.ts +++ b/tests/v1/api/multiReceiptsReconstruction.integration.ts @@ -23,22 +23,25 @@ describe("MindeeV1 - A Multi-Receipt Image", () => { it("should send to the server and cut properly", async () => { const multiReceiptResult = await client.parse(MultiReceiptsDetectorV1, sourceDoc); expect(multiReceiptResult.document?.inference.prediction.receipts.length).to.be.equals(6); + expect(multiReceiptResult.document?.inference.pages[0].orientation?.value).to.be.equals(90); const receipts = await extractReceipts(sourceDoc, multiReceiptResult.document!.inference); expect(receipts.length).to.be.equals(6); const extractedReceipts = await extractReceipts(sourceDoc, multiReceiptResult.document!.inference); expect(extractedReceipts.length).to.be.equals(6); const receiptsResults = []; + let i = 0; for (const extractedReceipt of extractedReceipts) { const localInput = extractedReceipt.asSource(); + extractedReceipt.saveToFile(path.join(RESOURCE_PATH, `output/extracted_receipt${i}.pdf`)); receiptsResults.push(await client.parse(ReceiptV5, localInput)); + i++; await setTimeout(1000); } expect(receiptsResults[0].document.inference.prediction.lineItems.length).to.be.equals(0); - // NOTE: disabled because flaky? - // expect(receiptsResults[1].document.inference.prediction.lineItems.length).to.be.equals(1); - // expect(receiptsResults[1].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(21.5); + expect(receiptsResults[1].document.inference.prediction.lineItems.length).to.be.equals(1); + expect(receiptsResults[1].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(21.5); expect(receiptsResults[2].document.inference.prediction.lineItems.length).to.be.equals(2); expect(receiptsResults[2].document.inference.prediction.lineItems[0].totalAmount).to.be.equals(11.5); @@ -70,6 +73,8 @@ describe("MindeeV1 - A Multi-Receipt Document", () => { expect(multiReceiptResult.document?.inference.prediction.receipts.length).to.be.equals(5); const extractedReceipts = await extractReceipts(sourceDoc, multiReceiptResult.document!.inference); expect(extractedReceipts.length).to.be.equals(5); + expect(multiReceiptResult.document?.inference.pages[0].orientation?.value).to.be.equals(0); + expect(multiReceiptResult.document?.inference.pages[1].orientation?.value).to.be.equals(0); const receiptsResults = []; for (const extractedReceipt of extractedReceipts) { const localInput = extractedReceipt.asSource();