mindee 4.19.0 → 4.21.0
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 +15 -0
- package/README.md +25 -11
- package/package.json +1 -1
- package/src/cli.js +10 -20
- package/src/client.d.ts +3 -3
- package/src/client.js +2 -2
- package/src/http/baseEndpoint.js +2 -2
- package/src/http/endpoint.js +2 -2
- package/src/http/workflowEndpoint.js +2 -2
- package/src/imageOperations/invoiceSplitterExtractor/invoiceSplitterExtractor.d.ts +1 -1
- package/src/imageOperations/multiReceiptsExtractor/multiReceiptsExtractor.d.ts +1 -1
- package/src/input/index.d.ts +1 -2
- package/src/input/index.js +16 -15
- package/src/input/sources/base64Input.d.ts +12 -0
- package/src/input/sources/base64Input.js +22 -0
- package/src/input/sources/bufferInput.d.ts +10 -0
- package/src/input/sources/bufferInput.js +18 -0
- package/src/input/sources/bytesInput.d.ts +12 -0
- package/src/input/sources/bytesInput.js +21 -0
- package/src/input/sources/index.d.ts +8 -0
- package/src/input/sources/index.js +24 -0
- package/src/input/sources/inputSource.d.ts +16 -0
- package/src/input/sources/inputSource.js +17 -0
- package/src/input/sources/localInputSource.d.ts +20 -0
- package/src/input/{base.js → sources/localInputSource.js} +16 -26
- package/src/input/sources/pathInput.d.ts +11 -0
- package/src/input/sources/pathInput.js +27 -0
- package/src/input/sources/streamInput.d.ts +14 -0
- package/src/input/sources/streamInput.js +28 -0
- package/src/input/sources/urlInput.d.ts +32 -0
- package/src/input/sources/urlInput.js +98 -0
- package/src/product/driverLicense/driverLicenseV1.d.ts +16 -0
- package/src/product/driverLicense/driverLicenseV1.js +27 -0
- package/src/product/driverLicense/driverLicenseV1Document.d.ts +38 -0
- package/src/product/driverLicense/driverLicenseV1Document.js +84 -0
- package/src/product/driverLicense/index.d.ts +1 -0
- package/src/product/driverLicense/index.js +5 -0
- package/src/product/driverLicense/internal.d.ts +2 -0
- package/src/product/driverLicense/internal.js +7 -0
- package/src/product/fr/{carteVitale/carteVitaleV1.d.ts → healthCard/healthCardV1.d.ts} +5 -5
- package/src/product/fr/{carteVitale/carteVitaleV1.js → healthCard/healthCardV1.js} +8 -8
- package/src/product/fr/{carteVitale/carteVitaleV1Document.d.ts → healthCard/healthCardV1Document.d.ts} +5 -5
- package/src/product/fr/{carteVitale/carteVitaleV1Document.js → healthCard/healthCardV1Document.js} +5 -5
- package/src/product/fr/healthCard/index.d.ts +1 -0
- package/src/product/fr/healthCard/index.js +5 -0
- package/src/product/fr/healthCard/internal.d.ts +2 -0
- package/src/product/fr/healthCard/internal.js +7 -0
- package/src/product/fr/index.d.ts +2 -1
- package/src/product/fr/index.js +5 -3
- package/src/product/fr/internal.d.ts +1 -1
- package/src/product/fr/internal.js +2 -2
- package/src/product/fr/payslip/index.d.ts +1 -0
- package/src/product/fr/payslip/index.js +3 -1
- package/src/product/fr/payslip/internal.d.ts +10 -0
- package/src/product/fr/payslip/internal.js +21 -1
- package/src/product/fr/payslip/payslipV3.d.ts +16 -0
- package/src/product/fr/payslip/payslipV3.js +27 -0
- package/src/product/fr/payslip/payslipV3BankAccountDetail.d.ts +32 -0
- package/src/product/fr/payslip/payslipV3BankAccountDetail.js +62 -0
- package/src/product/fr/payslip/payslipV3Document.d.ts +35 -0
- package/src/product/fr/payslip/payslipV3Document.js +96 -0
- package/src/product/fr/payslip/payslipV3Employee.d.ts +40 -0
- package/src/product/fr/payslip/payslipV3Employee.js +82 -0
- package/src/product/fr/payslip/payslipV3Employer.d.ts +40 -0
- package/src/product/fr/payslip/payslipV3Employer.js +82 -0
- package/src/product/fr/payslip/payslipV3Employment.d.ts +40 -0
- package/src/product/fr/payslip/payslipV3Employment.js +82 -0
- package/src/product/fr/payslip/payslipV3PaidTimeOff.d.ts +36 -0
- package/src/product/fr/payslip/payslipV3PaidTimeOff.js +107 -0
- package/src/product/fr/payslip/payslipV3PayDetail.d.ts +46 -0
- package/src/product/fr/payslip/payslipV3PayDetail.js +168 -0
- package/src/product/fr/payslip/payslipV3PayPeriod.d.ts +36 -0
- package/src/product/fr/payslip/payslipV3PayPeriod.js +72 -0
- package/src/product/fr/payslip/payslipV3SalaryDetail.d.ts +36 -0
- package/src/product/fr/payslip/payslipV3SalaryDetail.js +110 -0
- package/src/product/ind/indianPassport/indianPassportV1Document.d.ts +1 -1
- package/src/product/ind/indianPassport/indianPassportV1Document.js +1 -1
- package/src/product/index.d.ts +1 -0
- package/src/product/index.js +3 -1
- package/src/product/internal.d.ts +1 -0
- package/src/product/internal.js +2 -1
- package/src/product/resume/resumeV1Document.d.ts +1 -1
- package/src/product/resume/resumeV1Document.js +1 -1
- package/src/input/base.d.ts +0 -36
- package/src/input/sources.d.ts +0 -59
- package/src/input/sources.js +0 -133
- package/src/product/fr/carteVitale/index.d.ts +0 -1
- package/src/product/fr/carteVitale/index.js +0 -5
- package/src/product/fr/carteVitale/internal.d.ts +0 -2
- package/src/product/fr/carteVitale/internal.js +0 -7
|
@@ -9,7 +9,7 @@ const resumeV1ProfessionalExperience_1 = require("./resumeV1ProfessionalExperien
|
|
|
9
9
|
const resumeV1Certificate_1 = require("./resumeV1Certificate");
|
|
10
10
|
const standard_1 = require("../../parsing/standard");
|
|
11
11
|
/**
|
|
12
|
-
* Resume API version 1.
|
|
12
|
+
* Resume API version 1.2 document data.
|
|
13
13
|
*/
|
|
14
14
|
class ResumeV1Document {
|
|
15
15
|
constructor(rawPrediction, pageId) {
|
package/src/input/base.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { PageOptions } from "./pageOptions";
|
|
2
|
-
/**
|
|
3
|
-
* @param {string} inputType - the type of input used in file ("base64", "path", "dummy").
|
|
4
|
-
* NB: dummy is only used for tests purposes
|
|
5
|
-
*/
|
|
6
|
-
interface InputConstructor {
|
|
7
|
-
inputType: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const INPUT_TYPE_STREAM = "stream";
|
|
10
|
-
export declare const INPUT_TYPE_BASE64 = "base64";
|
|
11
|
-
export declare const INPUT_TYPE_BYTES = "bytes";
|
|
12
|
-
export declare const INPUT_TYPE_PATH = "path";
|
|
13
|
-
export declare const INPUT_TYPE_BUFFER = "buffer";
|
|
14
|
-
export declare abstract class InputSource {
|
|
15
|
-
fileObject: Buffer | string;
|
|
16
|
-
init(): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
export declare abstract class LocalInputSource extends InputSource {
|
|
19
|
-
inputType: string;
|
|
20
|
-
filename: string;
|
|
21
|
-
filepath?: string;
|
|
22
|
-
mimeType: string;
|
|
23
|
-
fileObject: Buffer | string;
|
|
24
|
-
/**
|
|
25
|
-
* @param {InputConstructor} constructor Constructor parameters.
|
|
26
|
-
*/
|
|
27
|
-
protected constructor({ inputType }: InputConstructor);
|
|
28
|
-
isPdf(): boolean;
|
|
29
|
-
checkMimetype(): Promise<string>;
|
|
30
|
-
/**
|
|
31
|
-
* Cut PDF pages.
|
|
32
|
-
* @param pageOptions
|
|
33
|
-
*/
|
|
34
|
-
cutPdf(pageOptions: PageOptions): Promise<void>;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
package/src/input/sources.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Readable } from "stream";
|
|
2
|
-
import { Buffer } from "buffer";
|
|
3
|
-
import { LocalInputSource, InputSource } from "./base";
|
|
4
|
-
interface PathInputProps {
|
|
5
|
-
inputPath: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class PathInput extends LocalInputSource {
|
|
8
|
-
readonly inputPath: string;
|
|
9
|
-
fileObject: Buffer;
|
|
10
|
-
constructor({ inputPath }: PathInputProps);
|
|
11
|
-
init(): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
interface Base64InputProps {
|
|
14
|
-
inputString: string;
|
|
15
|
-
filename: string;
|
|
16
|
-
}
|
|
17
|
-
export declare class Base64Input extends LocalInputSource {
|
|
18
|
-
private inputString;
|
|
19
|
-
fileObject: Buffer;
|
|
20
|
-
constructor({ inputString, filename }: Base64InputProps);
|
|
21
|
-
init(): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
interface StreamInputProps {
|
|
24
|
-
inputStream: Readable;
|
|
25
|
-
filename: string;
|
|
26
|
-
}
|
|
27
|
-
export declare class StreamInput extends LocalInputSource {
|
|
28
|
-
private readonly inputStream;
|
|
29
|
-
fileObject: Buffer;
|
|
30
|
-
constructor({ inputStream, filename }: StreamInputProps);
|
|
31
|
-
init(): Promise<void>;
|
|
32
|
-
stream2buffer(stream: Readable): Promise<Buffer>;
|
|
33
|
-
}
|
|
34
|
-
interface BytesInputProps {
|
|
35
|
-
inputBytes: string;
|
|
36
|
-
filename: string;
|
|
37
|
-
}
|
|
38
|
-
export declare class BytesInput extends LocalInputSource {
|
|
39
|
-
private inputBytes;
|
|
40
|
-
fileObject: Buffer;
|
|
41
|
-
constructor({ inputBytes, filename }: BytesInputProps);
|
|
42
|
-
init(): Promise<void>;
|
|
43
|
-
}
|
|
44
|
-
export declare class UrlInput extends InputSource {
|
|
45
|
-
private readonly url;
|
|
46
|
-
constructor({ url }: {
|
|
47
|
-
url: string;
|
|
48
|
-
});
|
|
49
|
-
init(): Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
interface BufferInputProps {
|
|
52
|
-
buffer: Buffer;
|
|
53
|
-
filename: string;
|
|
54
|
-
}
|
|
55
|
-
export declare class BufferInput extends LocalInputSource {
|
|
56
|
-
constructor({ buffer, filename }: BufferInputProps);
|
|
57
|
-
init(): Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
export {};
|
package/src/input/sources.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.BufferInput = exports.UrlInput = exports.BytesInput = exports.StreamInput = exports.Base64Input = exports.PathInput = void 0;
|
|
27
|
-
const fs_1 = require("fs");
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
|
-
const buffer_1 = require("buffer");
|
|
30
|
-
const logger_1 = require("../logger");
|
|
31
|
-
const base_1 = require("./base");
|
|
32
|
-
class PathInput extends base_1.LocalInputSource {
|
|
33
|
-
constructor({ inputPath }) {
|
|
34
|
-
super({
|
|
35
|
-
inputType: base_1.INPUT_TYPE_PATH,
|
|
36
|
-
});
|
|
37
|
-
this.fileObject = buffer_1.Buffer.alloc(0);
|
|
38
|
-
this.inputPath = inputPath;
|
|
39
|
-
this.filename = path.basename(this.inputPath);
|
|
40
|
-
}
|
|
41
|
-
async init() {
|
|
42
|
-
logger_1.logger.debug(`Loading from: ${this.inputPath}`);
|
|
43
|
-
this.fileObject = buffer_1.Buffer.from(await fs_1.promises.readFile(this.inputPath));
|
|
44
|
-
this.mimeType = await this.checkMimetype();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.PathInput = PathInput;
|
|
48
|
-
class Base64Input extends base_1.LocalInputSource {
|
|
49
|
-
constructor({ inputString, filename }) {
|
|
50
|
-
super({
|
|
51
|
-
inputType: base_1.INPUT_TYPE_BASE64,
|
|
52
|
-
});
|
|
53
|
-
this.fileObject = buffer_1.Buffer.alloc(0);
|
|
54
|
-
this.filename = filename;
|
|
55
|
-
this.inputString = inputString;
|
|
56
|
-
}
|
|
57
|
-
async init() {
|
|
58
|
-
this.fileObject = buffer_1.Buffer.from(this.inputString, "base64");
|
|
59
|
-
this.mimeType = await this.checkMimetype();
|
|
60
|
-
// clear out the string
|
|
61
|
-
this.inputString = "";
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.Base64Input = Base64Input;
|
|
65
|
-
class StreamInput extends base_1.LocalInputSource {
|
|
66
|
-
constructor({ inputStream, filename }) {
|
|
67
|
-
super({
|
|
68
|
-
inputType: base_1.INPUT_TYPE_STREAM,
|
|
69
|
-
});
|
|
70
|
-
this.fileObject = buffer_1.Buffer.alloc(0);
|
|
71
|
-
this.filename = filename;
|
|
72
|
-
this.inputStream = inputStream;
|
|
73
|
-
}
|
|
74
|
-
async init() {
|
|
75
|
-
this.fileObject = await this.stream2buffer(this.inputStream);
|
|
76
|
-
this.mimeType = await this.checkMimetype();
|
|
77
|
-
}
|
|
78
|
-
async stream2buffer(stream) {
|
|
79
|
-
return new Promise((resolve, reject) => {
|
|
80
|
-
const _buf = Array();
|
|
81
|
-
stream.on("data", (chunk) => _buf.push(chunk));
|
|
82
|
-
stream.on("end", () => resolve(buffer_1.Buffer.concat(_buf)));
|
|
83
|
-
stream.on("error", (err) => reject(`Error converting stream - ${err}`));
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.StreamInput = StreamInput;
|
|
88
|
-
class BytesInput extends base_1.LocalInputSource {
|
|
89
|
-
constructor({ inputBytes, filename }) {
|
|
90
|
-
super({
|
|
91
|
-
inputType: base_1.INPUT_TYPE_BYTES,
|
|
92
|
-
});
|
|
93
|
-
this.fileObject = buffer_1.Buffer.alloc(0);
|
|
94
|
-
this.filename = filename;
|
|
95
|
-
this.inputBytes = inputBytes;
|
|
96
|
-
}
|
|
97
|
-
async init() {
|
|
98
|
-
this.fileObject = buffer_1.Buffer.from(this.inputBytes, "hex");
|
|
99
|
-
this.mimeType = await this.checkMimetype();
|
|
100
|
-
// clear out the string
|
|
101
|
-
this.inputBytes = "";
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.BytesInput = BytesInput;
|
|
105
|
-
//
|
|
106
|
-
// URL
|
|
107
|
-
//
|
|
108
|
-
class UrlInput extends base_1.InputSource {
|
|
109
|
-
constructor({ url }) {
|
|
110
|
-
super();
|
|
111
|
-
this.url = url;
|
|
112
|
-
}
|
|
113
|
-
async init() {
|
|
114
|
-
if (!this.url.toLowerCase().startsWith("https")) {
|
|
115
|
-
throw new Error("URL must be HTTPS");
|
|
116
|
-
}
|
|
117
|
-
this.fileObject = this.url;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
exports.UrlInput = UrlInput;
|
|
121
|
-
class BufferInput extends base_1.LocalInputSource {
|
|
122
|
-
constructor({ buffer, filename }) {
|
|
123
|
-
super({
|
|
124
|
-
inputType: base_1.INPUT_TYPE_BUFFER,
|
|
125
|
-
});
|
|
126
|
-
this.fileObject = buffer;
|
|
127
|
-
this.filename = filename;
|
|
128
|
-
}
|
|
129
|
-
async init() {
|
|
130
|
-
this.mimeType = await this.checkMimetype();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
exports.BufferInput = BufferInput;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CarteVitaleV1 } from "./carteVitaleV1";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CarteVitaleV1 = void 0;
|
|
4
|
-
var carteVitaleV1_1 = require("./carteVitaleV1");
|
|
5
|
-
Object.defineProperty(exports, "CarteVitaleV1", { enumerable: true, get: function () { return carteVitaleV1_1.CarteVitaleV1; } });
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CarteVitaleV1Document = exports.CarteVitaleV1 = void 0;
|
|
4
|
-
var carteVitaleV1_1 = require("./carteVitaleV1");
|
|
5
|
-
Object.defineProperty(exports, "CarteVitaleV1", { enumerable: true, get: function () { return carteVitaleV1_1.CarteVitaleV1; } });
|
|
6
|
-
var carteVitaleV1Document_1 = require("./carteVitaleV1Document");
|
|
7
|
-
Object.defineProperty(exports, "CarteVitaleV1Document", { enumerable: true, get: function () { return carteVitaleV1Document_1.CarteVitaleV1Document; } });
|