Socket
Socket
Sign inDemoInstall

mindee

Package Overview
Dependencies
2
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

30

CHANGELOG.md
# CHANGELOG
## v1.0.4 (2021-02-18)
## v1.0.3 (01/02/2021)
### New
* :sparkles: :zap: Add a parameter `filename` and a default filename for streams
fix: :bug: _request parameters
fix: :bug: pageNumber default value
fix: :bug: reconstruction method set fields to probability
### Changes
* :zap: Change parse function to use an object instead of multiples parameters
## v1.0.2 (01/02/2021)
## v1.0.3 (2021-02-01)
chg: :sparkles: Better coverage for total tax
fix: :bug: includeWords is now working
### Fixes
* :bug: _request parameters
* :bug: `pageNumber` default value
* :bug: reconstruction method set fields to probability
## v1.0.1 (11/01/2021)
## v1.0.2 (2021-02-01)
🎉 First release
### Changes
* :zap: Better coverage for total tax
### Fixes
* :bug: `includeWords` is now working
## v1.0.1 (2021-01-11)
* 🎉 First release

@@ -8,3 +8,3 @@ const { Client } = require("mindee");

mindeeClient.financialDocument
.parse("./documents/receipts/receipt.jpg")
.parse({ input: "./documents/receipts/receipt.jpg" })
.then((res) => {

@@ -25,3 +25,3 @@ console.log("Success !");

mindeeClient.financialDocument
.parse(base64, "base64")
.parse({ input: base64, inputType: "base64" })
.then((res) => {

@@ -28,0 +28,0 @@ console.log("Success !");

@@ -9,3 +9,3 @@ const { Client } = require("mindee");

mindeeClient.invoice
.parse("./documents/invoices/invoice.pdf")
.parse({ input: "./documents/invoices/invoice.pdf" })
.then((res) => {

@@ -22,3 +22,3 @@ console.log("Success !");

mindeeClient.invoice
.parse("./documents/invoices/invoice_6p.pdf")
.parse({ input: "./documents/invoices/invoice_6p.pdf" })
.then((res) => {

@@ -38,3 +38,3 @@ console.log("Success !");

mindeeClient.invoice
.parse(base64, "base64")
.parse({ input: base64, inputType: "base64" })
.then((res) => {

@@ -52,3 +52,3 @@ console.log("Success !");

mindeeClient.invoice
.parse(stream, "stream")
.parse({ input: stream, inputType: "stream" })
.then((res) => {

@@ -55,0 +55,0 @@ console.log("Success !");

@@ -9,3 +9,3 @@ const { Client } = require("mindee");

mindeeClient.receipt
.parse("./documents/receipts/receipt.jpg")
.parse({ input: "./documents/receipts/receipt.jpg" })
.then((res) => {

@@ -25,3 +25,3 @@ console.log("Success !");

mindeeClient.receipt
.parse(base64, "base64")
.parse({ input: base64, inputType: "base64" })
.then((res) => {

@@ -39,3 +39,3 @@ console.log("Success !");

mindeeClient.receipt
.parse(stream, "stream")
.parse({ input: stream, inputType: "stream" })
.then((res) => {

@@ -42,0 +42,0 @@ console.log("Success !");

@@ -27,5 +27,4 @@ "use strict";

parse(file) {
var _arguments = arguments,
_superprop_getParse = () => super.parse,
parse(_ref) {
var _superprop_getParse = () => super.parse,
_superprop_get_request = () => super._request,

@@ -35,9 +34,14 @@ _this = this;

return _asyncToGenerator(function* () {
var inputType = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : "path";
var version = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : "3";
var cutPdf = _arguments.length > 3 && _arguments[3] !== undefined ? _arguments[3] : true;
var includeWords = _arguments.length > 4 && _arguments[4] !== undefined ? _arguments[4] : false;
var {
input,
inputType = "path",
filename = undefined,
version = "3",
cutPdf = true,
includeWords = false
} = _ref;
var inputFile = new Input({
file,
file: input,
inputType,
filename,
cutPdf

@@ -44,0 +48,0 @@ });

@@ -27,5 +27,4 @@ "use strict";

parse(file) {
var _arguments = arguments,
_superprop_getParse = () => super.parse,
parse(_ref) {
var _superprop_getParse = () => super.parse,
_superprop_get_request = () => super._request,

@@ -35,6 +34,10 @@ _this = this;

return _asyncToGenerator(function* () {
var inputType = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : "path";
var version = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : "2";
var cutPdf = _arguments.length > 3 && _arguments[3] !== undefined ? _arguments[3] : true;
var includeWords = _arguments.length > 4 && _arguments[4] !== undefined ? _arguments[4] : false;
var {
input,
inputType = "path",
filename = undefined,
version = "2",
cutPdf = true,
includeWords = false
} = _ref;

@@ -44,4 +47,5 @@ _superprop_getParse().call(_this);

var inputFile = new Input({
file,
file: input,
inputType,
filename,
cutPdf

@@ -48,0 +52,0 @@ });

@@ -27,5 +27,4 @@ "use strict";

parse(file) {
var _arguments = arguments,
_superprop_getParse = () => super.parse,
parse(_ref) {
var _superprop_getParse = () => super.parse,
_superprop_get_request = () => super._request,

@@ -35,6 +34,10 @@ _this = this;

return _asyncToGenerator(function* () {
var inputType = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : "path";
var version = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : "3";
var cutPdf = _arguments.length > 3 && _arguments[3] !== undefined ? _arguments[3] : true;
var includeWords = _arguments.length > 4 && _arguments[4] !== undefined ? _arguments[4] : false;
var {
input,
inputType = "path",
filename = undefined,
version = "3",
cutPdf = true,
includeWords = false
} = _ref;

@@ -44,4 +47,5 @@ _superprop_getParse().call(_this);

var inputFile = new Input({
file,
file: input,
inputType,
filename,
cutPdf

@@ -48,0 +52,0 @@ });

@@ -28,3 +28,3 @@ "use strict";

if (input.inputType === "path") {
if (["path", "stream"].includes(input.inputType)) {
var fileParams = {

@@ -36,6 +36,2 @@ filename: input.filename

headers = _objectSpread(_objectSpread({}, headers), form.getHeaders());
} else if (input.inputType === "stream") {
form.append("file", input.fileObject);
if (includeWords) form.append("include_mvision", "true");
headers = _objectSpread(_objectSpread({}, headers), form.getHeaders());
} else if (input.inputType === "base64") {

@@ -42,0 +38,0 @@ var body_obj = {

@@ -80,3 +80,3 @@ "use strict";

_this2.filepath = _this2.file;
_this2.filename = path.basename(_this2.file); // Check if file type is valid
_this2.filename = _this2.filename || path.basename(_this2.file); // Check if file type is valid

@@ -102,4 +102,4 @@ var filetype = _this2.filename.split(".").pop();

_this3.fileObject = _this3.file;
_this3.filename = _this3.filename || "stream";
_this3.filepath = undefined;
_this3.filename = undefined;
})();

@@ -106,0 +106,0 @@ }

{
"name": "mindee",
"version": "1.0.3",
"version": "1.0.4",
"description": "Mindee API SDK for Node.js",

@@ -15,9 +15,9 @@ "main": "lib/index.js",

"type": "git",
"url": "git+https://github.com/publicMindee/mindee-api-nodejs.git"
"url": "git+https://github.com/mindee/mindee-api-nodejs.git"
},
"author": "@techmindee",
"bugs": {
"url": "https://github.com/publicMindee/mindee-api-nodejs/issues"
"url": "https://github.com/mindee/mindee-api-nodejs/issues"
},
"homepage": "https://github.com/publicMindee/mindee-api-nodejs/#readme",
"homepage": "https://github.com/mindee/mindee-api-nodejs/#readme",
"devDependencies": {

@@ -24,0 +24,0 @@ "@babel/cli": "^7.12.8",

@@ -25,5 +25,8 @@ # API SDK for Node.js

mindeeClient.invoice.parse("path/to/file", "file");
mindeeClient.receipt.parse(base64String, "base64");
mindeeClient.financialDocument.parse(base64String, "base64");
mindeeClient.invoice.parse({ input: "path/to/file", inputType: "file" });
mindeeClient.receipt.parse({ input: base64String, inputType: "base64" });
mindeeClient.financialDocument.parse({
input: base64String,
inputType: "base64",
});
```

@@ -58,3 +61,3 @@

mindeeClient.invoice
.parse("./documents/invoices/invoice.pdf") // see examples for more input types
.parse({ input: "./documents/invoices/invoice.pdf" }) // see examples for more input types
.then((res) => {

@@ -71,2 +74,3 @@ console.log("Success !");

## Parsing receipts
```js

@@ -81,3 +85,3 @@ const { Client } = require("mindee");

mindeeClient.receipt
.parse("./documents/receipts/receipt.jpg") // see examples for more input types
.parse({ input: "./documents/receipts/receipt.jpg" }) // see examples for more input types
.then((res) => {

@@ -108,3 +112,3 @@ console.log("Success !");

mindeeClient.financialDocument
.parse("./documents/receipts/receipt.jpg")
.parse({ input: "./documents/receipts/receipt.jpg" })
.then((res) => {

@@ -118,3 +122,2 @@ console.log("Success !");

});
```

@@ -121,0 +124,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc