diff --git a/docs/code_samples/bank_account_details_v1.txt b/docs/code_samples/bank_account_details_v1.txt index a5edf36a..3c9eb26f 100644 --- a/docs/code_samples/bank_account_details_v1.txt +++ b/docs/code_samples/bank_account_details_v1.txt @@ -1,5 +1,7 @@ +// If you're on CommonJS: const mindee = require("mindee"); -// for TS or modules: + +// ESM or TypeScript (Recommended) // import * as mindee from "mindee"; // Init a new client diff --git a/docs/code_samples/bank_account_details_v2.txt b/docs/code_samples/bank_account_details_v2.txt index 43f3f232..252f1a48 100644 --- a/docs/code_samples/bank_account_details_v2.txt +++ b/docs/code_samples/bank_account_details_v2.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/bank_check_v1.txt b/docs/code_samples/bank_check_v1.txt index 76c8d74f..7b44b87b 100644 --- a/docs/code_samples/bank_check_v1.txt +++ b/docs/code_samples/bank_check_v1.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/barcode_reader_v1.txt b/docs/code_samples/barcode_reader_v1.txt index afea500f..6977129f 100644 --- a/docs/code_samples/barcode_reader_v1.txt +++ b/docs/code_samples/barcode_reader_v1.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/carte_grise_v1.txt b/docs/code_samples/carte_grise_v1.txt index 38b8d04d..58b7904e 100644 --- a/docs/code_samples/carte_grise_v1.txt +++ b/docs/code_samples/carte_grise_v1.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/cropper_v1.txt b/docs/code_samples/cropper_v1.txt index e7513d2b..c1edac58 100644 --- a/docs/code_samples/cropper_v1.txt +++ b/docs/code_samples/cropper_v1.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/default.txt b/docs/code_samples/default.txt index 875363d6..ac110070 100644 --- a/docs/code_samples/default.txt +++ b/docs/code_samples/default.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/default_async.txt b/docs/code_samples/default_async.txt index f4260c2f..4fc2ed1a 100644 --- a/docs/code_samples/default_async.txt +++ b/docs/code_samples/default_async.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/driver_license_v1_async.txt b/docs/code_samples/driver_license_v1_async.txt index c2e4c1b2..7decc0cd 100644 --- a/docs/code_samples/driver_license_v1_async.txt +++ b/docs/code_samples/driver_license_v1_async.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/expense_receipts_v5.txt b/docs/code_samples/expense_receipts_v5.txt index 502cad69..5bdcad70 100644 --- a/docs/code_samples/expense_receipts_v5.txt +++ b/docs/code_samples/expense_receipts_v5.txt @@ -1,5 +1,7 @@ +// If you're on CommonJS: const mindee = require("mindee"); -// for TS or modules: + +// ESM or TypeScript (Recommended) // import * as mindee from "mindee"; // Init a new client diff --git a/docs/code_samples/expense_receipts_v5_async.txt b/docs/code_samples/expense_receipts_v5_async.txt index 6f8f0d7d..5edaf354 100644 --- a/docs/code_samples/expense_receipts_v5_async.txt +++ b/docs/code_samples/expense_receipts_v5_async.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/financial_document_v1.txt b/docs/code_samples/financial_document_v1.txt index 9e2a1ce3..5502b133 100644 --- a/docs/code_samples/financial_document_v1.txt +++ b/docs/code_samples/financial_document_v1.txt @@ -1,5 +1,7 @@ +// If you're on CommonJS: const mindee = require("mindee"); -// for TS or modules: + +// ESM or TypeScript (Recommended) // import * as mindee from "mindee"; // Init a new client diff --git a/docs/code_samples/financial_document_v1_async.txt b/docs/code_samples/financial_document_v1_async.txt index e5063cf8..04976ea2 100644 --- a/docs/code_samples/financial_document_v1_async.txt +++ b/docs/code_samples/financial_document_v1_async.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/idcard_fr_v2.txt b/docs/code_samples/idcard_fr_v2.txt index d4e4d001..1e939f24 100644 --- a/docs/code_samples/idcard_fr_v2.txt +++ b/docs/code_samples/idcard_fr_v2.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/international_id_v2_async.txt b/docs/code_samples/international_id_v2_async.txt index 3765f8eb..7e21d0fd 100644 --- a/docs/code_samples/international_id_v2_async.txt +++ b/docs/code_samples/international_id_v2_async.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/invoice_splitter_v1_async.txt b/docs/code_samples/invoice_splitter_v1_async.txt index 451b6c1f..97d69901 100644 --- a/docs/code_samples/invoice_splitter_v1_async.txt +++ b/docs/code_samples/invoice_splitter_v1_async.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/invoices_v4.txt b/docs/code_samples/invoices_v4.txt index c48565b6..5459b3c4 100644 --- a/docs/code_samples/invoices_v4.txt +++ b/docs/code_samples/invoices_v4.txt @@ -1,5 +1,7 @@ +// If you're on CommonJS: const mindee = require("mindee"); -// for TS or modules: + +// ESM or TypeScript (Recommended) // import * as mindee from "mindee"; // Init a new client diff --git a/docs/code_samples/invoices_v4_async.txt b/docs/code_samples/invoices_v4_async.txt index f11ed961..3b538737 100644 --- a/docs/code_samples/invoices_v4_async.txt +++ b/docs/code_samples/invoices_v4_async.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/multi_receipts_detector_v1.txt b/docs/code_samples/multi_receipts_detector_v1.txt index f17555ca..0689ea4b 100644 --- a/docs/code_samples/multi_receipts_detector_v1.txt +++ b/docs/code_samples/multi_receipts_detector_v1.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/passport_v1.txt b/docs/code_samples/passport_v1.txt index c60f4ff9..5085300b 100644 --- a/docs/code_samples/passport_v1.txt +++ b/docs/code_samples/passport_v1.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/resume_v1_async.txt b/docs/code_samples/resume_v1_async.txt index f760cc57..97f58601 100644 --- a/docs/code_samples/resume_v1_async.txt +++ b/docs/code_samples/resume_v1_async.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); // Init a new client const mindeeClient = new mindee.v1.Client( diff --git a/docs/code_samples/v2_classification.txt b/docs/code_samples/v2_classification.txt index dfd0f443..b9b3650a 100644 --- a/docs/code_samples/v2_classification.txt +++ b/docs/code_samples/v2_classification.txt @@ -1,4 +1,6 @@ +// ESM or TypeScript (Recommended) import * as mindee from "mindee"; + // If you're on CommonJS: // const mindee = require("mindee"); diff --git a/docs/code_samples/v2_crop.txt b/docs/code_samples/v2_crop.txt index b5e3bca5..aa81a02d 100644 --- a/docs/code_samples/v2_crop.txt +++ b/docs/code_samples/v2_crop.txt @@ -1,4 +1,6 @@ +// ESM or TypeScript (Recommended) import * as mindee from "mindee"; + // If you're on CommonJS: // const mindee = require("mindee"); diff --git a/docs/code_samples/v2_extraction.txt b/docs/code_samples/v2_extraction.txt index 863cab38..9cc50028 100644 --- a/docs/code_samples/v2_extraction.txt +++ b/docs/code_samples/v2_extraction.txt @@ -1,4 +1,6 @@ +// ESM or TypeScript (Recommended) import * as mindee from "mindee"; + // If you're on CommonJS: // const mindee = require("mindee"); diff --git a/docs/code_samples/v2_ocr.txt b/docs/code_samples/v2_ocr.txt index d0f9e9ac..01ec2f03 100644 --- a/docs/code_samples/v2_ocr.txt +++ b/docs/code_samples/v2_ocr.txt @@ -1,4 +1,6 @@ +// ESM or TypeScript (Recommended) import * as mindee from "mindee"; + // If you're on CommonJS: // const mindee = require("mindee"); diff --git a/docs/code_samples/v2_split.txt b/docs/code_samples/v2_split.txt index 5f68151b..3c63ebb6 100644 --- a/docs/code_samples/v2_split.txt +++ b/docs/code_samples/v2_split.txt @@ -1,4 +1,6 @@ +// ESM or TypeScript (Recommended) import * as mindee from "mindee"; + // If you're on CommonJS: // const mindee = require("mindee"); diff --git a/docs/code_samples/workflow_execution.txt b/docs/code_samples/workflow_execution.txt index 7ab2f67d..ee50c82b 100644 --- a/docs/code_samples/workflow_execution.txt +++ b/docs/code_samples/workflow_execution.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); const workflowId: string = "workflow-id"; diff --git a/docs/code_samples/workflow_ots_rag.txt b/docs/code_samples/workflow_ots_rag.txt index 0cc72d3e..633071fa 100644 --- a/docs/code_samples/workflow_ots_rag.txt +++ b/docs/code_samples/workflow_ots_rag.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); const workflowId: string = "workflow-id"; diff --git a/docs/code_samples/workflow_polling.txt b/docs/code_samples/workflow_polling.txt index 9d6cf2c0..2142f2e2 100644 --- a/docs/code_samples/workflow_polling.txt +++ b/docs/code_samples/workflow_polling.txt @@ -1,6 +1,8 @@ -const mindee = require("mindee"); -// for TS or modules: -// import * as mindee from "mindee"; +// ESM or TypeScript (Recommended) +import * as mindee from "mindee"; + +// If you're on CommonJS: +// const mindee = require("mindee"); const workflowId: string = "workflow-id"; diff --git a/tests/v2/client/client.integration.ts b/tests/v2/client/client.integration.ts index 4c864a6a..6a64f925 100644 --- a/tests/v2/client/client.integration.ts +++ b/tests/v2/client/client.integration.ts @@ -113,7 +113,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { }); it("enqueueAndGetResult must succeed: Empty, multi-page PDF – PathInput", async () => { - const source = new PathInput({ inputPath: emptyPdfPath }); + const inputSource = new PathInput({ inputPath: emptyPdfPath }); const params = { modelId, rag: false, @@ -124,7 +124,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { alias: "ts_integration_empty_multiple" }; const response = await client.enqueueAndGetResult( - Extraction, source, params + Extraction, inputSource, params ); assert.ok(response); assert.ok(response.inference instanceof ExtractionInference); @@ -140,7 +140,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { }); it("enqueueAndGetResult must succeed: Filled, single-page image – PathInput", async () => { - const source = new PathInput({ inputPath: sampleImagePath }); + const inputSource = new PathInput({ inputPath: sampleImagePath }); const params = { modelId, rag: false, @@ -153,7 +153,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { }; const response = await client.enqueueAndGetResult( - Extraction, source, params + Extraction, inputSource, params ); assert.ok(response.inference instanceof ExtractionInference); const inference: ExtractionInference = response.inference; @@ -180,7 +180,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { it("enqueueAndGetResult must succeed: Filled, single-page image – Base64Input", async () => { const data = fs.readFileSync(sampleBase64Path, "utf8"); - const source = new Base64Input({ inputString: data, filename: "receipt.jpg" }); + const inputSource = new Base64Input({ inputString: data, filename: "receipt.jpg" }); const params = { modelId, rag: false, @@ -192,7 +192,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { }; const response = await client.enqueueAndGetResult( - Extraction, source, params + Extraction, inputSource, params ); assert.ok(response.inference instanceof ExtractionInference); const inference: ExtractionInference = response.inference; @@ -210,11 +210,11 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { }); it("enqueue must raise 422: Invalid model ID", async () => { - const source = new PathInput({ inputPath: emptyPdfPath }); + const inputSource = new PathInput({ inputPath: emptyPdfPath }); const badParams = { modelId: "00000000-0000-0000-0000-000000000000" }; try { - await client.enqueue(Extraction, source, badParams); + await client.enqueue(Extraction, inputSource, badParams); assert.fail("Expected the call to throw, but it succeeded."); } catch (err) { check422(err); @@ -234,7 +234,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { }); it("enqueue, getJob, and getResult must succeed", async () => { - const source = new PathInput({ inputPath: emptyPdfPath }); + const inputSource = new PathInput({ inputPath: emptyPdfPath }); const params = { modelId, rag: false, @@ -245,7 +245,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { }; const enqueueResponse = await client.enqueue( - Extraction, source, params + Extraction, inputSource, params ); assert.ok(enqueueResponse.job.id); const resultUrl = await waitForResultUrl(client, enqueueResponse.job.id); @@ -259,7 +259,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { it("enqueueAndGetResult must succeed: HTTPS URL", async () => { const url = process.env.MINDEE_V2_SE_TESTS_BLANK_PDF_URL ?? "error-no-url-found"; - const source = new UrlInput({ url }); + const inputSource = new UrlInput({ url }); const params = new ExtractionParameters({ modelId, rag: false, @@ -270,14 +270,14 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { alias: "ts_integration_url_source" }); const response: ExtractionResponse = await client.enqueueAndGetResult( - Extraction, source, params + Extraction, inputSource, params ); assert.ok(response); assert.ok(response.inference instanceof ExtractionInference); }); it("should override the data schema successfully", async () => { - const source = new PathInput({ inputPath: emptyPdfPath }); + const inputSource = new PathInput({ inputPath: emptyPdfPath }); const params = new ExtractionParameters({ modelId, rag: false, @@ -289,7 +289,7 @@ describe("MindeeV2 – Integration - Client", { timeout: 120000 }, () => { alias: "ts_integration_data_schema_replace" }); const response = await client.enqueueAndGetResult( - Extraction, source, params + Extraction, inputSource, params ); assert.ok(response); assert.ok(response.inference instanceof ExtractionInference); diff --git a/tests/v2/client/client.spec.ts b/tests/v2/client/client.spec.ts index fbebc871..ecbac638 100644 --- a/tests/v2/client/client.spec.ts +++ b/tests/v2/client/client.spec.ts @@ -84,11 +84,11 @@ describe("MindeeV2 - Client", () => { describe("enqueue(path)", () => { it("extraction rejects with MindeeHttpErrorV2 on 400", async () => { const filePath = path.join(fileTypesDir, "receipt.jpg"); - const inputDoc = new PathInput({ inputPath: filePath }); + const inputSource = new PathInput({ inputPath: filePath }); await assert.rejects( client.enqueue( - product.Extraction, inputDoc, { modelId: "dummy-model", textContext: "hello" } + product.Extraction, inputSource, { modelId: "dummy-model", textContext: "hello" } ), (error: any) => { assert.strictEqual(error instanceof MindeeHttpErrorV2, true); @@ -101,11 +101,11 @@ describe("MindeeV2 - Client", () => { it("crop rejects with MindeeHttpErrorV2 on 400", async () => { const filePath = path.join(fileTypesDir, "receipt.jpg"); - const inputDoc = new PathInput({ inputPath: filePath }); + const inputSource = new PathInput({ inputPath: filePath }); await assert.rejects( client.enqueue( - product.Crop, inputDoc, { modelId: "dummy-model" } + product.Crop, inputSource, { modelId: "dummy-model" } ), (error: any) => { assert.strictEqual(error instanceof MindeeHttpErrorV2, true); @@ -120,11 +120,11 @@ describe("MindeeV2 - Client", () => { describe("enqueueAndGetResult(path)", () => { it("no polling options rejects with MindeeHttpErrorV2 on 400", async () => { const filePath = path.join(fileTypesDir, "receipt.jpg"); - const inputDoc = new PathInput({ inputPath: filePath }); + const inputSource = new PathInput({ inputPath: filePath }); await assert.rejects( client.enqueueAndGetResult( product.Extraction, - inputDoc, + inputSource, { modelId: "dummy-model", rag: false } ), (error: any) => { @@ -137,11 +137,11 @@ describe("MindeeV2 - Client", () => { it("with polling options rejects with MindeeHttpErrorV2 on 400", async () => { const filePath = path.join(fileTypesDir, "receipt.jpg"); - const inputDoc = new PathInput({ inputPath: filePath }); + const inputSource = new PathInput({ inputPath: filePath }); await assert.rejects( client.enqueueAndGetResult( product.Extraction, - inputDoc, + inputSource, { modelId: "dummy-model", rag: false }, { initialDelaySec: 2, maxRetries: 100 } ), diff --git a/tests/v2/client/foreignDispatcher.integration.ts b/tests/v2/client/foreignDispatcher.integration.ts index 63c9a22c..d4a2fe30 100644 --- a/tests/v2/client/foreignDispatcher.integration.ts +++ b/tests/v2/client/foreignDispatcher.integration.ts @@ -49,13 +49,13 @@ describe( apiKey: apiKey, dispatcher: foreignDispatcher, }); - const source = new mindee.BufferInput({ + const inputSource = new mindee.BufferInput({ buffer: pdfBuffer, filename: "blank.pdf", }); try { await client.enqueue( - mindee.product.Extraction, source, { modelId: modelId } + mindee.product.Extraction, inputSource, { modelId: modelId } ); } catch (err: unknown) { assert.ok( @@ -72,25 +72,25 @@ describe( it("fix: the default client ignores the foreign dispatcher and succeeds", async () => { const client = new mindee.Client({ apiKey: apiKey }); - const source = new mindee.BufferInput({ + const inputSource = new mindee.BufferInput({ buffer: pdfBuffer, filename: "blank.pdf", }); const response = await client.enqueue( - mindee.product.Extraction, source, { modelId: modelId } + mindee.product.Extraction, inputSource, { modelId: modelId } ); assert.ok(response.job.id); }); it("fix: UrlInput ignores the foreign dispatcher and downloads succeed", async () => { - const source = new mindee.UrlInput({ + const inputSource = new mindee.UrlInput({ url: "https://github.com/mindee/client-lib-test-data/blob/main/" + "file_types/pdf/blank_1.pdf?raw=true", }); - assert.notStrictEqual(source.dispatcher, foreignDispatcher); - assert.ok(source.dispatcher instanceof undici.Dispatcher); - await source.init(); - const localized = await source.asLocalInputSource(); + assert.notStrictEqual(inputSource.dispatcher, foreignDispatcher); + assert.ok(inputSource.dispatcher instanceof undici.Dispatcher); + await inputSource.init(); + const localized = await inputSource.asLocalInputSource(); await localized.init(); assert.ok(localized.fileObject.length > 0); });