@ekyc_qoobiss/qbs-ect-cmp 3.6.57 → 3.6.60
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-80c3bff8.js → TranslationUtils-fbb2c39c.js} +4 -5
- package/dist/cjs/agreement-check_17.cjs.entry.js +54 -13
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/components/common/capture-error/capture-error.js +2 -1
- package/dist/collection/components/common/id-capture/id-capture.js +3 -0
- package/dist/collection/components/flow/process-id/process-id.js +23 -5
- package/dist/collection/components/flow/user-liveness/user-liveness.js +25 -5
- package/dist/collection/helpers/ApiCall.js +4 -5
- package/dist/esm/{TranslationUtils-9c2605e3.js → TranslationUtils-32c06882.js} +4 -5
- package/dist/esm/agreement-check_17.entry.js +54 -13
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/{p-c31df575.entry.js → p-20c53edc.entry.js} +2 -2
- package/dist/qbs-ect-cmp/{p-8a07814a.js → p-601c9197.js} +1 -1
- package/dist/qbs-ect-cmp/{p-892507b7.entry.js → p-fc771dd3.entry.js} +1 -1
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/flow/process-id/process-id.d.ts +1 -0
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +1 -0
- package/dist/types/helpers/ApiCall.d.ts +2 -1
- package/dist/types/models/IAddRequest.d.ts +1 -0
- package/package.json +1 -1
|
@@ -496,6 +496,7 @@ class ApiCall {
|
|
|
496
496
|
state.phoneNumber = jsonResp.phoneNumber;
|
|
497
497
|
state.flowStatus = exports.FlowStatus[jsonResp.state];
|
|
498
498
|
state.logSteps = jsonResp.logSteps;
|
|
499
|
+
state.debug = jsonResp.debug;
|
|
499
500
|
return true;
|
|
500
501
|
}
|
|
501
502
|
async UploadFileForRequestB64(requestId, type, file) {
|
|
@@ -505,11 +506,9 @@ class ApiCall {
|
|
|
505
506
|
data: await this.toBase64(file),
|
|
506
507
|
};
|
|
507
508
|
let respJson = await this.post(this.urls.UploadCapture, JSON.stringify(data));
|
|
508
|
-
state.
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}
|
|
512
|
-
return true;
|
|
509
|
+
if (state.debug)
|
|
510
|
+
console.log(`apicall | uploadfileforrequestb64 | ${respJson}`);
|
|
511
|
+
return respJson;
|
|
513
512
|
}
|
|
514
513
|
async GetAgreement(agreementType) {
|
|
515
514
|
let resp = await this.get(this.urls.GetAgreement + '?type=' + agreementType + '&requestId=' + state.requestId);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-fbb2c39c.js');
|
|
7
7
|
|
|
8
8
|
const agreementCheckCss = "";
|
|
9
9
|
|
|
@@ -4754,7 +4754,7 @@ const CaptureError = class {
|
|
|
4754
4754
|
this.eventCaptureErrorDone.emit();
|
|
4755
4755
|
}
|
|
4756
4756
|
render() {
|
|
4757
|
-
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.titleR1), index.h("h1", { class: "color-red" }, this.titleR2), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), index.h("p", { class: "font-size-1" }, this.reason)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
4757
|
+
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.titleR1), index.h("h1", { class: "color-red" }, this.titleR2), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), TranslationUtils.state.debug ? index.h("p", { class: "font-size-1" }, this.reason) : null), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
4758
4758
|
}
|
|
4759
4759
|
};
|
|
4760
4760
|
CaptureError.style = captureErrorCss;
|
|
@@ -5063,6 +5063,9 @@ const IdCapture = class {
|
|
|
5063
5063
|
async openCamera() {
|
|
5064
5064
|
if (TranslationUtils.state.debug)
|
|
5065
5065
|
console.log('id-capture | openCamera');
|
|
5066
|
+
if (!TranslationUtils.state.cameraId) {
|
|
5067
|
+
await Cameras.InitCameras(TranslationUtils.state.device);
|
|
5068
|
+
}
|
|
5066
5069
|
const constraints = Cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
|
|
5067
5070
|
setTimeout(() => {
|
|
5068
5071
|
navigator.mediaDevices
|
|
@@ -5205,7 +5208,7 @@ function v4(options, buf, offset) {
|
|
|
5205
5208
|
}
|
|
5206
5209
|
|
|
5207
5210
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5208
|
-
const version$1 = "3.6.
|
|
5211
|
+
const version$1 = "3.6.60";
|
|
5209
5212
|
const description = "Person Identification Component";
|
|
5210
5213
|
const main = "./dist/index.cjs.js";
|
|
5211
5214
|
const module$1 = "./dist/index.js";
|
|
@@ -8685,6 +8688,8 @@ const ProcessId = class {
|
|
|
8685
8688
|
async captureIdImage(event) {
|
|
8686
8689
|
if (TranslationUtils.state.debug)
|
|
8687
8690
|
console.log('process-id | captureIdImage');
|
|
8691
|
+
if (this.mode == 'tilt')
|
|
8692
|
+
return;
|
|
8688
8693
|
let idPhoto = event.detail;
|
|
8689
8694
|
if (idPhoto.size == 0) {
|
|
8690
8695
|
if (TranslationUtils.state.debug)
|
|
@@ -8698,7 +8703,10 @@ const ProcessId = class {
|
|
|
8698
8703
|
var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.photoType, frontCapture);
|
|
8699
8704
|
if (TranslationUtils.state.debug)
|
|
8700
8705
|
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
8701
|
-
if (
|
|
8706
|
+
if (uploadResult.isValid) {
|
|
8707
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[uploadResult.state];
|
|
8708
|
+
}
|
|
8709
|
+
else {
|
|
8702
8710
|
this.switchCamera();
|
|
8703
8711
|
this.triggerErrorFlow();
|
|
8704
8712
|
}
|
|
@@ -8727,7 +8735,10 @@ const ProcessId = class {
|
|
|
8727
8735
|
var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.recType, captureRec);
|
|
8728
8736
|
if (TranslationUtils.state.debug)
|
|
8729
8737
|
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
8730
|
-
if (
|
|
8738
|
+
if (uploadResult.saved) {
|
|
8739
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[uploadResult.state];
|
|
8740
|
+
}
|
|
8741
|
+
else {
|
|
8731
8742
|
this.triggerErrorFlow();
|
|
8732
8743
|
}
|
|
8733
8744
|
this.recordingResultCount = 0;
|
|
@@ -8736,17 +8747,23 @@ const ProcessId = class {
|
|
|
8736
8747
|
if (TranslationUtils.state.debug)
|
|
8737
8748
|
console.log('process-id | verificationFinished');
|
|
8738
8749
|
this.verificationReceived = Date.now();
|
|
8739
|
-
|
|
8750
|
+
let initialStatus = TranslationUtils.state.flowStatus;
|
|
8751
|
+
let statusChanged = false;
|
|
8752
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
8740
8753
|
await delay(2000);
|
|
8754
|
+
statusChanged = initialStatus != TranslationUtils.state.flowStatus;
|
|
8755
|
+
}
|
|
8756
|
+
if (!statusChanged) {
|
|
8741
8757
|
let currentStatus = await TranslationUtils.ApiCall.instance.GetFlowState();
|
|
8742
8758
|
if (currentStatus != TranslationUtils.state.flowStatus) {
|
|
8743
8759
|
TranslationUtils.state.flowStatus = currentStatus;
|
|
8744
|
-
|
|
8760
|
+
}
|
|
8761
|
+
else {
|
|
8762
|
+
this.triggerUploadFailedFlow();
|
|
8745
8763
|
}
|
|
8746
8764
|
}
|
|
8747
8765
|
if (TranslationUtils.state.debug)
|
|
8748
8766
|
console.log('process-id | verificationFinished | waitingFinished ');
|
|
8749
|
-
this.triggerErrorFlow();
|
|
8750
8767
|
}
|
|
8751
8768
|
async componentDidLoad() {
|
|
8752
8769
|
if (TranslationUtils.state.debug)
|
|
@@ -8757,6 +8774,10 @@ const ProcessId = class {
|
|
|
8757
8774
|
this.errorReason = 'Invalid';
|
|
8758
8775
|
this.showInvalid = true;
|
|
8759
8776
|
}
|
|
8777
|
+
triggerUploadFailedFlow() {
|
|
8778
|
+
this.errorReason = 'Upload Failed';
|
|
8779
|
+
this.showInvalid = true;
|
|
8780
|
+
}
|
|
8760
8781
|
async disconnectedCallback() {
|
|
8761
8782
|
if (TranslationUtils.state.debug)
|
|
8762
8783
|
console.log('process-id | disconnectedCallback');
|
|
@@ -9071,7 +9092,10 @@ const UserLiveness = class {
|
|
|
9071
9092
|
try {
|
|
9072
9093
|
var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
9073
9094
|
let photoUploaded = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.photoType, uploadPhoto);
|
|
9074
|
-
if (
|
|
9095
|
+
if (photoUploaded.isValid) {
|
|
9096
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[photoUploaded.state];
|
|
9097
|
+
}
|
|
9098
|
+
else {
|
|
9075
9099
|
this.triggerErrorFlow();
|
|
9076
9100
|
}
|
|
9077
9101
|
}
|
|
@@ -9095,7 +9119,10 @@ const UserLiveness = class {
|
|
|
9095
9119
|
try {
|
|
9096
9120
|
let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
9097
9121
|
let uplodDone = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.recType, uploadRec);
|
|
9098
|
-
if (
|
|
9122
|
+
if (uplodDone.saved) {
|
|
9123
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[uplodDone.state];
|
|
9124
|
+
}
|
|
9125
|
+
else {
|
|
9099
9126
|
this.triggerErrorFlow();
|
|
9100
9127
|
}
|
|
9101
9128
|
}
|
|
@@ -9110,16 +9137,26 @@ const UserLiveness = class {
|
|
|
9110
9137
|
}
|
|
9111
9138
|
}
|
|
9112
9139
|
async verificationFinished() {
|
|
9140
|
+
if (TranslationUtils.state.debug)
|
|
9141
|
+
console.log('user-liveness | verificationFinished');
|
|
9113
9142
|
this.verificationReceived = Date.now();
|
|
9114
|
-
|
|
9143
|
+
let initialStatus = TranslationUtils.state.flowStatus;
|
|
9144
|
+
let statusChanged = false;
|
|
9145
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
9115
9146
|
await delay(2000);
|
|
9147
|
+
statusChanged = initialStatus != TranslationUtils.state.flowStatus;
|
|
9148
|
+
}
|
|
9149
|
+
if (!statusChanged) {
|
|
9116
9150
|
let currentStatus = await TranslationUtils.ApiCall.instance.GetFlowState();
|
|
9117
9151
|
if (currentStatus != TranslationUtils.state.flowStatus) {
|
|
9118
9152
|
TranslationUtils.state.flowStatus = currentStatus;
|
|
9119
|
-
|
|
9153
|
+
}
|
|
9154
|
+
else {
|
|
9155
|
+
this.triggerUploadFailedFlow();
|
|
9120
9156
|
}
|
|
9121
9157
|
}
|
|
9122
|
-
|
|
9158
|
+
if (TranslationUtils.state.debug)
|
|
9159
|
+
console.log('user-liveness | verificationFinished | waitingFinished ');
|
|
9123
9160
|
}
|
|
9124
9161
|
async disconnectedCallback() {
|
|
9125
9162
|
await BaseComponent.finalize(this.currentStep);
|
|
@@ -9128,6 +9165,10 @@ const UserLiveness = class {
|
|
|
9128
9165
|
this.errorReason = 'Invalid';
|
|
9129
9166
|
this.showError = true;
|
|
9130
9167
|
}
|
|
9168
|
+
triggerUploadFailedFlow() {
|
|
9169
|
+
this.errorReason = 'Upload Failed';
|
|
9170
|
+
this.showError = true;
|
|
9171
|
+
}
|
|
9131
9172
|
render() {
|
|
9132
9173
|
let howTo = index.h("how-to-info", null);
|
|
9133
9174
|
let capture = index.h("selfie-capture", null);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-fbb2c39c.js');
|
|
7
7
|
|
|
8
8
|
const randomActionsCss = "";
|
|
9
9
|
|
|
@@ -3,6 +3,7 @@ import { delay } from '../../../utils/utils';
|
|
|
3
3
|
import { BaseComponent } from '../../base-component';
|
|
4
4
|
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
5
5
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
6
|
+
import store from '../../../helpers/store';
|
|
6
7
|
export class CaptureError {
|
|
7
8
|
constructor() { this.type = undefined; this.reason = undefined; this.buttonEnabled = undefined; this.buttonText = undefined; }
|
|
8
9
|
async componentWillLoad() {
|
|
@@ -36,7 +37,7 @@ export class CaptureError {
|
|
|
36
37
|
this.eventCaptureErrorDone.emit();
|
|
37
38
|
}
|
|
38
39
|
render() {
|
|
39
|
-
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.titleR1), h("h1", { class: "color-red" }, this.titleR2), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), h("p", { class: "font-size-1" }, this.reason)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
40
|
+
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.titleR1), h("h1", { class: "color-red" }, this.titleR2), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), store.debug ? h("p", { class: "font-size-1" }, this.reason) : null), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
40
41
|
}
|
|
41
42
|
static get is() { return "capture-error"; }
|
|
42
43
|
static get originalStyleUrls() {
|
|
@@ -80,6 +80,9 @@ export class IdCapture {
|
|
|
80
80
|
async openCamera() {
|
|
81
81
|
if (store.debug)
|
|
82
82
|
console.log('id-capture | openCamera');
|
|
83
|
+
if (!store.cameraId) {
|
|
84
|
+
await Cameras.InitCameras(store.device);
|
|
85
|
+
}
|
|
83
86
|
const constraints = Cameras.GetConstraints(store.cameraId, store.device);
|
|
84
87
|
setTimeout(() => {
|
|
85
88
|
navigator.mediaDevices
|
|
@@ -79,6 +79,8 @@ export class ProcessId {
|
|
|
79
79
|
async captureIdImage(event) {
|
|
80
80
|
if (store.debug)
|
|
81
81
|
console.log('process-id | captureIdImage');
|
|
82
|
+
if (this.mode == 'tilt')
|
|
83
|
+
return;
|
|
82
84
|
let idPhoto = event.detail;
|
|
83
85
|
if (idPhoto.size == 0) {
|
|
84
86
|
if (store.debug)
|
|
@@ -92,7 +94,10 @@ export class ProcessId {
|
|
|
92
94
|
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.photoType, frontCapture);
|
|
93
95
|
if (store.debug)
|
|
94
96
|
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
95
|
-
if (
|
|
97
|
+
if (uploadResult.isValid) {
|
|
98
|
+
store.flowStatus = FlowStatus[uploadResult.state];
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
96
101
|
this.switchCamera();
|
|
97
102
|
this.triggerErrorFlow();
|
|
98
103
|
}
|
|
@@ -121,7 +126,10 @@ export class ProcessId {
|
|
|
121
126
|
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.recType, captureRec);
|
|
122
127
|
if (store.debug)
|
|
123
128
|
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
124
|
-
if (
|
|
129
|
+
if (uploadResult.saved) {
|
|
130
|
+
store.flowStatus = FlowStatus[uploadResult.state];
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
125
133
|
this.triggerErrorFlow();
|
|
126
134
|
}
|
|
127
135
|
this.recordingResultCount = 0;
|
|
@@ -130,17 +138,23 @@ export class ProcessId {
|
|
|
130
138
|
if (store.debug)
|
|
131
139
|
console.log('process-id | verificationFinished');
|
|
132
140
|
this.verificationReceived = Date.now();
|
|
133
|
-
|
|
141
|
+
let initialStatus = store.flowStatus;
|
|
142
|
+
let statusChanged = false;
|
|
143
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
134
144
|
await delay(2000);
|
|
145
|
+
statusChanged = initialStatus != store.flowStatus;
|
|
146
|
+
}
|
|
147
|
+
if (!statusChanged) {
|
|
135
148
|
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
136
149
|
if (currentStatus != store.flowStatus) {
|
|
137
150
|
store.flowStatus = currentStatus;
|
|
138
|
-
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this.triggerUploadFailedFlow();
|
|
139
154
|
}
|
|
140
155
|
}
|
|
141
156
|
if (store.debug)
|
|
142
157
|
console.log('process-id | verificationFinished | waitingFinished ');
|
|
143
|
-
this.triggerErrorFlow();
|
|
144
158
|
}
|
|
145
159
|
async componentDidLoad() {
|
|
146
160
|
if (store.debug)
|
|
@@ -151,6 +165,10 @@ export class ProcessId {
|
|
|
151
165
|
this.errorReason = 'Invalid';
|
|
152
166
|
this.showInvalid = true;
|
|
153
167
|
}
|
|
168
|
+
triggerUploadFailedFlow() {
|
|
169
|
+
this.errorReason = 'Upload Failed';
|
|
170
|
+
this.showInvalid = true;
|
|
171
|
+
}
|
|
154
172
|
async disconnectedCallback() {
|
|
155
173
|
if (store.debug)
|
|
156
174
|
console.log('process-id | disconnectedCallback');
|
|
@@ -71,7 +71,10 @@ export class UserLiveness {
|
|
|
71
71
|
try {
|
|
72
72
|
var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
73
73
|
let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.photoType, uploadPhoto);
|
|
74
|
-
if (
|
|
74
|
+
if (photoUploaded.isValid) {
|
|
75
|
+
store.flowStatus = FlowStatus[photoUploaded.state];
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
75
78
|
this.triggerErrorFlow();
|
|
76
79
|
}
|
|
77
80
|
}
|
|
@@ -95,7 +98,10 @@ export class UserLiveness {
|
|
|
95
98
|
try {
|
|
96
99
|
let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
97
100
|
let uplodDone = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.recType, uploadRec);
|
|
98
|
-
if (
|
|
101
|
+
if (uplodDone.saved) {
|
|
102
|
+
store.flowStatus = FlowStatus[uplodDone.state];
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
99
105
|
this.triggerErrorFlow();
|
|
100
106
|
}
|
|
101
107
|
}
|
|
@@ -110,16 +116,26 @@ export class UserLiveness {
|
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
async verificationFinished() {
|
|
119
|
+
if (store.debug)
|
|
120
|
+
console.log('user-liveness | verificationFinished');
|
|
113
121
|
this.verificationReceived = Date.now();
|
|
114
|
-
|
|
122
|
+
let initialStatus = store.flowStatus;
|
|
123
|
+
let statusChanged = false;
|
|
124
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
115
125
|
await delay(2000);
|
|
126
|
+
statusChanged = initialStatus != store.flowStatus;
|
|
127
|
+
}
|
|
128
|
+
if (!statusChanged) {
|
|
116
129
|
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
117
130
|
if (currentStatus != store.flowStatus) {
|
|
118
131
|
store.flowStatus = currentStatus;
|
|
119
|
-
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
this.triggerUploadFailedFlow();
|
|
120
135
|
}
|
|
121
136
|
}
|
|
122
|
-
|
|
137
|
+
if (store.debug)
|
|
138
|
+
console.log('user-liveness | verificationFinished | waitingFinished ');
|
|
123
139
|
}
|
|
124
140
|
async disconnectedCallback() {
|
|
125
141
|
await BaseComponent.finalize(this.currentStep);
|
|
@@ -128,6 +144,10 @@ export class UserLiveness {
|
|
|
128
144
|
this.errorReason = 'Invalid';
|
|
129
145
|
this.showError = true;
|
|
130
146
|
}
|
|
147
|
+
triggerUploadFailedFlow() {
|
|
148
|
+
this.errorReason = 'Upload Failed';
|
|
149
|
+
this.showError = true;
|
|
150
|
+
}
|
|
131
151
|
render() {
|
|
132
152
|
let howTo = h("how-to-info", null);
|
|
133
153
|
let capture = h("selfie-capture", null);
|
|
@@ -165,6 +165,7 @@ export class ApiCall {
|
|
|
165
165
|
store.phoneNumber = jsonResp.phoneNumber;
|
|
166
166
|
store.flowStatus = FlowStatus[jsonResp.state];
|
|
167
167
|
store.logSteps = jsonResp.logSteps;
|
|
168
|
+
store.debug = jsonResp.debug;
|
|
168
169
|
return true;
|
|
169
170
|
}
|
|
170
171
|
async UploadFileForRequestB64(requestId, type, file) {
|
|
@@ -174,11 +175,9 @@ export class ApiCall {
|
|
|
174
175
|
data: await this.toBase64(file),
|
|
175
176
|
};
|
|
176
177
|
let respJson = await this.post(this.urls.UploadCapture, JSON.stringify(data));
|
|
177
|
-
store.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
return true;
|
|
178
|
+
if (store.debug)
|
|
179
|
+
console.log(`apicall | uploadfileforrequestb64 | ${respJson}`);
|
|
180
|
+
return respJson;
|
|
182
181
|
}
|
|
183
182
|
async GetAgreement(agreementType) {
|
|
184
183
|
let resp = await this.get(this.urls.GetAgreement + '?type=' + agreementType + '&requestId=' + store.requestId);
|
|
@@ -494,6 +494,7 @@ class ApiCall {
|
|
|
494
494
|
state.phoneNumber = jsonResp.phoneNumber;
|
|
495
495
|
state.flowStatus = FlowStatus[jsonResp.state];
|
|
496
496
|
state.logSteps = jsonResp.logSteps;
|
|
497
|
+
state.debug = jsonResp.debug;
|
|
497
498
|
return true;
|
|
498
499
|
}
|
|
499
500
|
async UploadFileForRequestB64(requestId, type, file) {
|
|
@@ -503,11 +504,9 @@ class ApiCall {
|
|
|
503
504
|
data: await this.toBase64(file),
|
|
504
505
|
};
|
|
505
506
|
let respJson = await this.post(this.urls.UploadCapture, JSON.stringify(data));
|
|
506
|
-
state.
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
}
|
|
510
|
-
return true;
|
|
507
|
+
if (state.debug)
|
|
508
|
+
console.log(`apicall | uploadfileforrequestb64 | ${respJson}`);
|
|
509
|
+
return respJson;
|
|
511
510
|
}
|
|
512
511
|
async GetAgreement(agreementType) {
|
|
513
512
|
let resp = await this.get(this.urls.GetAgreement + '?type=' + agreementType + '&requestId=' + state.requestId);
|
|
@@ -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-32c06882.js';
|
|
3
3
|
|
|
4
4
|
const agreementCheckCss = "";
|
|
5
5
|
|
|
@@ -4750,7 +4750,7 @@ const CaptureError = class {
|
|
|
4750
4750
|
this.eventCaptureErrorDone.emit();
|
|
4751
4751
|
}
|
|
4752
4752
|
render() {
|
|
4753
|
-
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.titleR1), h("h1", { class: "color-red" }, this.titleR2), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), h("p", { class: "font-size-1" }, this.reason)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
4753
|
+
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.titleR1), h("h1", { class: "color-red" }, this.titleR2), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), state.debug ? h("p", { class: "font-size-1" }, this.reason) : null), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
4754
4754
|
}
|
|
4755
4755
|
};
|
|
4756
4756
|
CaptureError.style = captureErrorCss;
|
|
@@ -5059,6 +5059,9 @@ const IdCapture = class {
|
|
|
5059
5059
|
async openCamera() {
|
|
5060
5060
|
if (state.debug)
|
|
5061
5061
|
console.log('id-capture | openCamera');
|
|
5062
|
+
if (!state.cameraId) {
|
|
5063
|
+
await Cameras.InitCameras(state.device);
|
|
5064
|
+
}
|
|
5062
5065
|
const constraints = Cameras.GetConstraints(state.cameraId, state.device);
|
|
5063
5066
|
setTimeout(() => {
|
|
5064
5067
|
navigator.mediaDevices
|
|
@@ -5201,7 +5204,7 @@ function v4(options, buf, offset) {
|
|
|
5201
5204
|
}
|
|
5202
5205
|
|
|
5203
5206
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5204
|
-
const version$1 = "3.6.
|
|
5207
|
+
const version$1 = "3.6.60";
|
|
5205
5208
|
const description = "Person Identification Component";
|
|
5206
5209
|
const main = "./dist/index.cjs.js";
|
|
5207
5210
|
const module = "./dist/index.js";
|
|
@@ -8681,6 +8684,8 @@ const ProcessId = class {
|
|
|
8681
8684
|
async captureIdImage(event) {
|
|
8682
8685
|
if (state.debug)
|
|
8683
8686
|
console.log('process-id | captureIdImage');
|
|
8687
|
+
if (this.mode == 'tilt')
|
|
8688
|
+
return;
|
|
8684
8689
|
let idPhoto = event.detail;
|
|
8685
8690
|
if (idPhoto.size == 0) {
|
|
8686
8691
|
if (state.debug)
|
|
@@ -8694,7 +8699,10 @@ const ProcessId = class {
|
|
|
8694
8699
|
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.photoType, frontCapture);
|
|
8695
8700
|
if (state.debug)
|
|
8696
8701
|
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
8697
|
-
if (
|
|
8702
|
+
if (uploadResult.isValid) {
|
|
8703
|
+
state.flowStatus = FlowStatus[uploadResult.state];
|
|
8704
|
+
}
|
|
8705
|
+
else {
|
|
8698
8706
|
this.switchCamera();
|
|
8699
8707
|
this.triggerErrorFlow();
|
|
8700
8708
|
}
|
|
@@ -8723,7 +8731,10 @@ const ProcessId = class {
|
|
|
8723
8731
|
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.recType, captureRec);
|
|
8724
8732
|
if (state.debug)
|
|
8725
8733
|
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
8726
|
-
if (
|
|
8734
|
+
if (uploadResult.saved) {
|
|
8735
|
+
state.flowStatus = FlowStatus[uploadResult.state];
|
|
8736
|
+
}
|
|
8737
|
+
else {
|
|
8727
8738
|
this.triggerErrorFlow();
|
|
8728
8739
|
}
|
|
8729
8740
|
this.recordingResultCount = 0;
|
|
@@ -8732,17 +8743,23 @@ const ProcessId = class {
|
|
|
8732
8743
|
if (state.debug)
|
|
8733
8744
|
console.log('process-id | verificationFinished');
|
|
8734
8745
|
this.verificationReceived = Date.now();
|
|
8735
|
-
|
|
8746
|
+
let initialStatus = state.flowStatus;
|
|
8747
|
+
let statusChanged = false;
|
|
8748
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
8736
8749
|
await delay(2000);
|
|
8750
|
+
statusChanged = initialStatus != state.flowStatus;
|
|
8751
|
+
}
|
|
8752
|
+
if (!statusChanged) {
|
|
8737
8753
|
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
8738
8754
|
if (currentStatus != state.flowStatus) {
|
|
8739
8755
|
state.flowStatus = currentStatus;
|
|
8740
|
-
|
|
8756
|
+
}
|
|
8757
|
+
else {
|
|
8758
|
+
this.triggerUploadFailedFlow();
|
|
8741
8759
|
}
|
|
8742
8760
|
}
|
|
8743
8761
|
if (state.debug)
|
|
8744
8762
|
console.log('process-id | verificationFinished | waitingFinished ');
|
|
8745
|
-
this.triggerErrorFlow();
|
|
8746
8763
|
}
|
|
8747
8764
|
async componentDidLoad() {
|
|
8748
8765
|
if (state.debug)
|
|
@@ -8753,6 +8770,10 @@ const ProcessId = class {
|
|
|
8753
8770
|
this.errorReason = 'Invalid';
|
|
8754
8771
|
this.showInvalid = true;
|
|
8755
8772
|
}
|
|
8773
|
+
triggerUploadFailedFlow() {
|
|
8774
|
+
this.errorReason = 'Upload Failed';
|
|
8775
|
+
this.showInvalid = true;
|
|
8776
|
+
}
|
|
8756
8777
|
async disconnectedCallback() {
|
|
8757
8778
|
if (state.debug)
|
|
8758
8779
|
console.log('process-id | disconnectedCallback');
|
|
@@ -9067,7 +9088,10 @@ const UserLiveness = class {
|
|
|
9067
9088
|
try {
|
|
9068
9089
|
var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
9069
9090
|
let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.photoType, uploadPhoto);
|
|
9070
|
-
if (
|
|
9091
|
+
if (photoUploaded.isValid) {
|
|
9092
|
+
state.flowStatus = FlowStatus[photoUploaded.state];
|
|
9093
|
+
}
|
|
9094
|
+
else {
|
|
9071
9095
|
this.triggerErrorFlow();
|
|
9072
9096
|
}
|
|
9073
9097
|
}
|
|
@@ -9091,7 +9115,10 @@ const UserLiveness = class {
|
|
|
9091
9115
|
try {
|
|
9092
9116
|
let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
9093
9117
|
let uplodDone = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.recType, uploadRec);
|
|
9094
|
-
if (
|
|
9118
|
+
if (uplodDone.saved) {
|
|
9119
|
+
state.flowStatus = FlowStatus[uplodDone.state];
|
|
9120
|
+
}
|
|
9121
|
+
else {
|
|
9095
9122
|
this.triggerErrorFlow();
|
|
9096
9123
|
}
|
|
9097
9124
|
}
|
|
@@ -9106,16 +9133,26 @@ const UserLiveness = class {
|
|
|
9106
9133
|
}
|
|
9107
9134
|
}
|
|
9108
9135
|
async verificationFinished() {
|
|
9136
|
+
if (state.debug)
|
|
9137
|
+
console.log('user-liveness | verificationFinished');
|
|
9109
9138
|
this.verificationReceived = Date.now();
|
|
9110
|
-
|
|
9139
|
+
let initialStatus = state.flowStatus;
|
|
9140
|
+
let statusChanged = false;
|
|
9141
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
9111
9142
|
await delay(2000);
|
|
9143
|
+
statusChanged = initialStatus != state.flowStatus;
|
|
9144
|
+
}
|
|
9145
|
+
if (!statusChanged) {
|
|
9112
9146
|
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
9113
9147
|
if (currentStatus != state.flowStatus) {
|
|
9114
9148
|
state.flowStatus = currentStatus;
|
|
9115
|
-
|
|
9149
|
+
}
|
|
9150
|
+
else {
|
|
9151
|
+
this.triggerUploadFailedFlow();
|
|
9116
9152
|
}
|
|
9117
9153
|
}
|
|
9118
|
-
|
|
9154
|
+
if (state.debug)
|
|
9155
|
+
console.log('user-liveness | verificationFinished | waitingFinished ');
|
|
9119
9156
|
}
|
|
9120
9157
|
async disconnectedCallback() {
|
|
9121
9158
|
await BaseComponent.finalize(this.currentStep);
|
|
@@ -9124,6 +9161,10 @@ const UserLiveness = class {
|
|
|
9124
9161
|
this.errorReason = 'Invalid';
|
|
9125
9162
|
this.showError = true;
|
|
9126
9163
|
}
|
|
9164
|
+
triggerUploadFailedFlow() {
|
|
9165
|
+
this.errorReason = 'Upload Failed';
|
|
9166
|
+
this.showError = true;
|
|
9167
|
+
}
|
|
9127
9168
|
render() {
|
|
9128
9169
|
let howTo = h("how-to-info", null);
|
|
9129
9170
|
let capture = h("selfie-capture", null);
|