mindee 4.17.0 → 4.18.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 +17 -0
- package/package.json +1 -4
- package/src/cli.js +4 -4
- package/src/client.js +7 -7
- package/src/parsing/generated/generatedObject.d.ts +3 -0
- package/src/parsing/generated/generatedObject.js +11 -1
- package/src/product/businessCard/businessCardV1.d.ts +16 -0
- package/src/product/businessCard/businessCardV1.js +27 -0
- package/src/product/businessCard/businessCardV1Document.d.ts +34 -0
- package/src/product/businessCard/businessCardV1Document.js +78 -0
- package/src/product/businessCard/index.d.ts +1 -0
- package/src/product/businessCard/index.js +5 -0
- package/src/product/businessCard/internal.d.ts +2 -0
- package/src/product/businessCard/internal.js +7 -0
- package/src/product/deliveryNote/deliveryNoteV1.d.ts +16 -0
- package/src/product/deliveryNote/deliveryNoteV1.js +27 -0
- package/src/product/deliveryNote/deliveryNoteV1Document.d.ts +26 -0
- package/src/product/deliveryNote/deliveryNoteV1Document.js +54 -0
- package/src/product/deliveryNote/index.d.ts +1 -0
- package/src/product/deliveryNote/index.js +5 -0
- package/src/product/deliveryNote/internal.d.ts +2 -0
- package/src/product/deliveryNote/internal.js +7 -0
- package/src/product/financialDocument/financialDocumentV1Document.d.ts +1 -1
- package/src/product/financialDocument/financialDocumentV1Document.js +1 -1
- package/src/product/ind/index.d.ts +1 -0
- package/src/product/ind/index.js +5 -0
- package/src/product/ind/indianPassport/index.d.ts +1 -0
- package/src/product/ind/indianPassport/index.js +5 -0
- package/src/product/ind/indianPassport/indianPassportV1.d.ts +16 -0
- package/src/product/ind/indianPassport/indianPassportV1.js +27 -0
- package/src/product/ind/indianPassport/indianPassportV1Document.d.ts +58 -0
- package/src/product/ind/indianPassport/indianPassportV1Document.js +132 -0
- package/src/product/ind/indianPassport/internal.d.ts +2 -0
- package/src/product/ind/indianPassport/internal.js +7 -0
- package/src/product/ind/internal.d.ts +1 -0
- package/src/product/ind/internal.js +27 -0
- package/src/product/index.d.ts +3 -0
- package/src/product/index.js +6 -1
- package/src/product/internal.d.ts +2 -0
- package/src/product/internal.js +3 -1
- package/src/product/invoice/invoiceV4Document.d.ts +1 -1
- package/src/product/invoice/invoiceV4Document.js +1 -1
- package/src/product/resume/resumeV1Document.d.ts +1 -1
- package/src/product/resume/resumeV1Document.js +3 -2
- package/src/product/resume/resumeV1ProfessionalExperience.d.ts +2 -0
- package/src/product/resume/resumeV1ProfessionalExperience.js +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v.4.18.0 - 2024-11-14
|
|
4
|
+
### Changes
|
|
5
|
+
* :sparkles: add support for business cards V1
|
|
6
|
+
* :sparkles: add support for delivery note V1.1
|
|
7
|
+
* :sparkles: add support for indian passport V1
|
|
8
|
+
* :sparkles: add support for resume V1.1
|
|
9
|
+
### Fixes
|
|
10
|
+
* :recycle: adjust default values for async delays
|
|
11
|
+
* :recycle: remove unused dependencies
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## v4.17.1 - 2024-10-17
|
|
15
|
+
### Fixes
|
|
16
|
+
* :bug: fix invalid handling of boolean fields & fix accidental coercion into numbers in `GeneratedObjectField` fields
|
|
17
|
+
* :bug: fix `GeneratedObjectField` fields being inaccessible in typescript without going through the main object
|
|
18
|
+
|
|
19
|
+
|
|
3
20
|
## v4.17.0 - 2024-10-11
|
|
4
21
|
### Changes
|
|
5
22
|
* :sparkles: add support for Financial Document v1.10
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindee",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"description": "Mindee Client Library for Node.js",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": "bin/mindee.js",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"homepage": "https://mindee.com/",
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/chai": "^4.3.4",
|
|
44
|
-
"@types/lint-staged": "^13.2.0",
|
|
45
44
|
"@types/mocha": "^9.1.1",
|
|
46
45
|
"@types/node": "^18.15.11",
|
|
47
46
|
"@typescript-eslint/eslint-plugin": "^5.57.1",
|
|
@@ -49,7 +48,6 @@
|
|
|
49
48
|
"chai": "^4.3.10",
|
|
50
49
|
"eslint": "^8.49.0",
|
|
51
50
|
"eslint-plugin-jsdoc": "^46.8.2",
|
|
52
|
-
"lint-staged": "^15.2.10",
|
|
53
51
|
"mocha": "^10.1.0",
|
|
54
52
|
"nock": "^13.3.3",
|
|
55
53
|
"ts-node": "^10.9.1",
|
|
@@ -60,7 +58,6 @@
|
|
|
60
58
|
"commander": "~9.4.1",
|
|
61
59
|
"file-type": "~16.5.4",
|
|
62
60
|
"form-data": "~3.0.1",
|
|
63
|
-
"mrz": "~3.2.1",
|
|
64
61
|
"pdf-lib": "~1.17.1"
|
|
65
62
|
},
|
|
66
63
|
"keywords": [
|
package/src/cli.js
CHANGED
|
@@ -339,8 +339,8 @@ async function callEnqueueAndParse(productClass, command, inputPath, options) {
|
|
|
339
339
|
pageOptions: pageOptions,
|
|
340
340
|
allWords: predictParams.allWords,
|
|
341
341
|
cropper: predictParams.cropper,
|
|
342
|
-
initialDelaySec:
|
|
343
|
-
delaySec:
|
|
342
|
+
initialDelaySec: 2,
|
|
343
|
+
delaySec: 1.5,
|
|
344
344
|
maxRetries: 60,
|
|
345
345
|
});
|
|
346
346
|
}
|
|
@@ -349,8 +349,8 @@ async function callEnqueueAndParse(productClass, command, inputPath, options) {
|
|
|
349
349
|
pageOptions: pageOptions,
|
|
350
350
|
allWords: predictParams.allWords,
|
|
351
351
|
cropper: predictParams.cropper,
|
|
352
|
-
initialDelaySec:
|
|
353
|
-
delaySec:
|
|
352
|
+
initialDelaySec: 2,
|
|
353
|
+
delaySec: 1.5,
|
|
354
354
|
maxRetries: 60,
|
|
355
355
|
});
|
|
356
356
|
if (!response.document) {
|
package/src/client.js
CHANGED
|
@@ -177,8 +177,8 @@ class Client {
|
|
|
177
177
|
fullText: undefined,
|
|
178
178
|
cropper: undefined,
|
|
179
179
|
pageOptions: undefined,
|
|
180
|
-
initialDelaySec:
|
|
181
|
-
delaySec:
|
|
180
|
+
initialDelaySec: 2,
|
|
181
|
+
delaySec: 1.5,
|
|
182
182
|
maxRetries: 60,
|
|
183
183
|
initialTimerOptions: undefined,
|
|
184
184
|
recurringTimerOptions: undefined,
|
|
@@ -310,17 +310,17 @@ Job status: ${pollResults.job.status}.`);
|
|
|
310
310
|
exports.Client = Client;
|
|
311
311
|
_Client_instances = new WeakSet(), _Client_setAsyncParams = function _Client_setAsyncParams(asyncParams) {
|
|
312
312
|
const minDelaySec = 1;
|
|
313
|
-
const minInitialDelay =
|
|
313
|
+
const minInitialDelay = 1;
|
|
314
314
|
const minRetries = 2;
|
|
315
315
|
const newAsyncParams = { ...asyncParams };
|
|
316
|
-
newAsyncParams.delaySec ?? (newAsyncParams.delaySec =
|
|
317
|
-
newAsyncParams.initialDelaySec ?? (newAsyncParams.initialDelaySec =
|
|
316
|
+
newAsyncParams.delaySec ?? (newAsyncParams.delaySec = 1.5);
|
|
317
|
+
newAsyncParams.initialDelaySec ?? (newAsyncParams.initialDelaySec = 2);
|
|
318
318
|
newAsyncParams.maxRetries ?? (newAsyncParams.maxRetries = 60);
|
|
319
319
|
if (newAsyncParams.delaySec < minDelaySec) {
|
|
320
|
-
throw Error(`Cannot set auto-parsing delay to less than ${minDelaySec}
|
|
320
|
+
throw Error(`Cannot set auto-parsing delay to less than ${minDelaySec} second(s).`);
|
|
321
321
|
}
|
|
322
322
|
if (newAsyncParams.initialDelaySec < minInitialDelay) {
|
|
323
|
-
throw Error(`Cannot set initial parsing delay to less than ${minInitialDelay}
|
|
323
|
+
throw Error(`Cannot set initial parsing delay to less than ${minInitialDelay} second(s).`);
|
|
324
324
|
}
|
|
325
325
|
if (newAsyncParams.maxRetries < minRetries) {
|
|
326
326
|
throw Error(`Cannot set retry to less than ${minRetries}.`);
|
|
@@ -10,6 +10,8 @@ export declare class GeneratedObjectField {
|
|
|
10
10
|
rawValue?: string;
|
|
11
11
|
/** List of all printable field names. */
|
|
12
12
|
private printableValues;
|
|
13
|
+
/** All potentially present fields. */
|
|
14
|
+
[key: string]: string | number | boolean | object | undefined;
|
|
13
15
|
constructor({ prediction, pageId, }: BaseFieldConstructor);
|
|
14
16
|
/**
|
|
15
17
|
* ReSTructured-compliant string representation.
|
|
@@ -24,6 +26,7 @@ export declare class GeneratedObjectField {
|
|
|
24
26
|
*/
|
|
25
27
|
private toNumberString;
|
|
26
28
|
toString(): string;
|
|
29
|
+
get(fieldName: string): string | number | boolean | object | undefined;
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* Checks whether a field is a custom object or not.
|
|
@@ -28,9 +28,16 @@ class GeneratedObjectField {
|
|
|
28
28
|
this.rawValue = fieldValue;
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
|
-
if (fieldValue !== null &&
|
|
31
|
+
if (fieldValue !== null &&
|
|
32
|
+
fieldValue !== undefined &&
|
|
33
|
+
typeof fieldValue === "number" &&
|
|
34
|
+
!isNaN(fieldValue) &&
|
|
35
|
+
fieldName !== "degrees") {
|
|
32
36
|
Object.assign(this, { [fieldName]: this.toNumberString(fieldValue) });
|
|
33
37
|
}
|
|
38
|
+
else if (typeof fieldValue === "boolean") {
|
|
39
|
+
Object.assign(this, { [fieldName]: fieldValue });
|
|
40
|
+
}
|
|
34
41
|
else {
|
|
35
42
|
Object.assign(this, {
|
|
36
43
|
[fieldName]: (fieldValue !== undefined && fieldValue !== null) ?
|
|
@@ -70,6 +77,9 @@ class GeneratedObjectField {
|
|
|
70
77
|
toString() {
|
|
71
78
|
return this.toStringLevel();
|
|
72
79
|
}
|
|
80
|
+
get(fieldName) {
|
|
81
|
+
return this[fieldName];
|
|
82
|
+
}
|
|
73
83
|
}
|
|
74
84
|
exports.GeneratedObjectField = GeneratedObjectField;
|
|
75
85
|
/**
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
+
import { BusinessCardV1Document } from "./businessCardV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Business Card API version 1 inference prediction.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BusinessCardV1 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: BusinessCardV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<BusinessCardV1Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BusinessCardV1 = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const businessCardV1Document_1 = require("./businessCardV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Business Card API version 1 inference prediction.
|
|
8
|
+
*/
|
|
9
|
+
class BusinessCardV1 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "business_card";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new businessCardV1Document_1.BusinessCardV1Document(rawPrediction["prediction"]);
|
|
19
|
+
rawPrediction["pages"].forEach((page) => {
|
|
20
|
+
if (page.prediction !== undefined && page.prediction !== null &&
|
|
21
|
+
Object.keys(page.prediction).length > 0) {
|
|
22
|
+
this.pages.push(new common_1.Page(businessCardV1Document_1.BusinessCardV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.BusinessCardV1 = BusinessCardV1;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
|
+
import { StringField } from "../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Business Card API version 1.0 document data.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BusinessCardV1Document implements Prediction {
|
|
7
|
+
/** The address of the person. */
|
|
8
|
+
address: StringField;
|
|
9
|
+
/** The company the person works for. */
|
|
10
|
+
company: StringField;
|
|
11
|
+
/** The email address of the person. */
|
|
12
|
+
email: StringField;
|
|
13
|
+
/** The Fax number of the person. */
|
|
14
|
+
faxNumber: StringField;
|
|
15
|
+
/** The given name of the person. */
|
|
16
|
+
firstname: StringField;
|
|
17
|
+
/** The job title of the person. */
|
|
18
|
+
jobTitle: StringField;
|
|
19
|
+
/** The lastname of the person. */
|
|
20
|
+
lastname: StringField;
|
|
21
|
+
/** The mobile number of the person. */
|
|
22
|
+
mobileNumber: StringField;
|
|
23
|
+
/** The phone number of the person. */
|
|
24
|
+
phoneNumber: StringField;
|
|
25
|
+
/** The social media profiles of the person or company. */
|
|
26
|
+
socialMedia: StringField[];
|
|
27
|
+
/** The website of the person or company. */
|
|
28
|
+
website: StringField;
|
|
29
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
30
|
+
/**
|
|
31
|
+
* Default string representation.
|
|
32
|
+
*/
|
|
33
|
+
toString(): string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BusinessCardV1Document = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const standard_1 = require("../../parsing/standard");
|
|
6
|
+
/**
|
|
7
|
+
* Business Card API version 1.0 document data.
|
|
8
|
+
*/
|
|
9
|
+
class BusinessCardV1Document {
|
|
10
|
+
constructor(rawPrediction, pageId) {
|
|
11
|
+
/** The social media profiles of the person or company. */
|
|
12
|
+
this.socialMedia = [];
|
|
13
|
+
this.address = new standard_1.StringField({
|
|
14
|
+
prediction: rawPrediction["address"],
|
|
15
|
+
pageId: pageId,
|
|
16
|
+
});
|
|
17
|
+
this.company = new standard_1.StringField({
|
|
18
|
+
prediction: rawPrediction["company"],
|
|
19
|
+
pageId: pageId,
|
|
20
|
+
});
|
|
21
|
+
this.email = new standard_1.StringField({
|
|
22
|
+
prediction: rawPrediction["email"],
|
|
23
|
+
pageId: pageId,
|
|
24
|
+
});
|
|
25
|
+
this.faxNumber = new standard_1.StringField({
|
|
26
|
+
prediction: rawPrediction["fax_number"],
|
|
27
|
+
pageId: pageId,
|
|
28
|
+
});
|
|
29
|
+
this.firstname = new standard_1.StringField({
|
|
30
|
+
prediction: rawPrediction["firstname"],
|
|
31
|
+
pageId: pageId,
|
|
32
|
+
});
|
|
33
|
+
this.jobTitle = new standard_1.StringField({
|
|
34
|
+
prediction: rawPrediction["job_title"],
|
|
35
|
+
pageId: pageId,
|
|
36
|
+
});
|
|
37
|
+
this.lastname = new standard_1.StringField({
|
|
38
|
+
prediction: rawPrediction["lastname"],
|
|
39
|
+
pageId: pageId,
|
|
40
|
+
});
|
|
41
|
+
this.mobileNumber = new standard_1.StringField({
|
|
42
|
+
prediction: rawPrediction["mobile_number"],
|
|
43
|
+
pageId: pageId,
|
|
44
|
+
});
|
|
45
|
+
this.phoneNumber = new standard_1.StringField({
|
|
46
|
+
prediction: rawPrediction["phone_number"],
|
|
47
|
+
pageId: pageId,
|
|
48
|
+
});
|
|
49
|
+
rawPrediction["social_media"] &&
|
|
50
|
+
rawPrediction["social_media"].map((itemPrediction) => this.socialMedia.push(new standard_1.StringField({
|
|
51
|
+
prediction: itemPrediction,
|
|
52
|
+
pageId: pageId,
|
|
53
|
+
})));
|
|
54
|
+
this.website = new standard_1.StringField({
|
|
55
|
+
prediction: rawPrediction["website"],
|
|
56
|
+
pageId: pageId,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Default string representation.
|
|
61
|
+
*/
|
|
62
|
+
toString() {
|
|
63
|
+
const socialMedia = this.socialMedia.join("\n ");
|
|
64
|
+
const outStr = `:Firstname: ${this.firstname}
|
|
65
|
+
:Lastname: ${this.lastname}
|
|
66
|
+
:Job Title: ${this.jobTitle}
|
|
67
|
+
:Company: ${this.company}
|
|
68
|
+
:Email: ${this.email}
|
|
69
|
+
:Phone Number: ${this.phoneNumber}
|
|
70
|
+
:Mobile Number: ${this.mobileNumber}
|
|
71
|
+
:Fax Number: ${this.faxNumber}
|
|
72
|
+
:Address: ${this.address}
|
|
73
|
+
:Website: ${this.website}
|
|
74
|
+
:Social Media: ${socialMedia}`.trimEnd();
|
|
75
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.BusinessCardV1Document = BusinessCardV1Document;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BusinessCardV1 } from "./businessCardV1";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BusinessCardV1 = void 0;
|
|
4
|
+
var businessCardV1_1 = require("./businessCardV1");
|
|
5
|
+
Object.defineProperty(exports, "BusinessCardV1", { enumerable: true, get: function () { return businessCardV1_1.BusinessCardV1; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BusinessCardV1Document = exports.BusinessCardV1 = void 0;
|
|
4
|
+
var businessCardV1_1 = require("./businessCardV1");
|
|
5
|
+
Object.defineProperty(exports, "BusinessCardV1", { enumerable: true, get: function () { return businessCardV1_1.BusinessCardV1; } });
|
|
6
|
+
var businessCardV1Document_1 = require("./businessCardV1Document");
|
|
7
|
+
Object.defineProperty(exports, "BusinessCardV1Document", { enumerable: true, get: function () { return businessCardV1Document_1.BusinessCardV1Document; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
+
import { DeliveryNoteV1Document } from "./deliveryNoteV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Delivery note API version 1 inference prediction.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DeliveryNoteV1 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: DeliveryNoteV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<DeliveryNoteV1Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryNoteV1 = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const deliveryNoteV1Document_1 = require("./deliveryNoteV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Delivery note API version 1 inference prediction.
|
|
8
|
+
*/
|
|
9
|
+
class DeliveryNoteV1 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "delivery_notes";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new deliveryNoteV1Document_1.DeliveryNoteV1Document(rawPrediction["prediction"]);
|
|
19
|
+
rawPrediction["pages"].forEach((page) => {
|
|
20
|
+
if (page.prediction !== undefined && page.prediction !== null &&
|
|
21
|
+
Object.keys(page.prediction).length > 0) {
|
|
22
|
+
this.pages.push(new common_1.Page(deliveryNoteV1Document_1.DeliveryNoteV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.DeliveryNoteV1 = DeliveryNoteV1;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
|
+
import { AmountField, DateField, StringField } from "../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Delivery note API version 1.1 document data.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DeliveryNoteV1Document implements Prediction {
|
|
7
|
+
/** The address of the customer receiving the goods. */
|
|
8
|
+
customerAddress: StringField;
|
|
9
|
+
/** The name of the customer receiving the goods. */
|
|
10
|
+
customerName: StringField;
|
|
11
|
+
/** The date on which the delivery is scheduled to arrive. */
|
|
12
|
+
deliveryDate: DateField;
|
|
13
|
+
/** A unique identifier for the delivery note. */
|
|
14
|
+
deliveryNumber: StringField;
|
|
15
|
+
/** The address of the supplier providing the goods. */
|
|
16
|
+
supplierAddress: StringField;
|
|
17
|
+
/** The name of the supplier providing the goods. */
|
|
18
|
+
supplierName: StringField;
|
|
19
|
+
/** The total monetary value of the goods being delivered. */
|
|
20
|
+
totalAmount: AmountField;
|
|
21
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
22
|
+
/**
|
|
23
|
+
* Default string representation.
|
|
24
|
+
*/
|
|
25
|
+
toString(): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryNoteV1Document = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const standard_1 = require("../../parsing/standard");
|
|
6
|
+
/**
|
|
7
|
+
* Delivery note API version 1.1 document data.
|
|
8
|
+
*/
|
|
9
|
+
class DeliveryNoteV1Document {
|
|
10
|
+
constructor(rawPrediction, pageId) {
|
|
11
|
+
this.customerAddress = new standard_1.StringField({
|
|
12
|
+
prediction: rawPrediction["customer_address"],
|
|
13
|
+
pageId: pageId,
|
|
14
|
+
});
|
|
15
|
+
this.customerName = new standard_1.StringField({
|
|
16
|
+
prediction: rawPrediction["customer_name"],
|
|
17
|
+
pageId: pageId,
|
|
18
|
+
});
|
|
19
|
+
this.deliveryDate = new standard_1.DateField({
|
|
20
|
+
prediction: rawPrediction["delivery_date"],
|
|
21
|
+
pageId: pageId,
|
|
22
|
+
});
|
|
23
|
+
this.deliveryNumber = new standard_1.StringField({
|
|
24
|
+
prediction: rawPrediction["delivery_number"],
|
|
25
|
+
pageId: pageId,
|
|
26
|
+
});
|
|
27
|
+
this.supplierAddress = new standard_1.StringField({
|
|
28
|
+
prediction: rawPrediction["supplier_address"],
|
|
29
|
+
pageId: pageId,
|
|
30
|
+
});
|
|
31
|
+
this.supplierName = new standard_1.StringField({
|
|
32
|
+
prediction: rawPrediction["supplier_name"],
|
|
33
|
+
pageId: pageId,
|
|
34
|
+
});
|
|
35
|
+
this.totalAmount = new standard_1.AmountField({
|
|
36
|
+
prediction: rawPrediction["total_amount"],
|
|
37
|
+
pageId: pageId,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Default string representation.
|
|
42
|
+
*/
|
|
43
|
+
toString() {
|
|
44
|
+
const outStr = `:Delivery Date: ${this.deliveryDate}
|
|
45
|
+
:Delivery Number: ${this.deliveryNumber}
|
|
46
|
+
:Supplier Name: ${this.supplierName}
|
|
47
|
+
:Supplier Address: ${this.supplierAddress}
|
|
48
|
+
:Customer Name: ${this.customerName}
|
|
49
|
+
:Customer Address: ${this.customerAddress}
|
|
50
|
+
:Total Amount: ${this.totalAmount}`.trimEnd();
|
|
51
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DeliveryNoteV1Document = DeliveryNoteV1Document;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeliveryNoteV1 } from "./deliveryNoteV1";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryNoteV1 = void 0;
|
|
4
|
+
var deliveryNoteV1_1 = require("./deliveryNoteV1");
|
|
5
|
+
Object.defineProperty(exports, "DeliveryNoteV1", { enumerable: true, get: function () { return deliveryNoteV1_1.DeliveryNoteV1; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryNoteV1Document = exports.DeliveryNoteV1 = void 0;
|
|
4
|
+
var deliveryNoteV1_1 = require("./deliveryNoteV1");
|
|
5
|
+
Object.defineProperty(exports, "DeliveryNoteV1", { enumerable: true, get: function () { return deliveryNoteV1_1.DeliveryNoteV1; } });
|
|
6
|
+
var deliveryNoteV1Document_1 = require("./deliveryNoteV1Document");
|
|
7
|
+
Object.defineProperty(exports, "DeliveryNoteV1Document", { enumerable: true, get: function () { return deliveryNoteV1Document_1.DeliveryNoteV1Document; } });
|
|
@@ -2,7 +2,7 @@ import { Prediction, StringDict } from "../../parsing/common";
|
|
|
2
2
|
import { FinancialDocumentV1LineItem } from "./financialDocumentV1LineItem";
|
|
3
3
|
import { AmountField, ClassificationField, CompanyRegistrationField, DateField, LocaleField, PaymentDetailsField, StringField, Taxes } from "../../parsing/standard";
|
|
4
4
|
/**
|
|
5
|
-
* Financial Document API version 1.
|
|
5
|
+
* Financial Document API version 1.11 document data.
|
|
6
6
|
*/
|
|
7
7
|
export declare class FinancialDocumentV1Document implements Prediction {
|
|
8
8
|
/** The customer's address used for billing. */
|
|
@@ -5,7 +5,7 @@ const common_1 = require("../../parsing/common");
|
|
|
5
5
|
const financialDocumentV1LineItem_1 = require("./financialDocumentV1LineItem");
|
|
6
6
|
const standard_1 = require("../../parsing/standard");
|
|
7
7
|
/**
|
|
8
|
-
* Financial Document API version 1.
|
|
8
|
+
* Financial Document API version 1.11 document data.
|
|
9
9
|
*/
|
|
10
10
|
class FinancialDocumentV1Document {
|
|
11
11
|
constructor(rawPrediction, pageId) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IndianPassportV1 } from "./indianPassport/indianPassportV1";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndianPassportV1 = void 0;
|
|
4
|
+
var indianPassportV1_1 = require("./indianPassport/indianPassportV1");
|
|
5
|
+
Object.defineProperty(exports, "IndianPassportV1", { enumerable: true, get: function () { return indianPassportV1_1.IndianPassportV1; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IndianPassportV1 } from "./indianPassportV1";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndianPassportV1 = void 0;
|
|
4
|
+
var indianPassportV1_1 = require("./indianPassportV1");
|
|
5
|
+
Object.defineProperty(exports, "IndianPassportV1", { enumerable: true, get: function () { return indianPassportV1_1.IndianPassportV1; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
|
+
import { IndianPassportV1Document } from "./indianPassportV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Passport - India API version 1 inference prediction.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IndianPassportV1 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: IndianPassportV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<IndianPassportV1Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndianPassportV1 = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const indianPassportV1Document_1 = require("./indianPassportV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Passport - India API version 1 inference prediction.
|
|
8
|
+
*/
|
|
9
|
+
class IndianPassportV1 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "ind_passport";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new indianPassportV1Document_1.IndianPassportV1Document(rawPrediction["prediction"]);
|
|
19
|
+
rawPrediction["pages"].forEach((page) => {
|
|
20
|
+
if (page.prediction !== undefined && page.prediction !== null &&
|
|
21
|
+
Object.keys(page.prediction).length > 0) {
|
|
22
|
+
this.pages.push(new common_1.Page(indianPassportV1Document_1.IndianPassportV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.IndianPassportV1 = IndianPassportV1;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../../parsing/common";
|
|
2
|
+
import { ClassificationField, DateField, StringField } from "../../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Passport - India API version 1.0 document data.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IndianPassportV1Document implements Prediction {
|
|
7
|
+
/** The first line of the address of the passport holder. */
|
|
8
|
+
address1: StringField;
|
|
9
|
+
/** The second line of the address of the passport holder. */
|
|
10
|
+
address2: StringField;
|
|
11
|
+
/** The third line of the address of the passport holder. */
|
|
12
|
+
address3: StringField;
|
|
13
|
+
/** The birth date of the passport holder, ISO format: YYYY-MM-DD. */
|
|
14
|
+
birthDate: DateField;
|
|
15
|
+
/** The birth place of the passport holder. */
|
|
16
|
+
birthPlace: StringField;
|
|
17
|
+
/** ISO 3166-1 alpha-3 country code (3 letters format). */
|
|
18
|
+
country: StringField;
|
|
19
|
+
/** The date when the passport will expire, ISO format: YYYY-MM-DD. */
|
|
20
|
+
expiryDate: DateField;
|
|
21
|
+
/** The file number of the passport document. */
|
|
22
|
+
fileNumber: StringField;
|
|
23
|
+
/** The gender of the passport holder. */
|
|
24
|
+
gender: ClassificationField;
|
|
25
|
+
/** The given names of the passport holder. */
|
|
26
|
+
givenNames: StringField;
|
|
27
|
+
/** The identification number of the passport document. */
|
|
28
|
+
idNumber: StringField;
|
|
29
|
+
/** The date when the passport was issued, ISO format: YYYY-MM-DD. */
|
|
30
|
+
issuanceDate: DateField;
|
|
31
|
+
/** The place where the passport was issued. */
|
|
32
|
+
issuancePlace: StringField;
|
|
33
|
+
/** The name of the legal guardian of the passport holder (if applicable). */
|
|
34
|
+
legalGuardian: StringField;
|
|
35
|
+
/** The first line of the machine-readable zone (MRZ) of the passport document. */
|
|
36
|
+
mrz1: StringField;
|
|
37
|
+
/** The second line of the machine-readable zone (MRZ) of the passport document. */
|
|
38
|
+
mrz2: StringField;
|
|
39
|
+
/** The name of the mother of the passport holder. */
|
|
40
|
+
nameOfMother: StringField;
|
|
41
|
+
/** The name of the spouse of the passport holder (if applicable). */
|
|
42
|
+
nameOfSpouse: StringField;
|
|
43
|
+
/** The date of issue of the old passport (if applicable), ISO format: YYYY-MM-DD. */
|
|
44
|
+
oldPassportDateOfIssue: DateField;
|
|
45
|
+
/** The number of the old passport (if applicable). */
|
|
46
|
+
oldPassportNumber: StringField;
|
|
47
|
+
/** The place of issue of the old passport (if applicable). */
|
|
48
|
+
oldPassportPlaceOfIssue: StringField;
|
|
49
|
+
/** The page number of the passport document. */
|
|
50
|
+
pageNumber: ClassificationField;
|
|
51
|
+
/** The surname of the passport holder. */
|
|
52
|
+
surname: StringField;
|
|
53
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
54
|
+
/**
|
|
55
|
+
* Default string representation.
|
|
56
|
+
*/
|
|
57
|
+
toString(): string;
|
|
58
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndianPassportV1Document = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const standard_1 = require("../../../parsing/standard");
|
|
6
|
+
/**
|
|
7
|
+
* Passport - India API version 1.0 document data.
|
|
8
|
+
*/
|
|
9
|
+
class IndianPassportV1Document {
|
|
10
|
+
constructor(rawPrediction, pageId) {
|
|
11
|
+
this.address1 = new standard_1.StringField({
|
|
12
|
+
prediction: rawPrediction["address1"],
|
|
13
|
+
pageId: pageId,
|
|
14
|
+
});
|
|
15
|
+
this.address2 = new standard_1.StringField({
|
|
16
|
+
prediction: rawPrediction["address2"],
|
|
17
|
+
pageId: pageId,
|
|
18
|
+
});
|
|
19
|
+
this.address3 = new standard_1.StringField({
|
|
20
|
+
prediction: rawPrediction["address3"],
|
|
21
|
+
pageId: pageId,
|
|
22
|
+
});
|
|
23
|
+
this.birthDate = new standard_1.DateField({
|
|
24
|
+
prediction: rawPrediction["birth_date"],
|
|
25
|
+
pageId: pageId,
|
|
26
|
+
});
|
|
27
|
+
this.birthPlace = new standard_1.StringField({
|
|
28
|
+
prediction: rawPrediction["birth_place"],
|
|
29
|
+
pageId: pageId,
|
|
30
|
+
});
|
|
31
|
+
this.country = new standard_1.StringField({
|
|
32
|
+
prediction: rawPrediction["country"],
|
|
33
|
+
pageId: pageId,
|
|
34
|
+
});
|
|
35
|
+
this.expiryDate = new standard_1.DateField({
|
|
36
|
+
prediction: rawPrediction["expiry_date"],
|
|
37
|
+
pageId: pageId,
|
|
38
|
+
});
|
|
39
|
+
this.fileNumber = new standard_1.StringField({
|
|
40
|
+
prediction: rawPrediction["file_number"],
|
|
41
|
+
pageId: pageId,
|
|
42
|
+
});
|
|
43
|
+
this.gender = new standard_1.ClassificationField({
|
|
44
|
+
prediction: rawPrediction["gender"],
|
|
45
|
+
});
|
|
46
|
+
this.givenNames = new standard_1.StringField({
|
|
47
|
+
prediction: rawPrediction["given_names"],
|
|
48
|
+
pageId: pageId,
|
|
49
|
+
});
|
|
50
|
+
this.idNumber = new standard_1.StringField({
|
|
51
|
+
prediction: rawPrediction["id_number"],
|
|
52
|
+
pageId: pageId,
|
|
53
|
+
});
|
|
54
|
+
this.issuanceDate = new standard_1.DateField({
|
|
55
|
+
prediction: rawPrediction["issuance_date"],
|
|
56
|
+
pageId: pageId,
|
|
57
|
+
});
|
|
58
|
+
this.issuancePlace = new standard_1.StringField({
|
|
59
|
+
prediction: rawPrediction["issuance_place"],
|
|
60
|
+
pageId: pageId,
|
|
61
|
+
});
|
|
62
|
+
this.legalGuardian = new standard_1.StringField({
|
|
63
|
+
prediction: rawPrediction["legal_guardian"],
|
|
64
|
+
pageId: pageId,
|
|
65
|
+
});
|
|
66
|
+
this.mrz1 = new standard_1.StringField({
|
|
67
|
+
prediction: rawPrediction["mrz1"],
|
|
68
|
+
pageId: pageId,
|
|
69
|
+
});
|
|
70
|
+
this.mrz2 = new standard_1.StringField({
|
|
71
|
+
prediction: rawPrediction["mrz2"],
|
|
72
|
+
pageId: pageId,
|
|
73
|
+
});
|
|
74
|
+
this.nameOfMother = new standard_1.StringField({
|
|
75
|
+
prediction: rawPrediction["name_of_mother"],
|
|
76
|
+
pageId: pageId,
|
|
77
|
+
});
|
|
78
|
+
this.nameOfSpouse = new standard_1.StringField({
|
|
79
|
+
prediction: rawPrediction["name_of_spouse"],
|
|
80
|
+
pageId: pageId,
|
|
81
|
+
});
|
|
82
|
+
this.oldPassportDateOfIssue = new standard_1.DateField({
|
|
83
|
+
prediction: rawPrediction["old_passport_date_of_issue"],
|
|
84
|
+
pageId: pageId,
|
|
85
|
+
});
|
|
86
|
+
this.oldPassportNumber = new standard_1.StringField({
|
|
87
|
+
prediction: rawPrediction["old_passport_number"],
|
|
88
|
+
pageId: pageId,
|
|
89
|
+
});
|
|
90
|
+
this.oldPassportPlaceOfIssue = new standard_1.StringField({
|
|
91
|
+
prediction: rawPrediction["old_passport_place_of_issue"],
|
|
92
|
+
pageId: pageId,
|
|
93
|
+
});
|
|
94
|
+
this.pageNumber = new standard_1.ClassificationField({
|
|
95
|
+
prediction: rawPrediction["page_number"],
|
|
96
|
+
});
|
|
97
|
+
this.surname = new standard_1.StringField({
|
|
98
|
+
prediction: rawPrediction["surname"],
|
|
99
|
+
pageId: pageId,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Default string representation.
|
|
104
|
+
*/
|
|
105
|
+
toString() {
|
|
106
|
+
const outStr = `:Page Number: ${this.pageNumber}
|
|
107
|
+
:Country: ${this.country}
|
|
108
|
+
:ID Number: ${this.idNumber}
|
|
109
|
+
:Given Names: ${this.givenNames}
|
|
110
|
+
:Surname: ${this.surname}
|
|
111
|
+
:Birth Date: ${this.birthDate}
|
|
112
|
+
:Birth Place: ${this.birthPlace}
|
|
113
|
+
:Issuance Place: ${this.issuancePlace}
|
|
114
|
+
:Gender: ${this.gender}
|
|
115
|
+
:Issuance Date: ${this.issuanceDate}
|
|
116
|
+
:Expiry Date: ${this.expiryDate}
|
|
117
|
+
:MRZ Line 1: ${this.mrz1}
|
|
118
|
+
:MRZ Line 2: ${this.mrz2}
|
|
119
|
+
:Legal Guardian: ${this.legalGuardian}
|
|
120
|
+
:Name of Spouse: ${this.nameOfSpouse}
|
|
121
|
+
:Name of Mother: ${this.nameOfMother}
|
|
122
|
+
:Old Passport Date of Issue: ${this.oldPassportDateOfIssue}
|
|
123
|
+
:Old Passport Number: ${this.oldPassportNumber}
|
|
124
|
+
:Address Line 1: ${this.address1}
|
|
125
|
+
:Address Line 2: ${this.address2}
|
|
126
|
+
:Address Line 3: ${this.address3}
|
|
127
|
+
:Old Passport Place of Issue: ${this.oldPassportPlaceOfIssue}
|
|
128
|
+
:File Number: ${this.fileNumber}`.trimEnd();
|
|
129
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.IndianPassportV1Document = IndianPassportV1Document;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndianPassportV1Document = exports.IndianPassportV1 = void 0;
|
|
4
|
+
var indianPassportV1_1 = require("./indianPassportV1");
|
|
5
|
+
Object.defineProperty(exports, "IndianPassportV1", { enumerable: true, get: function () { return indianPassportV1_1.IndianPassportV1; } });
|
|
6
|
+
var indianPassportV1Document_1 = require("./indianPassportV1Document");
|
|
7
|
+
Object.defineProperty(exports, "IndianPassportV1Document", { enumerable: true, get: function () { return indianPassportV1Document_1.IndianPassportV1Document; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as ind from "./indianPassport/internal";
|
|
@@ -0,0 +1,27 @@
|
|
|
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.ind = void 0;
|
|
27
|
+
exports.ind = __importStar(require("./indianPassport/internal"));
|
package/src/product/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { BarcodeReaderV1 } from "./barcodeReader/barcodeReaderV1";
|
|
2
2
|
export { BillOfLadingV1 } from "./billOfLading/billOfLadingV1";
|
|
3
|
+
export { BusinessCardV1 } from "./businessCard/businessCardV1";
|
|
3
4
|
export { CropperV1 } from "./cropper/cropperV1";
|
|
4
5
|
export { CustomV1 } from "./custom/customV1";
|
|
6
|
+
export { DeliveryNoteV1 } from "./deliveryNote/deliveryNoteV1";
|
|
5
7
|
export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
|
|
6
8
|
export { GeneratedV1 } from "./generated/generatedV1";
|
|
7
9
|
export { InternationalIdV1 } from "./internationalId/internationalIdV1";
|
|
@@ -17,4 +19,5 @@ export { ReceiptV5 } from "./receipt/receiptV5";
|
|
|
17
19
|
export { ResumeV1 } from "./resume/resumeV1";
|
|
18
20
|
export * as eu from "./eu";
|
|
19
21
|
export * as fr from "./fr";
|
|
22
|
+
export * as ind from "./ind";
|
|
20
23
|
export * as us from "./us";
|
package/src/product/index.js
CHANGED
|
@@ -23,15 +23,19 @@ 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.fr = exports.eu = exports.ResumeV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ProofOfAddressV1 = exports.PassportV1 = exports.NutritionFactsLabelV1 = exports.MultiReceiptsDetectorV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InternationalIdV2 = exports.InternationalIdV1 = exports.GeneratedV1 = exports.FinancialDocumentV1 = exports.CustomV1 = exports.CropperV1 = exports.BillOfLadingV1 = exports.BarcodeReaderV1 = void 0;
|
|
26
|
+
exports.us = exports.ind = exports.fr = exports.eu = exports.ResumeV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ProofOfAddressV1 = exports.PassportV1 = exports.NutritionFactsLabelV1 = exports.MultiReceiptsDetectorV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InternationalIdV2 = exports.InternationalIdV1 = exports.GeneratedV1 = exports.FinancialDocumentV1 = exports.DeliveryNoteV1 = exports.CustomV1 = exports.CropperV1 = exports.BusinessCardV1 = exports.BillOfLadingV1 = exports.BarcodeReaderV1 = void 0;
|
|
27
27
|
var barcodeReaderV1_1 = require("./barcodeReader/barcodeReaderV1");
|
|
28
28
|
Object.defineProperty(exports, "BarcodeReaderV1", { enumerable: true, get: function () { return barcodeReaderV1_1.BarcodeReaderV1; } });
|
|
29
29
|
var billOfLadingV1_1 = require("./billOfLading/billOfLadingV1");
|
|
30
30
|
Object.defineProperty(exports, "BillOfLadingV1", { enumerable: true, get: function () { return billOfLadingV1_1.BillOfLadingV1; } });
|
|
31
|
+
var businessCardV1_1 = require("./businessCard/businessCardV1");
|
|
32
|
+
Object.defineProperty(exports, "BusinessCardV1", { enumerable: true, get: function () { return businessCardV1_1.BusinessCardV1; } });
|
|
31
33
|
var cropperV1_1 = require("./cropper/cropperV1");
|
|
32
34
|
Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
|
|
33
35
|
var customV1_1 = require("./custom/customV1");
|
|
34
36
|
Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return customV1_1.CustomV1; } });
|
|
37
|
+
var deliveryNoteV1_1 = require("./deliveryNote/deliveryNoteV1");
|
|
38
|
+
Object.defineProperty(exports, "DeliveryNoteV1", { enumerable: true, get: function () { return deliveryNoteV1_1.DeliveryNoteV1; } });
|
|
35
39
|
var financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
|
|
36
40
|
Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
|
|
37
41
|
var generatedV1_1 = require("./generated/generatedV1");
|
|
@@ -60,4 +64,5 @@ var resumeV1_1 = require("./resume/resumeV1");
|
|
|
60
64
|
Object.defineProperty(exports, "ResumeV1", { enumerable: true, get: function () { return resumeV1_1.ResumeV1; } });
|
|
61
65
|
exports.eu = __importStar(require("./eu"));
|
|
62
66
|
exports.fr = __importStar(require("./fr"));
|
|
67
|
+
exports.ind = __importStar(require("./ind"));
|
|
63
68
|
exports.us = __importStar(require("./us"));
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * as barcodeReader from "./barcodeReader/internal";
|
|
2
2
|
export * as billOfLading from "./billOfLading/internal";
|
|
3
|
+
export * as businessCard from "./businessCard/internal";
|
|
3
4
|
export * as cropper from "./cropper/internal";
|
|
4
5
|
export * as custom from "./custom/internal";
|
|
6
|
+
export * as deliveryNote from "./deliveryNote/internal";
|
|
5
7
|
export * as eu from "./eu/internal";
|
|
6
8
|
export * as financialDocument from "./financialDocument/internal";
|
|
7
9
|
export * as fr from "./fr/internal";
|
package/src/product/internal.js
CHANGED
|
@@ -23,11 +23,13 @@ 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.resume = exports.receipt = exports.proofOfAddress = exports.passport = exports.nutritionFactsLabel = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.internationalId = exports.generated = exports.fr = exports.financialDocument = exports.eu = exports.custom = exports.cropper = exports.billOfLading = exports.barcodeReader = void 0;
|
|
26
|
+
exports.us = exports.resume = exports.receipt = exports.proofOfAddress = exports.passport = exports.nutritionFactsLabel = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.internationalId = exports.generated = exports.fr = exports.financialDocument = exports.eu = exports.deliveryNote = exports.custom = exports.cropper = exports.businessCard = exports.billOfLading = exports.barcodeReader = void 0;
|
|
27
27
|
exports.barcodeReader = __importStar(require("./barcodeReader/internal"));
|
|
28
28
|
exports.billOfLading = __importStar(require("./billOfLading/internal"));
|
|
29
|
+
exports.businessCard = __importStar(require("./businessCard/internal"));
|
|
29
30
|
exports.cropper = __importStar(require("./cropper/internal"));
|
|
30
31
|
exports.custom = __importStar(require("./custom/internal"));
|
|
32
|
+
exports.deliveryNote = __importStar(require("./deliveryNote/internal"));
|
|
31
33
|
exports.eu = __importStar(require("./eu/internal"));
|
|
32
34
|
exports.financialDocument = __importStar(require("./financialDocument/internal"));
|
|
33
35
|
exports.fr = __importStar(require("./fr/internal"));
|
|
@@ -2,7 +2,7 @@ import { Prediction, StringDict } from "../../parsing/common";
|
|
|
2
2
|
import { InvoiceV4LineItem } from "./invoiceV4LineItem";
|
|
3
3
|
import { AmountField, ClassificationField, CompanyRegistrationField, DateField, LocaleField, PaymentDetailsField, StringField, Taxes } from "../../parsing/standard";
|
|
4
4
|
/**
|
|
5
|
-
* Invoice API version 4.
|
|
5
|
+
* Invoice API version 4.9 document data.
|
|
6
6
|
*/
|
|
7
7
|
export declare class InvoiceV4Document implements Prediction {
|
|
8
8
|
/** The customer's address used for billing. */
|
|
@@ -5,7 +5,7 @@ const common_1 = require("../../parsing/common");
|
|
|
5
5
|
const invoiceV4LineItem_1 = require("./invoiceV4LineItem");
|
|
6
6
|
const standard_1 = require("../../parsing/standard");
|
|
7
7
|
/**
|
|
8
|
-
* Invoice API version 4.
|
|
8
|
+
* Invoice API version 4.9 document data.
|
|
9
9
|
*/
|
|
10
10
|
class InvoiceV4Document {
|
|
11
11
|
constructor(rawPrediction, pageId) {
|
|
@@ -6,7 +6,7 @@ import { ResumeV1ProfessionalExperience } from "./resumeV1ProfessionalExperience
|
|
|
6
6
|
import { ResumeV1Certificate } from "./resumeV1Certificate";
|
|
7
7
|
import { ClassificationField, StringField } from "../../parsing/standard";
|
|
8
8
|
/**
|
|
9
|
-
* Resume API version 1.
|
|
9
|
+
* Resume API version 1.1 document data.
|
|
10
10
|
*/
|
|
11
11
|
export declare class ResumeV1Document implements Prediction {
|
|
12
12
|
/** The location information of the candidate, including city, state, and country. */
|
|
@@ -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.1 document data.
|
|
13
13
|
*/
|
|
14
14
|
class ResumeV1Document {
|
|
15
15
|
constructor(rawPrediction, pageId) {
|
|
@@ -150,10 +150,11 @@ class ResumeV1Document {
|
|
|
150
150
|
}
|
|
151
151
|
let professionalExperiencesSummary = "";
|
|
152
152
|
if (this.professionalExperiences && this.professionalExperiences.length > 0) {
|
|
153
|
-
const professionalExperiencesColSizes = [17, 12, 27, 11, 10, 22, 13, 12];
|
|
153
|
+
const professionalExperiencesColSizes = [17, 12, 38, 27, 11, 10, 22, 13, 12];
|
|
154
154
|
professionalExperiencesSummary += "\n" + (0, common_1.lineSeparator)(professionalExperiencesColSizes, "-") + "\n ";
|
|
155
155
|
professionalExperiencesSummary += "| Contract Type ";
|
|
156
156
|
professionalExperiencesSummary += "| Department ";
|
|
157
|
+
professionalExperiencesSummary += "| Description ";
|
|
157
158
|
professionalExperiencesSummary += "| Employer ";
|
|
158
159
|
professionalExperiencesSummary += "| End Month ";
|
|
159
160
|
professionalExperiencesSummary += "| End Year ";
|
|
@@ -9,6 +9,8 @@ export declare class ResumeV1ProfessionalExperience {
|
|
|
9
9
|
contractType: string | null;
|
|
10
10
|
/** The specific department or division within the company. */
|
|
11
11
|
department: string | null;
|
|
12
|
+
/** The description of the professional experience as written in the document. */
|
|
13
|
+
description: string | null;
|
|
12
14
|
/** The name of the company or organization. */
|
|
13
15
|
employer: string | null;
|
|
14
16
|
/** The month when the professional experience ended. */
|
|
@@ -23,6 +23,7 @@ class ResumeV1ProfessionalExperience {
|
|
|
23
23
|
this.polygon = [];
|
|
24
24
|
this.contractType = prediction["contract_type"];
|
|
25
25
|
this.department = prediction["department"];
|
|
26
|
+
this.description = prediction["description"];
|
|
26
27
|
this.employer = prediction["employer"];
|
|
27
28
|
this.endMonth = prediction["end_month"];
|
|
28
29
|
this.endYear = prediction["end_year"];
|
|
@@ -44,6 +45,8 @@ class ResumeV1ProfessionalExperience {
|
|
|
44
45
|
printable.contractType +
|
|
45
46
|
", Department: " +
|
|
46
47
|
printable.department +
|
|
48
|
+
", Description: " +
|
|
49
|
+
printable.description +
|
|
47
50
|
", Employer: " +
|
|
48
51
|
printable.employer +
|
|
49
52
|
", End Month: " +
|
|
@@ -67,6 +70,8 @@ class ResumeV1ProfessionalExperience {
|
|
|
67
70
|
" | " +
|
|
68
71
|
printable.department.padEnd(10) +
|
|
69
72
|
" | " +
|
|
73
|
+
printable.description.padEnd(36) +
|
|
74
|
+
" | " +
|
|
70
75
|
printable.employer.padEnd(25) +
|
|
71
76
|
" | " +
|
|
72
77
|
printable.endMonth.padEnd(9) +
|
|
@@ -94,6 +99,11 @@ _ResumeV1ProfessionalExperience_instances = new WeakSet(), _ResumeV1Professional
|
|
|
94
99
|
(0, common_1.cleanSpecialChars)(this.department) :
|
|
95
100
|
(0, common_1.cleanSpecialChars)(this.department).slice(0, 7) + "..." :
|
|
96
101
|
"",
|
|
102
|
+
description: this.description ?
|
|
103
|
+
this.description.length <= 36 ?
|
|
104
|
+
(0, common_1.cleanSpecialChars)(this.description) :
|
|
105
|
+
(0, common_1.cleanSpecialChars)(this.description).slice(0, 33) + "..." :
|
|
106
|
+
"",
|
|
97
107
|
employer: this.employer ?
|
|
98
108
|
this.employer.length <= 25 ?
|
|
99
109
|
(0, common_1.cleanSpecialChars)(this.employer) :
|