@ekyc_qoobiss/qbs-ect-cmp 3.6.58 → 3.6.61
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 +73 -17
- 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/flow/process-id/process-id.js +28 -7
- package/dist/collection/components/flow/user-liveness/user-liveness.js +30 -7
- package/dist/collection/components/identification-component/identification-component.js +12 -0
- 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 +73 -17
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/{p-8a07814a.js → p-601c9197.js} +1 -1
- package/dist/qbs-ect-cmp/{p-705cdf0b.entry.js → p-9091de00.entry.js} +2 -2
- 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;
|
|
@@ -5208,7 +5208,7 @@ function v4(options, buf, offset) {
|
|
|
5208
5208
|
}
|
|
5209
5209
|
|
|
5210
5210
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5211
|
-
const version$1 = "3.6.
|
|
5211
|
+
const version$1 = "3.6.61";
|
|
5212
5212
|
const description = "Person Identification Component";
|
|
5213
5213
|
const main = "./dist/index.cjs.js";
|
|
5214
5214
|
const module$1 = "./dist/index.js";
|
|
@@ -5539,21 +5539,33 @@ const IdentificationComponent = class {
|
|
|
5539
5539
|
currentBlock = index.h("sms-code-validation", null);
|
|
5540
5540
|
}
|
|
5541
5541
|
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDFRONT) {
|
|
5542
|
+
if (TranslationUtils.state.debug)
|
|
5543
|
+
console.log('identification-component | render | IDFRONT');
|
|
5542
5544
|
currentBlock = index.h("process-id", { mode: "front" });
|
|
5543
5545
|
}
|
|
5544
5546
|
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
|
|
5547
|
+
if (TranslationUtils.state.debug)
|
|
5548
|
+
console.log('identification-component | render | IDBACK');
|
|
5545
5549
|
currentBlock = index.h("process-id", { mode: "back" });
|
|
5546
5550
|
}
|
|
5547
5551
|
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDTILT) {
|
|
5552
|
+
if (TranslationUtils.state.debug)
|
|
5553
|
+
console.log('identification-component | render | TILT');
|
|
5548
5554
|
currentBlock = index.h("process-id", { mode: "tilt" });
|
|
5549
5555
|
}
|
|
5550
5556
|
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
|
|
5557
|
+
if (TranslationUtils.state.debug)
|
|
5558
|
+
console.log('identification-component | render | LIVENESS');
|
|
5551
5559
|
currentBlock = index.h("user-liveness", { mode: "selfie" });
|
|
5552
5560
|
}
|
|
5553
5561
|
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESSGESTURE) {
|
|
5562
|
+
if (TranslationUtils.state.debug)
|
|
5563
|
+
console.log('identification-component | render | LIVENESSGESTURE');
|
|
5554
5564
|
currentBlock = index.h("user-liveness", { mode: "selfieGesture" });
|
|
5555
5565
|
}
|
|
5556
5566
|
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.COMPLETE) {
|
|
5567
|
+
if (TranslationUtils.state.debug)
|
|
5568
|
+
console.log('identification-component | render | COMPLETE');
|
|
5557
5569
|
currentBlock = index.h("end-redirect", null);
|
|
5558
5570
|
}
|
|
5559
5571
|
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.ERROREND) {
|
|
@@ -8688,6 +8700,8 @@ const ProcessId = class {
|
|
|
8688
8700
|
async captureIdImage(event) {
|
|
8689
8701
|
if (TranslationUtils.state.debug)
|
|
8690
8702
|
console.log('process-id | captureIdImage');
|
|
8703
|
+
if (this.mode == 'tilt')
|
|
8704
|
+
return;
|
|
8691
8705
|
let idPhoto = event.detail;
|
|
8692
8706
|
if (idPhoto.size == 0) {
|
|
8693
8707
|
if (TranslationUtils.state.debug)
|
|
@@ -8701,7 +8715,10 @@ const ProcessId = class {
|
|
|
8701
8715
|
var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.photoType, frontCapture);
|
|
8702
8716
|
if (TranslationUtils.state.debug)
|
|
8703
8717
|
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
8704
|
-
if (
|
|
8718
|
+
if (uploadResult.isValid) {
|
|
8719
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[uploadResult.state];
|
|
8720
|
+
}
|
|
8721
|
+
else {
|
|
8705
8722
|
this.switchCamera();
|
|
8706
8723
|
this.triggerErrorFlow();
|
|
8707
8724
|
}
|
|
@@ -8730,7 +8747,10 @@ const ProcessId = class {
|
|
|
8730
8747
|
var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.recType, captureRec);
|
|
8731
8748
|
if (TranslationUtils.state.debug)
|
|
8732
8749
|
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
8733
|
-
if (
|
|
8750
|
+
if (uploadResult.saved) {
|
|
8751
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[uploadResult.state];
|
|
8752
|
+
}
|
|
8753
|
+
else {
|
|
8734
8754
|
this.triggerErrorFlow();
|
|
8735
8755
|
}
|
|
8736
8756
|
this.recordingResultCount = 0;
|
|
@@ -8739,17 +8759,26 @@ const ProcessId = class {
|
|
|
8739
8759
|
if (TranslationUtils.state.debug)
|
|
8740
8760
|
console.log('process-id | verificationFinished');
|
|
8741
8761
|
this.verificationReceived = Date.now();
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8762
|
+
let initialStatus = TranslationUtils.state.flowStatus;
|
|
8763
|
+
let statusChanged = false;
|
|
8764
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
8765
|
+
await delay(1000);
|
|
8766
|
+
statusChanged = initialStatus != TranslationUtils.state.flowStatus;
|
|
8767
|
+
}
|
|
8768
|
+
let currentStatus = await TranslationUtils.ApiCall.instance.GetFlowState();
|
|
8769
|
+
if (statusChanged) {
|
|
8770
|
+
TranslationUtils.state.flowStatus = currentStatus;
|
|
8771
|
+
}
|
|
8772
|
+
else {
|
|
8745
8773
|
if (currentStatus != TranslationUtils.state.flowStatus) {
|
|
8746
8774
|
TranslationUtils.state.flowStatus = currentStatus;
|
|
8747
|
-
|
|
8775
|
+
}
|
|
8776
|
+
else {
|
|
8777
|
+
this.triggerUploadFailedFlow();
|
|
8748
8778
|
}
|
|
8749
8779
|
}
|
|
8750
8780
|
if (TranslationUtils.state.debug)
|
|
8751
8781
|
console.log('process-id | verificationFinished | waitingFinished ');
|
|
8752
|
-
this.triggerErrorFlow();
|
|
8753
8782
|
}
|
|
8754
8783
|
async componentDidLoad() {
|
|
8755
8784
|
if (TranslationUtils.state.debug)
|
|
@@ -8760,6 +8789,10 @@ const ProcessId = class {
|
|
|
8760
8789
|
this.errorReason = 'Invalid';
|
|
8761
8790
|
this.showInvalid = true;
|
|
8762
8791
|
}
|
|
8792
|
+
triggerUploadFailedFlow() {
|
|
8793
|
+
this.errorReason = 'Upload Failed';
|
|
8794
|
+
this.showInvalid = true;
|
|
8795
|
+
}
|
|
8763
8796
|
async disconnectedCallback() {
|
|
8764
8797
|
if (TranslationUtils.state.debug)
|
|
8765
8798
|
console.log('process-id | disconnectedCallback');
|
|
@@ -9074,7 +9107,10 @@ const UserLiveness = class {
|
|
|
9074
9107
|
try {
|
|
9075
9108
|
var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
9076
9109
|
let photoUploaded = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.photoType, uploadPhoto);
|
|
9077
|
-
if (
|
|
9110
|
+
if (photoUploaded.isValid) {
|
|
9111
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[photoUploaded.state];
|
|
9112
|
+
}
|
|
9113
|
+
else {
|
|
9078
9114
|
this.triggerErrorFlow();
|
|
9079
9115
|
}
|
|
9080
9116
|
}
|
|
@@ -9098,7 +9134,10 @@ const UserLiveness = class {
|
|
|
9098
9134
|
try {
|
|
9099
9135
|
let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
9100
9136
|
let uplodDone = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.recType, uploadRec);
|
|
9101
|
-
if (
|
|
9137
|
+
if (uplodDone.saved) {
|
|
9138
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[uplodDone.state];
|
|
9139
|
+
}
|
|
9140
|
+
else {
|
|
9102
9141
|
this.triggerErrorFlow();
|
|
9103
9142
|
}
|
|
9104
9143
|
}
|
|
@@ -9113,16 +9152,29 @@ const UserLiveness = class {
|
|
|
9113
9152
|
}
|
|
9114
9153
|
}
|
|
9115
9154
|
async verificationFinished() {
|
|
9155
|
+
if (TranslationUtils.state.debug)
|
|
9156
|
+
console.log('user-liveness | verificationFinished');
|
|
9116
9157
|
this.verificationReceived = Date.now();
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9158
|
+
let initialStatus = TranslationUtils.state.flowStatus;
|
|
9159
|
+
let statusChanged = false;
|
|
9160
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
9161
|
+
await delay(1000);
|
|
9162
|
+
statusChanged = initialStatus != TranslationUtils.state.flowStatus;
|
|
9163
|
+
}
|
|
9164
|
+
let currentStatus = await TranslationUtils.ApiCall.instance.GetFlowState();
|
|
9165
|
+
if (statusChanged) {
|
|
9166
|
+
TranslationUtils.state.flowStatus = currentStatus;
|
|
9167
|
+
}
|
|
9168
|
+
else {
|
|
9120
9169
|
if (currentStatus != TranslationUtils.state.flowStatus) {
|
|
9121
9170
|
TranslationUtils.state.flowStatus = currentStatus;
|
|
9122
|
-
|
|
9171
|
+
}
|
|
9172
|
+
else {
|
|
9173
|
+
this.triggerUploadFailedFlow();
|
|
9123
9174
|
}
|
|
9124
9175
|
}
|
|
9125
|
-
|
|
9176
|
+
if (TranslationUtils.state.debug)
|
|
9177
|
+
console.log('user-liveness | verificationFinished | waitingFinished ');
|
|
9126
9178
|
}
|
|
9127
9179
|
async disconnectedCallback() {
|
|
9128
9180
|
await BaseComponent.finalize(this.currentStep);
|
|
@@ -9131,6 +9183,10 @@ const UserLiveness = class {
|
|
|
9131
9183
|
this.errorReason = 'Invalid';
|
|
9132
9184
|
this.showError = true;
|
|
9133
9185
|
}
|
|
9186
|
+
triggerUploadFailedFlow() {
|
|
9187
|
+
this.errorReason = 'Upload Failed';
|
|
9188
|
+
this.showError = true;
|
|
9189
|
+
}
|
|
9134
9190
|
render() {
|
|
9135
9191
|
let howTo = index.h("how-to-info", null);
|
|
9136
9192
|
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() {
|
|
@@ -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,26 @@ export class ProcessId {
|
|
|
130
138
|
if (store.debug)
|
|
131
139
|
console.log('process-id | verificationFinished');
|
|
132
140
|
this.verificationReceived = Date.now();
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
let initialStatus = store.flowStatus;
|
|
142
|
+
let statusChanged = false;
|
|
143
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
144
|
+
await delay(1000);
|
|
145
|
+
statusChanged = initialStatus != store.flowStatus;
|
|
146
|
+
}
|
|
147
|
+
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
148
|
+
if (statusChanged) {
|
|
149
|
+
store.flowStatus = currentStatus;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
136
152
|
if (currentStatus != store.flowStatus) {
|
|
137
153
|
store.flowStatus = currentStatus;
|
|
138
|
-
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
this.triggerUploadFailedFlow();
|
|
139
157
|
}
|
|
140
158
|
}
|
|
141
159
|
if (store.debug)
|
|
142
160
|
console.log('process-id | verificationFinished | waitingFinished ');
|
|
143
|
-
this.triggerErrorFlow();
|
|
144
161
|
}
|
|
145
162
|
async componentDidLoad() {
|
|
146
163
|
if (store.debug)
|
|
@@ -151,6 +168,10 @@ export class ProcessId {
|
|
|
151
168
|
this.errorReason = 'Invalid';
|
|
152
169
|
this.showInvalid = true;
|
|
153
170
|
}
|
|
171
|
+
triggerUploadFailedFlow() {
|
|
172
|
+
this.errorReason = 'Upload Failed';
|
|
173
|
+
this.showInvalid = true;
|
|
174
|
+
}
|
|
154
175
|
async disconnectedCallback() {
|
|
155
176
|
if (store.debug)
|
|
156
177
|
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,29 @@ 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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
let initialStatus = store.flowStatus;
|
|
123
|
+
let statusChanged = false;
|
|
124
|
+
while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
|
|
125
|
+
await delay(1000);
|
|
126
|
+
statusChanged = initialStatus != store.flowStatus;
|
|
127
|
+
}
|
|
128
|
+
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
129
|
+
if (statusChanged) {
|
|
130
|
+
store.flowStatus = currentStatus;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
117
133
|
if (currentStatus != store.flowStatus) {
|
|
118
134
|
store.flowStatus = currentStatus;
|
|
119
|
-
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.triggerUploadFailedFlow();
|
|
120
138
|
}
|
|
121
139
|
}
|
|
122
|
-
|
|
140
|
+
if (store.debug)
|
|
141
|
+
console.log('user-liveness | verificationFinished | waitingFinished ');
|
|
123
142
|
}
|
|
124
143
|
async disconnectedCallback() {
|
|
125
144
|
await BaseComponent.finalize(this.currentStep);
|
|
@@ -128,6 +147,10 @@ export class UserLiveness {
|
|
|
128
147
|
this.errorReason = 'Invalid';
|
|
129
148
|
this.showError = true;
|
|
130
149
|
}
|
|
150
|
+
triggerUploadFailedFlow() {
|
|
151
|
+
this.errorReason = 'Upload Failed';
|
|
152
|
+
this.showError = true;
|
|
153
|
+
}
|
|
131
154
|
render() {
|
|
132
155
|
let howTo = h("how-to-info", null);
|
|
133
156
|
let capture = h("selfie-capture", null);
|
|
@@ -190,21 +190,33 @@ export class IdentificationComponent {
|
|
|
190
190
|
currentBlock = h("sms-code-validation", null);
|
|
191
191
|
}
|
|
192
192
|
else if (store.flowStatus == FlowStatus.IDFRONT) {
|
|
193
|
+
if (store.debug)
|
|
194
|
+
console.log('identification-component | render | IDFRONT');
|
|
193
195
|
currentBlock = h("process-id", { mode: "front" });
|
|
194
196
|
}
|
|
195
197
|
else if (store.flowStatus == FlowStatus.IDBACK) {
|
|
198
|
+
if (store.debug)
|
|
199
|
+
console.log('identification-component | render | IDBACK');
|
|
196
200
|
currentBlock = h("process-id", { mode: "back" });
|
|
197
201
|
}
|
|
198
202
|
else if (store.flowStatus == FlowStatus.IDTILT) {
|
|
203
|
+
if (store.debug)
|
|
204
|
+
console.log('identification-component | render | TILT');
|
|
199
205
|
currentBlock = h("process-id", { mode: "tilt" });
|
|
200
206
|
}
|
|
201
207
|
else if (store.flowStatus == FlowStatus.LIVENESS) {
|
|
208
|
+
if (store.debug)
|
|
209
|
+
console.log('identification-component | render | LIVENESS');
|
|
202
210
|
currentBlock = h("user-liveness", { mode: "selfie" });
|
|
203
211
|
}
|
|
204
212
|
else if (store.flowStatus == FlowStatus.LIVENESSGESTURE) {
|
|
213
|
+
if (store.debug)
|
|
214
|
+
console.log('identification-component | render | LIVENESSGESTURE');
|
|
205
215
|
currentBlock = h("user-liveness", { mode: "selfieGesture" });
|
|
206
216
|
}
|
|
207
217
|
else if (store.flowStatus == FlowStatus.COMPLETE) {
|
|
218
|
+
if (store.debug)
|
|
219
|
+
console.log('identification-component | render | COMPLETE');
|
|
208
220
|
currentBlock = h("end-redirect", null);
|
|
209
221
|
}
|
|
210
222
|
else if (store.flowStatus == FlowStatus.ERROREND) {
|
|
@@ -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);
|