@ekyc_qoobiss/qbs-ect-cmp 3.6.64 → 3.6.65
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/dist/cjs/{TranslationUtils-fbb2c39c.js → TranslationUtils-eeb71e60.js} +15 -10
- package/dist/cjs/agreement-check_17.cjs.entry.js +112 -69
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/components/common/how-to-info/how-to-info.js +3 -17
- package/dist/collection/components/flow/process-id/process-id.js +50 -42
- package/dist/collection/components/flow/user-liveness/user-liveness.js +47 -38
- package/dist/collection/components/identification-component/identification-component.js +25 -0
- package/dist/collection/models/FlowStatus.js +15 -11
- package/dist/esm/{TranslationUtils-32c06882.js → TranslationUtils-21a568f6.js} +15 -10
- package/dist/esm/agreement-check_17.entry.js +112 -69
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qbs-ect-cmp.js +1 -1
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/p-2735b5f4.js +1 -0
- package/dist/qbs-ect-cmp/{p-98a9c331.entry.js → p-3695074a.entry.js} +2 -2
- package/dist/qbs-ect-cmp/{p-fc771dd3.entry.js → p-4fef4884.entry.js} +1 -1
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +1 -2
- package/dist/types/components/flow/process-id/process-id.d.ts +3 -1
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +3 -2
- package/dist/types/components.d.ts +0 -1
- package/dist/types/models/CaptureFlow.d.ts +0 -1
- package/dist/types/models/FlowStatus.d.ts +15 -10
- package/package.json +1 -1
- package/dist/qbs-ect-cmp/p-601c9197.js +0 -1
|
@@ -3,7 +3,7 @@ import store from '../../../helpers/store';
|
|
|
3
3
|
import { Stream } from '../../../helpers/Stream';
|
|
4
4
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
5
5
|
import { FlowSteps } from '../../../models/FlowSteps';
|
|
6
|
-
import { getLogMessage } from '../../../utils/utils';
|
|
6
|
+
import { delay, getLogMessage } from '../../../utils/utils';
|
|
7
7
|
import { BaseComponent } from '../../base-component';
|
|
8
8
|
import { CaptureUploadTypes } from '../../../models/CaptureFlow';
|
|
9
9
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
@@ -15,38 +15,28 @@ export class UserLiveness {
|
|
|
15
15
|
this.showError = undefined;
|
|
16
16
|
this.showTimeout = undefined;
|
|
17
17
|
this.flow = undefined;
|
|
18
|
-
this.howToDone = false;
|
|
19
18
|
}
|
|
20
19
|
async componentDidLoad() { }
|
|
21
20
|
componentWillLoad() {
|
|
22
21
|
if (this.mode == 'selfie') {
|
|
23
22
|
this.currentStep = FlowSteps.Selfie;
|
|
24
23
|
this.flow = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
recType: CaptureUploadTypes.SelfieVideo,
|
|
30
|
-
},
|
|
31
|
-
howToDone: false,
|
|
24
|
+
fileName: 'selfie.png',
|
|
25
|
+
recName: 'selfieVideo.',
|
|
26
|
+
photoType: CaptureUploadTypes.Selfie,
|
|
27
|
+
recType: CaptureUploadTypes.SelfieVideo,
|
|
32
28
|
};
|
|
33
29
|
}
|
|
34
30
|
else if (this.mode == 'selfieGesture') {
|
|
35
31
|
this.currentStep = FlowSteps.SelfieTilt;
|
|
36
32
|
this.flow = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
42
|
-
},
|
|
43
|
-
howToDone: false,
|
|
33
|
+
fileName: '',
|
|
34
|
+
recName: 'selfieTiltVideo.',
|
|
35
|
+
photoType: CaptureUploadTypes.None,
|
|
36
|
+
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
44
37
|
};
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
|
-
howToDoneEvent() {
|
|
48
|
-
this.howToDone = true;
|
|
49
|
-
}
|
|
50
40
|
timeElapsed() {
|
|
51
41
|
this.errorReason = 'Timeout';
|
|
52
42
|
this.showTimeout = true;
|
|
@@ -69,8 +59,8 @@ export class UserLiveness {
|
|
|
69
59
|
return;
|
|
70
60
|
}
|
|
71
61
|
try {
|
|
72
|
-
var uploadPhoto = new File([selfiePhoto], this.flow.
|
|
73
|
-
let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.
|
|
62
|
+
var uploadPhoto = new File([selfiePhoto], this.flow.fileName, { type: 'image/png' });
|
|
63
|
+
let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.photoType, uploadPhoto);
|
|
74
64
|
if (photoUploaded.isValid) {
|
|
75
65
|
store.flowStatus = FlowStatus[photoUploaded.state];
|
|
76
66
|
}
|
|
@@ -96,8 +86,8 @@ export class UserLiveness {
|
|
|
96
86
|
}
|
|
97
87
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
98
88
|
try {
|
|
99
|
-
let uploadRec = new File([selfieRecording], this.flow.
|
|
100
|
-
let uplodDone = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.
|
|
89
|
+
let uploadRec = new File([selfieRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
90
|
+
let uplodDone = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.recType, uploadRec);
|
|
101
91
|
if (uplodDone.saved) {
|
|
102
92
|
store.flowStatus = FlowStatus[uplodDone.state];
|
|
103
93
|
}
|
|
@@ -115,6 +105,32 @@ export class UserLiveness {
|
|
|
115
105
|
}
|
|
116
106
|
}
|
|
117
107
|
}
|
|
108
|
+
async verificationFinished() {
|
|
109
|
+
if (store.debug)
|
|
110
|
+
console.log('user-liveness | verificationFinished');
|
|
111
|
+
this.verificationReceived = Date.now();
|
|
112
|
+
let initialStatus = store.flowStatus;
|
|
113
|
+
let statusChanged = false;
|
|
114
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
115
|
+
await delay(2000);
|
|
116
|
+
statusChanged = initialStatus != store.flowStatus;
|
|
117
|
+
}
|
|
118
|
+
if (!statusChanged) {
|
|
119
|
+
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
120
|
+
if (currentStatus != store.flowStatus) {
|
|
121
|
+
store.flowStatus = currentStatus;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
this.triggerUploadFailedFlow();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (store.debug)
|
|
128
|
+
console.log('user-liveness | verificationFinished | waitingFinished ');
|
|
129
|
+
}
|
|
130
|
+
triggerUploadFailedFlow() {
|
|
131
|
+
this.errorReason = 'Upload Failed';
|
|
132
|
+
this.showError = true;
|
|
133
|
+
}
|
|
118
134
|
async disconnectedCallback() {
|
|
119
135
|
await BaseComponent.finalize(this.currentStep);
|
|
120
136
|
}
|
|
@@ -123,18 +139,12 @@ export class UserLiveness {
|
|
|
123
139
|
this.showError = true;
|
|
124
140
|
}
|
|
125
141
|
render() {
|
|
126
|
-
let howTo = h("how-to-info", null);
|
|
127
142
|
let capture = h("selfie-capture", null);
|
|
128
143
|
let error = h("capture-error", { type: "LIVENESS", reason: this.errorReason });
|
|
129
144
|
if (this.showError || this.showTimeout) {
|
|
130
145
|
return error;
|
|
131
146
|
}
|
|
132
|
-
|
|
133
|
-
return capture;
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
return howTo;
|
|
137
|
-
}
|
|
147
|
+
return capture;
|
|
138
148
|
}
|
|
139
149
|
static get is() { return "user-liveness"; }
|
|
140
150
|
static get originalStyleUrls() {
|
|
@@ -172,8 +182,7 @@ export class UserLiveness {
|
|
|
172
182
|
return {
|
|
173
183
|
"showError": {},
|
|
174
184
|
"showTimeout": {},
|
|
175
|
-
"flow": {}
|
|
176
|
-
"howToDone": {}
|
|
185
|
+
"flow": {}
|
|
177
186
|
};
|
|
178
187
|
}
|
|
179
188
|
static get events() {
|
|
@@ -196,12 +205,6 @@ export class UserLiveness {
|
|
|
196
205
|
}
|
|
197
206
|
static get listeners() {
|
|
198
207
|
return [{
|
|
199
|
-
"name": "howToInfoDone",
|
|
200
|
-
"method": "howToDoneEvent",
|
|
201
|
-
"target": undefined,
|
|
202
|
-
"capture": false,
|
|
203
|
-
"passive": false
|
|
204
|
-
}, {
|
|
205
208
|
"name": "timeElapsed",
|
|
206
209
|
"method": "timeElapsed",
|
|
207
210
|
"target": undefined,
|
|
@@ -225,6 +228,12 @@ export class UserLiveness {
|
|
|
225
228
|
"target": undefined,
|
|
226
229
|
"capture": false,
|
|
227
230
|
"passive": false
|
|
231
|
+
}, {
|
|
232
|
+
"name": "verificationFinished",
|
|
233
|
+
"method": "verificationFinished",
|
|
234
|
+
"target": undefined,
|
|
235
|
+
"capture": false,
|
|
236
|
+
"passive": false
|
|
228
237
|
}];
|
|
229
238
|
}
|
|
230
239
|
}
|
|
@@ -189,26 +189,51 @@ export class IdentificationComponent {
|
|
|
189
189
|
else if (store.flowStatus == FlowStatus.CODEERROR) {
|
|
190
190
|
currentBlock = h("sms-code-validation", null);
|
|
191
191
|
}
|
|
192
|
+
else if (store.flowStatus == FlowStatus.IDFRONTHOWTO) {
|
|
193
|
+
if (store.debug)
|
|
194
|
+
console.log('identification-component | render | IDFRONTHOWTO');
|
|
195
|
+
currentBlock = h("how-to-info", null);
|
|
196
|
+
}
|
|
192
197
|
else if (store.flowStatus == FlowStatus.IDFRONT) {
|
|
193
198
|
if (store.debug)
|
|
194
199
|
console.log('identification-component | render | IDFRONT');
|
|
195
200
|
currentBlock = h("process-id", { id: "processIdFront", mode: "front" });
|
|
196
201
|
}
|
|
202
|
+
else if (store.flowStatus == FlowStatus.IDBACKHOWTO) {
|
|
203
|
+
if (store.debug)
|
|
204
|
+
console.log('identification-component | render | IDBACKHOWTO');
|
|
205
|
+
currentBlock = h("how-to-info", null);
|
|
206
|
+
}
|
|
197
207
|
else if (store.flowStatus == FlowStatus.IDBACK) {
|
|
198
208
|
if (store.debug)
|
|
199
209
|
console.log('identification-component | render | IDBACK');
|
|
200
210
|
currentBlock = h("process-id", { id: "processIdBack", mode: "back" });
|
|
201
211
|
}
|
|
212
|
+
else if (store.flowStatus == FlowStatus.IDTILTHOWTO) {
|
|
213
|
+
if (store.debug)
|
|
214
|
+
console.log('identification-component | render | IDTILTHOWTO');
|
|
215
|
+
currentBlock = h("how-to-info", null);
|
|
216
|
+
}
|
|
202
217
|
else if (store.flowStatus == FlowStatus.IDTILT) {
|
|
203
218
|
if (store.debug)
|
|
204
219
|
console.log('identification-component | render | TILT');
|
|
205
220
|
currentBlock = h("process-id", { id: "processIdTilt", mode: "tilt" });
|
|
206
221
|
}
|
|
222
|
+
else if (store.flowStatus == FlowStatus.LIVENESSHOWTO) {
|
|
223
|
+
if (store.debug)
|
|
224
|
+
console.log('identification-component | render | LIVENESSHOWTO');
|
|
225
|
+
currentBlock = h("how-to-info", null);
|
|
226
|
+
}
|
|
207
227
|
else if (store.flowStatus == FlowStatus.LIVENESS) {
|
|
208
228
|
if (store.debug)
|
|
209
229
|
console.log('identification-component | render | LIVENESS');
|
|
210
230
|
currentBlock = h("user-liveness", { id: "userLiveness", mode: "selfie" });
|
|
211
231
|
}
|
|
232
|
+
else if (store.flowStatus == FlowStatus.LIVENESSGESTUREHOWTO) {
|
|
233
|
+
if (store.debug)
|
|
234
|
+
console.log('identification-component | render | LIVENESSGESTUREHOWTO');
|
|
235
|
+
currentBlock = h("how-to-info", null);
|
|
236
|
+
}
|
|
212
237
|
else if (store.flowStatus == FlowStatus.LIVENESSGESTURE) {
|
|
213
238
|
if (store.debug)
|
|
214
239
|
console.log('identification-component | render | LIVENESSGESTURE');
|
|
@@ -6,15 +6,19 @@ export var FlowStatus;
|
|
|
6
6
|
FlowStatus[FlowStatus["PHONE"] = 3] = "PHONE";
|
|
7
7
|
FlowStatus[FlowStatus["CODE"] = 4] = "CODE";
|
|
8
8
|
FlowStatus[FlowStatus["CODEERROR"] = 5] = "CODEERROR";
|
|
9
|
-
FlowStatus[FlowStatus["
|
|
10
|
-
FlowStatus[FlowStatus["
|
|
11
|
-
FlowStatus[FlowStatus["
|
|
12
|
-
FlowStatus[FlowStatus["
|
|
13
|
-
FlowStatus[FlowStatus["
|
|
14
|
-
FlowStatus[FlowStatus["
|
|
15
|
-
FlowStatus[FlowStatus["
|
|
16
|
-
FlowStatus[FlowStatus["
|
|
17
|
-
FlowStatus[FlowStatus["
|
|
18
|
-
FlowStatus[FlowStatus["
|
|
9
|
+
FlowStatus[FlowStatus["IDFRONTHOWTO"] = 6] = "IDFRONTHOWTO";
|
|
10
|
+
FlowStatus[FlowStatus["IDFRONT"] = 7] = "IDFRONT";
|
|
11
|
+
FlowStatus[FlowStatus["IDBACKHOWTO"] = 8] = "IDBACKHOWTO";
|
|
12
|
+
FlowStatus[FlowStatus["IDBACK"] = 9] = "IDBACK";
|
|
13
|
+
FlowStatus[FlowStatus["IDTILTHOWTO"] = 10] = "IDTILTHOWTO";
|
|
14
|
+
FlowStatus[FlowStatus["IDTILT"] = 11] = "IDTILT";
|
|
15
|
+
FlowStatus[FlowStatus["LIVENESSHOWTO"] = 12] = "LIVENESSHOWTO";
|
|
16
|
+
FlowStatus[FlowStatus["LIVENESS"] = 13] = "LIVENESS";
|
|
17
|
+
FlowStatus[FlowStatus["LIVENESSGESTUREHOWTO"] = 14] = "LIVENESSGESTUREHOWTO";
|
|
18
|
+
FlowStatus[FlowStatus["LIVENESSGESTURE"] = 15] = "LIVENESSGESTURE";
|
|
19
|
+
FlowStatus[FlowStatus["COMPLETE"] = 16] = "COMPLETE";
|
|
20
|
+
FlowStatus[FlowStatus["ERROREND"] = 17] = "ERROREND";
|
|
21
|
+
FlowStatus[FlowStatus["CAMERAERROR"] = 18] = "CAMERAERROR";
|
|
22
|
+
FlowStatus[FlowStatus["ABORTED"] = 19] = "ABORTED";
|
|
23
|
+
FlowStatus[FlowStatus["NONE"] = 20] = "NONE";
|
|
19
24
|
})(FlowStatus || (FlowStatus = {}));
|
|
20
|
-
;
|
|
@@ -208,16 +208,21 @@ var FlowStatus;
|
|
|
208
208
|
FlowStatus[FlowStatus["PHONE"] = 3] = "PHONE";
|
|
209
209
|
FlowStatus[FlowStatus["CODE"] = 4] = "CODE";
|
|
210
210
|
FlowStatus[FlowStatus["CODEERROR"] = 5] = "CODEERROR";
|
|
211
|
-
FlowStatus[FlowStatus["
|
|
212
|
-
FlowStatus[FlowStatus["
|
|
213
|
-
FlowStatus[FlowStatus["
|
|
214
|
-
FlowStatus[FlowStatus["
|
|
215
|
-
FlowStatus[FlowStatus["
|
|
216
|
-
FlowStatus[FlowStatus["
|
|
217
|
-
FlowStatus[FlowStatus["
|
|
218
|
-
FlowStatus[FlowStatus["
|
|
219
|
-
FlowStatus[FlowStatus["
|
|
220
|
-
FlowStatus[FlowStatus["
|
|
211
|
+
FlowStatus[FlowStatus["IDFRONTHOWTO"] = 6] = "IDFRONTHOWTO";
|
|
212
|
+
FlowStatus[FlowStatus["IDFRONT"] = 7] = "IDFRONT";
|
|
213
|
+
FlowStatus[FlowStatus["IDBACKHOWTO"] = 8] = "IDBACKHOWTO";
|
|
214
|
+
FlowStatus[FlowStatus["IDBACK"] = 9] = "IDBACK";
|
|
215
|
+
FlowStatus[FlowStatus["IDTILTHOWTO"] = 10] = "IDTILTHOWTO";
|
|
216
|
+
FlowStatus[FlowStatus["IDTILT"] = 11] = "IDTILT";
|
|
217
|
+
FlowStatus[FlowStatus["LIVENESSHOWTO"] = 12] = "LIVENESSHOWTO";
|
|
218
|
+
FlowStatus[FlowStatus["LIVENESS"] = 13] = "LIVENESS";
|
|
219
|
+
FlowStatus[FlowStatus["LIVENESSGESTUREHOWTO"] = 14] = "LIVENESSGESTUREHOWTO";
|
|
220
|
+
FlowStatus[FlowStatus["LIVENESSGESTURE"] = 15] = "LIVENESSGESTURE";
|
|
221
|
+
FlowStatus[FlowStatus["COMPLETE"] = 16] = "COMPLETE";
|
|
222
|
+
FlowStatus[FlowStatus["ERROREND"] = 17] = "ERROREND";
|
|
223
|
+
FlowStatus[FlowStatus["CAMERAERROR"] = 18] = "CAMERAERROR";
|
|
224
|
+
FlowStatus[FlowStatus["ABORTED"] = 19] = "ABORTED";
|
|
225
|
+
FlowStatus[FlowStatus["NONE"] = 20] = "NONE";
|
|
221
226
|
})(FlowStatus || (FlowStatus = {}));
|
|
222
227
|
|
|
223
228
|
class IdCaptureValues {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cf54a432.js';
|
|
2
|
-
import { A as ApiCall, T as Translations, F as FlowMoments, a as FlowSteps, s as state, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-
|
|
2
|
+
import { A as ApiCall, T as Translations, F as FlowMoments, a as FlowSteps, s as state, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-21a568f6.js';
|
|
3
3
|
|
|
4
4
|
const agreementCheckCss = "";
|
|
5
5
|
|
|
@@ -4794,16 +4794,16 @@ ErrorEnd.style = errorEndCss;
|
|
|
4794
4794
|
const howToInfoCss = "";
|
|
4795
4795
|
|
|
4796
4796
|
const HowToInfo = class {
|
|
4797
|
-
constructor(hostRef) { registerInstance(this, hostRef); this.
|
|
4797
|
+
constructor(hostRef) { registerInstance(this, hostRef); this.apiErrorEvent = createEvent(this, "apiError", 7); this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
|
|
4798
4798
|
async componentDidLoad() {
|
|
4799
4799
|
await BaseComponent.initialize(this.currentStep);
|
|
4800
4800
|
}
|
|
4801
4801
|
async disconnectedCallback() {
|
|
4802
4802
|
await BaseComponent.finalize(this.currentStep);
|
|
4803
4803
|
}
|
|
4804
|
-
buttonClick() {
|
|
4804
|
+
async buttonClick() {
|
|
4805
4805
|
this.buttonEnabled = false;
|
|
4806
|
-
|
|
4806
|
+
state.flowStatus = await ApiCall.instance.GetNextFlowState();
|
|
4807
4807
|
}
|
|
4808
4808
|
async componentWillLoad() {
|
|
4809
4809
|
this.translations = await Translations.getValues();
|
|
@@ -5204,7 +5204,7 @@ function v4(options, buf, offset) {
|
|
|
5204
5204
|
}
|
|
5205
5205
|
|
|
5206
5206
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5207
|
-
const version$1 = "3.6.
|
|
5207
|
+
const version$1 = "3.6.65";
|
|
5208
5208
|
const description = "Person Identification Component";
|
|
5209
5209
|
const main = "./dist/index.cjs.js";
|
|
5210
5210
|
const module = "./dist/index.js";
|
|
@@ -5534,26 +5534,51 @@ const IdentificationComponent = class {
|
|
|
5534
5534
|
else if (state.flowStatus == FlowStatus.CODEERROR) {
|
|
5535
5535
|
currentBlock = h("sms-code-validation", null);
|
|
5536
5536
|
}
|
|
5537
|
+
else if (state.flowStatus == FlowStatus.IDFRONTHOWTO) {
|
|
5538
|
+
if (state.debug)
|
|
5539
|
+
console.log('identification-component | render | IDFRONTHOWTO');
|
|
5540
|
+
currentBlock = h("how-to-info", null);
|
|
5541
|
+
}
|
|
5537
5542
|
else if (state.flowStatus == FlowStatus.IDFRONT) {
|
|
5538
5543
|
if (state.debug)
|
|
5539
5544
|
console.log('identification-component | render | IDFRONT');
|
|
5540
5545
|
currentBlock = h("process-id", { id: "processIdFront", mode: "front" });
|
|
5541
5546
|
}
|
|
5547
|
+
else if (state.flowStatus == FlowStatus.IDBACKHOWTO) {
|
|
5548
|
+
if (state.debug)
|
|
5549
|
+
console.log('identification-component | render | IDBACKHOWTO');
|
|
5550
|
+
currentBlock = h("how-to-info", null);
|
|
5551
|
+
}
|
|
5542
5552
|
else if (state.flowStatus == FlowStatus.IDBACK) {
|
|
5543
5553
|
if (state.debug)
|
|
5544
5554
|
console.log('identification-component | render | IDBACK');
|
|
5545
5555
|
currentBlock = h("process-id", { id: "processIdBack", mode: "back" });
|
|
5546
5556
|
}
|
|
5557
|
+
else if (state.flowStatus == FlowStatus.IDTILTHOWTO) {
|
|
5558
|
+
if (state.debug)
|
|
5559
|
+
console.log('identification-component | render | IDTILTHOWTO');
|
|
5560
|
+
currentBlock = h("how-to-info", null);
|
|
5561
|
+
}
|
|
5547
5562
|
else if (state.flowStatus == FlowStatus.IDTILT) {
|
|
5548
5563
|
if (state.debug)
|
|
5549
5564
|
console.log('identification-component | render | TILT');
|
|
5550
5565
|
currentBlock = h("process-id", { id: "processIdTilt", mode: "tilt" });
|
|
5551
5566
|
}
|
|
5567
|
+
else if (state.flowStatus == FlowStatus.LIVENESSHOWTO) {
|
|
5568
|
+
if (state.debug)
|
|
5569
|
+
console.log('identification-component | render | LIVENESSHOWTO');
|
|
5570
|
+
currentBlock = h("how-to-info", null);
|
|
5571
|
+
}
|
|
5552
5572
|
else if (state.flowStatus == FlowStatus.LIVENESS) {
|
|
5553
5573
|
if (state.debug)
|
|
5554
5574
|
console.log('identification-component | render | LIVENESS');
|
|
5555
5575
|
currentBlock = h("user-liveness", { id: "userLiveness", mode: "selfie" });
|
|
5556
5576
|
}
|
|
5577
|
+
else if (state.flowStatus == FlowStatus.LIVENESSGESTUREHOWTO) {
|
|
5578
|
+
if (state.debug)
|
|
5579
|
+
console.log('identification-component | render | LIVENESSGESTUREHOWTO');
|
|
5580
|
+
currentBlock = h("how-to-info", null);
|
|
5581
|
+
}
|
|
5557
5582
|
else if (state.flowStatus == FlowStatus.LIVENESSGESTURE) {
|
|
5558
5583
|
if (state.debug)
|
|
5559
5584
|
console.log('identification-component | render | LIVENESSGESTURE');
|
|
@@ -8642,45 +8667,33 @@ const ProcessId = class {
|
|
|
8642
8667
|
if (this.mode == 'front') {
|
|
8643
8668
|
this.currentStep = FlowSteps.CiFront;
|
|
8644
8669
|
this.flow = {
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
recType: CaptureUploadTypes.IdFrontVideo,
|
|
8650
|
-
},
|
|
8651
|
-
howToDone: false,
|
|
8670
|
+
fileName: 'idImage.png',
|
|
8671
|
+
recName: 'idVideo.',
|
|
8672
|
+
photoType: CaptureUploadTypes.IdFront,
|
|
8673
|
+
recType: CaptureUploadTypes.IdFrontVideo,
|
|
8652
8674
|
};
|
|
8653
8675
|
}
|
|
8654
8676
|
else if (this.mode == 'back') {
|
|
8655
8677
|
this.currentStep = FlowSteps.CiBack;
|
|
8656
8678
|
this.flow = {
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
recType: CaptureUploadTypes.IdBackVideo,
|
|
8662
|
-
},
|
|
8663
|
-
howToDone: false,
|
|
8679
|
+
fileName: 'idBackImage.png',
|
|
8680
|
+
recName: 'idBackVideo.',
|
|
8681
|
+
photoType: CaptureUploadTypes.IdBack,
|
|
8682
|
+
recType: CaptureUploadTypes.IdBackVideo,
|
|
8664
8683
|
};
|
|
8665
8684
|
}
|
|
8666
8685
|
else if (this.mode == 'tilt') {
|
|
8667
8686
|
this.currentStep = FlowSteps.CiTilt;
|
|
8668
8687
|
this.flow = {
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
recType: CaptureUploadTypes.TiltVideo,
|
|
8674
|
-
},
|
|
8675
|
-
howToDone: false,
|
|
8688
|
+
fileName: 'idTiltImage.png',
|
|
8689
|
+
recName: 'idTiltVideo.',
|
|
8690
|
+
photoType: CaptureUploadTypes.None,
|
|
8691
|
+
recType: CaptureUploadTypes.TiltVideo,
|
|
8676
8692
|
};
|
|
8677
8693
|
}
|
|
8678
8694
|
if (state.debug)
|
|
8679
8695
|
console.log('process-id | initFlow');
|
|
8680
8696
|
}
|
|
8681
|
-
howToDone() {
|
|
8682
|
-
this.flow.howToDone = true;
|
|
8683
|
-
}
|
|
8684
8697
|
timeElapsed() {
|
|
8685
8698
|
this.errorReason = 'Timeout';
|
|
8686
8699
|
this.showTimeout = true;
|
|
@@ -8707,8 +8720,8 @@ const ProcessId = class {
|
|
|
8707
8720
|
return;
|
|
8708
8721
|
}
|
|
8709
8722
|
try {
|
|
8710
|
-
let frontCapture = new File([idPhoto], this.flow.
|
|
8711
|
-
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.
|
|
8723
|
+
let frontCapture = new File([idPhoto], this.flow.fileName, { type: 'image/png' });
|
|
8724
|
+
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.photoType, frontCapture);
|
|
8712
8725
|
if (state.debug)
|
|
8713
8726
|
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
8714
8727
|
if (uploadResult.isValid) {
|
|
@@ -8739,8 +8752,8 @@ const ProcessId = class {
|
|
|
8739
8752
|
return;
|
|
8740
8753
|
}
|
|
8741
8754
|
let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
8742
|
-
let captureRec = new File([idRecording], this.flow.
|
|
8743
|
-
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.
|
|
8755
|
+
let captureRec = new File([idRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
8756
|
+
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.recType, captureRec);
|
|
8744
8757
|
if (state.debug)
|
|
8745
8758
|
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
8746
8759
|
if (uploadResult.saved) {
|
|
@@ -8751,6 +8764,32 @@ const ProcessId = class {
|
|
|
8751
8764
|
}
|
|
8752
8765
|
this.recordingResultCount = 0;
|
|
8753
8766
|
}
|
|
8767
|
+
async verificationFinished() {
|
|
8768
|
+
if (state.debug)
|
|
8769
|
+
console.log('process-id | verificationFinished');
|
|
8770
|
+
this.verificationReceived = Date.now();
|
|
8771
|
+
let initialStatus = state.flowStatus;
|
|
8772
|
+
let statusChanged = false;
|
|
8773
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
8774
|
+
await delay(2000);
|
|
8775
|
+
statusChanged = initialStatus != state.flowStatus;
|
|
8776
|
+
}
|
|
8777
|
+
if (!statusChanged) {
|
|
8778
|
+
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
8779
|
+
if (currentStatus != state.flowStatus) {
|
|
8780
|
+
state.flowStatus = currentStatus;
|
|
8781
|
+
}
|
|
8782
|
+
else {
|
|
8783
|
+
this.triggerUploadFailedFlow();
|
|
8784
|
+
}
|
|
8785
|
+
}
|
|
8786
|
+
if (state.debug)
|
|
8787
|
+
console.log('process-id | verificationFinished | waitingFinished ');
|
|
8788
|
+
}
|
|
8789
|
+
triggerUploadFailedFlow() {
|
|
8790
|
+
this.errorReason = 'Upload Failed';
|
|
8791
|
+
this.showInvalid = true;
|
|
8792
|
+
}
|
|
8754
8793
|
async componentDidLoad() {
|
|
8755
8794
|
if (state.debug)
|
|
8756
8795
|
console.log('process-id | componentDidLoad');
|
|
@@ -8779,16 +8818,10 @@ const ProcessId = class {
|
|
|
8779
8818
|
render() {
|
|
8780
8819
|
let error = h("capture-error", { type: "ID", reason: this.errorReason });
|
|
8781
8820
|
let capture = h("id-capture", null);
|
|
8782
|
-
let howTo = h("how-to-info", null);
|
|
8783
8821
|
if (this.showInvalid || this.showTimeout) {
|
|
8784
8822
|
return error;
|
|
8785
8823
|
}
|
|
8786
|
-
|
|
8787
|
-
return howTo;
|
|
8788
|
-
}
|
|
8789
|
-
else {
|
|
8790
|
-
return capture;
|
|
8791
|
-
}
|
|
8824
|
+
return capture;
|
|
8792
8825
|
}
|
|
8793
8826
|
};
|
|
8794
8827
|
ProcessId.style = processIdCss;
|
|
@@ -9018,38 +9051,28 @@ const UserLiveness = class {
|
|
|
9018
9051
|
this.showError = undefined;
|
|
9019
9052
|
this.showTimeout = undefined;
|
|
9020
9053
|
this.flow = undefined;
|
|
9021
|
-
this.howToDone = false;
|
|
9022
9054
|
}
|
|
9023
9055
|
async componentDidLoad() { }
|
|
9024
9056
|
componentWillLoad() {
|
|
9025
9057
|
if (this.mode == 'selfie') {
|
|
9026
9058
|
this.currentStep = FlowSteps.Selfie;
|
|
9027
9059
|
this.flow = {
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
recType: CaptureUploadTypes.SelfieVideo,
|
|
9033
|
-
},
|
|
9034
|
-
howToDone: false,
|
|
9060
|
+
fileName: 'selfie.png',
|
|
9061
|
+
recName: 'selfieVideo.',
|
|
9062
|
+
photoType: CaptureUploadTypes.Selfie,
|
|
9063
|
+
recType: CaptureUploadTypes.SelfieVideo,
|
|
9035
9064
|
};
|
|
9036
9065
|
}
|
|
9037
9066
|
else if (this.mode == 'selfieGesture') {
|
|
9038
9067
|
this.currentStep = FlowSteps.SelfieTilt;
|
|
9039
9068
|
this.flow = {
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9045
|
-
},
|
|
9046
|
-
howToDone: false,
|
|
9069
|
+
fileName: '',
|
|
9070
|
+
recName: 'selfieTiltVideo.',
|
|
9071
|
+
photoType: CaptureUploadTypes.None,
|
|
9072
|
+
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9047
9073
|
};
|
|
9048
9074
|
}
|
|
9049
9075
|
}
|
|
9050
|
-
howToDoneEvent() {
|
|
9051
|
-
this.howToDone = true;
|
|
9052
|
-
}
|
|
9053
9076
|
timeElapsed() {
|
|
9054
9077
|
this.errorReason = 'Timeout';
|
|
9055
9078
|
this.showTimeout = true;
|
|
@@ -9072,8 +9095,8 @@ const UserLiveness = class {
|
|
|
9072
9095
|
return;
|
|
9073
9096
|
}
|
|
9074
9097
|
try {
|
|
9075
|
-
var uploadPhoto = new File([selfiePhoto], this.flow.
|
|
9076
|
-
let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.
|
|
9098
|
+
var uploadPhoto = new File([selfiePhoto], this.flow.fileName, { type: 'image/png' });
|
|
9099
|
+
let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.photoType, uploadPhoto);
|
|
9077
9100
|
if (photoUploaded.isValid) {
|
|
9078
9101
|
state.flowStatus = FlowStatus[photoUploaded.state];
|
|
9079
9102
|
}
|
|
@@ -9099,8 +9122,8 @@ const UserLiveness = class {
|
|
|
9099
9122
|
}
|
|
9100
9123
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9101
9124
|
try {
|
|
9102
|
-
let uploadRec = new File([selfieRecording], this.flow.
|
|
9103
|
-
let uplodDone = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.
|
|
9125
|
+
let uploadRec = new File([selfieRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
9126
|
+
let uplodDone = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.recType, uploadRec);
|
|
9104
9127
|
if (uplodDone.saved) {
|
|
9105
9128
|
state.flowStatus = FlowStatus[uplodDone.state];
|
|
9106
9129
|
}
|
|
@@ -9118,6 +9141,32 @@ const UserLiveness = class {
|
|
|
9118
9141
|
}
|
|
9119
9142
|
}
|
|
9120
9143
|
}
|
|
9144
|
+
async verificationFinished() {
|
|
9145
|
+
if (state.debug)
|
|
9146
|
+
console.log('user-liveness | verificationFinished');
|
|
9147
|
+
this.verificationReceived = Date.now();
|
|
9148
|
+
let initialStatus = state.flowStatus;
|
|
9149
|
+
let statusChanged = false;
|
|
9150
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
9151
|
+
await delay(2000);
|
|
9152
|
+
statusChanged = initialStatus != state.flowStatus;
|
|
9153
|
+
}
|
|
9154
|
+
if (!statusChanged) {
|
|
9155
|
+
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
9156
|
+
if (currentStatus != state.flowStatus) {
|
|
9157
|
+
state.flowStatus = currentStatus;
|
|
9158
|
+
}
|
|
9159
|
+
else {
|
|
9160
|
+
this.triggerUploadFailedFlow();
|
|
9161
|
+
}
|
|
9162
|
+
}
|
|
9163
|
+
if (state.debug)
|
|
9164
|
+
console.log('user-liveness | verificationFinished | waitingFinished ');
|
|
9165
|
+
}
|
|
9166
|
+
triggerUploadFailedFlow() {
|
|
9167
|
+
this.errorReason = 'Upload Failed';
|
|
9168
|
+
this.showError = true;
|
|
9169
|
+
}
|
|
9121
9170
|
async disconnectedCallback() {
|
|
9122
9171
|
await BaseComponent.finalize(this.currentStep);
|
|
9123
9172
|
}
|
|
@@ -9126,18 +9175,12 @@ const UserLiveness = class {
|
|
|
9126
9175
|
this.showError = true;
|
|
9127
9176
|
}
|
|
9128
9177
|
render() {
|
|
9129
|
-
let howTo = h("how-to-info", null);
|
|
9130
9178
|
let capture = h("selfie-capture", null);
|
|
9131
9179
|
let error = h("capture-error", { type: "LIVENESS", reason: this.errorReason });
|
|
9132
9180
|
if (this.showError || this.showTimeout) {
|
|
9133
9181
|
return error;
|
|
9134
9182
|
}
|
|
9135
|
-
|
|
9136
|
-
return capture;
|
|
9137
|
-
}
|
|
9138
|
-
else {
|
|
9139
|
-
return howTo;
|
|
9140
|
-
}
|
|
9183
|
+
return capture;
|
|
9141
9184
|
}
|
|
9142
9185
|
};
|
|
9143
9186
|
UserLiveness.style = userLivenessCss;
|
package/dist/esm/loader.js
CHANGED
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["loader-dots",[[1,"loader-dots"]]],["random-actions",[[0,"random-actions"]]],["agreement-check_17",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"
|
|
14
|
+
return bootstrapLazy([["loader-dots",[[1,"loader-dots"]]],["random-actions",[[0,"random-actions"]]],["agreement-check_17",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|