Skip to content

Commit 89f6438

Browse files
committed
🔖 Version 5.0.0-alpha1 (#422)
### 💥 ♻️ base for v5 * ⬆️ update file-type * ♻️ migrate to ES modules (node18) * ⚰️ remove support for obsolete/unused products: * API builder (no longer maintained, use v2) * ⚰️ remove support for unused products available in v2: * nutrition facts * business card * US healthcare cards * bill of lading * ⚰️ remove support for unused products: * delivery note * payslip_fra_v2_async * idcard_fr_v1 * ind_passport_v1_async * us_mail_v3_async * energy_bill_fra_v1_async * french_healthcard_v1_async * payslip_fra_v3_async * ♻️ use undici for HTTP requests and mocking * ✨ add ability for a user to specify their own undici `Dispatcher` instance * ✨ add basic V2 CLI * ♻️ 💥 rework of directory structure * ♻️ 💥 rework input source errors * ✨ handle abort signal stream inputs * ✨ add support for all utility products * 💥 ✨ move PDF and image libraries to optional dependencies
1 parent 5e5e949 commit 89f6438

555 files changed

Lines changed: 6634 additions & 12625 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ end_of_line = lf
66
insert_final_newline = true
77
trim_trailing_whitespace = true
88

9-
[*.{js,json,ts,tsx,txt}]
9+
[*.{mjs,js,json,ts,tsx,txt}]
1010
indent_style = space
1111
indent_size = 2
1212

.github/workflows/_publish-code.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#
2-
# Publish releases to NPM
3-
#
41
name: Publish Code
52

63
on:

.github/workflows/_publish-docs.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#
2-
# Publish Documentation to GitHub pages.
3-
#
41
name: Publish Documentation
52

63
on:

.github/workflows/_static-analysis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#
2-
# Run static code analysis.
3-
#
41
name: Static Analysis
52

63
on:
@@ -18,7 +15,7 @@ jobs:
1815
- name: Set up Node.js
1916
uses: actions/setup-node@v4
2017
with:
21-
node-version: 18
18+
node-version: 22
2219
cache: "npm"
2320

2421
- name: Install Node.js dependencies

.github/workflows/_test-code-samples.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/_test-integrations.yml

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
#
2-
# Run integration tests.
3-
#
41
name: Integration Test
52

63
on:
74
workflow_call:
85
workflow_dispatch:
96

7+
env:
8+
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
9+
WORKFLOW_ID: ${{ secrets.WORKFLOW_ID_SE_TESTS }}
10+
MINDEE_V2_API_KEY: ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }}
11+
MINDEE_V2_SE_TESTS_BLANK_PDF_URL: ${{ secrets.MINDEE_V2_SE_TESTS_BLANK_PDF_URL }}
12+
MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
13+
MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID }}
14+
MINDEE_V2_SE_TESTS_CROP_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CROP_MODEL_ID }}
15+
MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID }}
16+
MINDEE_V2_SE_TESTS_OCR_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_OCR_MODEL_ID }}
17+
1018
jobs:
11-
run-tests:
12-
name: Run Integration Tests
19+
run-tests-with-optional-dependencies:
20+
name: Run Integration Tests With Optional Dependencies
1321
timeout-minutes: 30
1422
strategy:
1523
matrix:
@@ -56,10 +64,40 @@ jobs:
5664
run: npm run build
5765

5866
- name: Test code
59-
env:
60-
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
61-
WORKFLOW_ID: ${{ secrets.WORKFLOW_ID_SE_TESTS }}
62-
MINDEE_V2_API_KEY: ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }}
63-
MINDEE_V2_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
64-
MINDEE_V2_SE_TESTS_BLANK_PDF_URL: ${{ secrets.MINDEE_V2_SE_TESTS_BLANK_PDF_URL }}
6567
run: npm run test-integration
68+
69+
70+
run-tests-without-optional-dependencies:
71+
name: Run Integration Tests Without Optional Dependencies
72+
timeout-minutes: 30
73+
strategy:
74+
matrix:
75+
os:
76+
- "ubuntu-latest"
77+
- "windows-latest"
78+
- "macos-latest"
79+
node-version:
80+
- "18"
81+
- "24"
82+
runs-on: ${{ matrix.os }}
83+
84+
steps:
85+
- name: Check out Git repository
86+
uses: actions/checkout@v4
87+
with:
88+
submodules: recursive
89+
90+
- name: Set up Node.js ${{ matrix.node-version }}
91+
uses: actions/setup-node@v4
92+
with:
93+
node-version: ${{ matrix.node-version }}
94+
cache: "npm"
95+
96+
- name: Install Node.js dependencies
97+
run: npm ci --omit=optional
98+
99+
- name: Compilation
100+
run: npm run build
101+
102+
- name: Test code
103+
run: npm run test-integration-light

.github/workflows/_test-smoke.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Smoke Test
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
env:
8+
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
9+
MINDEE_V2_API_KEY: ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }}
10+
MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
11+
MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID }}
12+
MINDEE_V2_SE_TESTS_CROP_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CROP_MODEL_ID }}
13+
MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID }}
14+
MINDEE_V2_SE_TESTS_OCR_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_OCR_MODEL_ID }}
15+
16+
jobs:
17+
build:
18+
name: Run Tests
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
node-version:
23+
- "20"
24+
- "22"
25+
- "24"
26+
27+
steps:
28+
- name: Check out Git repository
29+
uses: actions/checkout@v4
30+
with:
31+
submodules: recursive
32+
33+
- name: Set up Node.js ${{ matrix.node-version }}
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: ${{ matrix.node-version }}
37+
cache: "npm"
38+
39+
- name: Install Node.js dependencies
40+
run: npm ci
41+
42+
- name: Build
43+
run: npm run build-for-dist
44+
45+
- name: Tests v2 sample code
46+
run: |
47+
./tests/test_v2_code_samples.sh
48+
49+
- name: Tests v2 CLI commands
50+
run: |
51+
./tests/test_v2_cli.sh
52+
53+
- name: Tests v1 sample code
54+
run: |
55+
./tests/test_v1_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }}

.github/workflows/_test-units.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
#
2-
# Run unit tests.
3-
#
41
name: Test
52

63
on:
74
workflow_call:
85

96
jobs:
10-
run-tests:
11-
name: Run Tests
7+
run-tests-with-optional-dependencies:
8+
name: Run Tests With Optional Dependencies
129
strategy:
1310
matrix:
1411
os:
@@ -45,3 +42,36 @@ jobs:
4542

4643
- name: Test code
4744
run: npm run test
45+
run-tests-without-optional-dependencies:
46+
name: Run Tests Without Optional Dependencies
47+
strategy:
48+
matrix:
49+
os:
50+
- "ubuntu-latest"
51+
node-version:
52+
- "18"
53+
- "20"
54+
- "22"
55+
- "24"
56+
runs-on: ${{ matrix.os }}
57+
58+
steps:
59+
- name: Check out Git repository
60+
uses: actions/checkout@v4
61+
with:
62+
submodules: recursive
63+
64+
- name: Set up Node.js ${{ matrix.node-version }}
65+
uses: actions/setup-node@v4
66+
with:
67+
node-version: ${{ matrix.node-version }}
68+
cache: "npm"
69+
70+
- name: Install Node.js dependencies
71+
run: npm ci --omit=optional
72+
73+
- name: Compilation
74+
run: npm run build
75+
76+
- name: Test code
77+
run: npm run test-light

.github/workflows/pull-request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
uses: ./.github/workflows/_test-units.yml
1515
needs: static_analysis
1616
secrets: inherit
17+
test_smoke:
18+
uses: ./.github/workflows/_test-smoke.yml
19+
needs: static_analysis
20+
secrets: inherit
1721
test_integrations:
1822
uses: ./.github/workflows/_test-integrations.yml
1923
needs: test_units
2024
secrets: inherit
21-
test_code_samples:
22-
uses: ./.github/workflows/_test-code-samples.yml
23-
needs: test_units
24-
secrets: inherit

.mocharc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json.schemastore.org/mocharc",
33
"extension": ["ts"],
4-
"require": "ts-node/register",
4+
"node-option": ["import=tsx"],
55
"spec": ["tests"]
66
}

0 commit comments

Comments
 (0)