Skip to content

✨ add support for client V2 #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
019f865
add support for basic deserialization classes
sebastianMindee Jul 10, 2025
ad1d1c2
fix vunlerabilities
sebastianMindee Jul 10, 2025
41460b0
add http logic
sebastianMindee Jul 11, 2025
21f59d8
more elegant solution for job/inference internal deserialization
sebastianMindee Jul 11, 2025
4003615
add code sample + fix syntax
sebastianMindee Jul 11, 2025
10659d2
fix unit test
sebastianMindee Jul 16, 2025
30096bc
update client syntaxes to match other SDKs
sebastianMindee Jul 17, 2025
2c4eb03
uniformize syntaxes to fit other SDK changes
sebastianMindee Jul 17, 2025
d5c3933
update CI trigger
sebastianMindee Jul 17, 2025
cea6d34
fix CI trigger typo
sebastianMindee Jul 17, 2025
c71261c
fix tests + fix inferenceFields instanciation
sebastianMindee Jul 17, 2025
62b3db1
update mocha targetting to work for windows files
sebastianMindee Jul 17, 2025
ee578e1
fix invalid date
sebastianMindee Jul 17, 2025
86cd8d0
fix test
sebastianMindee Jul 17, 2025
0f11a4f
fix display & add all unit tests
sebastianMindee Jul 18, 2025
149490b
fix header setting for V1
sebastianMindee Jul 18, 2025
6a594d9
done?
sebastianMindee Jul 18, 2025
c2067b6
fix test?
sebastianMindee Jul 18, 2025
bc45930
fix workflows
sebastianMindee Jul 18, 2025
b2c9ec9
bump packages to cover vulnerability
sebastianMindee Jul 21, 2025
7f7f41d
apply suggested changes
sebastianMindee Jul 21, 2025
b3b3eeb
add docstrings
sebastianMindee Jul 21, 2025
532ffcf
fix code sample
sebastianMindee Jul 21, 2025
f4401e2
deprecate cutPdf()
sebastianMindee Jul 21, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/_test-code-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ jobs:

- name: Tests sample code
run: |
./tests/test_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }} ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
./tests/test_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }} ${{ secrets.MINDEE_API_KEY_SE_TESTS }} ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }} ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}

2 changes: 2 additions & 0 deletions .github/workflows/_test-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ jobs:
env:
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
WORKFLOW_ID: ${{ secrets.WORKFLOW_ID_SE_TESTS }}
MINDEE_V2_API_KEY: ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }}
MINDEE_V2_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
run: npm run test-integration
12 changes: 8 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ name: Pull Request
on:
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
static_analysis:
uses: mindee/mindee-api-nodejs/.github/workflows/_static-analysis.yml@main
uses: ./.github/workflows/_static-analysis.yml
test_units:
uses: mindee/mindee-api-nodejs/.github/workflows/_test-units.yml@main
uses: ./.github/workflows/_test-units.yml
needs: static_analysis
secrets: inherit
test_integrations:
uses: mindee/mindee-api-nodejs/.github/workflows/_test-integrations.yml@main
uses: ./.github/workflows/_test-integrations.yml
needs: test_units
secrets: inherit
test_code_samples:
uses: mindee/mindee-api-nodejs/.github/workflows/_test-code-samples.yml@main
uses: ./.github/workflows/_test-code-samples.yml
needs: test_units
secrets: inherit
21 changes: 0 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,27 +154,6 @@ const apiResponse = mindeeClient.parse(
});
```

## Further Reading
Complete details on the working of the library are available in the following guides:

* [Node.js Getting Started](https://developers.mindee.com/docs/nodejs-getting-started)
* [Node.js Generated API](https://developers.mindee.com/docs/nodejs-generated-ocr)
* [Node.js Custom OCR (Deprecated)](https://developers.mindee.com/docs/nodejs-api-builder)
* [Node.js Invoice OCR](https://developers.mindee.com/docs/nodejs-invoice-ocr)
* [Node.js International Id OCR](https://developers.mindee.com/docs/nodejs-international-id-ocr)
* [Node.js Receipt OCR](https://developers.mindee.com/docs/nodejs-receipt-ocr)
* [Node.js Resume OCR](https://developers.mindee.com/docs/nodejs-resume-ocr)
* [Node.js Financial Document OCR](https://developers.mindee.com/docs/nodejs-financial-document-ocr)
* [Node.js Passport OCR](https://developers.mindee.com/docs/nodejs-passport-ocr)
* [Node.js FR Bank Account Detail OCR](https://developers.mindee.com/docs/nodejs-fr-bank-account-details-ocr)
* [Node.js FR Health Card OCR](https://developers.mindee.com/docs/nodejs-fr-health-card-ocr)
* [Node.js FR ID Card OCR](https://developers.mindee.com/docs/nodejs-fr-carte-nationale-didentite-ocr)
* [Node.js US Bank Check OCR](https://developers.mindee.com/docs/nodejs-us-bank-check-ocr)
* [Node.js Barcode Reader API](https://developers.mindee.com/docs/nodejs-barcode-reader-ocr)
* [Node.js Cropper API](https://developers.mindee.com/docs/nodejs-cropper-ocr)
* [Node.js Invoice Splitter API](https://developers.mindee.com/docs/nodejs-invoice-splitter-ocr)
* [Node.js Multi Receipts Detector API](https://developers.mindee.com/docs/nodejs-multi-receipts-detector-ocr)

You can also take a look at the **[Reference Documentation](https://mindee.github.io/mindee-api-nodejs/)**.

## License
Expand Down
26 changes: 26 additions & 0 deletions docs/code_samples/default_v2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.ClientV2({ apiKey: "MY_API_KEY" });
const modelId = "MY_MODEL_ID";

// Load a file from disk
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext");
const params = {
modelId: modelId,
// If set to `true`, will enable Retrieval-Augmented Generation.
rag: false
};

const apiResponse = mindeeClient.enqueueAndGetInference(
inputSource,
params
);

// Handle the response Promise
apiResponse.then((resp) => {
// print a string summary
console.log(resp.inference.toString());
});
Loading
Loading