@ekyc_qoobiss/qbs-ect-cmp 3.6.54 → 3.6.56
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/agreement-check_17.cjs.entry.js +111 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/collection/components/common/capture-error/capture-error.js +1 -1
- package/dist/collection/components/common/id-capture/id-capture.js +22 -5
- package/dist/collection/components/controls/camera/camera.js +4 -0
- package/dist/collection/components/flow/process-id/process-id.js +43 -1
- package/dist/collection/components/flow/sms-send/sms-send.js +4 -2
- package/dist/collection/components/flow/user-liveness/user-liveness.js +19 -1
- package/dist/collection/helpers/Cameras.js +4 -0
- package/dist/collection/helpers/Stream.js +28 -0
- package/dist/esm/agreement-check_17.entry.js +111 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qbs-ect-cmp.js +1 -1
- package/dist/qbs-ect-cmp/{p-195076dc.entry.js → p-2a7693e1.entry.js} +1 -1
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/id-capture/id-capture.d.ts +0 -1
- package/dist/types/components/flow/process-id/process-id.d.ts +2 -0
- package/dist/types/components/flow/sms-send/sms-send.d.ts +1 -0
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +2 -0
- package/package.json +1 -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';
|
|
@@ -58,6 +58,8 @@ export class ProcessId {
|
|
|
58
58
|
howToDone: false,
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
+
if (store.debug)
|
|
62
|
+
console.log('process-id | initFlow');
|
|
61
63
|
}
|
|
62
64
|
howToDone() {
|
|
63
65
|
this.flow.howToDone = true;
|
|
@@ -75,8 +77,12 @@ export class ProcessId {
|
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
async captureIdImage(event) {
|
|
80
|
+
if (store.debug)
|
|
81
|
+
console.log('process-id | captureIdImage');
|
|
78
82
|
let idPhoto = event.detail;
|
|
79
83
|
if (idPhoto.size == 0) {
|
|
84
|
+
if (store.debug)
|
|
85
|
+
console.log('process-id | captureIdImage | Empty id photo');
|
|
80
86
|
await ApiCall.instance.AddLog({ message: 'Empty id photo', blobData: idPhoto }, getLogMessage());
|
|
81
87
|
this.triggerErrorFlow();
|
|
82
88
|
return;
|
|
@@ -84,6 +90,8 @@ export class ProcessId {
|
|
|
84
90
|
try {
|
|
85
91
|
let frontCapture = new File([idPhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
86
92
|
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.photoType, frontCapture);
|
|
93
|
+
if (store.debug)
|
|
94
|
+
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
87
95
|
if (!uploadResult) {
|
|
88
96
|
this.switchCamera();
|
|
89
97
|
this.triggerErrorFlow();
|
|
@@ -94,12 +102,16 @@ export class ProcessId {
|
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
104
|
async capturedIdRecording(event) {
|
|
105
|
+
if (store.debug)
|
|
106
|
+
console.log('process-id | capturedIdRecording');
|
|
97
107
|
let idRecording = event.detail;
|
|
98
108
|
if (idRecording.size == 0 && this.recordingResultCount == 0) {
|
|
99
109
|
this.recordingResultCount++;
|
|
100
110
|
return;
|
|
101
111
|
}
|
|
102
112
|
if (idRecording.size == 0) {
|
|
113
|
+
if (store.debug)
|
|
114
|
+
console.log('process-id | capturedIdRecording | Empty ID recording');
|
|
103
115
|
await ApiCall.instance.AddLog({ message: 'Empty ID recording', blobData: idRecording }, getLogMessage());
|
|
104
116
|
this.triggerErrorFlow();
|
|
105
117
|
return;
|
|
@@ -107,12 +119,32 @@ export class ProcessId {
|
|
|
107
119
|
let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
108
120
|
let captureRec = new File([idRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
109
121
|
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.recType, captureRec);
|
|
122
|
+
if (store.debug)
|
|
123
|
+
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
110
124
|
if (!uploadResult) {
|
|
111
125
|
this.triggerErrorFlow();
|
|
112
126
|
}
|
|
113
127
|
this.recordingResultCount = 0;
|
|
114
128
|
}
|
|
129
|
+
async verificationFinished() {
|
|
130
|
+
if (store.debug)
|
|
131
|
+
console.log('process-id | verificationFinished');
|
|
132
|
+
this.verificationReceived = Date.now();
|
|
133
|
+
while (Date.now() - this.verificationReceived < 25000) {
|
|
134
|
+
await delay(2000);
|
|
135
|
+
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
136
|
+
if (currentStatus != store.flowStatus) {
|
|
137
|
+
store.flowStatus = currentStatus;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (store.debug)
|
|
142
|
+
console.log('process-id | verificationFinished | waitingFinished ');
|
|
143
|
+
this.triggerErrorFlow();
|
|
144
|
+
}
|
|
115
145
|
async componentDidLoad() {
|
|
146
|
+
if (store.debug)
|
|
147
|
+
console.log('process-id | componentDidLoad');
|
|
116
148
|
await BaseComponent.initialize(this.currentStep);
|
|
117
149
|
}
|
|
118
150
|
triggerErrorFlow() {
|
|
@@ -120,9 +152,13 @@ export class ProcessId {
|
|
|
120
152
|
this.showInvalid = true;
|
|
121
153
|
}
|
|
122
154
|
async disconnectedCallback() {
|
|
155
|
+
if (store.debug)
|
|
156
|
+
console.log('process-id | disconnectedCallback');
|
|
123
157
|
await BaseComponent.finalize(this.currentStep);
|
|
124
158
|
}
|
|
125
159
|
switchCamera() {
|
|
160
|
+
if (store.debug)
|
|
161
|
+
console.log('process-id | switchCamera');
|
|
126
162
|
if (this.captureRetryCount == 1) {
|
|
127
163
|
Cameras.switchCamera();
|
|
128
164
|
this.captureRetryCount = 0;
|
|
@@ -233,6 +269,12 @@ export class ProcessId {
|
|
|
233
269
|
"target": undefined,
|
|
234
270
|
"capture": false,
|
|
235
271
|
"passive": false
|
|
272
|
+
}, {
|
|
273
|
+
"name": "verificationFinished",
|
|
274
|
+
"method": "verificationFinished",
|
|
275
|
+
"target": undefined,
|
|
276
|
+
"capture": false,
|
|
277
|
+
"passive": false
|
|
236
278
|
}];
|
|
237
279
|
}
|
|
238
280
|
}
|
|
@@ -6,7 +6,7 @@ import { BaseComponent } from '../../base-component';
|
|
|
6
6
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
7
7
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
8
8
|
export class SmsSend {
|
|
9
|
-
constructor() { this.buttonText = undefined; this.title = undefined; this.phoneNumber = undefined; this.prefilledPhone = false; this.canSend = false; }
|
|
9
|
+
constructor() { this.buttonText = undefined; this.title = undefined; this.details = undefined; this.phoneNumber = undefined; this.prefilledPhone = false; this.canSend = false; }
|
|
10
10
|
async doAction() {
|
|
11
11
|
try {
|
|
12
12
|
this.canSend = false;
|
|
@@ -26,6 +26,7 @@ export class SmsSend {
|
|
|
26
26
|
this.translations = await Translations.getValues();
|
|
27
27
|
this.buttonText = this.translations.PhoneValidationValues.Button;
|
|
28
28
|
this.title = this.translations.PhoneValidationValues.Title;
|
|
29
|
+
this.details = this.translations.PhoneValidationValues.Description;
|
|
29
30
|
if (store.phoneNumber && store.phoneNumber != '') {
|
|
30
31
|
this.phoneNumber = store.phoneNumber;
|
|
31
32
|
this.prefilledPhone = true;
|
|
@@ -44,7 +45,7 @@ export class SmsSend {
|
|
|
44
45
|
ev.target.value = this.phoneNumber;
|
|
45
46
|
}
|
|
46
47
|
render() {
|
|
47
|
-
return (h("div", { class: "container" }, h("div", { class: "row row-validare" }, h("div", null, h("h1", { class: "text-center" }, this.title)), h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1" }, h("b", null, this.translations.PhoneValidationValues.Label)), h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
48
|
+
return (h("div", { class: "container" }, h("div", { class: "row row-validare" }, h("div", null, h("h1", { class: "text-center" }, this.title), h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details)), h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1" }, h("b", null, this.translations.PhoneValidationValues.Label)), h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
48
49
|
}
|
|
49
50
|
static get is() { return "sms-send"; }
|
|
50
51
|
static get originalStyleUrls() {
|
|
@@ -61,6 +62,7 @@ export class SmsSend {
|
|
|
61
62
|
return {
|
|
62
63
|
"buttonText": {},
|
|
63
64
|
"title": {},
|
|
65
|
+
"details": {},
|
|
64
66
|
"phoneNumber": {},
|
|
65
67
|
"prefilledPhone": {},
|
|
66
68
|
"canSend": {}
|
|
@@ -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';
|
|
@@ -109,6 +109,18 @@ export class UserLiveness {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
+
async verificationFinished() {
|
|
113
|
+
this.verificationReceived = Date.now();
|
|
114
|
+
while (Date.now() - this.verificationReceived < 25000) {
|
|
115
|
+
await delay(2000);
|
|
116
|
+
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
117
|
+
if (currentStatus != store.flowStatus) {
|
|
118
|
+
store.flowStatus = currentStatus;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
this.triggerErrorFlow();
|
|
123
|
+
}
|
|
112
124
|
async disconnectedCallback() {
|
|
113
125
|
await BaseComponent.finalize(this.currentStep);
|
|
114
126
|
}
|
|
@@ -219,6 +231,12 @@ export class UserLiveness {
|
|
|
219
231
|
"target": undefined,
|
|
220
232
|
"capture": false,
|
|
221
233
|
"passive": false
|
|
234
|
+
}, {
|
|
235
|
+
"name": "verificationFinished",
|
|
236
|
+
"method": "verificationFinished",
|
|
237
|
+
"target": undefined,
|
|
238
|
+
"capture": false,
|
|
239
|
+
"passive": false
|
|
222
240
|
}];
|
|
223
241
|
}
|
|
224
242
|
}
|
|
@@ -110,12 +110,16 @@ export class Cameras {
|
|
|
110
110
|
return null;
|
|
111
111
|
}
|
|
112
112
|
static async InitCameras(device) {
|
|
113
|
+
if (store.debug)
|
|
114
|
+
console.log('cameras | initCameras');
|
|
113
115
|
try {
|
|
114
116
|
let cam = new Cameras();
|
|
115
117
|
let cameras = (await cam.GetCameras(device)).filter(c => c.facingMode == 'environment');
|
|
116
118
|
var recommCamera = cam.GetRecommendedCamera(cameras);
|
|
117
119
|
store.cameraIds = cameras.map(camera => camera.deviceId);
|
|
118
120
|
store.cameraId = recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId;
|
|
121
|
+
if (store.debug)
|
|
122
|
+
console.log(`cameras | initCameras | cameraIds ${store.cameraIds} | cameraId ${store.cameraId}`);
|
|
119
123
|
return true;
|
|
120
124
|
}
|
|
121
125
|
catch (e) {
|
|
@@ -38,24 +38,36 @@ export class Stream {
|
|
|
38
38
|
this.streamPaused = false;
|
|
39
39
|
this.recordedChunks = [];
|
|
40
40
|
this.videoSize = { width: 0, height: 0 };
|
|
41
|
+
if (store.debug)
|
|
42
|
+
console.log('stream | constructor');
|
|
41
43
|
this.initFacePose();
|
|
42
44
|
this.idML5Detector = IDML5Detector.getInstance(this, store.device.isMobile);
|
|
43
45
|
this.faceML5Detector = FaceML5Detector.getInstance(this, store.device.isMobile);
|
|
44
46
|
this.verificationMode = mode;
|
|
45
47
|
}
|
|
46
48
|
static getNewInstance(mode) {
|
|
49
|
+
if (store.debug)
|
|
50
|
+
console.log('stream | getNewInstance');
|
|
47
51
|
if (!Stream.instance) {
|
|
52
|
+
if (store.debug)
|
|
53
|
+
console.log('stream | getNewInstance | new instance');
|
|
48
54
|
Stream.instance = new Stream(mode);
|
|
49
55
|
}
|
|
50
56
|
return Stream.instance;
|
|
51
57
|
}
|
|
52
58
|
autoCapturing() {
|
|
59
|
+
if (store.debug)
|
|
60
|
+
console.log('stream | autoCapturing');
|
|
53
61
|
this.callbackAutoCapturing();
|
|
54
62
|
}
|
|
55
63
|
timeElapsed() {
|
|
64
|
+
if (store.debug)
|
|
65
|
+
console.log('stream | timeElapsed');
|
|
56
66
|
this.callbackTimeElapsed();
|
|
57
67
|
}
|
|
58
68
|
verificationReady() {
|
|
69
|
+
if (store.debug)
|
|
70
|
+
console.log('stream | verificationReady');
|
|
59
71
|
this.verificationFinished();
|
|
60
72
|
}
|
|
61
73
|
updateHtmlElements(videoElement, canvasElement, component) {
|
|
@@ -65,6 +77,8 @@ export class Stream {
|
|
|
65
77
|
this.faceML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
|
|
66
78
|
}
|
|
67
79
|
startStream(stream) {
|
|
80
|
+
if (store.debug)
|
|
81
|
+
console.log('stream | startStream');
|
|
68
82
|
if (this.stream)
|
|
69
83
|
this.stream.getTracks().forEach((track) => track.stop());
|
|
70
84
|
this.stream = stream;
|
|
@@ -96,6 +110,8 @@ export class Stream {
|
|
|
96
110
|
this.recordStream();
|
|
97
111
|
}
|
|
98
112
|
recordStream() {
|
|
113
|
+
if (store.debug)
|
|
114
|
+
console.log('stream | recordStream');
|
|
99
115
|
if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
|
|
100
116
|
return;
|
|
101
117
|
var options = { mimeType: Stream.webmMimeType.mime, videoBitsPerSecond: 1500000 };
|
|
@@ -106,9 +122,13 @@ export class Stream {
|
|
|
106
122
|
this.recordedChunks = [];
|
|
107
123
|
this.mediaRecorder = new MediaRecorder(this.stream, options);
|
|
108
124
|
this.mediaRecorder.ondataavailable = event => {
|
|
125
|
+
if (store.debug)
|
|
126
|
+
console.log('stream | recordStream | ondataavailable');
|
|
109
127
|
this.recordedChunks.push(event.data);
|
|
110
128
|
};
|
|
111
129
|
this.mediaRecorder.onstop = _e => {
|
|
130
|
+
if (store.debug)
|
|
131
|
+
console.log('stream | recordStream | onstop');
|
|
112
132
|
var rec = new Blob(this.recordedChunks, {
|
|
113
133
|
type: options.mimeType.split(';')[0],
|
|
114
134
|
});
|
|
@@ -139,6 +159,8 @@ export class Stream {
|
|
|
139
159
|
return !(this.stream && this.stream.getTracks && this.stream.getTracks().length > 0);
|
|
140
160
|
}
|
|
141
161
|
async takePhoto() {
|
|
162
|
+
if (store.debug)
|
|
163
|
+
console.log('stream | takePhoto');
|
|
142
164
|
const canvas = document.createElement('canvas');
|
|
143
165
|
canvas.style.visibility = 'hidden';
|
|
144
166
|
canvas.width = this.videoElement.videoWidth;
|
|
@@ -146,12 +168,16 @@ export class Stream {
|
|
|
146
168
|
return await this.getFrame(canvas);
|
|
147
169
|
}
|
|
148
170
|
getFrame(canvas) {
|
|
171
|
+
if (store.debug)
|
|
172
|
+
console.log('stream | getFrame');
|
|
149
173
|
return new Promise(resolve => {
|
|
150
174
|
const context = canvas.getContext('2d');
|
|
151
175
|
context.drawImage(this.videoElement, 0, 0, canvas.width, canvas.height);
|
|
152
176
|
canvas.toBlob((frame) => {
|
|
153
177
|
if (frame.type === ImageFormat.JPEG && !store.device.isAppleDevice) {
|
|
154
178
|
try {
|
|
179
|
+
if (store.debug)
|
|
180
|
+
console.log('stream | getFrame | addExifInImg');
|
|
155
181
|
addExifInImg(frame, this.stream.getTracks()[0], this.videoSize).then(updatedFrame => resolve(updatedFrame));
|
|
156
182
|
}
|
|
157
183
|
catch (e) {
|
|
@@ -160,6 +186,8 @@ export class Stream {
|
|
|
160
186
|
}
|
|
161
187
|
}
|
|
162
188
|
else {
|
|
189
|
+
if (store.debug)
|
|
190
|
+
console.log('stream | getFrame | resolve');
|
|
163
191
|
resolve(frame);
|
|
164
192
|
}
|
|
165
193
|
}, ImageFormat.PNG, 1);
|