mindee 4.18.1 → 4.20.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 +16 -0
- package/package.json +1 -1
- package/src/cli.js +10 -20
- package/src/client.d.ts +44 -9
- package/src/client.js +24 -0
- package/src/http/apiSettings.d.ts +2 -0
- package/src/http/apiSettings.js +3 -1
- package/src/http/baseEndpoint.d.ts +10 -1
- package/src/http/baseEndpoint.js +13 -1
- package/src/http/endpoint.d.ts +3 -11
- package/src/http/endpoint.js +26 -22
- package/src/http/error.js +1 -1
- package/src/http/httpParams.d.ts +17 -0
- package/src/http/httpParams.js +2 -0
- package/src/http/index.d.ts +1 -0
- package/src/http/responseValidation.js +6 -0
- package/src/http/workflowEndpoint.d.ts +29 -0
- package/src/http/workflowEndpoint.js +99 -0
- package/src/parsing/common/asyncPredictResponse.d.ts +1 -1
- package/src/parsing/common/asyncPredictResponse.js +10 -9
- package/src/parsing/common/execution.d.ts +39 -0
- package/src/parsing/common/execution.js +32 -0
- package/src/parsing/common/executionFile.d.ts +12 -0
- package/src/parsing/common/executionFile.js +14 -0
- package/src/parsing/common/executionPriority.d.ts +5 -0
- package/src/parsing/common/executionPriority.js +9 -0
- package/src/parsing/common/index.d.ts +4 -1
- package/src/parsing/common/index.js +9 -3
- package/src/parsing/common/workflowResponse.d.ts +17 -0
- package/src/parsing/common/workflowResponse.js +17 -0
- package/src/product/{internationalId/internationalIdV1.d.ts → driverLicense/driverLicenseV1.d.ts} +5 -5
- package/src/product/{internationalId/internationalIdV1.js → driverLicense/driverLicenseV1.js} +8 -8
- 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/healthCard/healthCardV1.d.ts +16 -0
- package/src/product/fr/healthCard/healthCardV1.js +27 -0
- package/src/product/fr/healthCard/healthCardV1Document.d.ts +20 -0
- package/src/product/fr/healthCard/healthCardV1Document.js +43 -0
- 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 -0
- package/src/product/fr/index.js +5 -1
- package/src/product/fr/internal.d.ts +1 -0
- package/src/product/fr/internal.js +2 -1
- 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 -1
- package/src/product/index.js +3 -3
- package/src/product/internal.d.ts +1 -0
- package/src/product/internal.js +2 -1
- package/src/product/internationalId/internal.d.ts +0 -2
- package/src/product/internationalId/internal.js +1 -5
- package/src/product/resume/resumeV1Document.d.ts +1 -1
- package/src/product/resume/resumeV1Document.js +1 -1
- package/src/product/internationalId/internationalIdV1Document.d.ts +0 -42
- package/src/product/internationalId/internationalIdV1Document.js +0 -101
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AsyncPredictResponse = exports.Job = void 0;
|
|
4
|
+
exports.datetimeWithTimezone = datetimeWithTimezone;
|
|
4
5
|
const apiResponse_1 = require("./apiResponse");
|
|
5
6
|
const document_1 = require("./document");
|
|
6
7
|
/** Wrapper for asynchronous request queues. Holds information regarding a job (queue).
|
|
@@ -10,10 +11,10 @@ const document_1 = require("./document");
|
|
|
10
11
|
*/
|
|
11
12
|
class Job {
|
|
12
13
|
constructor(jsonResponse) {
|
|
13
|
-
this.issuedAt =
|
|
14
|
+
this.issuedAt = datetimeWithTimezone(jsonResponse["issued_at"]);
|
|
14
15
|
if (jsonResponse["available_at"] !== undefined &&
|
|
15
16
|
jsonResponse["available_at"] !== null) {
|
|
16
|
-
this.availableAt =
|
|
17
|
+
this.availableAt = datetimeWithTimezone(jsonResponse["available_at"]);
|
|
17
18
|
}
|
|
18
19
|
this.id = jsonResponse["id"];
|
|
19
20
|
this.status = jsonResponse["status"];
|
|
@@ -22,15 +23,15 @@ class Job {
|
|
|
22
23
|
this.availableAt.getTime() - this.issuedAt.getTime();
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
// Hideous thing to make sure dates sent back by the server are parsed correctly in UTC.
|
|
26
|
-
datetimeWithTimezone(date) {
|
|
27
|
-
if (date.search(/\+[0-9]{2}:[0-9]{2}$/) === -1) {
|
|
28
|
-
date += "+00:00";
|
|
29
|
-
}
|
|
30
|
-
return new Date(date);
|
|
31
|
-
}
|
|
32
26
|
}
|
|
33
27
|
exports.Job = Job;
|
|
28
|
+
// Hideous thing to make sure dates sent back by the server are parsed correctly in UTC.
|
|
29
|
+
function datetimeWithTimezone(date) {
|
|
30
|
+
if (date.search(/\+[0-9]{2}:[0-9]{2}$/) === -1) {
|
|
31
|
+
date += "+00:00";
|
|
32
|
+
}
|
|
33
|
+
return new Date(date);
|
|
34
|
+
}
|
|
34
35
|
/** Wrapper for asynchronous jobs and parsing results.
|
|
35
36
|
*
|
|
36
37
|
* @category API Response
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Inference } from "./inference";
|
|
2
|
+
import { GeneratedV1Document } from "../../product/generated/generatedV1Document";
|
|
3
|
+
import { ExecutionFile } from "./executionFile";
|
|
4
|
+
import { StringDict } from "./stringDict";
|
|
5
|
+
import { ExecutionPriority } from "./executionPriority";
|
|
6
|
+
/**
|
|
7
|
+
* Representation of an execution for a workflow.
|
|
8
|
+
* @category Workflow
|
|
9
|
+
*/
|
|
10
|
+
export declare class Execution<T extends Inference> {
|
|
11
|
+
/** Identifier for the batch to which the execution belongs. */
|
|
12
|
+
batchName: string;
|
|
13
|
+
/** The time at which the execution started. */
|
|
14
|
+
createdAt: Date | null;
|
|
15
|
+
/** File representation within a workflow execution. */
|
|
16
|
+
file: ExecutionFile;
|
|
17
|
+
/** Identifier for the execution. */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Deserialized inference object. */
|
|
20
|
+
inference: T | null;
|
|
21
|
+
/** Priority of the execution. */
|
|
22
|
+
priority: ExecutionPriority | null;
|
|
23
|
+
/** The time at which the file was tagged as reviewed. */
|
|
24
|
+
reviewedAt: Date | null;
|
|
25
|
+
/** The time at which the file was uploaded to a workflow. */
|
|
26
|
+
availableAt: Date | null;
|
|
27
|
+
/** Reviewed fields and values. */
|
|
28
|
+
reviewedPrediction: GeneratedV1Document | null;
|
|
29
|
+
/** Execution Status. */
|
|
30
|
+
status: string;
|
|
31
|
+
/** Execution type. */
|
|
32
|
+
type: string | null;
|
|
33
|
+
/** The time at which the file was uploaded to a workflow. */
|
|
34
|
+
uploadedAt: Date | null;
|
|
35
|
+
/** Identifier for the workflow. */
|
|
36
|
+
workflowId: string;
|
|
37
|
+
constructor(inferenceClass: new (serverResponse: StringDict) => T, jsonResponse: StringDict);
|
|
38
|
+
private parseDate;
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Execution = void 0;
|
|
4
|
+
const generatedV1Document_1 = require("../../product/generated/generatedV1Document");
|
|
5
|
+
/**
|
|
6
|
+
* Representation of an execution for a workflow.
|
|
7
|
+
* @category Workflow
|
|
8
|
+
*/
|
|
9
|
+
class Execution {
|
|
10
|
+
constructor(inferenceClass, jsonResponse) {
|
|
11
|
+
this.batchName = jsonResponse["batch_name"];
|
|
12
|
+
this.createdAt = jsonResponse["created_at"] ? this.parseDate(jsonResponse["created_at"]) : null;
|
|
13
|
+
this.file = jsonResponse["file"];
|
|
14
|
+
this.id = jsonResponse["id"];
|
|
15
|
+
this.inference = jsonResponse["inference"] ? new inferenceClass(jsonResponse["inference"]) : null;
|
|
16
|
+
this.priority = jsonResponse["priority"];
|
|
17
|
+
this.reviewedAt = this.parseDate(jsonResponse["reviewed_at"]);
|
|
18
|
+
this.availableAt = this.parseDate(jsonResponse["available_at"]);
|
|
19
|
+
this.reviewedPrediction = jsonResponse["reviewed_prediction"] ?
|
|
20
|
+
new generatedV1Document_1.GeneratedV1Document(jsonResponse["reviewed_prediction"]) : null;
|
|
21
|
+
this.status = jsonResponse["status"];
|
|
22
|
+
this.type = jsonResponse["type"];
|
|
23
|
+
this.uploadedAt = this.parseDate(jsonResponse["uploaded_at"]);
|
|
24
|
+
this.workflowId = jsonResponse["workflow_id"];
|
|
25
|
+
}
|
|
26
|
+
parseDate(dateString) {
|
|
27
|
+
if (!dateString)
|
|
28
|
+
return null;
|
|
29
|
+
return new Date(dateString);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.Execution = Execution;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StringDict } from "./stringDict";
|
|
2
|
+
/**
|
|
3
|
+
* Representation of an execution's file info.
|
|
4
|
+
* @category Workflow
|
|
5
|
+
*/
|
|
6
|
+
export declare class ExecutionFile {
|
|
7
|
+
/** File name. */
|
|
8
|
+
name: string | null;
|
|
9
|
+
/** Optional alias for the fil. */
|
|
10
|
+
alias: string | null;
|
|
11
|
+
constructor(jsonResponse: StringDict);
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionFile = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Representation of an execution's file info.
|
|
6
|
+
* @category Workflow
|
|
7
|
+
*/
|
|
8
|
+
class ExecutionFile {
|
|
9
|
+
constructor(jsonResponse) {
|
|
10
|
+
this.name = jsonResponse["name"];
|
|
11
|
+
this.alias = jsonResponse["alias"];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.ExecutionFile = ExecutionFile;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionPriority = void 0;
|
|
4
|
+
var ExecutionPriority;
|
|
5
|
+
(function (ExecutionPriority) {
|
|
6
|
+
ExecutionPriority["low"] = "low";
|
|
7
|
+
ExecutionPriority["medium"] = "medium";
|
|
8
|
+
ExecutionPriority["high"] = "high";
|
|
9
|
+
})(ExecutionPriority || (exports.ExecutionPriority = ExecutionPriority = {}));
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export { Document } from "./document";
|
|
2
|
+
export { Execution } from "./execution";
|
|
3
|
+
export { ExecutionFile } from "./executionFile";
|
|
4
|
+
export { ExecutionPriority } from "./executionPriority";
|
|
5
|
+
export { Inference } from "./inference";
|
|
2
6
|
export { FeedbackResponse } from "./feedback/feedbackResponse";
|
|
3
7
|
export { OrientationField } from "./orientation";
|
|
4
8
|
export { StringDict } from "./stringDict";
|
|
5
|
-
export { Inference } from "./inference";
|
|
6
9
|
export { AsyncPredictResponse } from "./asyncPredictResponse";
|
|
7
10
|
export { PredictResponse } from "./predictResponse";
|
|
8
11
|
export { Prediction } from "./prediction";
|
|
@@ -23,15 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.cleanSpecialChars = exports.floatToString = exports.extras = exports.lineSeparator = exports.cleanOutString = exports.Page = exports.Prediction = exports.PredictResponse = exports.AsyncPredictResponse = exports.Inference = exports.
|
|
26
|
+
exports.cleanSpecialChars = exports.floatToString = exports.extras = exports.lineSeparator = exports.cleanOutString = exports.Page = exports.Prediction = exports.PredictResponse = exports.AsyncPredictResponse = exports.OrientationField = exports.FeedbackResponse = exports.Inference = exports.ExecutionPriority = exports.ExecutionFile = exports.Execution = exports.Document = void 0;
|
|
27
27
|
var document_1 = require("./document");
|
|
28
28
|
Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return document_1.Document; } });
|
|
29
|
+
var execution_1 = require("./execution");
|
|
30
|
+
Object.defineProperty(exports, "Execution", { enumerable: true, get: function () { return execution_1.Execution; } });
|
|
31
|
+
var executionFile_1 = require("./executionFile");
|
|
32
|
+
Object.defineProperty(exports, "ExecutionFile", { enumerable: true, get: function () { return executionFile_1.ExecutionFile; } });
|
|
33
|
+
var executionPriority_1 = require("./executionPriority");
|
|
34
|
+
Object.defineProperty(exports, "ExecutionPriority", { enumerable: true, get: function () { return executionPriority_1.ExecutionPriority; } });
|
|
35
|
+
var inference_1 = require("./inference");
|
|
36
|
+
Object.defineProperty(exports, "Inference", { enumerable: true, get: function () { return inference_1.Inference; } });
|
|
29
37
|
var feedbackResponse_1 = require("./feedback/feedbackResponse");
|
|
30
38
|
Object.defineProperty(exports, "FeedbackResponse", { enumerable: true, get: function () { return feedbackResponse_1.FeedbackResponse; } });
|
|
31
39
|
var orientation_1 = require("./orientation");
|
|
32
40
|
Object.defineProperty(exports, "OrientationField", { enumerable: true, get: function () { return orientation_1.OrientationField; } });
|
|
33
|
-
var inference_1 = require("./inference");
|
|
34
|
-
Object.defineProperty(exports, "Inference", { enumerable: true, get: function () { return inference_1.Inference; } });
|
|
35
41
|
var asyncPredictResponse_1 = require("./asyncPredictResponse");
|
|
36
42
|
Object.defineProperty(exports, "AsyncPredictResponse", { enumerable: true, get: function () { return asyncPredictResponse_1.AsyncPredictResponse; } });
|
|
37
43
|
var predictResponse_1 = require("./predictResponse");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StringDict } from "./stringDict";
|
|
2
|
+
import { ApiResponse } from "./apiResponse";
|
|
3
|
+
import { Execution } from "./execution";
|
|
4
|
+
import { Inference } from "./inference";
|
|
5
|
+
/** Wrapper for workflow requests.
|
|
6
|
+
*
|
|
7
|
+
* @category API Response
|
|
8
|
+
* @category Workflow
|
|
9
|
+
*/
|
|
10
|
+
export declare class WorkflowResponse<T extends Inference> extends ApiResponse {
|
|
11
|
+
/**
|
|
12
|
+
* Set the prediction model used to parse the document.
|
|
13
|
+
* The response object will be instantiated based on this parameter.
|
|
14
|
+
*/
|
|
15
|
+
execution: Execution<T>;
|
|
16
|
+
constructor(inferenceClass: new (serverResponse: StringDict) => T, serverResponse: StringDict);
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowResponse = void 0;
|
|
4
|
+
const apiResponse_1 = require("./apiResponse");
|
|
5
|
+
const execution_1 = require("./execution");
|
|
6
|
+
/** Wrapper for workflow requests.
|
|
7
|
+
*
|
|
8
|
+
* @category API Response
|
|
9
|
+
* @category Workflow
|
|
10
|
+
*/
|
|
11
|
+
class WorkflowResponse extends apiResponse_1.ApiResponse {
|
|
12
|
+
constructor(inferenceClass, serverResponse) {
|
|
13
|
+
super(serverResponse);
|
|
14
|
+
this.execution = new execution_1.Execution(inferenceClass, serverResponse["execution"]);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.WorkflowResponse = WorkflowResponse;
|
package/src/product/{internationalId/internationalIdV1.d.ts → driverLicense/driverLicenseV1.d.ts}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
-
import {
|
|
2
|
+
import { DriverLicenseV1Document } from "./driverLicenseV1Document";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Driver License API version 1 inference prediction.
|
|
5
5
|
*/
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class DriverLicenseV1 extends Inference {
|
|
7
7
|
/** The endpoint's name. */
|
|
8
8
|
endpointName: string;
|
|
9
9
|
/** The endpoint's version. */
|
|
10
10
|
endpointVersion: string;
|
|
11
11
|
/** The document-level prediction. */
|
|
12
|
-
prediction:
|
|
12
|
+
prediction: DriverLicenseV1Document;
|
|
13
13
|
/** The document's pages. */
|
|
14
|
-
pages: Page<
|
|
14
|
+
pages: Page<DriverLicenseV1Document>[];
|
|
15
15
|
constructor(rawPrediction: StringDict);
|
|
16
16
|
}
|
package/src/product/{internationalId/internationalIdV1.js → driverLicense/driverLicenseV1.js}
RENAMED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DriverLicenseV1 = void 0;
|
|
4
4
|
const common_1 = require("../../parsing/common");
|
|
5
|
-
const
|
|
5
|
+
const driverLicenseV1Document_1 = require("./driverLicenseV1Document");
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Driver License API version 1 inference prediction.
|
|
8
8
|
*/
|
|
9
|
-
class
|
|
9
|
+
class DriverLicenseV1 extends common_1.Inference {
|
|
10
10
|
constructor(rawPrediction) {
|
|
11
11
|
super(rawPrediction);
|
|
12
12
|
/** The endpoint's name. */
|
|
13
|
-
this.endpointName = "
|
|
13
|
+
this.endpointName = "driver_license";
|
|
14
14
|
/** The endpoint's version. */
|
|
15
15
|
this.endpointVersion = "1";
|
|
16
16
|
/** The document's pages. */
|
|
17
17
|
this.pages = [];
|
|
18
|
-
this.prediction = new
|
|
18
|
+
this.prediction = new driverLicenseV1Document_1.DriverLicenseV1Document(rawPrediction["prediction"]);
|
|
19
19
|
rawPrediction["pages"].forEach((page) => {
|
|
20
20
|
if (page.prediction !== undefined && page.prediction !== null &&
|
|
21
21
|
Object.keys(page.prediction).length > 0) {
|
|
22
|
-
this.pages.push(new common_1.Page(
|
|
22
|
+
this.pages.push(new common_1.Page(driverLicenseV1Document_1.DriverLicenseV1Document, page, page["id"], page["orientation"]));
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
exports.
|
|
27
|
+
exports.DriverLicenseV1 = DriverLicenseV1;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
|
+
import { DateField, StringField } from "../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Driver License API version 1.0 document data.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DriverLicenseV1Document implements Prediction {
|
|
7
|
+
/** The category or class of the driver license. */
|
|
8
|
+
category: StringField;
|
|
9
|
+
/** The alpha-3 ISO 3166 code of the country where the driver license was issued. */
|
|
10
|
+
countryCode: StringField;
|
|
11
|
+
/** The date of birth of the driver license holder. */
|
|
12
|
+
dateOfBirth: DateField;
|
|
13
|
+
/** The DD number of the driver license. */
|
|
14
|
+
ddNumber: StringField;
|
|
15
|
+
/** The expiry date of the driver license. */
|
|
16
|
+
expiryDate: DateField;
|
|
17
|
+
/** The first name of the driver license holder. */
|
|
18
|
+
firstName: StringField;
|
|
19
|
+
/** The unique identifier of the driver license. */
|
|
20
|
+
id: StringField;
|
|
21
|
+
/** The date when the driver license was issued. */
|
|
22
|
+
issuedDate: DateField;
|
|
23
|
+
/** The authority that issued the driver license. */
|
|
24
|
+
issuingAuthority: StringField;
|
|
25
|
+
/** The last name of the driver license holder. */
|
|
26
|
+
lastName: StringField;
|
|
27
|
+
/** The Machine Readable Zone (MRZ) of the driver license. */
|
|
28
|
+
mrz: StringField;
|
|
29
|
+
/** The place of birth of the driver license holder. */
|
|
30
|
+
placeOfBirth: StringField;
|
|
31
|
+
/** Second part of the ISO 3166-2 code, consisting of two letters indicating the US State. */
|
|
32
|
+
state: StringField;
|
|
33
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
34
|
+
/**
|
|
35
|
+
* Default string representation.
|
|
36
|
+
*/
|
|
37
|
+
toString(): string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DriverLicenseV1Document = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const standard_1 = require("../../parsing/standard");
|
|
6
|
+
/**
|
|
7
|
+
* Driver License API version 1.0 document data.
|
|
8
|
+
*/
|
|
9
|
+
class DriverLicenseV1Document {
|
|
10
|
+
constructor(rawPrediction, pageId) {
|
|
11
|
+
this.category = new standard_1.StringField({
|
|
12
|
+
prediction: rawPrediction["category"],
|
|
13
|
+
pageId: pageId,
|
|
14
|
+
});
|
|
15
|
+
this.countryCode = new standard_1.StringField({
|
|
16
|
+
prediction: rawPrediction["country_code"],
|
|
17
|
+
pageId: pageId,
|
|
18
|
+
});
|
|
19
|
+
this.dateOfBirth = new standard_1.DateField({
|
|
20
|
+
prediction: rawPrediction["date_of_birth"],
|
|
21
|
+
pageId: pageId,
|
|
22
|
+
});
|
|
23
|
+
this.ddNumber = new standard_1.StringField({
|
|
24
|
+
prediction: rawPrediction["dd_number"],
|
|
25
|
+
pageId: pageId,
|
|
26
|
+
});
|
|
27
|
+
this.expiryDate = new standard_1.DateField({
|
|
28
|
+
prediction: rawPrediction["expiry_date"],
|
|
29
|
+
pageId: pageId,
|
|
30
|
+
});
|
|
31
|
+
this.firstName = new standard_1.StringField({
|
|
32
|
+
prediction: rawPrediction["first_name"],
|
|
33
|
+
pageId: pageId,
|
|
34
|
+
});
|
|
35
|
+
this.id = new standard_1.StringField({
|
|
36
|
+
prediction: rawPrediction["id"],
|
|
37
|
+
pageId: pageId,
|
|
38
|
+
});
|
|
39
|
+
this.issuedDate = new standard_1.DateField({
|
|
40
|
+
prediction: rawPrediction["issued_date"],
|
|
41
|
+
pageId: pageId,
|
|
42
|
+
});
|
|
43
|
+
this.issuingAuthority = new standard_1.StringField({
|
|
44
|
+
prediction: rawPrediction["issuing_authority"],
|
|
45
|
+
pageId: pageId,
|
|
46
|
+
});
|
|
47
|
+
this.lastName = new standard_1.StringField({
|
|
48
|
+
prediction: rawPrediction["last_name"],
|
|
49
|
+
pageId: pageId,
|
|
50
|
+
});
|
|
51
|
+
this.mrz = new standard_1.StringField({
|
|
52
|
+
prediction: rawPrediction["mrz"],
|
|
53
|
+
pageId: pageId,
|
|
54
|
+
});
|
|
55
|
+
this.placeOfBirth = new standard_1.StringField({
|
|
56
|
+
prediction: rawPrediction["place_of_birth"],
|
|
57
|
+
pageId: pageId,
|
|
58
|
+
});
|
|
59
|
+
this.state = new standard_1.StringField({
|
|
60
|
+
prediction: rawPrediction["state"],
|
|
61
|
+
pageId: pageId,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Default string representation.
|
|
66
|
+
*/
|
|
67
|
+
toString() {
|
|
68
|
+
const outStr = `:Country Code: ${this.countryCode}
|
|
69
|
+
:State: ${this.state}
|
|
70
|
+
:ID: ${this.id}
|
|
71
|
+
:Category: ${this.category}
|
|
72
|
+
:Last Name: ${this.lastName}
|
|
73
|
+
:First Name: ${this.firstName}
|
|
74
|
+
:Date of Birth: ${this.dateOfBirth}
|
|
75
|
+
:Place of Birth: ${this.placeOfBirth}
|
|
76
|
+
:Expiry Date: ${this.expiryDate}
|
|
77
|
+
:Issued Date: ${this.issuedDate}
|
|
78
|
+
:Issuing Authority: ${this.issuingAuthority}
|
|
79
|
+
:MRZ: ${this.mrz}
|
|
80
|
+
:DD Number: ${this.ddNumber}`.trimEnd();
|
|
81
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.DriverLicenseV1Document = DriverLicenseV1Document;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DriverLicenseV1 } from "./driverLicenseV1";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DriverLicenseV1 = void 0;
|
|
4
|
+
var driverLicenseV1_1 = require("./driverLicenseV1");
|
|
5
|
+
Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DriverLicenseV1Document = exports.DriverLicenseV1 = void 0;
|
|
4
|
+
var driverLicenseV1_1 = require("./driverLicenseV1");
|
|
5
|
+
Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
|
|
6
|
+
var driverLicenseV1Document_1 = require("./driverLicenseV1Document");
|
|
7
|
+
Object.defineProperty(exports, "DriverLicenseV1Document", { enumerable: true, get: function () { return driverLicenseV1Document_1.DriverLicenseV1Document; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
|
+
import { HealthCardV1Document } from "./healthCardV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Health Card API version 1 inference prediction.
|
|
5
|
+
*/
|
|
6
|
+
export declare class HealthCardV1 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: HealthCardV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<HealthCardV1Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HealthCardV1 = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const healthCardV1Document_1 = require("./healthCardV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Health Card API version 1 inference prediction.
|
|
8
|
+
*/
|
|
9
|
+
class HealthCardV1 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "french_healthcard";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new healthCardV1Document_1.HealthCardV1Document(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(healthCardV1Document_1.HealthCardV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.HealthCardV1 = HealthCardV1;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../../parsing/common";
|
|
2
|
+
import { DateField, StringField } from "../../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Health Card API version 1.0 document data.
|
|
5
|
+
*/
|
|
6
|
+
export declare class HealthCardV1Document implements Prediction {
|
|
7
|
+
/** The given names of the card holder. */
|
|
8
|
+
givenNames: StringField[];
|
|
9
|
+
/** The date when the carte vitale document was issued. */
|
|
10
|
+
issuanceDate: DateField;
|
|
11
|
+
/** The social security number of the card holder. */
|
|
12
|
+
socialSecurity: StringField;
|
|
13
|
+
/** The surname of the card holder. */
|
|
14
|
+
surname: StringField;
|
|
15
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
16
|
+
/**
|
|
17
|
+
* Default string representation.
|
|
18
|
+
*/
|
|
19
|
+
toString(): string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HealthCardV1Document = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const standard_1 = require("../../../parsing/standard");
|
|
6
|
+
/**
|
|
7
|
+
* Health Card API version 1.0 document data.
|
|
8
|
+
*/
|
|
9
|
+
class HealthCardV1Document {
|
|
10
|
+
constructor(rawPrediction, pageId) {
|
|
11
|
+
/** The given names of the card holder. */
|
|
12
|
+
this.givenNames = [];
|
|
13
|
+
rawPrediction["given_names"] &&
|
|
14
|
+
rawPrediction["given_names"].map((itemPrediction) => this.givenNames.push(new standard_1.StringField({
|
|
15
|
+
prediction: itemPrediction,
|
|
16
|
+
pageId: pageId,
|
|
17
|
+
})));
|
|
18
|
+
this.issuanceDate = new standard_1.DateField({
|
|
19
|
+
prediction: rawPrediction["issuance_date"],
|
|
20
|
+
pageId: pageId,
|
|
21
|
+
});
|
|
22
|
+
this.socialSecurity = new standard_1.StringField({
|
|
23
|
+
prediction: rawPrediction["social_security"],
|
|
24
|
+
pageId: pageId,
|
|
25
|
+
});
|
|
26
|
+
this.surname = new standard_1.StringField({
|
|
27
|
+
prediction: rawPrediction["surname"],
|
|
28
|
+
pageId: pageId,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Default string representation.
|
|
33
|
+
*/
|
|
34
|
+
toString() {
|
|
35
|
+
const givenNames = this.givenNames.join("\n ");
|
|
36
|
+
const outStr = `:Given Name(s): ${givenNames}
|
|
37
|
+
:Surname: ${this.surname}
|
|
38
|
+
:Social Security Number: ${this.socialSecurity}
|
|
39
|
+
:Issuance Date: ${this.issuanceDate}`.trimEnd();
|
|
40
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.HealthCardV1Document = HealthCardV1Document;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HealthCardV1 } from "./healthCardV1";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HealthCardV1 = void 0;
|
|
4
|
+
var healthCardV1_1 = require("./healthCardV1");
|
|
5
|
+
Object.defineProperty(exports, "HealthCardV1", { enumerable: true, get: function () { return healthCardV1_1.HealthCardV1; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HealthCardV1Document = exports.HealthCardV1 = void 0;
|
|
4
|
+
var healthCardV1_1 = require("./healthCardV1");
|
|
5
|
+
Object.defineProperty(exports, "HealthCardV1", { enumerable: true, get: function () { return healthCardV1_1.HealthCardV1; } });
|
|
6
|
+
var healthCardV1Document_1 = require("./healthCardV1Document");
|
|
7
|
+
Object.defineProperty(exports, "HealthCardV1Document", { enumerable: true, get: function () { return healthCardV1Document_1.HealthCardV1Document; } });
|
|
@@ -3,6 +3,8 @@ export { BankAccountDetailsV2 } from "./bankAccountDetails/bankAccountDetailsV2"
|
|
|
3
3
|
export { CarteGriseV1 } from "./carteGrise/carteGriseV1";
|
|
4
4
|
export { CarteVitaleV1 } from "./carteVitale/carteVitaleV1";
|
|
5
5
|
export { EnergyBillV1 } from "./energyBill/energyBillV1";
|
|
6
|
+
export { HealthCardV1 } from "./healthCard/healthCardV1";
|
|
6
7
|
export { IdCardV1 } from "./idCard/idCardV1";
|
|
7
8
|
export { IdCardV2 } from "./idCard/idCardV2";
|
|
8
9
|
export { PayslipV2 } from "./payslip/payslipV2";
|
|
10
|
+
export { PayslipV3 } from "./payslip/payslipV3";
|
package/src/product/fr/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PayslipV2 = exports.IdCardV2 = exports.IdCardV1 = exports.EnergyBillV1 = exports.CarteVitaleV1 = exports.CarteGriseV1 = exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1 = void 0;
|
|
3
|
+
exports.PayslipV3 = exports.PayslipV2 = exports.IdCardV2 = exports.IdCardV1 = exports.HealthCardV1 = exports.EnergyBillV1 = exports.CarteVitaleV1 = exports.CarteGriseV1 = exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1 = void 0;
|
|
4
4
|
var bankAccountDetailsV1_1 = require("./bankAccountDetails/bankAccountDetailsV1");
|
|
5
5
|
Object.defineProperty(exports, "BankAccountDetailsV1", { enumerable: true, get: function () { return bankAccountDetailsV1_1.BankAccountDetailsV1; } });
|
|
6
6
|
var bankAccountDetailsV2_1 = require("./bankAccountDetails/bankAccountDetailsV2");
|
|
@@ -11,9 +11,13 @@ var carteVitaleV1_1 = require("./carteVitale/carteVitaleV1");
|
|
|
11
11
|
Object.defineProperty(exports, "CarteVitaleV1", { enumerable: true, get: function () { return carteVitaleV1_1.CarteVitaleV1; } });
|
|
12
12
|
var energyBillV1_1 = require("./energyBill/energyBillV1");
|
|
13
13
|
Object.defineProperty(exports, "EnergyBillV1", { enumerable: true, get: function () { return energyBillV1_1.EnergyBillV1; } });
|
|
14
|
+
var healthCardV1_1 = require("./healthCard/healthCardV1");
|
|
15
|
+
Object.defineProperty(exports, "HealthCardV1", { enumerable: true, get: function () { return healthCardV1_1.HealthCardV1; } });
|
|
14
16
|
var idCardV1_1 = require("./idCard/idCardV1");
|
|
15
17
|
Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return idCardV1_1.IdCardV1; } });
|
|
16
18
|
var idCardV2_1 = require("./idCard/idCardV2");
|
|
17
19
|
Object.defineProperty(exports, "IdCardV2", { enumerable: true, get: function () { return idCardV2_1.IdCardV2; } });
|
|
18
20
|
var payslipV2_1 = require("./payslip/payslipV2");
|
|
19
21
|
Object.defineProperty(exports, "PayslipV2", { enumerable: true, get: function () { return payslipV2_1.PayslipV2; } });
|
|
22
|
+
var payslipV3_1 = require("./payslip/payslipV3");
|
|
23
|
+
Object.defineProperty(exports, "PayslipV3", { enumerable: true, get: function () { return payslipV3_1.PayslipV3; } });
|
|
@@ -2,5 +2,6 @@ export * as bankAccountDetails from "./bankAccountDetails/internal";
|
|
|
2
2
|
export * as carteGrise from "./carteGrise/internal";
|
|
3
3
|
export * as carteVitale from "./carteVitale/internal";
|
|
4
4
|
export * as energyBill from "./energyBill/internal";
|
|
5
|
+
export * as fr from "./healthCard/internal";
|
|
5
6
|
export * as idCard from "./idCard/internal";
|
|
6
7
|
export * as payslip from "./payslip/internal";
|
|
@@ -23,10 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.payslip = exports.idCard = exports.energyBill = exports.carteVitale = exports.carteGrise = exports.bankAccountDetails = void 0;
|
|
26
|
+
exports.payslip = exports.idCard = exports.fr = exports.energyBill = exports.carteVitale = exports.carteGrise = exports.bankAccountDetails = void 0;
|
|
27
27
|
exports.bankAccountDetails = __importStar(require("./bankAccountDetails/internal"));
|
|
28
28
|
exports.carteGrise = __importStar(require("./carteGrise/internal"));
|
|
29
29
|
exports.carteVitale = __importStar(require("./carteVitale/internal"));
|
|
30
30
|
exports.energyBill = __importStar(require("./energyBill/internal"));
|
|
31
|
+
exports.fr = __importStar(require("./healthCard/internal"));
|
|
31
32
|
exports.idCard = __importStar(require("./idCard/internal"));
|
|
32
33
|
exports.payslip = __importStar(require("./payslip/internal"));
|