mindee 4.1.0 → 4.2.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 +22 -0
- package/README.md +4 -1
- package/package.json +1 -1
- package/src/client.d.ts +9 -0
- package/src/client.js +7 -2
- package/src/http/error.d.ts +1 -1
- package/src/http/error.js +2 -2
- package/src/parsing/common/document.js +2 -1
- package/src/parsing/common/inference.js +1 -2
- package/src/parsing/standard/base.d.ts +2 -2
- package/src/parsing/standard/base.js +2 -2
- package/src/parsing/standard/field.d.ts +10 -10
- package/src/parsing/standard/field.js +10 -10
- package/src/parsing/standard/position.js +12 -1
- package/src/product/barcodeReader/barcodeReaderV1.d.ts +16 -0
- package/src/product/barcodeReader/barcodeReaderV1.js +22 -0
- package/src/product/barcodeReader/barcodeReaderV1Document.d.ts +16 -0
- package/src/product/barcodeReader/barcodeReaderV1Document.js +37 -0
- package/src/product/barcodeReader/internal.d.ts +2 -0
- package/src/product/barcodeReader/internal.js +7 -0
- package/src/product/cropper/cropperV1.d.ts +4 -3
- package/src/product/cropper/cropperV1.js +4 -3
- package/src/product/cropper/cropperV1Document.d.ts +2 -6
- package/src/product/cropper/cropperV1Document.js +2 -19
- package/src/product/cropper/cropperV1Page.d.ts +12 -0
- package/src/product/cropper/cropperV1Page.js +26 -0
- package/src/product/cropper/internal.d.ts +1 -0
- package/src/product/cropper/internal.js +3 -1
- package/src/product/fr/carteVitale/carteVitaleV1Document.js +1 -1
- package/src/product/fr/idCard/idCardV1Document.js +1 -1
- package/src/product/fr/idCard/idCardV2.d.ts +17 -0
- package/src/product/fr/idCard/idCardV2.js +23 -0
- package/src/product/fr/idCard/idCardV2Document.d.ts +42 -0
- package/src/product/fr/idCard/idCardV2Document.js +98 -0
- package/src/product/fr/idCard/idCardV2Page.d.ts +14 -0
- package/src/product/fr/idCard/idCardV2Page.js +27 -0
- package/src/product/fr/idCard/internal.d.ts +1 -0
- package/src/product/fr/idCard/internal.js +3 -1
- package/src/product/fr/index.d.ts +1 -0
- package/src/product/fr/index.js +3 -1
- package/src/product/index.d.ts +8 -6
- package/src/product/index.js +16 -12
- package/src/product/internal.d.ts +2 -0
- package/src/product/internal.js +3 -1
- package/src/product/multiReceiptsDetector/internal.d.ts +2 -0
- package/src/product/multiReceiptsDetector/internal.js +7 -0
- package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1.d.ts +16 -0
- package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +22 -0
- package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +14 -0
- package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +28 -0
- package/src/product/passport/passportV1Document.js +1 -1
- package/src/product/proofOfAddress/proofOfAddressV1Document.js +2 -2
- package/src/product/us/bankCheck/bankCheckV1Page.js +1 -1
- package/src/product/us/index.d.ts +1 -0
- package/src/product/us/index.js +3 -1
- package/src/product/us/w9/internal.d.ts +3 -0
- package/src/product/us/w9/internal.js +9 -0
- package/src/product/us/w9/w9V1.d.ts +17 -0
- package/src/product/us/w9/w9V1.js +23 -0
- package/src/product/us/w9/w9V1Document.d.ts +10 -0
- package/src/product/us/w9/w9V1Document.js +15 -0
- package/src/product/us/w9/w9V1Page.d.ts +34 -0
- package/src/product/us/w9/w9V1Page.js +78 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../../parsing/common";
|
|
2
|
+
import { DateField, StringField } from "../../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Document data for Carte Nationale d'Identité, API version 2.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IdCardV2Document implements Prediction {
|
|
7
|
+
/** The alternate name of the card holder. */
|
|
8
|
+
alternateName: StringField;
|
|
9
|
+
/** The name of the issuing authority. */
|
|
10
|
+
authority: StringField;
|
|
11
|
+
/** The date of birth of the card holder. */
|
|
12
|
+
birthDate: DateField;
|
|
13
|
+
/** The place of birth of the card holder. */
|
|
14
|
+
birthPlace: StringField;
|
|
15
|
+
/** The card access number (CAN). */
|
|
16
|
+
cardAccessNumber: StringField;
|
|
17
|
+
/** The document number. */
|
|
18
|
+
documentNumber: StringField;
|
|
19
|
+
/** The expiry date of the identification card. */
|
|
20
|
+
expiryDate: DateField;
|
|
21
|
+
/** The gender of the card holder. */
|
|
22
|
+
gender: StringField;
|
|
23
|
+
/** The given name(s) of the card holder. */
|
|
24
|
+
givenNames: StringField[];
|
|
25
|
+
/** The date of issue of the identification card. */
|
|
26
|
+
issueDate: DateField;
|
|
27
|
+
/** The Machine Readable Zone, first line. */
|
|
28
|
+
mrz1: StringField;
|
|
29
|
+
/** The Machine Readable Zone, second line. */
|
|
30
|
+
mrz2: StringField;
|
|
31
|
+
/** The Machine Readable Zone, third line. */
|
|
32
|
+
mrz3: StringField;
|
|
33
|
+
/** The nationality of the card holder. */
|
|
34
|
+
nationality: StringField;
|
|
35
|
+
/** The surname of the card holder. */
|
|
36
|
+
surname: StringField;
|
|
37
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
38
|
+
/**
|
|
39
|
+
* Default string representation.
|
|
40
|
+
*/
|
|
41
|
+
toString(): string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdCardV2Document = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const standard_1 = require("../../../parsing/standard");
|
|
6
|
+
/**
|
|
7
|
+
* Document data for Carte Nationale d'Identité, API version 2.
|
|
8
|
+
*/
|
|
9
|
+
class IdCardV2Document {
|
|
10
|
+
constructor(rawPrediction, pageId) {
|
|
11
|
+
/** The given name(s) of the card holder. */
|
|
12
|
+
this.givenNames = [];
|
|
13
|
+
this.alternateName = new standard_1.StringField({
|
|
14
|
+
prediction: rawPrediction["alternate_name"],
|
|
15
|
+
pageId: pageId,
|
|
16
|
+
});
|
|
17
|
+
this.authority = new standard_1.StringField({
|
|
18
|
+
prediction: rawPrediction["authority"],
|
|
19
|
+
pageId: pageId,
|
|
20
|
+
});
|
|
21
|
+
this.birthDate = new standard_1.DateField({
|
|
22
|
+
prediction: rawPrediction["birth_date"],
|
|
23
|
+
pageId: pageId,
|
|
24
|
+
});
|
|
25
|
+
this.birthPlace = new standard_1.StringField({
|
|
26
|
+
prediction: rawPrediction["birth_place"],
|
|
27
|
+
pageId: pageId,
|
|
28
|
+
});
|
|
29
|
+
this.cardAccessNumber = new standard_1.StringField({
|
|
30
|
+
prediction: rawPrediction["card_access_number"],
|
|
31
|
+
pageId: pageId,
|
|
32
|
+
});
|
|
33
|
+
this.documentNumber = new standard_1.StringField({
|
|
34
|
+
prediction: rawPrediction["document_number"],
|
|
35
|
+
pageId: pageId,
|
|
36
|
+
});
|
|
37
|
+
this.expiryDate = new standard_1.DateField({
|
|
38
|
+
prediction: rawPrediction["expiry_date"],
|
|
39
|
+
pageId: pageId,
|
|
40
|
+
});
|
|
41
|
+
this.gender = new standard_1.StringField({
|
|
42
|
+
prediction: rawPrediction["gender"],
|
|
43
|
+
pageId: pageId,
|
|
44
|
+
});
|
|
45
|
+
rawPrediction["given_names"] &&
|
|
46
|
+
rawPrediction["given_names"].map((itemPrediction) => this.givenNames.push(new standard_1.StringField({
|
|
47
|
+
prediction: itemPrediction,
|
|
48
|
+
pageId: pageId,
|
|
49
|
+
})));
|
|
50
|
+
this.issueDate = new standard_1.DateField({
|
|
51
|
+
prediction: rawPrediction["issue_date"],
|
|
52
|
+
pageId: pageId,
|
|
53
|
+
});
|
|
54
|
+
this.mrz1 = new standard_1.StringField({
|
|
55
|
+
prediction: rawPrediction["mrz1"],
|
|
56
|
+
pageId: pageId,
|
|
57
|
+
});
|
|
58
|
+
this.mrz2 = new standard_1.StringField({
|
|
59
|
+
prediction: rawPrediction["mrz2"],
|
|
60
|
+
pageId: pageId,
|
|
61
|
+
});
|
|
62
|
+
this.mrz3 = new standard_1.StringField({
|
|
63
|
+
prediction: rawPrediction["mrz3"],
|
|
64
|
+
pageId: pageId,
|
|
65
|
+
});
|
|
66
|
+
this.nationality = new standard_1.StringField({
|
|
67
|
+
prediction: rawPrediction["nationality"],
|
|
68
|
+
pageId: pageId,
|
|
69
|
+
});
|
|
70
|
+
this.surname = new standard_1.StringField({
|
|
71
|
+
prediction: rawPrediction["surname"],
|
|
72
|
+
pageId: pageId,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Default string representation.
|
|
77
|
+
*/
|
|
78
|
+
toString() {
|
|
79
|
+
const givenNames = this.givenNames.join("\n ");
|
|
80
|
+
const outStr = `:Nationality: ${this.nationality}
|
|
81
|
+
:Card Access Number: ${this.cardAccessNumber}
|
|
82
|
+
:Document Number: ${this.documentNumber}
|
|
83
|
+
:Given Name(s): ${givenNames}
|
|
84
|
+
:Surname: ${this.surname}
|
|
85
|
+
:Alternate Name: ${this.alternateName}
|
|
86
|
+
:Date of Birth: ${this.birthDate}
|
|
87
|
+
:Place of Birth: ${this.birthPlace}
|
|
88
|
+
:Gender: ${this.gender}
|
|
89
|
+
:Expiry Date: ${this.expiryDate}
|
|
90
|
+
:Mrz Line 1: ${this.mrz1}
|
|
91
|
+
:Mrz Line 2: ${this.mrz2}
|
|
92
|
+
:Mrz Line 3: ${this.mrz3}
|
|
93
|
+
:Date of Issue: ${this.issueDate}
|
|
94
|
+
:Issuing Authority: ${this.authority}`.trimEnd();
|
|
95
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.IdCardV2Document = IdCardV2Document;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/common";
|
|
2
|
+
import { ClassificationField } from "../../../parsing/standard";
|
|
3
|
+
import { IdCardV2Document } from "./idCardV2Document";
|
|
4
|
+
/**
|
|
5
|
+
* Page data for Carte Nationale d'Identité, API version 2.
|
|
6
|
+
*/
|
|
7
|
+
export declare class IdCardV2Page extends IdCardV2Document {
|
|
8
|
+
/** The sides of the document which are visible. */
|
|
9
|
+
documentSide: ClassificationField;
|
|
10
|
+
/** The document type or format. */
|
|
11
|
+
documentType: ClassificationField;
|
|
12
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
13
|
+
toString(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdCardV2Page = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const standard_1 = require("../../../parsing/standard");
|
|
6
|
+
const idCardV2Document_1 = require("./idCardV2Document");
|
|
7
|
+
/**
|
|
8
|
+
* Page data for Carte Nationale d'Identité, API version 2.
|
|
9
|
+
*/
|
|
10
|
+
class IdCardV2Page extends idCardV2Document_1.IdCardV2Document {
|
|
11
|
+
constructor(rawPrediction, pageId) {
|
|
12
|
+
super(rawPrediction, pageId);
|
|
13
|
+
this.documentSide = new standard_1.ClassificationField({
|
|
14
|
+
prediction: rawPrediction["document_side"],
|
|
15
|
+
});
|
|
16
|
+
this.documentType = new standard_1.ClassificationField({
|
|
17
|
+
prediction: rawPrediction["document_type"],
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
toString() {
|
|
21
|
+
let outStr = `:Document Type: ${this.documentType}
|
|
22
|
+
:Document Sides: ${this.documentSide}`.trimEnd();
|
|
23
|
+
outStr += "\n" + super.toString();
|
|
24
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.IdCardV2Page = IdCardV2Page;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IdCardV1Page = exports.IdCardV1Document = exports.IdCardV1 = void 0;
|
|
3
|
+
exports.IdCardV1Page = exports.IdCardV1Document = exports.IdCardV2 = exports.IdCardV1 = void 0;
|
|
4
4
|
var idCardV1_1 = require("./idCardV1");
|
|
5
5
|
Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return idCardV1_1.IdCardV1; } });
|
|
6
|
+
var idCardV2_1 = require("./idCardV2");
|
|
7
|
+
Object.defineProperty(exports, "IdCardV2", { enumerable: true, get: function () { return idCardV2_1.IdCardV2; } });
|
|
6
8
|
var idCardV1Document_1 = require("./idCardV1Document");
|
|
7
9
|
Object.defineProperty(exports, "IdCardV1Document", { enumerable: true, get: function () { return idCardV1Document_1.IdCardV1Document; } });
|
|
8
10
|
var idCardV1Page_1 = require("./idCardV1Page");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { IdCardV1 } from "./idCard/idCardV1";
|
|
2
|
+
export { IdCardV2 } from "./idCard/idCardV2";
|
|
2
3
|
export { BankAccountDetailsV1 } from "./bankAccountDetails/bankAccountDetailsV1";
|
|
3
4
|
export { BankAccountDetailsV2 } from "./bankAccountDetails/bankAccountDetailsV2";
|
|
4
5
|
export { CarteVitaleV1 } from "./carteVitale/carteVitaleV1";
|
package/src/product/fr/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CarteVitaleV1 = exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1 = exports.IdCardV1 = void 0;
|
|
3
|
+
exports.CarteVitaleV1 = exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1 = exports.IdCardV2 = exports.IdCardV1 = void 0;
|
|
4
4
|
var idCardV1_1 = require("./idCard/idCardV1");
|
|
5
5
|
Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return idCardV1_1.IdCardV1; } });
|
|
6
|
+
var idCardV2_1 = require("./idCard/idCardV2");
|
|
7
|
+
Object.defineProperty(exports, "IdCardV2", { enumerable: true, get: function () { return idCardV2_1.IdCardV2; } });
|
|
6
8
|
var bankAccountDetailsV1_1 = require("./bankAccountDetails/bankAccountDetailsV1");
|
|
7
9
|
Object.defineProperty(exports, "BankAccountDetailsV1", { enumerable: true, get: function () { return bankAccountDetailsV1_1.BankAccountDetailsV1; } });
|
|
8
10
|
var bankAccountDetailsV2_1 = require("./bankAccountDetails/bankAccountDetailsV2");
|
package/src/product/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
export { BarcodeReaderV1 } from "./barcodeReader/barcodeReaderV1";
|
|
2
|
+
export { CropperV1 } from "./cropper/cropperV1";
|
|
3
|
+
export { CustomV1 } from "./custom/customV1";
|
|
4
|
+
export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
|
|
1
5
|
export { InvoiceV4 } from "./invoice/invoiceV4";
|
|
2
6
|
export { InvoiceSplitterV1 } from "./invoiceSplitter/invoiceSplitterV1";
|
|
3
|
-
export {
|
|
4
|
-
export { ReceiptV5 } from "./receipt/receiptV5";
|
|
7
|
+
export { MultiReceiptsDetectorV1 } from "./multiReceiptsDetector/multiReceiptsDetectorV1";
|
|
5
8
|
export { PassportV1 } from "./passport/passportV1";
|
|
6
|
-
export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
|
|
7
|
-
export { CustomV1 } from "./custom/customV1";
|
|
8
|
-
export { CropperV1 } from "./cropper/cropperV1";
|
|
9
9
|
export { ProofOfAddressV1 } from "./proofOfAddress/proofOfAddressV1";
|
|
10
|
+
export { ReceiptV4 } from "./receipt/receiptV4";
|
|
11
|
+
export { ReceiptV5 } from "./receipt/receiptV5";
|
|
12
|
+
export * as eu from "./eu";
|
|
10
13
|
export * as fr from "./fr";
|
|
11
14
|
export * as us from "./us";
|
|
12
|
-
export * as eu from "./eu";
|
package/src/product/index.js
CHANGED
|
@@ -23,25 +23,29 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.eu = exports.
|
|
26
|
+
exports.us = exports.fr = exports.eu = exports.ReceiptV5 = exports.ReceiptV4 = exports.ProofOfAddressV1 = exports.PassportV1 = exports.MultiReceiptsDetectorV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.FinancialDocumentV1 = exports.CustomV1 = exports.CropperV1 = exports.BarcodeReaderV1 = void 0;
|
|
27
|
+
var barcodeReaderV1_1 = require("./barcodeReader/barcodeReaderV1");
|
|
28
|
+
Object.defineProperty(exports, "BarcodeReaderV1", { enumerable: true, get: function () { return barcodeReaderV1_1.BarcodeReaderV1; } });
|
|
29
|
+
var cropperV1_1 = require("./cropper/cropperV1");
|
|
30
|
+
Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
|
|
31
|
+
var customV1_1 = require("./custom/customV1");
|
|
32
|
+
Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return customV1_1.CustomV1; } });
|
|
33
|
+
var financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
|
|
34
|
+
Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
|
|
27
35
|
var invoiceV4_1 = require("./invoice/invoiceV4");
|
|
28
36
|
Object.defineProperty(exports, "InvoiceV4", { enumerable: true, get: function () { return invoiceV4_1.InvoiceV4; } });
|
|
29
37
|
var invoiceSplitterV1_1 = require("./invoiceSplitter/invoiceSplitterV1");
|
|
30
38
|
Object.defineProperty(exports, "InvoiceSplitterV1", { enumerable: true, get: function () { return invoiceSplitterV1_1.InvoiceSplitterV1; } });
|
|
31
|
-
var
|
|
32
|
-
Object.defineProperty(exports, "
|
|
33
|
-
var receiptV5_1 = require("./receipt/receiptV5");
|
|
34
|
-
Object.defineProperty(exports, "ReceiptV5", { enumerable: true, get: function () { return receiptV5_1.ReceiptV5; } });
|
|
39
|
+
var multiReceiptsDetectorV1_1 = require("./multiReceiptsDetector/multiReceiptsDetectorV1");
|
|
40
|
+
Object.defineProperty(exports, "MultiReceiptsDetectorV1", { enumerable: true, get: function () { return multiReceiptsDetectorV1_1.MultiReceiptsDetectorV1; } });
|
|
35
41
|
var passportV1_1 = require("./passport/passportV1");
|
|
36
42
|
Object.defineProperty(exports, "PassportV1", { enumerable: true, get: function () { return passportV1_1.PassportV1; } });
|
|
37
|
-
var financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
|
|
38
|
-
Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
|
|
39
|
-
var customV1_1 = require("./custom/customV1");
|
|
40
|
-
Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return customV1_1.CustomV1; } });
|
|
41
|
-
var cropperV1_1 = require("./cropper/cropperV1");
|
|
42
|
-
Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
|
|
43
43
|
var proofOfAddressV1_1 = require("./proofOfAddress/proofOfAddressV1");
|
|
44
44
|
Object.defineProperty(exports, "ProofOfAddressV1", { enumerable: true, get: function () { return proofOfAddressV1_1.ProofOfAddressV1; } });
|
|
45
|
+
var receiptV4_1 = require("./receipt/receiptV4");
|
|
46
|
+
Object.defineProperty(exports, "ReceiptV4", { enumerable: true, get: function () { return receiptV4_1.ReceiptV4; } });
|
|
47
|
+
var receiptV5_1 = require("./receipt/receiptV5");
|
|
48
|
+
Object.defineProperty(exports, "ReceiptV5", { enumerable: true, get: function () { return receiptV5_1.ReceiptV5; } });
|
|
49
|
+
exports.eu = __importStar(require("./eu"));
|
|
45
50
|
exports.fr = __importStar(require("./fr"));
|
|
46
51
|
exports.us = __importStar(require("./us"));
|
|
47
|
-
exports.eu = __importStar(require("./eu"));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * as barcodeReader from "./barcodeReader/internal";
|
|
1
2
|
export * as cropper from "./cropper/internal";
|
|
2
3
|
export * as custom from "./custom/internal";
|
|
3
4
|
export * as eu from "./eu/internal";
|
|
@@ -5,6 +6,7 @@ export * as financialDocument from "./financialDocument/internal";
|
|
|
5
6
|
export * as fr from "./fr/internal";
|
|
6
7
|
export * as invoice from "./invoice/internal";
|
|
7
8
|
export * as invoiceSplitter from "./invoiceSplitter/internal";
|
|
9
|
+
export * as multiReceiptsDetector from "./multiReceiptsDetector/internal";
|
|
8
10
|
export * as passport from "./passport/internal";
|
|
9
11
|
export * as proofOfAddress from "./proofOfAddress/internal";
|
|
10
12
|
export * as receipt from "./receipt/internal";
|
package/src/product/internal.js
CHANGED
|
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.us = exports.receipt = exports.proofOfAddress = exports.passport = exports.invoiceSplitter = exports.invoice = exports.fr = exports.financialDocument = exports.eu = exports.custom = exports.cropper = void 0;
|
|
26
|
+
exports.us = exports.receipt = exports.proofOfAddress = exports.passport = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.fr = exports.financialDocument = exports.eu = exports.custom = exports.cropper = exports.barcodeReader = void 0;
|
|
27
|
+
exports.barcodeReader = __importStar(require("./barcodeReader/internal"));
|
|
27
28
|
exports.cropper = __importStar(require("./cropper/internal"));
|
|
28
29
|
exports.custom = __importStar(require("./custom/internal"));
|
|
29
30
|
exports.eu = __importStar(require("./eu/internal"));
|
|
@@ -31,6 +32,7 @@ exports.financialDocument = __importStar(require("./financialDocument/internal")
|
|
|
31
32
|
exports.fr = __importStar(require("./fr/internal"));
|
|
32
33
|
exports.invoice = __importStar(require("./invoice/internal"));
|
|
33
34
|
exports.invoiceSplitter = __importStar(require("./invoiceSplitter/internal"));
|
|
35
|
+
exports.multiReceiptsDetector = __importStar(require("./multiReceiptsDetector/internal"));
|
|
34
36
|
exports.passport = __importStar(require("./passport/internal"));
|
|
35
37
|
exports.proofOfAddress = __importStar(require("./proofOfAddress/internal"));
|
|
36
38
|
exports.receipt = __importStar(require("./receipt/internal"));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultiReceiptsDetectorV1Document = exports.MultiReceiptsDetectorV1 = void 0;
|
|
4
|
+
var multiReceiptsDetectorV1_1 = require("./multiReceiptsDetectorV1");
|
|
5
|
+
Object.defineProperty(exports, "MultiReceiptsDetectorV1", { enumerable: true, get: function () { return multiReceiptsDetectorV1_1.MultiReceiptsDetectorV1; } });
|
|
6
|
+
var multiReceiptsDetectorV1Document_1 = require("./multiReceiptsDetectorV1Document");
|
|
7
|
+
Object.defineProperty(exports, "MultiReceiptsDetectorV1Document", { enumerable: true, get: function () { return multiReceiptsDetectorV1Document_1.MultiReceiptsDetectorV1Document; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
+
import { MultiReceiptsDetectorV1Document } from "./multiReceiptsDetectorV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for Multi Receipts Detector, API version 1.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MultiReceiptsDetectorV1 extends Inference {
|
|
7
|
+
/** The endpoint's name. */
|
|
8
|
+
endpointName: string;
|
|
9
|
+
/** The endpoint's version. */
|
|
10
|
+
endpointVersion: string;
|
|
11
|
+
/** The document-level prediction. */
|
|
12
|
+
prediction: MultiReceiptsDetectorV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<MultiReceiptsDetectorV1Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultiReceiptsDetectorV1 = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const multiReceiptsDetectorV1Document_1 = require("./multiReceiptsDetectorV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for Multi Receipts Detector, API version 1.
|
|
8
|
+
*/
|
|
9
|
+
class MultiReceiptsDetectorV1 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "multi_receipts_detector";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new multiReceiptsDetectorV1Document_1.MultiReceiptsDetectorV1Document(rawPrediction["prediction"]);
|
|
19
|
+
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(multiReceiptsDetectorV1Document_1.MultiReceiptsDetectorV1Document, page, page["id"], page["orientation"]));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.MultiReceiptsDetectorV1 = MultiReceiptsDetectorV1;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
|
+
import { PositionField } from "../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Document data for Multi Receipts Detector, API version 1.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MultiReceiptsDetectorV1Document implements Prediction {
|
|
7
|
+
/** Positions of the receipts on the document. */
|
|
8
|
+
receipts: PositionField[];
|
|
9
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
10
|
+
/**
|
|
11
|
+
* Default string representation.
|
|
12
|
+
*/
|
|
13
|
+
toString(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultiReceiptsDetectorV1Document = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const standard_1 = require("../../parsing/standard");
|
|
6
|
+
/**
|
|
7
|
+
* Document data for Multi Receipts Detector, API version 1.
|
|
8
|
+
*/
|
|
9
|
+
class MultiReceiptsDetectorV1Document {
|
|
10
|
+
constructor(rawPrediction, pageId) {
|
|
11
|
+
/** Positions of the receipts on the document. */
|
|
12
|
+
this.receipts = [];
|
|
13
|
+
rawPrediction["receipts"] &&
|
|
14
|
+
rawPrediction["receipts"].map((itemPrediction) => this.receipts.push(new standard_1.PositionField({
|
|
15
|
+
prediction: itemPrediction,
|
|
16
|
+
pageId: pageId,
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Default string representation.
|
|
21
|
+
*/
|
|
22
|
+
toString() {
|
|
23
|
+
const receipts = this.receipts.join("\n ");
|
|
24
|
+
const outStr = `:List of Receipts: ${receipts}`.trimEnd();
|
|
25
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.MultiReceiptsDetectorV1Document = MultiReceiptsDetectorV1Document;
|
|
@@ -60,7 +60,7 @@ class PassportV1Document {
|
|
|
60
60
|
* Default string representation.
|
|
61
61
|
*/
|
|
62
62
|
toString() {
|
|
63
|
-
const givenNames = this.givenNames.join("\n
|
|
63
|
+
const givenNames = this.givenNames.join("\n ");
|
|
64
64
|
const outStr = `:Country Code: ${this.country}
|
|
65
65
|
:ID Number: ${this.idNumber}
|
|
66
66
|
:Given Name(s): ${givenNames}
|
|
@@ -57,8 +57,8 @@ class ProofOfAddressV1Document {
|
|
|
57
57
|
* Default string representation.
|
|
58
58
|
*/
|
|
59
59
|
toString() {
|
|
60
|
-
const issuerCompanyRegistration = this.issuerCompanyRegistration.join("\n
|
|
61
|
-
const recipientCompanyRegistration = this.recipientCompanyRegistration.join("\n
|
|
60
|
+
const issuerCompanyRegistration = this.issuerCompanyRegistration.join("\n ");
|
|
61
|
+
const recipientCompanyRegistration = this.recipientCompanyRegistration.join("\n ");
|
|
62
62
|
const dates = this.dates.join("\n ");
|
|
63
63
|
const outStr = `:Locale: ${this.locale}
|
|
64
64
|
:Issuer Name: ${this.issuerName}
|
|
@@ -22,7 +22,7 @@ class BankCheckV1Page extends bankCheckV1Document_1.BankCheckV1Document {
|
|
|
22
22
|
})));
|
|
23
23
|
}
|
|
24
24
|
toString() {
|
|
25
|
-
const signaturesPositions = this.signaturesPositions.join("\n
|
|
25
|
+
const signaturesPositions = this.signaturesPositions.join("\n ");
|
|
26
26
|
let outStr = `:Check Position: ${this.checkPosition}
|
|
27
27
|
:Signature Positions: ${signaturesPositions}`.trimEnd();
|
|
28
28
|
outStr += "\n" + super.toString();
|
package/src/product/us/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DriverLicenseV1 = exports.BankCheckV1 = void 0;
|
|
3
|
+
exports.W9V1 = exports.DriverLicenseV1 = exports.BankCheckV1 = void 0;
|
|
4
4
|
var bankCheckV1_1 = require("./bankCheck/bankCheckV1");
|
|
5
5
|
Object.defineProperty(exports, "BankCheckV1", { enumerable: true, get: function () { return bankCheckV1_1.BankCheckV1; } });
|
|
6
6
|
var driverLicenseV1_1 = require("./driverLicense/driverLicenseV1");
|
|
7
7
|
Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
|
|
8
|
+
var w9V1_1 = require("./w9/w9V1");
|
|
9
|
+
Object.defineProperty(exports, "W9V1", { enumerable: true, get: function () { return w9V1_1.W9V1; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.W9V1Page = exports.W9V1Document = exports.W9V1 = void 0;
|
|
4
|
+
var w9V1_1 = require("./w9V1");
|
|
5
|
+
Object.defineProperty(exports, "W9V1", { enumerable: true, get: function () { return w9V1_1.W9V1; } });
|
|
6
|
+
var w9V1Document_1 = require("./w9V1Document");
|
|
7
|
+
Object.defineProperty(exports, "W9V1Document", { enumerable: true, get: function () { return w9V1Document_1.W9V1Document; } });
|
|
8
|
+
var w9V1Page_1 = require("./w9V1Page");
|
|
9
|
+
Object.defineProperty(exports, "W9V1Page", { enumerable: true, get: function () { return w9V1Page_1.W9V1Page; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
|
+
import { W9V1Document } from "./w9V1Document";
|
|
3
|
+
import { W9V1Page } from "./w9V1Page";
|
|
4
|
+
/**
|
|
5
|
+
* Inference prediction for US W9, API version 1.
|
|
6
|
+
*/
|
|
7
|
+
export declare class W9V1 extends Inference {
|
|
8
|
+
/** The endpoint's name. */
|
|
9
|
+
endpointName: string;
|
|
10
|
+
/** The endpoint's version. */
|
|
11
|
+
endpointVersion: string;
|
|
12
|
+
/** The document-level prediction. */
|
|
13
|
+
prediction: W9V1Document;
|
|
14
|
+
/** The document's pages. */
|
|
15
|
+
pages: Page<W9V1Page>[];
|
|
16
|
+
constructor(rawPrediction: StringDict);
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.W9V1 = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const w9V1Document_1 = require("./w9V1Document");
|
|
6
|
+
const w9V1Page_1 = require("./w9V1Page");
|
|
7
|
+
/**
|
|
8
|
+
* Inference prediction for US W9, API version 1.
|
|
9
|
+
*/
|
|
10
|
+
class W9V1 extends common_1.Inference {
|
|
11
|
+
constructor(rawPrediction) {
|
|
12
|
+
super(rawPrediction);
|
|
13
|
+
/** The endpoint's name. */
|
|
14
|
+
this.endpointName = "us_w9";
|
|
15
|
+
/** The endpoint's version. */
|
|
16
|
+
this.endpointVersion = "1";
|
|
17
|
+
/** The document's pages. */
|
|
18
|
+
this.pages = [];
|
|
19
|
+
this.prediction = new w9V1Document_1.W9V1Document();
|
|
20
|
+
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(w9V1Page_1.W9V1Page, page, page["id"], page["orientation"]));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.W9V1 = W9V1;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.W9V1Document = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Document data for US W9, API version 1.
|
|
6
|
+
*/
|
|
7
|
+
class W9V1Document {
|
|
8
|
+
/**
|
|
9
|
+
* Default string representation.
|
|
10
|
+
*/
|
|
11
|
+
toString() {
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.W9V1Document = W9V1Document;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/common";
|
|
2
|
+
import { PositionField, StringField } from "../../../parsing/standard";
|
|
3
|
+
import { W9V1Document } from "./w9V1Document";
|
|
4
|
+
/**
|
|
5
|
+
* Page data for US W9, API version 1.
|
|
6
|
+
*/
|
|
7
|
+
export declare class W9V1Page extends W9V1Document {
|
|
8
|
+
/** The street address (number, street, and apt. or suite no.) of the applicant. */
|
|
9
|
+
address: StringField;
|
|
10
|
+
/** The business name or disregarded entity name, if different from Name. */
|
|
11
|
+
businessName: StringField;
|
|
12
|
+
/** The city, state, and ZIP code of the applicant. */
|
|
13
|
+
cityStateZip: StringField;
|
|
14
|
+
/** The employer identification number. */
|
|
15
|
+
ein: StringField;
|
|
16
|
+
/** Name as shown on the applicant's income tax return. */
|
|
17
|
+
name: StringField;
|
|
18
|
+
/** Position of the signature date on the document. */
|
|
19
|
+
signatureDatePosition: PositionField;
|
|
20
|
+
/** Position of the signature on the document. */
|
|
21
|
+
signaturePosition: PositionField;
|
|
22
|
+
/** The applicant's social security number. */
|
|
23
|
+
ssn: StringField;
|
|
24
|
+
/** The federal tax classification, which can vary depending on the revision date. */
|
|
25
|
+
taxClassification: StringField;
|
|
26
|
+
/** Depending on revision year, among S, C, P or D for Limited Liability Company Classification. */
|
|
27
|
+
taxClassificationLlc: StringField;
|
|
28
|
+
/** Tax Classification Other Details. */
|
|
29
|
+
taxClassificationOtherDetails: StringField;
|
|
30
|
+
/** The Revision month and year of the W9 form. */
|
|
31
|
+
w9RevisionDate: StringField;
|
|
32
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
33
|
+
toString(): string;
|
|
34
|
+
}
|