mindee 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +11 -8
- package/src/v2/cli.js +9 -4
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindee",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"description": "Mindee Client Library for Node.js",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mindee",
|
|
@@ -48,9 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"commander": "^14.0.3",
|
|
51
|
-
"file-type": "^21.3.
|
|
52
|
-
"tmp": "^0.2.
|
|
53
|
-
"tslib": "^2.8.1",
|
|
51
|
+
"file-type": "^21.3.1",
|
|
52
|
+
"tmp": "^0.2.5",
|
|
54
53
|
"undici": ">=6.23.0 <8.0.0"
|
|
55
54
|
},
|
|
56
55
|
"optionalDependencies": {
|
|
@@ -60,15 +59,19 @@
|
|
|
60
59
|
"sharp": "~0.34.5"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
62
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
63
|
+
"@eslint/js": "^10.0.1",
|
|
63
64
|
"@types/mocha": "^10.0.10",
|
|
64
|
-
"@types/node": "^20.19.
|
|
65
|
+
"@types/node": "^20.19.37",
|
|
65
66
|
"@types/tmp": "^0.2.6",
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
67
|
-
"@typescript-eslint/parser": "^8.
|
|
68
|
-
"eslint": "^
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
68
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
69
|
+
"eslint": "^10.0.3",
|
|
69
70
|
"eslint-plugin-jsdoc": "^62.7.1",
|
|
71
|
+
"globals": "^17.4.0",
|
|
70
72
|
"mocha": "^11.7.5",
|
|
71
73
|
"tsc-alias": "^1.8.16",
|
|
74
|
+
"tslib": "^2.8.1",
|
|
72
75
|
"tsx": "^4.21.0",
|
|
73
76
|
"typedoc": "^0.28.17",
|
|
74
77
|
"typescript": "^5.9.3"
|
package/src/v2/cli.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { Client } from "./client.js";
|
|
3
|
-
import { PathInput } from "../input/index.js";
|
|
4
2
|
import * as console from "console";
|
|
3
|
+
import { Client, PathInput, UrlInput } from "../index.js";
|
|
5
4
|
import { Classification, Crop, Extraction, Ocr, Split, } from "../v2/product/index.js";
|
|
6
5
|
const program = new Command();
|
|
7
6
|
//
|
|
@@ -15,7 +14,13 @@ function initClient(options) {
|
|
|
15
14
|
}
|
|
16
15
|
async function enqueueAndGetInference(product, inputPath, options) {
|
|
17
16
|
const mindeeClient = initClient(options);
|
|
18
|
-
|
|
17
|
+
let inputSource;
|
|
18
|
+
if (inputPath.startsWith("https://")) {
|
|
19
|
+
inputSource = new UrlInput({ url: inputPath });
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
inputSource = new PathInput({ inputPath: inputPath });
|
|
23
|
+
}
|
|
19
24
|
const response = await mindeeClient.enqueueAndGetResult(product, inputSource, { modelId: options.model }, {
|
|
20
25
|
initialDelaySec: 2,
|
|
21
26
|
delaySec: 1.5,
|
|
@@ -36,7 +41,7 @@ function printResponse(document) {
|
|
|
36
41
|
//
|
|
37
42
|
function addMainOptions(prog) {
|
|
38
43
|
prog.requiredOption("-m, --model <model_id>", "Model ID (required)");
|
|
39
|
-
prog.argument("<input_path>", "full path to the file");
|
|
44
|
+
prog.argument("<input_path>", "full path or URL to the file");
|
|
40
45
|
}
|
|
41
46
|
export function cli() {
|
|
42
47
|
program.name("mindee")
|