@trulioo/docv-capture-web 2.13.1 → 2.14.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/README.md CHANGED
@@ -129,9 +129,10 @@ verification by calling the `acceptImage` function.
129
129
 
130
130
 
131
131
  ```javascript showLineNumbers
132
- // As an example, we will submit the captured image for document verification if the post capture feedback returns a CAN_BE_PROCESSED status.
133
- result.verifyImage().then((verifyFeedback: TruliooVerifyResponse) => {
134
- if (verifyFeedback.verificationStatus == VerificationStatus.CAN_BE_PROCESSED) {
132
+ // As an example, we will submit the captured image for document verification if the post capture feedback documentVerifyResponse.documentTypeAccepted is not RESULT_CHECK_DECLINED.
133
+ // Note that the documentVerifyResponse will have more than just documentTypeAccepted, the below code is just an example of just checking for documentTypeAccepted.
134
+ result.verifyImage().then((verifyFeedback: TruliooVerifyFeedback) => {
135
+ if (verifyFeedback.documentVerifyResponse.documentTypeAccepted !== ResultCheck.RESULT_CHECK_DECLINED) {
135
136
  // Note that the acceptImage can be called outside of the verifyImage function.
136
137
  result.acceptImage().then((status: boolean) => {
137
138
  console.log("Successfully submitted the image")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trulioo/docv-capture-web",
3
- "version": "2.13.1",
3
+ "version": "2.14.0",
4
4
  "main": "trulioo-docv-capture-web.js",
5
5
  "types": "trulioo-docv-capture-web.d.ts",
6
6
  "devDependencies": {
@@ -40,47 +40,6 @@ export declare namespace com.trulioo.docv.core.workflow {
40
40
  equals(other: Nullable<any>): boolean;
41
41
  }
42
42
  }
43
- export declare class TruliooCamera /* extends capture.Camera */ {
44
- constructor(cameraId: string, cameraDetectionType: DetectionType);
45
- get id(): string;
46
- get detectionType(): DetectionType;
47
- removeCamera(): void;
48
- renderCamera(parentElementId: string, cameraProps?: Nullable<CameraProps>): Promise<boolean>;
49
- }
50
- export declare class CameraProps {
51
- constructor(onCaptureRegionChange: Nullable<(p0: CaptureRegion) => void>);
52
- get onCaptureRegionChange(): Nullable<(p0: CaptureRegion) => void>;
53
- copy(onCaptureRegionChange?: Nullable<(p0: CaptureRegion) => void>): CameraProps;
54
- toString(): string;
55
- hashCode(): number;
56
- equals(other: Nullable<any>): boolean;
57
- }
58
- export declare interface CaptureRegion {
59
- readonly bottomRight: PointCoordinates;
60
- readonly center: PointCoordinates;
61
- readonly selfieRadius: number;
62
- readonly topLeft: PointCoordinates;
63
- readonly __doNotUseOrImplementIt: {
64
- readonly CaptureRegion: unique symbol;
65
- };
66
- }
67
- export declare interface PointCoordinates {
68
- readonly x: number;
69
- readonly y: number;
70
- readonly __doNotUseOrImplementIt: {
71
- readonly PointCoordinates: unique symbol;
72
- };
73
- }
74
- export declare class TruliooCapture {
75
- constructor();
76
- initialize(shortCode: string, previewMode?: boolean): Promise<string>;
77
- getCameraComponent(config?: Nullable<TruliooCameraConfig>): TruliooCamera;
78
- startFeedback(cameraId: string, imageFeedback?: Nullable<(p0: TruliooImageFeedback) => void>): Promise<TruliooCaptureResponse>;
79
- stopFeedback(cameraId: string): Promise<boolean>;
80
- onFeedbackState(feedback: (p0: TruliooFeedbackState) => void): void;
81
- captureLatestFrame(): Promise<TruliooCaptureResponse>;
82
- submitTransaction(): Promise<boolean>;
83
- }
84
43
  export declare interface TruliooCameraConfig {
85
44
  readonly detectionType: DetectionType;
86
45
  readonly __doNotUseOrImplementIt: {
@@ -137,38 +96,11 @@ export declare interface TruliooCaptureResponse extends TruliooImageFeedback {
137
96
  }
138
97
  export declare interface TruliooVerifyFeedback {
139
98
  readonly isVerifyAttemptAvailable: boolean;
140
- readonly verificationStatus: VerificationStatus;
99
+ readonly documentVerifyResponse: DocumentVerifyResponse;
141
100
  readonly __doNotUseOrImplementIt: {
142
101
  readonly TruliooVerifyFeedback: unique symbol;
143
102
  };
144
103
  }
145
- export declare abstract class VerificationStatus {
146
- private constructor();
147
- static get CAN_BE_PROCESSED(): VerificationStatus & {
148
- get name(): "CAN_BE_PROCESSED";
149
- get ordinal(): 0;
150
- };
151
- static get CANNOT_BE_CLASSIFIED(): VerificationStatus & {
152
- get name(): "CANNOT_BE_CLASSIFIED";
153
- get ordinal(): 1;
154
- };
155
- static get UNSUPPORTED_DOCUMENT(): VerificationStatus & {
156
- get name(): "UNSUPPORTED_DOCUMENT";
157
- get ordinal(): 2;
158
- };
159
- static get EXPIRED_DOCUMENT(): VerificationStatus & {
160
- get name(): "EXPIRED_DOCUMENT";
161
- get ordinal(): 3;
162
- };
163
- static get ERROR(): VerificationStatus & {
164
- get name(): "ERROR";
165
- get ordinal(): 4;
166
- };
167
- static values(): Array<VerificationStatus>;
168
- static valueOf(value: string): VerificationStatus;
169
- get name(): "CAN_BE_PROCESSED" | "CANNOT_BE_CLASSIFIED" | "UNSUPPORTED_DOCUMENT" | "EXPIRED_DOCUMENT" | "ERROR";
170
- get ordinal(): 0 | 1 | 2 | 3 | 4;
171
- }
172
104
  export declare abstract class TruliooFeedbackState {
173
105
  private constructor();
174
106
  static get NONE(): TruliooFeedbackState & {
@@ -204,4 +136,119 @@ export declare abstract class TruliooFeedbackState {
204
136
  get name(): "NONE" | "CAPTURING" | "BLUR" | "SUCCESS" | "ERROR" | "TOO_CLOSE" | "TOO_FAR";
205
137
  get ordinal(): 0 | 1 | 2 | 3 | 4 | 5 | 6;
206
138
  }
139
+ export declare abstract class ResultCheck {
140
+ private constructor();
141
+ static get RESULT_CHECK_UNSPECIFIED(): ResultCheck & {
142
+ get name(): "RESULT_CHECK_UNSPECIFIED";
143
+ get ordinal(): 0;
144
+ };
145
+ static get RESULT_CHECK_DECLINED(): ResultCheck & {
146
+ get name(): "RESULT_CHECK_DECLINED";
147
+ get ordinal(): 1;
148
+ };
149
+ static get RESULT_CHECK_ACCEPTED(): ResultCheck & {
150
+ get name(): "RESULT_CHECK_ACCEPTED";
151
+ get ordinal(): 2;
152
+ };
153
+ static values(): Array<ResultCheck>;
154
+ static valueOf(value: string): ResultCheck;
155
+ get name(): "RESULT_CHECK_UNSPECIFIED" | "RESULT_CHECK_DECLINED" | "RESULT_CHECK_ACCEPTED";
156
+ get ordinal(): 0 | 1 | 2;
157
+ }
158
+ export declare abstract class DocumentExpirationCheck {
159
+ private constructor();
160
+ static get DOCUMENT_EXPIRATION_CHECK_UNSPECIFIED(): DocumentExpirationCheck & {
161
+ get name(): "DOCUMENT_EXPIRATION_CHECK_UNSPECIFIED";
162
+ get ordinal(): 0;
163
+ };
164
+ static get DOCUMENT_EXPIRATION_CHECK_EXPIRED(): DocumentExpirationCheck & {
165
+ get name(): "DOCUMENT_EXPIRATION_CHECK_EXPIRED";
166
+ get ordinal(): 1;
167
+ };
168
+ static get DOCUMENT_EXPIRATION_CHECK_VALID(): DocumentExpirationCheck & {
169
+ get name(): "DOCUMENT_EXPIRATION_CHECK_VALID";
170
+ get ordinal(): 2;
171
+ };
172
+ static values(): Array<DocumentExpirationCheck>;
173
+ static valueOf(value: string): DocumentExpirationCheck;
174
+ get name(): "DOCUMENT_EXPIRATION_CHECK_UNSPECIFIED" | "DOCUMENT_EXPIRATION_CHECK_EXPIRED" | "DOCUMENT_EXPIRATION_CHECK_VALID";
175
+ get ordinal(): 0 | 1 | 2;
176
+ }
177
+ export declare abstract class BackImageRequirement {
178
+ private constructor();
179
+ static get BACK_IMAGE_REQUIREMENT_UNSPECIFIED(): BackImageRequirement & {
180
+ get name(): "BACK_IMAGE_REQUIREMENT_UNSPECIFIED";
181
+ get ordinal(): 0;
182
+ };
183
+ static get BACK_IMAGE_REQUIREMENT_NOT_REQUIRED(): BackImageRequirement & {
184
+ get name(): "BACK_IMAGE_REQUIREMENT_NOT_REQUIRED";
185
+ get ordinal(): 1;
186
+ };
187
+ static get BACK_IMAGE_REQUIREMENT_REQUIRED(): BackImageRequirement & {
188
+ get name(): "BACK_IMAGE_REQUIREMENT_REQUIRED";
189
+ get ordinal(): 2;
190
+ };
191
+ static values(): Array<BackImageRequirement>;
192
+ static valueOf(value: string): BackImageRequirement;
193
+ get name(): "BACK_IMAGE_REQUIREMENT_UNSPECIFIED" | "BACK_IMAGE_REQUIREMENT_NOT_REQUIRED" | "BACK_IMAGE_REQUIREMENT_REQUIRED";
194
+ get ordinal(): 0 | 1 | 2;
195
+ }
196
+ export declare class DocumentVerifyResponse {
197
+ constructor(documentDetected: ResultCheck, documentTypeAccepted: ResultCheck, documentCountryAccepted: ResultCheck, documentJurisdictionAccepted: ResultCheck, blur: ResultCheck, glare: ResultCheck, skewed: ResultCheck, bright: ResultCheck, documentExpirationCheck: DocumentExpirationCheck, backImageRequirement: BackImageRequirement);
198
+ get documentDetected(): ResultCheck;
199
+ get documentTypeAccepted(): ResultCheck;
200
+ get documentCountryAccepted(): ResultCheck;
201
+ get documentJurisdictionAccepted(): ResultCheck;
202
+ get blur(): ResultCheck;
203
+ get glare(): ResultCheck;
204
+ get skewed(): ResultCheck;
205
+ get bright(): ResultCheck;
206
+ get documentExpirationCheck(): DocumentExpirationCheck;
207
+ get backImageRequirement(): BackImageRequirement;
208
+ copy(documentDetected?: ResultCheck, documentTypeAccepted?: ResultCheck, documentCountryAccepted?: ResultCheck, documentJurisdictionAccepted?: ResultCheck, blur?: ResultCheck, glare?: ResultCheck, skewed?: ResultCheck, bright?: ResultCheck, documentExpirationCheck?: DocumentExpirationCheck, backImageRequirement?: BackImageRequirement): DocumentVerifyResponse;
209
+ toString(): string;
210
+ hashCode(): number;
211
+ equals(other: Nullable<any>): boolean;
212
+ }
213
+ export declare class TruliooCamera /* extends capture.Camera */ {
214
+ constructor(cameraId: string, cameraDetectionType: DetectionType);
215
+ get id(): string;
216
+ get detectionType(): DetectionType;
217
+ removeCamera(): void;
218
+ renderCamera(parentElementId: string, cameraProps?: Nullable<CameraProps>): Promise<boolean>;
219
+ }
220
+ export declare class CameraProps {
221
+ constructor(onCaptureRegionChange: Nullable<(p0: CaptureRegion) => void>);
222
+ get onCaptureRegionChange(): Nullable<(p0: CaptureRegion) => void>;
223
+ copy(onCaptureRegionChange?: Nullable<(p0: CaptureRegion) => void>): CameraProps;
224
+ toString(): string;
225
+ hashCode(): number;
226
+ equals(other: Nullable<any>): boolean;
227
+ }
228
+ export declare interface CaptureRegion {
229
+ readonly bottomRight: PointCoordinates;
230
+ readonly center: PointCoordinates;
231
+ readonly selfieRadius: number;
232
+ readonly topLeft: PointCoordinates;
233
+ readonly __doNotUseOrImplementIt: {
234
+ readonly CaptureRegion: unique symbol;
235
+ };
236
+ }
237
+ export declare interface PointCoordinates {
238
+ readonly x: number;
239
+ readonly y: number;
240
+ readonly __doNotUseOrImplementIt: {
241
+ readonly PointCoordinates: unique symbol;
242
+ };
243
+ }
244
+ export declare class TruliooCapture {
245
+ constructor();
246
+ initialize(shortCode: string, previewMode?: boolean): Promise<string>;
247
+ getCameraComponent(config?: Nullable<TruliooCameraConfig>): TruliooCamera;
248
+ startFeedback(cameraId: string, imageFeedback?: Nullable<(p0: TruliooImageFeedback) => void>): Promise<TruliooCaptureResponse>;
249
+ stopFeedback(cameraId: string): Promise<boolean>;
250
+ onFeedbackState(feedback: (p0: TruliooFeedbackState) => void): void;
251
+ captureLatestFrame(): Promise<TruliooCaptureResponse>;
252
+ submitTransaction(): Promise<boolean>;
253
+ }
207
254
  export as namespace trulioo_docv_capture_web;