cordova-digital-onboarding 1.0.1 → 1.1.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/docs/Changelog.md +19 -0
- package/docs/Device-Activation.md +3 -3
- package/docs/Verifying-User.md +143 -32
- package/lib/index.d.ts +329 -143
- package/lib/index.js +634 -368
- package/package.json +1 -1
- package/plugin.xml +2 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,108 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
documents: WDOScannedDocument[];
|
|
5
|
-
/** Which document should be scanned next. `undefined` when all documents are uploaded and accepted. */
|
|
6
|
-
get nextDocumentToScan(): WDOScannedDocument | undefined;
|
|
7
|
-
}
|
|
8
|
-
/** Document that needs to be scanned during process. */
|
|
9
|
-
declare class WDOScannedDocument {
|
|
10
|
-
/** Type of the document. */
|
|
11
|
-
type: WDODocumentType;
|
|
12
|
-
/** Upload state. */
|
|
13
|
-
get uploadState(): UploadState;
|
|
14
|
-
/** Sides of the document that were uploaded on the server. */
|
|
15
|
-
get sides(): Side[];
|
|
1
|
+
/** For request that needs to identify the current process. */
|
|
2
|
+
interface WDOProcessRequest {
|
|
3
|
+
processId: string;
|
|
16
4
|
}
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/** The document was rejected and needs to be re-uploaded. */
|
|
24
|
-
rejected = 2
|
|
25
|
-
}
|
|
26
|
-
/** Side of the uploaded document. */
|
|
27
|
-
declare class Side {
|
|
28
|
-
/** Type of the side. */
|
|
29
|
-
type: WDODocumentSide;
|
|
30
|
-
/** ID on the server. Use this ID in case of an reupload */
|
|
31
|
-
serverId: string;
|
|
32
|
-
/** Upload state of the document */
|
|
33
|
-
uploadState: UploadState;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** String that contains a Base64 encoded JPEG image */
|
|
37
|
-
type Base64EncodedJPEG = string;
|
|
38
|
-
/** Image of a document that can be sent to the backend for Identity Verification. */
|
|
39
|
-
declare class WDODocumentFile {
|
|
40
|
-
/** Raw data to upload. Make sure that the data aren't too big, hundreds of kbs should be enough. */
|
|
41
|
-
data: Base64EncodedJPEG;
|
|
42
|
-
/**
|
|
43
|
-
* Image signature.
|
|
44
|
-
*
|
|
45
|
-
* Optional, use only when the scan SDK supports this.
|
|
46
|
-
*/
|
|
47
|
-
dataSignature: string | undefined;
|
|
48
|
-
/** Type of the document. */
|
|
49
|
-
type: WDODocumentType;
|
|
50
|
-
/** Side of the document (`front` if the document is one-sided or only one side is expected). */
|
|
51
|
-
side: WDODocumentSide;
|
|
5
|
+
/** Onboarding process response */
|
|
6
|
+
interface WDOProcessResponse {
|
|
7
|
+
/** ID of the process */
|
|
8
|
+
processId: string;
|
|
9
|
+
/** Status of the process */
|
|
10
|
+
onboardingStatus: WDOOnboardingStatus;
|
|
52
11
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* Without specifying this value, the document side won't be overwritten.
|
|
12
|
+
* Activation code used during the activation process.
|
|
13
|
+
* If not present, the activation is created later on in the onboarding process.
|
|
56
14
|
*/
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Create the document file from an image that can be sent to the backend for Identity Verification.
|
|
60
|
-
*
|
|
61
|
-
* @param scannedDocument Document to upload.
|
|
62
|
-
* @param side The side of the document that the image captures.
|
|
63
|
-
* @param data Raw image data. Make sure that the data aren't too big, hundreds of kbs should be enough.
|
|
64
|
-
* @param dataSignature Signature of the image data. Optional, use only when the scan SDK supports this. `undefined` by default.
|
|
65
|
-
* @returns Document file to upload.
|
|
66
|
-
*/
|
|
67
|
-
static fromScannedDocument(scannedDocument: WDOScannedDocument, side: WDODocumentSide, data: Base64EncodedJPEG, dataSignature?: string): WDODocumentFile;
|
|
68
|
-
/**
|
|
69
|
-
* Image of a document that can be sent to the backend for Identity Verification.
|
|
70
|
-
*
|
|
71
|
-
* @param data Raw image data. Make sure that the data aren't too big, hundreds of kbs should be enough.
|
|
72
|
-
* @param type Type of the document.
|
|
73
|
-
* @param side The side of the document that the image captures.
|
|
74
|
-
* @param originalDocumentId Original document ID In case of a reupload. If you've previously uploaded this type and side and won't specify the previous ID, the image won't be overwritten.
|
|
75
|
-
* @param dataSignature Signature of the image data. Optional, use only when the scan SDK supports this. `undefined` by default.
|
|
76
|
-
*/
|
|
77
|
-
constructor(data: Base64EncodedJPEG, type: WDODocumentType, side: WDODocumentSide, originalDocumentId?: string, dataSignature?: string);
|
|
78
|
-
}
|
|
79
|
-
/** Type of the document. */
|
|
80
|
-
declare enum WDODocumentType {
|
|
81
|
-
/** National ID card */
|
|
82
|
-
idCard = "idCard",
|
|
83
|
-
/** Passport */
|
|
84
|
-
passport = "passport",
|
|
85
|
-
/** Drivers license */
|
|
86
|
-
driversLicense = "driversLicense"
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Available sides of the document
|
|
90
|
-
*
|
|
91
|
-
* Front and back for ID card.
|
|
92
|
-
* For passport and drivers license front only.
|
|
93
|
-
*/
|
|
94
|
-
declare function WDODocumentTypeSides(type: WDODocumentType): WDODocumentSide[];
|
|
95
|
-
/** Side of the document */
|
|
96
|
-
declare enum WDODocumentSide {
|
|
97
|
-
/** Front side of a document. Usually the one with the picture.
|
|
98
|
-
*
|
|
99
|
-
* When a document has more than one side but only one side is used (for example passport), then such side is considered to be front.
|
|
100
|
-
*/
|
|
101
|
-
front = "front",
|
|
102
|
-
/** Back side of a document */
|
|
103
|
-
back = "back"
|
|
15
|
+
activationCode?: string;
|
|
104
16
|
}
|
|
105
|
-
|
|
106
17
|
/** Status of the onboarding */
|
|
107
18
|
declare enum WDOOnboardingStatus {
|
|
108
19
|
/** Activation part of the process is in progress */
|
|
@@ -114,6 +25,133 @@ declare enum WDOOnboardingStatus {
|
|
|
114
25
|
/** Onboarding process is completed */
|
|
115
26
|
finished = "FINISHED"
|
|
116
27
|
}
|
|
28
|
+
interface WDOIdentityStatusResponse {
|
|
29
|
+
processId: string;
|
|
30
|
+
identityVerificationStatus: WDOIdentityVerificationStatus;
|
|
31
|
+
identityVerificationPhase?: WDOIdentityVerificationPhase;
|
|
32
|
+
config: WDOIdentityConfig;
|
|
33
|
+
consentRequired: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Configuration for identity verification */
|
|
36
|
+
interface WDOIdentityConfig {
|
|
37
|
+
/** Period after which the OTP can be resent, in seconds */
|
|
38
|
+
otpResendPeriodSeconds: number;
|
|
39
|
+
}
|
|
40
|
+
/** Status of the current identity verification */
|
|
41
|
+
declare enum WDOIdentityVerificationStatus {
|
|
42
|
+
/** Identity verification is waiting for initialization */
|
|
43
|
+
notInitialized = "NOT_INITIALIZED",
|
|
44
|
+
/** All submitted documents are waiting for verification */
|
|
45
|
+
verificationPending = "VERIFICATION_PENDING",
|
|
46
|
+
/** Identity verification is in progress */
|
|
47
|
+
inProgress = "IN_PROGRESS",
|
|
48
|
+
/** Identity verification was successfully completed */
|
|
49
|
+
accepted = "ACCEPTED",
|
|
50
|
+
/** Identity verification has failed, an error occurred */
|
|
51
|
+
failed = "FAILED",
|
|
52
|
+
/** Identity verification was rejected */
|
|
53
|
+
rejected = "REJECTED"
|
|
54
|
+
}
|
|
55
|
+
/** Phase of the current identity verification */
|
|
56
|
+
declare enum WDOIdentityVerificationPhase {
|
|
57
|
+
/** Document upload is in progress */
|
|
58
|
+
documentUpload = "DOCUMENT_UPLOAD",
|
|
59
|
+
/** Presence check is in progress */
|
|
60
|
+
presenceCheck = "PRESENCE_CHECK",
|
|
61
|
+
/** Backend is verifying documents */
|
|
62
|
+
clientEvaluation = "CLIENT_EVALUATION",
|
|
63
|
+
/** Document verification is in progress */
|
|
64
|
+
documentVerification = "DOCUMENT_VERIFICATION",
|
|
65
|
+
/** Cross check on documents is in progress */
|
|
66
|
+
documentVerificationFinal = "DOCUMENT_VERIFICATION_FINAL",
|
|
67
|
+
/** OTP verification needed */
|
|
68
|
+
otp = "OTP_VERIFICATION",
|
|
69
|
+
/** Completed */
|
|
70
|
+
completed = "COMPLETED"
|
|
71
|
+
}
|
|
72
|
+
/** Types of available documents */
|
|
73
|
+
declare enum WDODocumentSubmitFileType {
|
|
74
|
+
/** National ID card */
|
|
75
|
+
idCard = "ID_CARD",
|
|
76
|
+
/** Passport */
|
|
77
|
+
passport = "PASSPORT",
|
|
78
|
+
/** Driving license */
|
|
79
|
+
driversLicense = "DRIVING_LICENSE",
|
|
80
|
+
/** Selfie photo */
|
|
81
|
+
selfiePhoto = "SELFIE_PHOTO"
|
|
82
|
+
}
|
|
83
|
+
/** Side of the file */
|
|
84
|
+
declare enum WDODocumentSubmitFileSide {
|
|
85
|
+
/** Front side of an document. Usually the one with the picture */
|
|
86
|
+
front = "FRONT",
|
|
87
|
+
/** Back side of an document */
|
|
88
|
+
back = "BACK"
|
|
89
|
+
}
|
|
90
|
+
/** Submitted document metadata */
|
|
91
|
+
interface WDODocument {
|
|
92
|
+
/** Name of the file (with path within the submit ZIP file). */
|
|
93
|
+
filename: string;
|
|
94
|
+
/** Unique ID of the file */
|
|
95
|
+
id: string;
|
|
96
|
+
/** Type of the file */
|
|
97
|
+
type: WDODocumentSubmitFileType;
|
|
98
|
+
/** Side of the file */
|
|
99
|
+
side: WDODocumentSubmitFileSide;
|
|
100
|
+
/** Status of the processing */
|
|
101
|
+
status: WDODocumentStatus;
|
|
102
|
+
/** Possible errors */
|
|
103
|
+
errors?: string[];
|
|
104
|
+
}
|
|
105
|
+
/** Status of the document */
|
|
106
|
+
declare enum WDODocumentStatus {
|
|
107
|
+
/** Document was accepted */
|
|
108
|
+
accepted = "ACCEPTED",
|
|
109
|
+
/** Document is being uploaded to the verification system by the backend */
|
|
110
|
+
uploadInProgress = "UPLOAD_IN_PROGRESS",
|
|
111
|
+
/** Document are being processed */
|
|
112
|
+
inProgress = "IN_PROGRESS",
|
|
113
|
+
/** Document is pending verification */
|
|
114
|
+
verificationPending = "VERIFICATION_PENDING",
|
|
115
|
+
/** Document is being verified */
|
|
116
|
+
verificationInProgress = "VERIFICATION_IN_PROGRESS",
|
|
117
|
+
/** Document was rejected */
|
|
118
|
+
rejected = "REJECTED",
|
|
119
|
+
/** Verification of the document failed */
|
|
120
|
+
failed = "FAILED"
|
|
121
|
+
}
|
|
122
|
+
/** Metadata for file inside ZIP (in `DocumentSubmitRequest.data`). */
|
|
123
|
+
interface WDODocumentSubmitFile {
|
|
124
|
+
/** Name of the file (with path) */
|
|
125
|
+
filename: string;
|
|
126
|
+
/** Type of the document */
|
|
127
|
+
type: WDODocumentSubmitFileType;
|
|
128
|
+
/** Side of the document (for example front side of the ID card) */
|
|
129
|
+
side: WDODocumentSubmitFileSide;
|
|
130
|
+
/** Original document ID in case of re-upload */
|
|
131
|
+
originalDocumentId?: string;
|
|
132
|
+
/** Base64 encoded data image. */
|
|
133
|
+
data: Base64URLString;
|
|
134
|
+
}
|
|
135
|
+
/** Status of the documents */
|
|
136
|
+
interface WDODocumentStatusResponse {
|
|
137
|
+
/** Overall status */
|
|
138
|
+
status: WDODocumentStatus;
|
|
139
|
+
/** Status for each document. */
|
|
140
|
+
documents: WDODocument[];
|
|
141
|
+
}
|
|
142
|
+
/** Response of the OTP verify */
|
|
143
|
+
interface WDOVerifyOTPResponse {
|
|
144
|
+
/** ID of the process */
|
|
145
|
+
processId: string;
|
|
146
|
+
/** Current onboarding status */
|
|
147
|
+
onboardingStatus: WDOOnboardingStatus;
|
|
148
|
+
/** Was OTP verified? */
|
|
149
|
+
verified: boolean;
|
|
150
|
+
/** Is OTP expired */
|
|
151
|
+
expired: boolean;
|
|
152
|
+
/** How many attempts are remaining */
|
|
153
|
+
remainingAttempts: number;
|
|
154
|
+
}
|
|
117
155
|
/** Configuration for a document */
|
|
118
156
|
interface WDOConfigurationDocument {
|
|
119
157
|
/** Type of the document */
|
|
@@ -162,7 +200,7 @@ declare abstract class WDOBaseActivationService {
|
|
|
162
200
|
* Note that even if this property is `true` it can be already discontinued on the server.
|
|
163
201
|
* Calling `status()` for example after the app is launched in this case is recommended.
|
|
164
202
|
*/
|
|
165
|
-
|
|
203
|
+
hasActiveProcess(): Promise<boolean>;
|
|
166
204
|
/**
|
|
167
205
|
* Accept language for the outgoing requests headers.
|
|
168
206
|
* Default value is "en".
|
|
@@ -199,7 +237,7 @@ declare abstract class WDOBaseActivationService {
|
|
|
199
237
|
*/
|
|
200
238
|
cancel(forceCancel?: boolean): Promise<void>;
|
|
201
239
|
/** Clear the stored data (without networking call). */
|
|
202
|
-
clear(): void
|
|
240
|
+
clear(): Promise<void>;
|
|
203
241
|
/**
|
|
204
242
|
* OTP resend request.
|
|
205
243
|
*
|
|
@@ -210,7 +248,7 @@ declare abstract class WDOBaseActivationService {
|
|
|
210
248
|
/**
|
|
211
249
|
* Activate the PowerAuth instance that was passed in the initializer.
|
|
212
250
|
*
|
|
213
|
-
* @param activationName Name of the activation.
|
|
251
|
+
* @param activationName Name of the activation. Usually something like John's iPhone or similar.
|
|
214
252
|
* @param otp OTP code received by the user (via SMS or email). Optional when not required.
|
|
215
253
|
* @return Promise resolved with activation result.
|
|
216
254
|
*/
|
|
@@ -237,6 +275,115 @@ declare class WDOActivationService extends WDOBaseActivationService {
|
|
|
237
275
|
constructor(powerauth: PowerAuth, baseUrl: string);
|
|
238
276
|
}
|
|
239
277
|
|
|
278
|
+
/** String that contains a Base64 encoded JPEG image */
|
|
279
|
+
type Base64EncodedJPEG = string;
|
|
280
|
+
/** Image of a document that can be sent to the backend for Identity Verification. */
|
|
281
|
+
declare class WDODocumentFile {
|
|
282
|
+
/** Raw data to upload. Make sure that the data aren't too big, hundreds of kbs should be enough. */
|
|
283
|
+
data: Base64EncodedJPEG;
|
|
284
|
+
/**
|
|
285
|
+
* Image signature.
|
|
286
|
+
*
|
|
287
|
+
* Optional, use only when the scan SDK supports this.
|
|
288
|
+
*/
|
|
289
|
+
dataSignature: string | undefined;
|
|
290
|
+
/** Type of the document. */
|
|
291
|
+
type: WDODocumentType;
|
|
292
|
+
/** Side of the document (`front` if the document is one-sided or only one side is expected). */
|
|
293
|
+
side: WDODocumentSide;
|
|
294
|
+
/**
|
|
295
|
+
* For image reuploading when the previous file of the same document was rejected.
|
|
296
|
+
*
|
|
297
|
+
* Without specifying this value, the document side won't be overwritten.
|
|
298
|
+
*/
|
|
299
|
+
originalDocumentId: string | undefined;
|
|
300
|
+
/**
|
|
301
|
+
* Create the document file from an image that can be sent to the backend for Identity Verification.
|
|
302
|
+
*
|
|
303
|
+
* @param scannedDocument Document to upload.
|
|
304
|
+
* @param side The side of the document that the image captures.
|
|
305
|
+
* @param data Raw image data. Make sure that the data aren't too big, hundreds of kbs should be enough.
|
|
306
|
+
* @param dataSignature Signature of the image data. Optional, use only when the scan SDK supports this. `undefined` by default.
|
|
307
|
+
* @returns Document file to upload.
|
|
308
|
+
*/
|
|
309
|
+
static fromScannedDocument(scannedDocument: WDOScannedDocument, side: WDODocumentSide, data: Base64EncodedJPEG, dataSignature?: string): WDODocumentFile;
|
|
310
|
+
/**
|
|
311
|
+
* Image of a document that can be sent to the backend for Identity Verification.
|
|
312
|
+
*
|
|
313
|
+
* @param data Raw image data. Make sure that the data aren't too big, hundreds of kbs should be enough.
|
|
314
|
+
* @param type Type of the document.
|
|
315
|
+
* @param side The side of the document that the image captures.
|
|
316
|
+
* @param originalDocumentId Original document ID In case of a reupload. If you've previously uploaded this type and side and won't specify the previous ID, the image won't be overwritten.
|
|
317
|
+
* @param dataSignature Signature of the image data. Optional, use only when the scan SDK supports this. `undefined` by default.
|
|
318
|
+
*/
|
|
319
|
+
constructor(data: Base64EncodedJPEG, type: WDODocumentType, side: WDODocumentSide, originalDocumentId?: string, dataSignature?: string);
|
|
320
|
+
}
|
|
321
|
+
/** Type of the document. */
|
|
322
|
+
declare enum WDODocumentType {
|
|
323
|
+
/** National ID card */
|
|
324
|
+
idCard = "idCard",
|
|
325
|
+
/** Passport */
|
|
326
|
+
passport = "passport",
|
|
327
|
+
/** Drivers license */
|
|
328
|
+
driversLicense = "driversLicense"
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Available sides of the document
|
|
332
|
+
*
|
|
333
|
+
* Front and back for ID card.
|
|
334
|
+
* For passport and drivers license front only.
|
|
335
|
+
*/
|
|
336
|
+
declare function WDODocumentTypeSides(type: WDODocumentType): WDODocumentSide[];
|
|
337
|
+
/** Side of the document */
|
|
338
|
+
declare enum WDODocumentSide {
|
|
339
|
+
/** Front side of a document. Usually the one with the picture.
|
|
340
|
+
*
|
|
341
|
+
* When a document has more than one side but only one side is used (for example passport), then such side is considered to be front.
|
|
342
|
+
*/
|
|
343
|
+
front = "front",
|
|
344
|
+
/** Back side of a document */
|
|
345
|
+
back = "back"
|
|
346
|
+
}
|
|
347
|
+
/** Converts WDODocumentType to WDODocumentSubmitFileType */
|
|
348
|
+
declare function WDODocumentTypeToSubmitType(type: WDODocumentType): WDODocumentSubmitFileType;
|
|
349
|
+
/** Converts WDODocumentSide to DocumentSubmitFileSide */
|
|
350
|
+
declare function WDOCreateDocumentSubmitFileSide(side: WDODocumentSide): WDODocumentSubmitFileSide;
|
|
351
|
+
|
|
352
|
+
/** Describes the state of documents that need to be uploaded to the server. */
|
|
353
|
+
declare class WDOVerificationScanProcess {
|
|
354
|
+
/** All documents that need to be scanned. */
|
|
355
|
+
documents: WDOScannedDocument[];
|
|
356
|
+
/** Which document should be scanned next. `undefined` when all documents are uploaded and accepted. */
|
|
357
|
+
get nextDocumentToScan(): WDOScannedDocument | undefined;
|
|
358
|
+
}
|
|
359
|
+
/** Document that needs to be scanned during process. */
|
|
360
|
+
declare class WDOScannedDocument {
|
|
361
|
+
/** Type of the document. */
|
|
362
|
+
type: WDODocumentType;
|
|
363
|
+
/** Upload state. */
|
|
364
|
+
get uploadState(): UploadState;
|
|
365
|
+
/** Sides of the document that were uploaded on the server. */
|
|
366
|
+
get sides(): Side[];
|
|
367
|
+
}
|
|
368
|
+
/** State of the document on the server. */
|
|
369
|
+
declare enum UploadState {
|
|
370
|
+
/** The document was not uploaded yet. */
|
|
371
|
+
notUploaded = 0,
|
|
372
|
+
/** The document was accepted by the server. */
|
|
373
|
+
accepted = 1,
|
|
374
|
+
/** The document was rejected and needs to be re-uploaded. */
|
|
375
|
+
rejected = 2
|
|
376
|
+
}
|
|
377
|
+
/** Side of the uploaded document. */
|
|
378
|
+
declare class Side {
|
|
379
|
+
/** Type of the side. */
|
|
380
|
+
type: WDODocumentSide;
|
|
381
|
+
/** ID on the server. Use this ID in case of an reupload */
|
|
382
|
+
serverId: string;
|
|
383
|
+
/** Upload state of the document */
|
|
384
|
+
uploadState: UploadState;
|
|
385
|
+
}
|
|
386
|
+
|
|
240
387
|
/**
|
|
241
388
|
* State which should be presented to the user.
|
|
242
389
|
* Each state represents a separate screen UI that should be presented to the user.
|
|
@@ -254,26 +401,16 @@ declare class WDOActivationService extends WDOBaseActivationService {
|
|
|
254
401
|
* }
|
|
255
402
|
* ```
|
|
256
403
|
*/
|
|
257
|
-
type WDOVerificationState =
|
|
404
|
+
type WDOVerificationState = WDOIntroState | WDODocumentsToScanSelectState | WDOScanDocumentState | WDOProcessingState | WDOPresenceCheckState | WDOOtpState | WDOFailedState | WDOEndStateState | WDOSuccessState;
|
|
258
405
|
/**
|
|
259
406
|
* Show the verification introduction screen where the user can start the activation.
|
|
260
407
|
*
|
|
261
|
-
* The next step should be calling the `
|
|
408
|
+
* The next step should be calling the `start`.
|
|
262
409
|
*/
|
|
263
|
-
interface
|
|
410
|
+
interface WDOIntroState {
|
|
264
411
|
type: WDOVerificationStateType.intro;
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
* Show approve/cancel user consent.
|
|
268
|
-
*
|
|
269
|
-
* The content of the text depends on the server configuration and might be plain text or HTML.
|
|
270
|
-
*
|
|
271
|
-
* The next step should be calling the `consentApprove`.
|
|
272
|
-
*/
|
|
273
|
-
interface Consent {
|
|
274
|
-
type: WDOVerificationStateType.consent;
|
|
275
|
-
/** Content of the consent text, which may be plain text or HTML depending on server configuration */
|
|
276
|
-
body: string;
|
|
412
|
+
/** Indicates whether the user consent is required to proceed */
|
|
413
|
+
consentRequired: boolean;
|
|
277
414
|
}
|
|
278
415
|
/**
|
|
279
416
|
* Show document selection to the user. Which documents are available and how many
|
|
@@ -281,7 +418,7 @@ interface Consent {
|
|
|
281
418
|
*
|
|
282
419
|
* The next step should be calling the `documentsSetSelectedTypes`.
|
|
283
420
|
*/
|
|
284
|
-
interface
|
|
421
|
+
interface WDODocumentsToScanSelectState {
|
|
285
422
|
type: WDOVerificationStateType.documentsToScanSelect;
|
|
286
423
|
}
|
|
287
424
|
/**
|
|
@@ -289,7 +426,7 @@ interface DocumentsToScanSelect {
|
|
|
289
426
|
*
|
|
290
427
|
* The next step should be calling the `documentsSubmit`.
|
|
291
428
|
*/
|
|
292
|
-
interface
|
|
429
|
+
interface WDOScanDocumentState {
|
|
293
430
|
type: WDOVerificationStateType.scanDocument;
|
|
294
431
|
/** Scanning process that helps with the document scanning */
|
|
295
432
|
process: WDOVerificationScanProcess;
|
|
@@ -299,7 +436,7 @@ interface ScanDocument {
|
|
|
299
436
|
*
|
|
300
437
|
* The next step should be calling the `status`.
|
|
301
438
|
*/
|
|
302
|
-
interface
|
|
439
|
+
interface WDOProcessingState {
|
|
303
440
|
type: WDOVerificationStateType.processing;
|
|
304
441
|
/** Reason for the current processing state */
|
|
305
442
|
item: WDOStatusCheckReason;
|
|
@@ -311,7 +448,7 @@ interface Processing {
|
|
|
311
448
|
* The next step should be calling the `presenceCheckInit` to start the check and `presenceCheckSubmit` to
|
|
312
449
|
* mark it finished. Note that these methods won't change the status and it's up to the app to handle the process of the presence check.
|
|
313
450
|
*/
|
|
314
|
-
interface
|
|
451
|
+
interface WDOPresenceCheckState {
|
|
315
452
|
type: WDOVerificationStateType.presenceCheck;
|
|
316
453
|
}
|
|
317
454
|
/**
|
|
@@ -320,7 +457,7 @@ interface PresenceCheck {
|
|
|
320
457
|
* The next step should be calling the `verifyOTP` with user-entered OTP.
|
|
321
458
|
* The OTP is usually SMS or email.
|
|
322
459
|
*/
|
|
323
|
-
interface
|
|
460
|
+
interface WDOOtpState {
|
|
324
461
|
type: WDOVerificationStateType.otp;
|
|
325
462
|
/** Number of remaining attempts to enter the correct OTP */
|
|
326
463
|
remainingAttempts?: number;
|
|
@@ -331,7 +468,7 @@ interface Otp {
|
|
|
331
468
|
* The next step should be calling the `restartVerification` or `cancelWholeProcess` based on
|
|
332
469
|
* the user's decision if he wants to try it again or cancel the process.
|
|
333
470
|
*/
|
|
334
|
-
interface
|
|
471
|
+
interface WDOFailedState {
|
|
335
472
|
type: WDOVerificationStateType.failed;
|
|
336
473
|
}
|
|
337
474
|
/**
|
|
@@ -339,7 +476,7 @@ interface Failed {
|
|
|
339
476
|
*
|
|
340
477
|
* The next step should be calling the `PowerAuth.removeActivationLocal()` and starting activation from scratch.
|
|
341
478
|
*/
|
|
342
|
-
interface
|
|
479
|
+
interface WDOEndStateState {
|
|
343
480
|
type: WDOVerificationStateType.endState;
|
|
344
481
|
/** Reason for the end state */
|
|
345
482
|
reason: WDOEndStateReason;
|
|
@@ -347,7 +484,7 @@ interface EndState {
|
|
|
347
484
|
/**
|
|
348
485
|
* Verification was successfully ended. Continue into your app flow.
|
|
349
486
|
*/
|
|
350
|
-
interface
|
|
487
|
+
interface WDOSuccessState {
|
|
351
488
|
type: WDOVerificationStateType.success;
|
|
352
489
|
}
|
|
353
490
|
/** Types of the verification state */
|
|
@@ -355,17 +492,9 @@ declare enum WDOVerificationStateType {
|
|
|
355
492
|
/**
|
|
356
493
|
* Show the verification introduction screen where the user can start the activation.
|
|
357
494
|
*
|
|
358
|
-
* The next step should be calling the `
|
|
495
|
+
* The next step should be calling the `start()`.
|
|
359
496
|
*/
|
|
360
497
|
intro = "intro",
|
|
361
|
-
/**
|
|
362
|
-
* Show approve/cancel user consent.
|
|
363
|
-
*
|
|
364
|
-
* The content of the text depends on the server configuration and might be plain text or HTML.
|
|
365
|
-
*
|
|
366
|
-
* The next step should be calling the `consentApprove`.
|
|
367
|
-
*/
|
|
368
|
-
consent = "consent",
|
|
369
498
|
/**
|
|
370
499
|
* Show document selection to the user. Which documents are available and how many
|
|
371
500
|
* can the user select is up to your backend configuration.
|
|
@@ -529,6 +658,15 @@ interface WDOVerificationServiceListener {
|
|
|
529
658
|
/** Called when state of the verification has changed. */
|
|
530
659
|
verificationStatusChanged(sender: WDOBaseVerificationService, status: WDOVerificationState): void;
|
|
531
660
|
}
|
|
661
|
+
/** Possible results of the user consent. */
|
|
662
|
+
declare enum WDOConsentResponse {
|
|
663
|
+
/** User approved the consent. */
|
|
664
|
+
approved = 0,
|
|
665
|
+
/** User declined the consent. */
|
|
666
|
+
declined = 1,
|
|
667
|
+
/** Consent is not required. */
|
|
668
|
+
notRequired = 2
|
|
669
|
+
}
|
|
532
670
|
/**
|
|
533
671
|
* Service that can verify previously activated PowerAuth instance.
|
|
534
672
|
*
|
|
@@ -562,11 +700,13 @@ declare abstract class WDOBaseVerificationService {
|
|
|
562
700
|
*
|
|
563
701
|
* Consent text explains how the service will handle his document photos or selfie scans.
|
|
564
702
|
*/
|
|
565
|
-
consentGet(): Promise<
|
|
703
|
+
consentGet(): Promise<string>;
|
|
566
704
|
/**
|
|
567
|
-
*
|
|
705
|
+
* Start the identity verification after user approved the consent (if required)
|
|
706
|
+
*
|
|
707
|
+
* @param consentApprovedByUser Response of the user to the consent. The hint can be obtained in the `status()` call (`consentRequired` property when the result is `intro`).
|
|
568
708
|
*/
|
|
569
|
-
|
|
709
|
+
start(consentApprovedByUser: WDOConsentResponse): Promise<WDOVerificationState>;
|
|
570
710
|
/**
|
|
571
711
|
* Get the token for the document scanning SDK, when required.
|
|
572
712
|
*
|
|
@@ -574,7 +714,10 @@ declare abstract class WDOBaseVerificationService {
|
|
|
574
714
|
*
|
|
575
715
|
* @param challenge Optional challenge provided by the scanning SDK.
|
|
576
716
|
*/
|
|
577
|
-
documentsInitSDK(challenge?: string): Promise<
|
|
717
|
+
documentsInitSDK(challenge?: string): Promise<{
|
|
718
|
+
blinkIDKey?: string;
|
|
719
|
+
zenIDToken?: string;
|
|
720
|
+
}>;
|
|
578
721
|
/**
|
|
579
722
|
* Set which documents will be scanned.
|
|
580
723
|
*
|
|
@@ -595,7 +738,9 @@ declare abstract class WDOBaseVerificationService {
|
|
|
595
738
|
/**
|
|
596
739
|
* Initiates the presence check. This returns attributes that are needed to start the 3rd party SDK (if needed).
|
|
597
740
|
*/
|
|
598
|
-
presenceCheckInit(): Promise<
|
|
741
|
+
presenceCheckInit(): Promise<{
|
|
742
|
+
iProovVerificationToken?: string;
|
|
743
|
+
}>;
|
|
599
744
|
/**
|
|
600
745
|
* Call when presence check was finished in the 3rd party SDK.
|
|
601
746
|
*/
|
|
@@ -687,5 +832,46 @@ declare class WDOLogger {
|
|
|
687
832
|
interface WDOLoggerListener {
|
|
688
833
|
log(level: WDOLogLevel, message: string): void;
|
|
689
834
|
}
|
|
690
|
-
|
|
691
|
-
|
|
835
|
+
|
|
836
|
+
/** Represent error thrown from a WDO library */
|
|
837
|
+
declare class WDOError {
|
|
838
|
+
/** Reason for the error */
|
|
839
|
+
readonly reason: WDOErrorReason;
|
|
840
|
+
/** Error message */
|
|
841
|
+
readonly message: string;
|
|
842
|
+
/** Additional info about the error (eg. original error object) */
|
|
843
|
+
readonly additionalInfo?: any;
|
|
844
|
+
/** Helper to identify this object as a WDOError */
|
|
845
|
+
readonly isWdoError = true;
|
|
846
|
+
/**
|
|
847
|
+
* Whether retrying OTP is allowed based on remaining attempts.
|
|
848
|
+
*
|
|
849
|
+
* This may be filled only when the error reason is `WDOErrorReason.activationFailed`.
|
|
850
|
+
*/
|
|
851
|
+
get allowOnboardingOtpRetry(): boolean;
|
|
852
|
+
/**
|
|
853
|
+
* Number of remaining OTP attempts during onboarding
|
|
854
|
+
*
|
|
855
|
+
* This may be filled only when the error reason is `WDOErrorReason.activationFailed`.
|
|
856
|
+
*/
|
|
857
|
+
get onboardingOtpRemainingAttempts(): number | undefined;
|
|
858
|
+
}
|
|
859
|
+
/** Reasons for WDO errors */
|
|
860
|
+
declare enum WDOErrorReason {
|
|
861
|
+
/** Network error occurred */
|
|
862
|
+
networkError = "NETWORK_ERROR",
|
|
863
|
+
/** Activation failed */
|
|
864
|
+
activationFailed = "ACTIVATION_FAILED",
|
|
865
|
+
/** Process is already in progress - happens when start() is called twice */
|
|
866
|
+
processAlreadyInProgress = "PROCESS_ALREADY_IN_PROGRESS",
|
|
867
|
+
/** No process is in progress - happens when an operation requires an active process */
|
|
868
|
+
processNotInProgress = "PROCESS_NOT_IN_PROGRESS",
|
|
869
|
+
/** The PowerAuth instance is already activated when trying to activate it again */
|
|
870
|
+
powerauthAlreadyActivated = "POWERAUTH_ALREADY_ACTIVATED",
|
|
871
|
+
/** The PowerAuth instance is not activated when trying to use it */
|
|
872
|
+
powerauthNotActivated = "POWERAUTH_NOT_ACTIVATED",
|
|
873
|
+
/** OTP verification failed */
|
|
874
|
+
otpFailed = "OTP_FAILED"
|
|
875
|
+
}
|
|
876
|
+
export { Side, UploadState, WDOActivationService, WDOConfigurationService, WDOConsentResponse, WDOCreateDocumentSubmitFileSide, WDODocumentFile, WDODocumentSide, WDODocumentStatus, WDODocumentSubmitFileSide, WDODocumentSubmitFileType, WDODocumentType, WDODocumentTypeSides, WDODocumentTypeToSubmitType, WDOEndStateReason, WDOError, WDOErrorReason, WDOIdentityVerificationPhase, WDOIdentityVerificationStatus, WDOLogLevel, WDOLogger, WDOOnboardingStatus, WDOScannedDocument, WDOStatusCheckReason, WDOVerificationScanProcess, WDOVerificationService, WDOVerificationStateType };
|
|
877
|
+
export type { Base64EncodedJPEG, WDOConfigurationDocument, WDOConfigurationResponse, WDODocument, WDODocumentStatusResponse, WDODocumentSubmitFile, WDODocumentsToScanSelectState, WDOEndStateState, WDOFailedState, WDOIdentityConfig, WDOIdentityStatusResponse, WDOIntroState, WDOLoggerListener, WDOOtpState, WDOPresenceCheckState, WDOProcessRequest, WDOProcessResponse, WDOProcessingState, WDOScanDocumentState, WDOSuccessState, WDOVerificationServiceListener, WDOVerificationState, WDOVerifyOTPResponse };
|