Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# CHANGELOG

## 5.0.0-rc2 - 2026-01-18
## v5.0.0-rc2 - 2026-01-18
### Changes
* :sparkles: add Job to inference responses
### Fixes
* :bug: fix for bin scripts


## 5.0.0-rc1 - 2026-01-17
## v5.0.0-rc1 - 2026-01-17
### Changes
* :boom: drop support for node.js 18
* :boom: :recycle: separate polling options


## 5.0.0-alpha2 - 2026-01-16
## v5.0.0-alpha2 - 2026-01-16
### Changes
* :recycle: use node test methods
* :recycle: v1 ocr word should be a class
* :recycle: make v2 products top level
* :bug: fix for optional node-poppler


## 5.0.0-alpha1 - 2026-01-13
## v5.0.0-alpha1 - 2026-01-13
### :boom: :recycle: base for v5
* :arrow_up: update file-type
* :recycle: migrate to ES modules (node18)
Expand Down
167 changes: 90 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@
"node": ">= 20.1"
},
"dependencies": {
"commander": "~9.4.1",
"file-type": "^19.6.0",
"commander": "^14.0.3",
"file-type": "^21.3.0",
"tmp": "^0.2.3",
"tslib": "^2.8.1",
"undici": "^6.23.0"
"undici": ">=6.23.0 <8.0.0"
},
"optionalDependencies": {
"@cantoo/pdf-lib": "^2.3.2",
"node-poppler": "^7.2.4",
"pdf.js-extract": "^0.2.1",
"@cantoo/pdf-lib": "^2.5.3",
"node-poppler": "^9.1.1",
"pdf.js-extract": "~0.2.1",
"sharp": "~0.34.5"
},
"devDependencies": {
Expand Down
15 changes: 7 additions & 8 deletions src/http/apiCore.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { logger } from "@/logger.js";
import { request, Dispatcher } from "undici";
import { request, Dispatcher, FormData } from "undici";
import { InputSource, PageOptions, LocalInputSource } from "@/input/index.js";

export const TIMEOUT_DEFAULT: number = 120;
export const TIMEOUT_SECS_DEFAULT: number = 120;

export interface RequestOptions {
hostname: string;
path: string;
method: any;
timeout: number;
timeoutSecs: number;
headers: any;
body?: any;
body?: FormData | string;
}

export interface BaseHttpResponse {
Expand Down Expand Up @@ -40,17 +40,16 @@ export async function sendRequestAndReadResponse(
options: RequestOptions,
): Promise<BaseHttpResponse> {
const url: string = `https://${options.hostname}${options.path}`;
logger.debug(`${options.method}: ${url}`);

logger.debug(`${options.method}: ${url}`);
const response = await request(
url,
{
method: options.method,
headers: options.headers,
bodyTimeout: options.timeout,
headersTimeout: options.timeoutSecs * 1000,
body: options.body,
throwOnError: false,
dispatcher: dispatcher
dispatcher: dispatcher,
}
);
logger.debug("Parsing the response ...");
Expand Down
Loading