@ekyc_qoobiss/qbs-ect-cmp 3.6.44 → 3.6.46
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-2d932eab.js → TranslationUtils-8f794c41.js} +12 -0
- package/dist/cjs/agreement-check_17.cjs.entry.js +208 -301
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/components/base-component.js +11 -44
- package/dist/collection/components/common/agreement-check/agreement-check.js +0 -4
- package/dist/collection/components/common/camera-error/camera-error.js +3 -10
- package/dist/collection/components/common/capture-error/capture-error.js +3 -8
- package/dist/collection/components/common/how-to-info/how-to-info.js +2 -4
- package/dist/collection/components/common/id-capture/id-capture.js +2 -3
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +1 -3
- package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -5
- package/dist/collection/components/flow/landing-validation/landing-validation.js +5 -11
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +6 -7
- package/dist/collection/components/flow/process-id/process-id.js +10 -8
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +5 -12
- package/dist/collection/components/flow/sms-send/sms-send.js +5 -11
- package/dist/collection/components/flow/user-liveness/user-liveness.js +7 -10
- package/dist/collection/components/identification-component/identification-component.js +14 -18
- package/dist/collection/helpers/ApiCall.js +10 -0
- package/dist/collection/helpers/textValues.js +1 -0
- package/dist/collection/models/FlowSteps.js +1 -0
- package/dist/esm/{TranslationUtils-0039c82d.js → TranslationUtils-770d32d7.js} +12 -0
- package/dist/esm/agreement-check_17.entry.js +208 -301
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/{p-0c1eead0.entry.js → p-1aa8595e.entry.js} +1 -1
- package/dist/qbs-ect-cmp/{p-fca9e256.entry.js → p-36eff211.entry.js} +2 -2
- package/dist/qbs-ect-cmp/p-a073c59e.js +1 -0
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/base-component.d.ts +3 -12
- package/dist/types/components/common/agreement-check/agreement-check.d.ts +0 -1
- package/dist/types/components/common/camera-error/camera-error.d.ts +0 -1
- package/dist/types/components/common/capture-error/capture-error.d.ts +0 -1
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +0 -1
- package/dist/types/components/common/id-capture/id-capture.d.ts +0 -1
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +0 -1
- package/dist/types/components/flow/agreement-info/agreement-info.d.ts +0 -1
- package/dist/types/components/flow/landing-validation/landing-validation.d.ts +0 -1
- package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +0 -1
- package/dist/types/components/flow/process-id/process-id.d.ts +1 -1
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +0 -1
- package/dist/types/components/flow/sms-send/sms-send.d.ts +0 -1
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +0 -1
- package/dist/types/components/identification-component/identification-component.d.ts +0 -2
- package/dist/types/helpers/ApiCall.d.ts +3 -0
- package/dist/types/helpers/textValues.d.ts +1 -0
- package/dist/types/models/FlowSteps.d.ts +2 -1
- package/package.json +1 -1
- package/dist/qbs-ect-cmp/p-b969ca3e.js +0 -1
|
@@ -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-8f794c41.js');
|
|
7
7
|
|
|
8
8
|
const randomActionsCss = "";
|
|
9
9
|
|
|
@@ -1,59 +1,26 @@
|
|
|
1
1
|
import { ApiCall } from '../helpers/ApiCall';
|
|
2
|
-
import { DeviceDetection } from '../helpers/DeviceDetection';
|
|
3
2
|
import Events from '../helpers/Events';
|
|
4
|
-
import store from '../helpers/store';
|
|
5
3
|
import { FlowMoments } from '../models/FlowSteps';
|
|
6
4
|
export class BaseComponent {
|
|
7
|
-
|
|
8
|
-
this.apiErrorEvent = null;
|
|
9
|
-
this.processError = null;
|
|
10
|
-
this.apiCall = new ApiCall();
|
|
11
|
-
if (step)
|
|
12
|
-
this.flowStep = step;
|
|
13
|
-
if (!store.device) {
|
|
14
|
-
store.device = new DeviceDetection().getDevice();
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
setEventEmitter(event) {
|
|
18
|
-
this.apiErrorEvent = event;
|
|
19
|
-
}
|
|
20
|
-
setErrorCallback(callback) {
|
|
21
|
-
this.processError = callback;
|
|
22
|
-
}
|
|
23
|
-
async logStep(step, moment) {
|
|
5
|
+
static async logStep(step, moment) {
|
|
24
6
|
Events.flowEvent(step, moment);
|
|
25
7
|
try {
|
|
26
|
-
await
|
|
27
|
-
}
|
|
28
|
-
catch (e) {
|
|
29
|
-
if (this.apiErrorEvent)
|
|
30
|
-
this.apiErrorEvent.emit(e);
|
|
31
|
-
else
|
|
32
|
-
this.processError(e, `${step}-${moment}`);
|
|
8
|
+
await ApiCall.instance.AddStep(step, moment);
|
|
33
9
|
}
|
|
10
|
+
catch (e) { }
|
|
34
11
|
}
|
|
35
|
-
async initialize() {
|
|
36
|
-
Events.flowEvent(
|
|
12
|
+
static async initialize(flowStep) {
|
|
13
|
+
Events.flowEvent(flowStep, FlowMoments.Initialized);
|
|
37
14
|
try {
|
|
38
|
-
await
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
if (this.apiErrorEvent)
|
|
42
|
-
this.apiErrorEvent.emit(e);
|
|
43
|
-
else
|
|
44
|
-
this.processError(e, `${this.flowStep}-${FlowMoments.Initialized}`);
|
|
15
|
+
await ApiCall.instance.AddStep(flowStep, FlowMoments.Initialized);
|
|
45
16
|
}
|
|
17
|
+
catch (e) { }
|
|
46
18
|
}
|
|
47
|
-
async finalize() {
|
|
48
|
-
Events.flowEvent(
|
|
19
|
+
static async finalize(flowStep) {
|
|
20
|
+
Events.flowEvent(flowStep, FlowMoments.Finalized);
|
|
49
21
|
try {
|
|
50
|
-
await
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
if (this.apiErrorEvent)
|
|
54
|
-
this.apiErrorEvent.emit(e);
|
|
55
|
-
else
|
|
56
|
-
this.processError(e, `${this.flowStep}-${FlowMoments.Finalized}`);
|
|
22
|
+
await ApiCall.instance.AddStep(flowStep, FlowMoments.Finalized);
|
|
57
23
|
}
|
|
24
|
+
catch (e) { }
|
|
58
25
|
}
|
|
59
26
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
3
|
-
import { FlowSteps } from '../../../models/FlowSteps';
|
|
4
|
-
import { BaseComponent } from '../../base-component';
|
|
5
3
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
6
4
|
export class AgreementCheck {
|
|
7
5
|
constructor() {
|
|
@@ -11,8 +9,6 @@ export class AgreementCheck {
|
|
|
11
9
|
this.scrollClass = 'scroll';
|
|
12
10
|
this.apiCalls = new ApiCall();
|
|
13
11
|
this.buttonEnabled = true;
|
|
14
|
-
this.baseComponent = new BaseComponent(FlowSteps.Agreements);
|
|
15
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
16
12
|
}
|
|
17
13
|
async componentWillLoad() {
|
|
18
14
|
this.translations = await Translations.getValues();
|
|
@@ -7,14 +7,7 @@ import { MobileOS } from '../../../models/IDevice';
|
|
|
7
7
|
import { BaseComponent } from '../../base-component';
|
|
8
8
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
9
9
|
export class CameraError {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.title = undefined;
|
|
12
|
-
this.description = undefined;
|
|
13
|
-
this.buttonDisabled = undefined;
|
|
14
|
-
this.demoVideo = undefined;
|
|
15
|
-
this.baseComponent = new BaseComponent(FlowSteps.CameraError);
|
|
16
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
17
|
-
}
|
|
10
|
+
constructor() { this.title = undefined; this.description = undefined; this.buttonDisabled = undefined; this.demoVideo = undefined; }
|
|
18
11
|
async componentWillLoad() {
|
|
19
12
|
this.translations = await Translations.getValues();
|
|
20
13
|
this.buttonDisabled = false;
|
|
@@ -23,7 +16,7 @@ export class CameraError {
|
|
|
23
16
|
this.buttonText = this.translations.CameraErrorValues.Button;
|
|
24
17
|
}
|
|
25
18
|
async componentDidLoad() {
|
|
26
|
-
await
|
|
19
|
+
await BaseComponent.initialize(FlowSteps.CameraError);
|
|
27
20
|
if (store.device.mobileOS != MobileOS.iOS) {
|
|
28
21
|
this.demoVideo.src = this.translations.CameraErrorValues.HowToLink;
|
|
29
22
|
this.demoVideo.loop = true;
|
|
@@ -38,7 +31,7 @@ export class CameraError {
|
|
|
38
31
|
}
|
|
39
32
|
}
|
|
40
33
|
async disconnectedCallback() {
|
|
41
|
-
await
|
|
34
|
+
await BaseComponent.finalize(FlowSteps.CameraError);
|
|
42
35
|
}
|
|
43
36
|
async buttonClick() {
|
|
44
37
|
this.buttonDisabled = true;
|
|
@@ -4,12 +4,7 @@ import { BaseComponent } from '../../base-component';
|
|
|
4
4
|
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
5
5
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
6
6
|
export class CaptureError {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.type = undefined;
|
|
9
|
-
this.buttonEnabled = undefined;
|
|
10
|
-
this.buttonText = undefined;
|
|
11
|
-
this.baseComponent = new BaseComponent(FlowSteps.CiError);
|
|
12
|
-
}
|
|
7
|
+
constructor() { this.type = undefined; this.buttonEnabled = undefined; this.buttonText = undefined; }
|
|
13
8
|
async componentWillLoad() {
|
|
14
9
|
this.translations = await Translations.getValues();
|
|
15
10
|
this.buttonEnabled = false;
|
|
@@ -27,7 +22,7 @@ export class CaptureError {
|
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
24
|
async componentDidLoad() {
|
|
30
|
-
await
|
|
25
|
+
await BaseComponent.logStep(FlowSteps.CiError, FlowMoments.Initialized);
|
|
31
26
|
for (let i = 5; i >= 1; i--) {
|
|
32
27
|
this.buttonText = i.toString();
|
|
33
28
|
await delay(1000);
|
|
@@ -37,7 +32,7 @@ export class CaptureError {
|
|
|
37
32
|
}
|
|
38
33
|
async buttonClick() {
|
|
39
34
|
this.buttonEnabled = false;
|
|
40
|
-
await
|
|
35
|
+
await BaseComponent.logStep(FlowSteps.CiError, FlowMoments.Finalized);
|
|
41
36
|
this.eventCaptureErrorDone.emit();
|
|
42
37
|
}
|
|
43
38
|
render() {
|
|
@@ -7,10 +7,10 @@ import { Translations } from '../../../helpers/TranslationUtils';
|
|
|
7
7
|
export class HowToInfo {
|
|
8
8
|
constructor() { this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
|
|
9
9
|
async componentDidLoad() {
|
|
10
|
-
await
|
|
10
|
+
await BaseComponent.initialize(this.currentStep);
|
|
11
11
|
}
|
|
12
12
|
async disconnectedCallback() {
|
|
13
|
-
await
|
|
13
|
+
await BaseComponent.finalize(this.currentStep);
|
|
14
14
|
}
|
|
15
15
|
buttonClick() {
|
|
16
16
|
this.buttonEnabled = false;
|
|
@@ -38,8 +38,6 @@ export class HowToInfo {
|
|
|
38
38
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
|
|
39
39
|
this.buttonText = this.translations.HowToValues.SelfieButton;
|
|
40
40
|
}
|
|
41
|
-
this.baseComponent = new BaseComponent(this.currentStep);
|
|
42
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
43
41
|
}
|
|
44
42
|
render() {
|
|
45
43
|
let sub = this.subTitle != '' ? h("p", { class: "font-size-2" }, this.subTitle) : null;
|
|
@@ -40,7 +40,6 @@ export class IdCapture {
|
|
|
40
40
|
if (!navigator.mediaDevices) {
|
|
41
41
|
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
42
42
|
}
|
|
43
|
-
this.baseComponent = new BaseComponent(this.flowStep);
|
|
44
43
|
}
|
|
45
44
|
initVariables() {
|
|
46
45
|
if (store.flowStatus == FlowStatus.IDFRONT) {
|
|
@@ -63,7 +62,7 @@ export class IdCapture {
|
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
async componentDidLoad() {
|
|
66
|
-
await
|
|
65
|
+
await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
|
|
67
66
|
this.initVariables();
|
|
68
67
|
if (store.flowStatus == FlowStatus.IDBACK) {
|
|
69
68
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
@@ -114,7 +113,7 @@ export class IdCapture {
|
|
|
114
113
|
else {
|
|
115
114
|
this.eventTimeElapsed.emit();
|
|
116
115
|
}
|
|
117
|
-
await
|
|
116
|
+
await BaseComponent.logStep(this.flowStep, FlowMoments.Finalized);
|
|
118
117
|
}
|
|
119
118
|
async verificationFinished() {
|
|
120
119
|
if (this.verified)
|
|
@@ -54,8 +54,6 @@ export class SelfieCapture {
|
|
|
54
54
|
this.mainStream = Stream.getNewInstance(this.verificationMode);
|
|
55
55
|
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
|
|
56
56
|
}
|
|
57
|
-
this.baseComponent = new BaseComponent(this.currentStep);
|
|
58
|
-
await this.baseComponent.logStep(this.currentStep, FlowMoments.Initialized);
|
|
59
57
|
this.demoVideo.play();
|
|
60
58
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
61
59
|
this.demoEnded = true;
|
|
@@ -96,7 +94,7 @@ export class SelfieCapture {
|
|
|
96
94
|
else {
|
|
97
95
|
this.eventTimeElapsed.emit();
|
|
98
96
|
}
|
|
99
|
-
await
|
|
97
|
+
await BaseComponent.logStep(this.currentStep, FlowMoments.Finalized);
|
|
100
98
|
}
|
|
101
99
|
async verificationFinished() {
|
|
102
100
|
if (this.verified)
|
|
@@ -3,19 +3,18 @@ import store from '../../../helpers/store';
|
|
|
3
3
|
import { FlowSteps } from '../../../models/FlowSteps';
|
|
4
4
|
import { BaseComponent } from '../../base-component';
|
|
5
5
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
6
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
6
7
|
export class AgreementInfo {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.agreementsChecked = undefined;
|
|
9
10
|
this.termsChecked = undefined;
|
|
10
11
|
this.openAgreements = undefined;
|
|
11
12
|
this.openTerms = undefined;
|
|
12
|
-
this.baseComponent = new BaseComponent(FlowSteps.Agreements);
|
|
13
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
14
13
|
this.agreementsChecked = false;
|
|
15
14
|
this.termsChecked = false;
|
|
16
15
|
}
|
|
17
16
|
async componentDidLoad() {
|
|
18
|
-
await
|
|
17
|
+
await BaseComponent.initialize(FlowSteps.Agreements);
|
|
19
18
|
}
|
|
20
19
|
async componentWillLoad() {
|
|
21
20
|
this.translations = await Translations.getValues();
|
|
@@ -23,12 +22,12 @@ export class AgreementInfo {
|
|
|
23
22
|
this.openTerms = false;
|
|
24
23
|
}
|
|
25
24
|
async disconnectedCallback() {
|
|
26
|
-
await
|
|
25
|
+
await BaseComponent.finalize(FlowSteps.Agreements);
|
|
27
26
|
}
|
|
28
27
|
async buttonClick() {
|
|
29
28
|
if (this.agreementsChecked && this.termsChecked) {
|
|
30
29
|
try {
|
|
31
|
-
store.flowStatus = await
|
|
30
|
+
store.flowStatus = await ApiCall.instance.GetNextFlowState();
|
|
32
31
|
}
|
|
33
32
|
catch (e) {
|
|
34
33
|
this.apiErrorEvent.emit(e);
|
|
@@ -18,22 +18,16 @@ import idValidation from '../../../assets/landing/validation.svg';
|
|
|
18
18
|
import idDevice from '../../../assets/landing/device.svg';
|
|
19
19
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
20
20
|
export class LandingValidation {
|
|
21
|
-
constructor() {
|
|
22
|
-
this.warningText = undefined;
|
|
23
|
-
this.buttonDisabled = undefined;
|
|
24
|
-
this.baseComponent = new BaseComponent(FlowSteps.Landing);
|
|
25
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
26
|
-
}
|
|
21
|
+
constructor() { this.warningText = undefined; this.buttonDisabled = undefined; }
|
|
27
22
|
async componentWillLoad() {
|
|
28
23
|
Events.flowStarted();
|
|
29
24
|
this.translations = await Translations.getValues();
|
|
30
|
-
this.baseComponent.apiCall = new ApiCall();
|
|
31
25
|
this.buttonDisabled = false;
|
|
32
26
|
await this.initRequest();
|
|
33
27
|
}
|
|
34
28
|
async componentDidLoad() {
|
|
35
29
|
if (store.environment !== 'DEMO') {
|
|
36
|
-
await
|
|
30
|
+
await BaseComponent.initialize(FlowSteps.Landing);
|
|
37
31
|
}
|
|
38
32
|
}
|
|
39
33
|
async initRequest() {
|
|
@@ -52,7 +46,7 @@ export class LandingValidation {
|
|
|
52
46
|
sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
|
|
53
47
|
}
|
|
54
48
|
try {
|
|
55
|
-
store.flowStatus = await
|
|
49
|
+
store.flowStatus = await ApiCall.instance.LandingValidationStartFlow(cameraIsAccessible);
|
|
56
50
|
}
|
|
57
51
|
catch (e) {
|
|
58
52
|
this.apiErrorEvent.emit(e);
|
|
@@ -60,13 +54,13 @@ export class LandingValidation {
|
|
|
60
54
|
}
|
|
61
55
|
}
|
|
62
56
|
async disconnectedCallback() {
|
|
63
|
-
await
|
|
57
|
+
await BaseComponent.finalize(FlowSteps.Landing);
|
|
64
58
|
}
|
|
65
59
|
async leaveFlow() {
|
|
66
60
|
if (this.buttonDisabled)
|
|
67
61
|
return;
|
|
68
62
|
try {
|
|
69
|
-
let abortResult = await
|
|
63
|
+
let abortResult = await ApiCall.instance.AbortRequest();
|
|
70
64
|
store.flowStatus = FlowStatus[abortResult.state];
|
|
71
65
|
Events.flowAborted();
|
|
72
66
|
}
|
|
@@ -8,6 +8,7 @@ import { FlowSteps } from '../../../models/FlowSteps';
|
|
|
8
8
|
import { delay } from '../../../utils/utils';
|
|
9
9
|
import { BaseComponent } from '../../base-component';
|
|
10
10
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
11
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
11
12
|
export class MobileRedirect {
|
|
12
13
|
constructor() {
|
|
13
14
|
this.infoTextTop = undefined;
|
|
@@ -19,8 +20,6 @@ export class MobileRedirect {
|
|
|
19
20
|
this.redirectLink = undefined;
|
|
20
21
|
this.qrCode = undefined;
|
|
21
22
|
this.prefilledPhone = false;
|
|
22
|
-
this.baseComponent = new BaseComponent(FlowSteps.MobileRedirect);
|
|
23
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
24
23
|
this.invalidValue = false;
|
|
25
24
|
this.waitingMobile = false;
|
|
26
25
|
}
|
|
@@ -30,7 +29,7 @@ export class MobileRedirect {
|
|
|
30
29
|
this.infoTextTop = this.translations.MobileRedirectValues.InfoTop;
|
|
31
30
|
this.infoTextBottom = this.translations.MobileRedirectValues.InfoBottom;
|
|
32
31
|
let envUri = store.environment == 'QA' ? 'test' : 'ect';
|
|
33
|
-
let baseUri = store.apiBaseUrl.includes(
|
|
32
|
+
let baseUri = store.apiBaseUrl.includes('apimd') ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
|
|
34
33
|
this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + store.redirectId;
|
|
35
34
|
if (store.phoneNumber && store.phoneNumber != '') {
|
|
36
35
|
this.contact = store.phoneNumber;
|
|
@@ -44,7 +43,7 @@ export class MobileRedirect {
|
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
45
|
async componentDidLoad() {
|
|
47
|
-
await
|
|
46
|
+
await BaseComponent.initialize(FlowSteps.MobileRedirect);
|
|
48
47
|
await delay(5000);
|
|
49
48
|
await this.checkStatus();
|
|
50
49
|
while (this.orderStatus == OrderStatuses.Capturing || this.orderStatus == OrderStatuses.Waiting) {
|
|
@@ -53,7 +52,7 @@ export class MobileRedirect {
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
async checkStatus() {
|
|
56
|
-
this.orderStatus = await
|
|
55
|
+
this.orderStatus = await ApiCall.instance.GetStatus(store.requestId);
|
|
57
56
|
if (this.orderStatus == OrderStatuses.FinishedCapturing) {
|
|
58
57
|
this.waitingMobile = false;
|
|
59
58
|
store.flowStatus = FlowStatus.COMPLETE;
|
|
@@ -72,7 +71,7 @@ export class MobileRedirect {
|
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
async disconnectedCallback() {
|
|
75
|
-
await
|
|
74
|
+
await BaseComponent.finalize(FlowSteps.MobileRedirect);
|
|
76
75
|
}
|
|
77
76
|
async buttonClick() {
|
|
78
77
|
if (this.contact == '' || this.contact.length != 10) {
|
|
@@ -82,7 +81,7 @@ export class MobileRedirect {
|
|
|
82
81
|
this.waitingMobile = true;
|
|
83
82
|
this.infoTextTop = this.translations.MobileRedirectValues.InfoWaiting;
|
|
84
83
|
try {
|
|
85
|
-
await
|
|
84
|
+
await ApiCall.instance.SendLink(this.redirectLink, this.contact);
|
|
86
85
|
}
|
|
87
86
|
catch (e) {
|
|
88
87
|
this.apiErrorEvent.emit(e);
|
|
@@ -6,6 +6,7 @@ import { FlowSteps } from '../../../models/FlowSteps';
|
|
|
6
6
|
import { getLogMessage } from '../../../utils/utils';
|
|
7
7
|
import { BaseComponent } from '../../base-component';
|
|
8
8
|
import { CaptureUploadTypes } from '../../../models/CaptureFlow';
|
|
9
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
9
10
|
// import { IDPose } from '../../libs/IDML5Detector/IDPose';
|
|
10
11
|
export class ProcessId {
|
|
11
12
|
constructor() {
|
|
@@ -13,8 +14,6 @@ export class ProcessId {
|
|
|
13
14
|
this.showTimeout = undefined;
|
|
14
15
|
this.showInvalid = undefined;
|
|
15
16
|
this.flow = undefined;
|
|
16
|
-
this.baseComponent = new BaseComponent(FlowSteps.CiBack);
|
|
17
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
18
17
|
}
|
|
19
18
|
componentWillLoad() {
|
|
20
19
|
this.captureRetryCount = 0;
|
|
@@ -22,6 +21,7 @@ export class ProcessId {
|
|
|
22
21
|
}
|
|
23
22
|
initFlow() {
|
|
24
23
|
if (store.flowStatus == FlowStatus.IDFRONT) {
|
|
24
|
+
this.currentStep = FlowSteps.CiFront;
|
|
25
25
|
this.flow = {
|
|
26
26
|
capture: {
|
|
27
27
|
fileName: 'idImage.png',
|
|
@@ -33,6 +33,7 @@ export class ProcessId {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
else if (store.flowStatus == FlowStatus.IDBACK) {
|
|
36
|
+
this.currentStep = FlowSteps.CiBack;
|
|
36
37
|
this.flow = {
|
|
37
38
|
capture: {
|
|
38
39
|
fileName: 'idBackImage.png',
|
|
@@ -44,6 +45,7 @@ export class ProcessId {
|
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
else if (store.flowStatus == FlowStatus.IDTILT) {
|
|
48
|
+
this.currentStep = FlowSteps.CiTilt;
|
|
47
49
|
this.flow = {
|
|
48
50
|
capture: {
|
|
49
51
|
fileName: 'idTiltImage.png',
|
|
@@ -72,7 +74,7 @@ export class ProcessId {
|
|
|
72
74
|
async captureIdImage(event) {
|
|
73
75
|
let idPhoto = event.detail;
|
|
74
76
|
if (idPhoto.size == 0) {
|
|
75
|
-
await
|
|
77
|
+
await ApiCall.instance.AddLog({ message: 'Empty id photo', blobData: idPhoto }, getLogMessage());
|
|
76
78
|
this.triggerErrorFlow();
|
|
77
79
|
return;
|
|
78
80
|
}
|
|
@@ -94,7 +96,7 @@ export class ProcessId {
|
|
|
94
96
|
return;
|
|
95
97
|
}
|
|
96
98
|
if (idRecording.size == 0) {
|
|
97
|
-
await
|
|
99
|
+
await ApiCall.instance.AddLog({ message: 'Empty ID recording', blobData: idRecording }, getLogMessage());
|
|
98
100
|
this.showTimeout = true;
|
|
99
101
|
return;
|
|
100
102
|
}
|
|
@@ -107,13 +109,13 @@ export class ProcessId {
|
|
|
107
109
|
this.recordingResultCount = 0;
|
|
108
110
|
}
|
|
109
111
|
async componentDidLoad() {
|
|
110
|
-
await
|
|
112
|
+
await BaseComponent.initialize(this.currentStep);
|
|
111
113
|
}
|
|
112
114
|
async uploadPhotos(uploadType, photoFile) {
|
|
113
115
|
if (photoFile == null || uploadType == '') {
|
|
114
116
|
return false;
|
|
115
117
|
}
|
|
116
|
-
var uploadResult = await
|
|
118
|
+
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(store.requestId, uploadType, photoFile);
|
|
117
119
|
if (uploadResult) {
|
|
118
120
|
return true;
|
|
119
121
|
}
|
|
@@ -127,7 +129,7 @@ export class ProcessId {
|
|
|
127
129
|
if (recordingFile == null) {
|
|
128
130
|
return;
|
|
129
131
|
}
|
|
130
|
-
var uploadResult = await
|
|
132
|
+
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(store.requestId, uploadType, recordingFile);
|
|
131
133
|
if (uploadResult) {
|
|
132
134
|
return true;
|
|
133
135
|
}
|
|
@@ -140,7 +142,7 @@ export class ProcessId {
|
|
|
140
142
|
this.showInvalid = true;
|
|
141
143
|
}
|
|
142
144
|
async disconnectedCallback() {
|
|
143
|
-
await
|
|
145
|
+
await BaseComponent.finalize(this.currentStep);
|
|
144
146
|
}
|
|
145
147
|
switchCamera() {
|
|
146
148
|
if (this.captureRetryCount == 1) {
|
|
@@ -4,20 +4,13 @@ import { FlowStatus } from '../../../models/FlowStatus';
|
|
|
4
4
|
import { FlowSteps } from '../../../models/FlowSteps';
|
|
5
5
|
import { BaseComponent } from '../../base-component';
|
|
6
6
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
7
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
7
8
|
export class SmsCodeValidation {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.title = undefined;
|
|
10
|
-
this.details = undefined;
|
|
11
|
-
this.buttonText = undefined;
|
|
12
|
-
this.code = undefined;
|
|
13
|
-
this.canSend = false;
|
|
14
|
-
this.baseComponent = new BaseComponent(FlowSteps.OtpCheck);
|
|
15
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
16
|
-
}
|
|
9
|
+
constructor() { this.title = undefined; this.details = undefined; this.buttonText = undefined; this.code = undefined; this.canSend = false; }
|
|
17
10
|
async doAction() {
|
|
18
11
|
try {
|
|
19
12
|
this.canSend = false;
|
|
20
|
-
var codeChecked = await
|
|
13
|
+
var codeChecked = await ApiCall.instance.CheckOTPCode(store.requestId, this.code);
|
|
21
14
|
store.flowStatus = FlowStatus[codeChecked.state];
|
|
22
15
|
}
|
|
23
16
|
catch (e) {
|
|
@@ -25,7 +18,7 @@ export class SmsCodeValidation {
|
|
|
25
18
|
}
|
|
26
19
|
}
|
|
27
20
|
async disconnectedCallback() {
|
|
28
|
-
await
|
|
21
|
+
await BaseComponent.finalize(FlowSteps.OtpCheck);
|
|
29
22
|
}
|
|
30
23
|
async componentWillRender() {
|
|
31
24
|
this.translations = await Translations.getValues();
|
|
@@ -34,7 +27,7 @@ export class SmsCodeValidation {
|
|
|
34
27
|
this.buttonText = this.translations.CodeValidationValues.Button;
|
|
35
28
|
}
|
|
36
29
|
async componentDidLoad() {
|
|
37
|
-
await
|
|
30
|
+
await BaseComponent.initialize(FlowSteps.OtpCheck);
|
|
38
31
|
}
|
|
39
32
|
handleChangeCode(ev) {
|
|
40
33
|
let value = ev.target ? ev.target.value : '';
|
|
@@ -4,19 +4,13 @@ import { FlowStatus } from '../../../models/FlowStatus';
|
|
|
4
4
|
import { FlowSteps } from '../../../models/FlowSteps';
|
|
5
5
|
import { BaseComponent } from '../../base-component';
|
|
6
6
|
import { Translations } from '../../../helpers/TranslationUtils';
|
|
7
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
7
8
|
export class SmsSend {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.buttonText = undefined;
|
|
10
|
-
this.phoneNumber = undefined;
|
|
11
|
-
this.prefilledPhone = false;
|
|
12
|
-
this.canSend = false;
|
|
13
|
-
this.baseComponent = new BaseComponent(FlowSteps.OtpSend);
|
|
14
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
15
|
-
}
|
|
9
|
+
constructor() { this.buttonText = undefined; this.phoneNumber = undefined; this.prefilledPhone = false; this.canSend = false; }
|
|
16
10
|
async doAction() {
|
|
17
11
|
try {
|
|
18
12
|
this.canSend = false;
|
|
19
|
-
var codeSent = await
|
|
13
|
+
var codeSent = await ApiCall.instance.SendOTPCode(store.requestId, this.phoneNumber);
|
|
20
14
|
if (codeSent.sent === true) {
|
|
21
15
|
store.flowStatus = FlowStatus[codeSent.state];
|
|
22
16
|
}
|
|
@@ -26,7 +20,7 @@ export class SmsSend {
|
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
22
|
async disconnectedCallback() {
|
|
29
|
-
await
|
|
23
|
+
await BaseComponent.finalize(FlowSteps.OtpSend);
|
|
30
24
|
}
|
|
31
25
|
async componentWillRender() {
|
|
32
26
|
this.translations = await Translations.getValues();
|
|
@@ -38,7 +32,7 @@ export class SmsSend {
|
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
34
|
async componentDidLoad() {
|
|
41
|
-
await
|
|
35
|
+
await BaseComponent.initialize(FlowSteps.OtpSend);
|
|
42
36
|
}
|
|
43
37
|
handleChangePhone(ev) {
|
|
44
38
|
let value = ev.target ? ev.target.value : '';
|
|
@@ -6,6 +6,7 @@ import { FlowSteps } from '../../../models/FlowSteps';
|
|
|
6
6
|
import { getLogMessage } from '../../../utils/utils';
|
|
7
7
|
import { BaseComponent } from '../../base-component';
|
|
8
8
|
import { CaptureUploadTypes } from '../../../models/CaptureFlow';
|
|
9
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
9
10
|
export class UserLiveness {
|
|
10
11
|
constructor() {
|
|
11
12
|
this.recordingResultCount = 0;
|
|
@@ -14,9 +15,7 @@ export class UserLiveness {
|
|
|
14
15
|
this.flow = undefined;
|
|
15
16
|
this.howToDone = false;
|
|
16
17
|
}
|
|
17
|
-
async componentDidLoad() {
|
|
18
|
-
await this.baseComponent.initialize();
|
|
19
|
-
}
|
|
18
|
+
async componentDidLoad() { }
|
|
20
19
|
componentWillLoad() {
|
|
21
20
|
if (store.flowStatus == FlowStatus.LIVENESS) {
|
|
22
21
|
this.currentStep = FlowSteps.Selfie;
|
|
@@ -42,8 +41,6 @@ export class UserLiveness {
|
|
|
42
41
|
howToDone: false,
|
|
43
42
|
};
|
|
44
43
|
}
|
|
45
|
-
this.baseComponent = new BaseComponent(this.currentStep);
|
|
46
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
47
44
|
}
|
|
48
45
|
howToDoneEvent() {
|
|
49
46
|
this.howToDone = true;
|
|
@@ -59,13 +56,13 @@ export class UserLiveness {
|
|
|
59
56
|
return;
|
|
60
57
|
let selfiePhoto = event.detail;
|
|
61
58
|
if (selfiePhoto.size == 0) {
|
|
62
|
-
await
|
|
59
|
+
await ApiCall.instance.AddLog({ message: 'Empty selfie', blobData: selfiePhoto }, getLogMessage());
|
|
63
60
|
this.triggerErrorFlow();
|
|
64
61
|
return;
|
|
65
62
|
}
|
|
66
63
|
try {
|
|
67
64
|
var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
68
|
-
let photoUploaded = await
|
|
65
|
+
let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.photoType, uploadPhoto);
|
|
69
66
|
if (!photoUploaded) {
|
|
70
67
|
this.triggerErrorFlow();
|
|
71
68
|
}
|
|
@@ -82,14 +79,14 @@ export class UserLiveness {
|
|
|
82
79
|
}
|
|
83
80
|
this.recordingResultCount = 0;
|
|
84
81
|
if (selfieRecording.size == 0) {
|
|
85
|
-
await
|
|
82
|
+
await ApiCall.instance.AddLog({ message: 'Empty recording', blobData: selfieRecording }, getLogMessage());
|
|
86
83
|
this.triggerErrorFlow();
|
|
87
84
|
return;
|
|
88
85
|
}
|
|
89
86
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
90
87
|
try {
|
|
91
88
|
let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
92
|
-
let uplodDone = await
|
|
89
|
+
let uplodDone = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.recType, uploadRec);
|
|
93
90
|
if (!uplodDone) {
|
|
94
91
|
this.triggerErrorFlow();
|
|
95
92
|
}
|
|
@@ -105,7 +102,7 @@ export class UserLiveness {
|
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
104
|
async disconnectedCallback() {
|
|
108
|
-
await
|
|
105
|
+
await BaseComponent.finalize(this.currentStep);
|
|
109
106
|
}
|
|
110
107
|
triggerErrorFlow() {
|
|
111
108
|
this.showError = true;
|