Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .github/workflows/_publish-code.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#
# Publish releases to NPM
#
name: Publish Code

on:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/_publish-docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#
# Publish Documentation to GitHub pages.
#
name: Publish Documentation

on:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/_static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#
# Run static code analysis.
#
name: Static Analysis

on:
Expand All @@ -18,7 +15,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"

- name: Install Node.js dependencies
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/_test-code-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ on:
workflow_call:
workflow_dispatch:

env:
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
MINDEE_V2_API_KEY: ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }}
MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID }}
MINDEE_V2_SE_TESTS_CROP_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CROP_MODEL_ID }}
MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID }}
MINDEE_V2_SE_TESTS_OCR_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_OCR_MODEL_ID }}

jobs:
build:
name: Run Tests
Expand Down Expand Up @@ -33,7 +42,10 @@ jobs:
- name: Build
run: npm run build-for-dist

- name: Tests sample code
- name: Tests v2 sample code
run: |
./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 }}
./tests/test_v2_code_samples.sh

- name: Tests v1 sample code
run: |
./tests/test_v1_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }}
20 changes: 11 additions & 9 deletions .github/workflows/_test-integrations.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#
# Run integration tests.
#
name: Integration Test

on:
workflow_call:
workflow_dispatch:

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_SE_TESTS_BLANK_PDF_URL: ${{ secrets.MINDEE_V2_SE_TESTS_BLANK_PDF_URL }}
MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID }}
MINDEE_V2_SE_TESTS_CROP_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CROP_MODEL_ID }}
MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID }}
MINDEE_V2_SE_TESTS_OCR_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_OCR_MODEL_ID }}

jobs:
run-tests:
name: Run Integration Tests
Expand Down Expand Up @@ -56,10 +64,4 @@ jobs:
run: npm run build

- name: Test code
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 }}
MINDEE_V2_SE_TESTS_BLANK_PDF_URL: ${{ secrets.MINDEE_V2_SE_TESTS_BLANK_PDF_URL }}
run: npm run test-integration
3 changes: 0 additions & 3 deletions .github/workflows/_test-units.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#
# Run unit tests.
#
name: Test

on:
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/mocharc",
"extension": ["ts"],
"require": "ts-node/register",
"node-option": ["import=tsx"],
"spec": ["tests"]
}
5 changes: 0 additions & 5 deletions bin/mindee.ts

This file was deleted.

5 changes: 5 additions & 0 deletions bin/mindeeV1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

import { cli } from "@/v1/cli.js";

cli();
5 changes: 5 additions & 0 deletions bin/mindeeV2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

import { cli } from "@/v2/cli.js";

cli();
6 changes: 4 additions & 2 deletions docs/code_samples/bank_account_details_v1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const mindee = require("mindee");
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
const mindeeClient = new mindee.v1.Client(
{ apiKey: "my-api-key" }
);

// Load a file from disk
const inputSource = new mindee.PathInput(
Expand All @@ -12,7 +14,7 @@ const inputSource = new mindee.PathInput(

// Parse the file
const apiResponse = mindeeClient.parse(
mindee.product.fr.BankAccountDetailsV1,
mindee.v1.product.fr.BankAccountDetailsV1,
inputSource
);

Expand Down
6 changes: 4 additions & 2 deletions docs/code_samples/bank_account_details_v2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const mindee = require("mindee");
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
const mindeeClient = new mindee.v1.Client(
{ apiKey: "my-api-key" }
);

// Load a file from disk
const inputSource = new mindee.PathInput(
Expand All @@ -12,7 +14,7 @@ const inputSource = new mindee.PathInput(

// Parse the file
const apiResponse = mindeeClient.parse(
mindee.product.fr.BankAccountDetailsV2,
mindee.v1.product.fr.BankAccountDetailsV2,
inputSource
);

Expand Down
6 changes: 4 additions & 2 deletions docs/code_samples/bank_check_v1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const mindee = require("mindee");
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
const mindeeClient = new mindee.v1.Client(
{ apiKey: "my-api-key" }
);

// Load a file from disk
const inputSource = new mindee.PathInput(
Expand All @@ -12,7 +14,7 @@ const inputSource = new mindee.PathInput(

// Parse the file
const apiResponse = mindeeClient.parse(
mindee.product.us.BankCheckV1,
mindee.v1.product.us.BankCheckV1,
inputSource
);

Expand Down
6 changes: 4 additions & 2 deletions docs/code_samples/barcode_reader_v1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const mindee = require("mindee");
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
const mindeeClient = new mindee.v1.Client(
{ apiKey: "my-api-key" }
);

// Load a file from disk
const inputSource = new mindee.PathInput(
Expand All @@ -12,7 +14,7 @@ const inputSource = new mindee.PathInput(

// Parse the file
const apiResponse = mindeeClient.parse(
mindee.product.BarcodeReaderV1,
mindee.v1.product.BarcodeReaderV1,
inputSource
);

Expand Down
23 changes: 0 additions & 23 deletions docs/code_samples/bill_of_lading_v1_async.txt

This file was deleted.

23 changes: 0 additions & 23 deletions docs/code_samples/business_card_v1_async.txt

This file was deleted.

6 changes: 4 additions & 2 deletions docs/code_samples/carte_grise_v1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const mindee = require("mindee");
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
const mindeeClient = new mindee.v1.Client(
{ apiKey: "my-api-key" }
);

// Load a file from disk
const inputSource = new mindee.PathInput(
Expand All @@ -12,7 +14,7 @@ const inputSource = new mindee.PathInput(

// Parse the file
const apiResponse = mindeeClient.parse(
mindee.product.fr.CarteGriseV1,
mindee.v1.product.fr.CarteGriseV1,
inputSource
);

Expand Down
6 changes: 4 additions & 2 deletions docs/code_samples/cropper_v1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const mindee = require("mindee");
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
const mindeeClient = new mindee.v1.Client(
{ apiKey: "my-api-key" }
);

// Load a file from disk
const inputSource = new mindee.PathInput(
Expand All @@ -12,7 +14,7 @@ const inputSource = new mindee.PathInput(

// Parse the file
const apiResponse = mindeeClient.parse(
mindee.product.CropperV1,
mindee.v1.product.CropperV1,
inputSource
);

Expand Down
32 changes: 0 additions & 32 deletions docs/code_samples/custom_v1.txt

This file was deleted.

6 changes: 4 additions & 2 deletions docs/code_samples/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const mindee = require("mindee");
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
const mindeeClient = new mindee.v1.Client(
{ apiKey: "my-api-key" }
);

// Load a file from disk
const inputSource = new mindee.PathInput(
Expand All @@ -20,7 +22,7 @@ const customEndpoint = mindeeClient.createEndpoint(
// Parse the file.
const apiResponse = mindeeClient
.parse(
mindee.product.GeneratedV1,
mindee.v1.product.GeneratedV1,
inputSource,
{ endpoint: customEndpoint }
);
Expand Down
6 changes: 4 additions & 2 deletions docs/code_samples/default_async.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const mindee = require("mindee");
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
const mindeeClient = new mindee.v1.Client(
{ apiKey: "my-api-key" }
);

// Load a file from disk
const inputSource = new mindee.PathInput(
Expand All @@ -19,7 +21,7 @@ const customEndpoint = mindeeClient.createEndpoint(

// Parse the file asynchronously.
const asyncApiResponse = mindeeClient.enqueueAndParse(
mindee.product.GeneratedV1,
mindee.v1.product.GeneratedV1,
inputSource,
{ endpoint: customEndpoint }
);
Expand Down
23 changes: 0 additions & 23 deletions docs/code_samples/delivery_notes_v1_async.txt

This file was deleted.

Loading
Loading