Skip to content

Commit 8e4bf65

Browse files
committed
⬆️ bump commander and file-type
1 parent 88d0fba commit 8e4bf65

4 files changed

Lines changed: 69 additions & 88 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
# CHANGELOG
22

3-
## 5.0.0-rc2 - 2026-01-18
3+
## v5.0.0-rc2 - 2026-01-18
44
### Changes
55
* :sparkles: add Job to inference responses
66
### Fixes
77
* :bug: fix for bin scripts
88

99

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

1515

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

2323

24-
## 5.0.0-alpha1 - 2026-01-13
24+
## v5.0.0-alpha1 - 2026-01-13
2525
### :boom: :recycle: base for v5
2626
* :arrow_up: update file-type
2727
* :recycle: migrate to ES modules (node18)

package-lock.json

Lines changed: 46 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"node": ">= 20.1"
4848
},
4949
"dependencies": {
50-
"commander": "~9.4.1",
51-
"file-type": "^19.6.0",
50+
"commander": "^14.0.3",
51+
"file-type": "^21.3.0",
5252
"tmp": "^0.2.3",
5353
"tslib": "^2.8.1",
5454
"undici": "^6.23.0"

src/v2/cli.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ import {
1212
Split,
1313
} from "@/v2/product/index.js";
1414

15+
interface CliProduct {
16+
name: string;
17+
description: string;
18+
productClass: typeof BaseProduct;
19+
}
20+
1521
const program = new Command();
1622

1723
//
@@ -35,13 +41,11 @@ async function enqueueAndGetInference(
3541
const response = await mindeeClient.enqueueAndGetResult(
3642
product,
3743
inputSource,
44+
{ modelId: options.model },
3845
{
39-
modelId: options.model,
40-
pollingOptions: {
41-
initialDelaySec: 2,
42-
delaySec: 1.5,
43-
maxRetries: 80,
44-
}
46+
initialDelaySec: 2,
47+
delaySec: 1.5,
48+
maxRetries: 80,
4549
}
4650
);
4751
if (!response.inference) {
@@ -76,12 +80,12 @@ export function cli() {
7680
.option("-d, --debug", "high verbosity mode")
7781
.option("-k, --api-key <api_key>", "your Mindee API key");
7882

79-
const inferenceTypes = [
80-
{ name: "extraction", description: "Extract data from a document.", product: Extraction },
81-
{ name: "crop", description: "Crop a document.", product: Crop },
82-
{ name: "split", description: "Split a document into pages.", product: Split },
83-
{ name: "ocr", description: "Read text from a document.", product: Ocr },
84-
{ name: "classification", description: "Classify a document.", product: Classification },
83+
const inferenceTypes: CliProduct[] = [
84+
{ name: "extraction", description: "Extract data from a document.", productClass: Extraction },
85+
{ name: "crop", description: "Crop a document.", productClass: Crop },
86+
{ name: "split", description: "Split a document into pages.", productClass: Split },
87+
{ name: "ocr", description: "Read text from a document.", productClass: Ocr },
88+
{ name: "classification", description: "Classify a document.", productClass: Classification },
8589
];
8690

8791
for (const inference of inferenceTypes) {
@@ -95,7 +99,7 @@ export function cli() {
9599
options: OptionValues,
96100
) {
97101
const allOptions = { ...program.opts(), ...options };
98-
return enqueueAndGetInference(inference.product, inputPath, allOptions);
102+
return enqueueAndGetInference(inference.productClass, inputPath, allOptions);
99103
});
100104
}
101105

0 commit comments

Comments
 (0)