mindee 1.0.2 → 1.0.7
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 +36 -5
- package/README.md +11 -8
- package/examples/documents/invoices/credit_note.pdf +899 -1
- package/examples/financialDocument.js +2 -2
- package/examples/invoice.js +21 -4
- package/examples/receipt.js +3 -3
- package/lib/api/financialDocument.js +12 -8
- package/lib/api/invoice.js +28 -9
- package/lib/api/receipt.js +13 -9
- package/lib/api/request.js +1 -5
- package/lib/documents/document.js +4 -2
- package/lib/documents/fields/amount.js +1 -1
- package/lib/documents/fields/date.js +1 -1
- package/lib/documents/fields/locale.js +1 -1
- package/lib/documents/fields/orientation.js +1 -1
- package/lib/documents/fields/paymentDetails.js +1 -1
- package/lib/documents/fields/tax.js +1 -1
- package/lib/inputs.js +52 -4
- package/mindee/api/financialDocument.js +40 -0
- package/mindee/api/index.js +5 -0
- package/mindee/api/invoice.js +48 -0
- package/mindee/api/object.js +82 -0
- package/mindee/api/receipt.js +34 -0
- package/mindee/api/request.js +63 -0
- package/mindee/api/response.js +62 -0
- package/mindee/documents/document.js +65 -0
- package/mindee/documents/fields/amount.js +25 -0
- package/mindee/documents/fields/date.js +29 -0
- package/mindee/documents/fields/field.js +89 -0
- package/mindee/documents/fields/index.js +7 -0
- package/mindee/documents/fields/locale.js +30 -0
- package/mindee/documents/fields/orientation.js +24 -0
- package/mindee/documents/fields/paymentDetails.js +52 -0
- package/mindee/documents/fields/tax.js +47 -0
- package/mindee/documents/financialDocument.js +204 -0
- package/mindee/documents/index.js +5 -0
- package/mindee/documents/invoice.js +395 -0
- package/mindee/documents/receipt.js +272 -0
- package/mindee/errors/handler.js +16 -0
- package/mindee/index.js +35 -0
- package/mindee/inputs.js +155 -0
- package/mindee/logger.js +33 -0
- package/package.json +12 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
## v1.0.
|
|
3
|
+
## v1.0.7 (2021-11-25)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
### New
|
|
6
|
+
- ✨ Added pdf page number parameter for multi-pages pdfs with file
|
|
7
7
|
|
|
8
|
+
### Changes
|
|
9
|
+
- :arrow_up: upgrade path-parse dependency
|
|
10
|
+
- :arrow_up: upgrade browserslist dependency
|
|
11
|
+
- :arrow_up: upgrade lodash dependency
|
|
12
|
+
- :arrow_up: upgrade y18n dependency
|
|
8
13
|
|
|
9
|
-
## v1.0.
|
|
14
|
+
## v1.0.4 (2021-02-18)
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
### New
|
|
17
|
+
* :sparkles: :zap: Add a parameter `filename` and a default filename for streams
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
* :zap: Change parse function to use an object instead of multiples parameters
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## v1.0.3 (2021-02-01)
|
|
24
|
+
|
|
25
|
+
### Fixes
|
|
26
|
+
* :bug: _request parameters
|
|
27
|
+
* :bug: `pageNumber` default value
|
|
28
|
+
* :bug: reconstruction method set fields to probability
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## v1.0.2 (2021-02-01)
|
|
32
|
+
|
|
33
|
+
### Changes
|
|
34
|
+
* :zap: Better coverage for total tax
|
|
35
|
+
|
|
36
|
+
### Fixes
|
|
37
|
+
* :bug: `includeWords` is now working
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## v1.0.1 (2021-01-11)
|
|
41
|
+
|
|
42
|
+
* 🎉 First release
|
package/README.md
CHANGED
|
@@ -17,14 +17,17 @@ You can use the SDK easily by creating a Client like this :
|
|
|
17
17
|
```js
|
|
18
18
|
const { Client } = require("mindee");
|
|
19
19
|
|
|
20
|
-
const mindeeClient = Client({
|
|
20
|
+
const mindeeClient = new Client({
|
|
21
21
|
invoiceToken: "invoiceApiToken",
|
|
22
22
|
receiptToken: "receiptExpenseApiToken",
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
mindeeClient.invoice.parse("path/to/file", "file");
|
|
26
|
-
mindeeClient.receipt.parse(base64String, "base64");
|
|
27
|
-
mindeeClient.financialDocument.parse(
|
|
25
|
+
mindeeClient.invoice.parse({ input: "path/to/file", inputType: "file" });
|
|
26
|
+
mindeeClient.receipt.parse({ input: base64String, inputType: "base64" });
|
|
27
|
+
mindeeClient.financialDocument.parse({
|
|
28
|
+
input: base64String,
|
|
29
|
+
inputType: "base64",
|
|
30
|
+
});
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
Three apis are actually supported : invoice (`ìnvoice`), receipt (`receipt`) and financial document (`financialDocument`)
|
|
@@ -54,7 +57,7 @@ const mindeeClient = new Client();
|
|
|
54
57
|
|
|
55
58
|
// parsing invoice from pdf
|
|
56
59
|
mindeeClient.invoice
|
|
57
|
-
.parse("./documents/invoices/invoice.pdf") // see examples for more input types
|
|
60
|
+
.parse({ input: "./documents/invoices/invoice.pdf" }) // see examples for more input types
|
|
58
61
|
.then((res) => {
|
|
59
62
|
console.log("Success !");
|
|
60
63
|
console.log(res.invoices);
|
|
@@ -66,6 +69,7 @@ mindeeClient.invoice
|
|
|
66
69
|
```
|
|
67
70
|
|
|
68
71
|
## Parsing receipts
|
|
72
|
+
|
|
69
73
|
```js
|
|
70
74
|
const { Client } = require("mindee");
|
|
71
75
|
const fs = require("fs");
|
|
@@ -75,7 +79,7 @@ const mindeeClient = new Client();
|
|
|
75
79
|
|
|
76
80
|
// parsing receipt from picture
|
|
77
81
|
mindeeClient.receipt
|
|
78
|
-
.parse("./documents/receipts/receipt.jpg") // see examples for more input types
|
|
82
|
+
.parse({ input: "./documents/receipts/receipt.jpg" }) // see examples for more input types
|
|
79
83
|
.then((res) => {
|
|
80
84
|
console.log("Success !");
|
|
81
85
|
console.log(res.receipts);
|
|
@@ -101,7 +105,7 @@ const mindeeClient = new Client();
|
|
|
101
105
|
|
|
102
106
|
// parsing receipt from picture
|
|
103
107
|
mindeeClient.financialDocument
|
|
104
|
-
.parse("./documents/receipts/receipt.jpg")
|
|
108
|
+
.parse({ input: "./documents/receipts/receipt.jpg" })
|
|
105
109
|
.then((res) => {
|
|
106
110
|
console.log("Success !");
|
|
107
111
|
console.log(res.financialDocuments);
|
|
@@ -110,7 +114,6 @@ mindeeClient.financialDocument
|
|
|
110
114
|
.catch((err) => {
|
|
111
115
|
console.error(err);
|
|
112
116
|
});
|
|
113
|
-
|
|
114
117
|
```
|
|
115
118
|
|
|
116
119
|
# Tests
|