@ekyc_qoobiss/qbs-ect-cmp 2.0.12 → 2.1.1
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 +92 -2
- package/dist/collection/components/flow/agreement-info/agreement-info.js +29 -0
- package/dist/collection/components/flow/end-redirect/end-redirect.js +30 -1
- package/dist/collection/components/flow/id-double-side/id-double-side.js +9 -0
- package/dist/collection/components/flow/id-single-side/id-single-side.js +9 -0
- package/dist/collection/components/flow/landing-validation/landing-validation.js +8 -1
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +7 -0
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +15 -0
- package/dist/collection/components/flow/user-liveness/user-liveness.js +9 -0
- package/dist/collection/helpers/ApiCall.js +6 -0
- package/dist/collection/helpers/textValues.js +1 -0
- package/dist/collection/models/FlowSteps.js +15 -0
- package/dist/esm/agreement-check_17.entry.js +92 -2
- package/dist/qbs-ect-cmp/{p-8da34a95.entry.js → p-1db86731.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/flow/agreement-info/agreement-info.d.ts +4 -0
- package/dist/types/components/flow/end-redirect/end-redirect.d.ts +5 -1
- package/dist/types/components/flow/id-double-side/id-double-side.d.ts +1 -0
- package/dist/types/components/flow/id-single-side/id-single-side.d.ts +1 -0
- package/dist/types/components/flow/landing-validation/landing-validation.d.ts +1 -1
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +1 -0
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +1 -0
- package/dist/types/components.d.ts +10 -0
- package/dist/types/helpers/ApiCall.d.ts +2 -0
- package/dist/types/models/FlowSteps.d.ts +14 -0
- package/package.json +1 -1
|
@@ -337,6 +337,7 @@ class ApiUrls {
|
|
|
337
337
|
this.SendLink = this.uriEnv + 'validation/otp/sendlink';
|
|
338
338
|
this.GetStatus = this.uriEnv + 'validation/identity/status';
|
|
339
339
|
this.AddLog = this.uriEnv + 'validation/logs/add';
|
|
340
|
+
this.AddStep = this.uriEnv + 'validation/logs/step';
|
|
340
341
|
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
341
342
|
}
|
|
342
343
|
}
|
|
@@ -389,6 +390,22 @@ onChange('phoneValidation', value => {
|
|
|
389
390
|
sessionStorage.setItem(SessionKeys.PhoneValidationKey, String(value));
|
|
390
391
|
});
|
|
391
392
|
|
|
393
|
+
var FlowSteps;
|
|
394
|
+
(function (FlowSteps) {
|
|
395
|
+
FlowSteps[FlowSteps["MobileRedirect"] = 0] = "MobileRedirect";
|
|
396
|
+
FlowSteps[FlowSteps["Landing"] = 1] = "Landing";
|
|
397
|
+
FlowSteps[FlowSteps["Agreements"] = 2] = "Agreements";
|
|
398
|
+
FlowSteps[FlowSteps["OtpSend"] = 3] = "OtpSend";
|
|
399
|
+
FlowSteps[FlowSteps["OtpCheck"] = 4] = "OtpCheck";
|
|
400
|
+
FlowSteps[FlowSteps["CiFrontHowTo"] = 5] = "CiFrontHowTo";
|
|
401
|
+
FlowSteps[FlowSteps["CiFront"] = 6] = "CiFront";
|
|
402
|
+
FlowSteps[FlowSteps["CiBackHowTo"] = 7] = "CiBackHowTo";
|
|
403
|
+
FlowSteps[FlowSteps["CiBack"] = 8] = "CiBack";
|
|
404
|
+
FlowSteps[FlowSteps["SelfieHowTo"] = 9] = "SelfieHowTo";
|
|
405
|
+
FlowSteps[FlowSteps["Selfie"] = 10] = "Selfie";
|
|
406
|
+
FlowSteps[FlowSteps["End"] = 11] = "End";
|
|
407
|
+
})(FlowSteps || (FlowSteps = {}));
|
|
408
|
+
|
|
392
409
|
class ApiCall {
|
|
393
410
|
constructor() {
|
|
394
411
|
this.toBase64 = (file) => new Promise((resolve, reject) => {
|
|
@@ -504,6 +521,11 @@ class ApiCall {
|
|
|
504
521
|
}
|
|
505
522
|
catch (_a) { }
|
|
506
523
|
}
|
|
524
|
+
async AddStep(step) {
|
|
525
|
+
let data = { requestId: state.requestId, step: FlowSteps[step] };
|
|
526
|
+
let result = await this.post(this.urls.AddStep, JSON.stringify(data));
|
|
527
|
+
return result.saved;
|
|
528
|
+
}
|
|
507
529
|
async AbortRequest() {
|
|
508
530
|
let result = await this.post(this.urls.AbortRequest, JSON.stringify({ requestId: state.requestId }));
|
|
509
531
|
return result.saved;
|
|
@@ -544,12 +566,22 @@ const agreementInfoCss = "";
|
|
|
544
566
|
const AgreementInfo = class {
|
|
545
567
|
constructor(hostRef) {
|
|
546
568
|
index.registerInstance(this, hostRef);
|
|
569
|
+
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
547
570
|
this.agreementsChecked = undefined;
|
|
548
571
|
this.termsChecked = undefined;
|
|
549
572
|
this.openAgreements = undefined;
|
|
550
573
|
this.openTerms = undefined;
|
|
551
574
|
this.agreementsChecked = false;
|
|
552
575
|
this.termsChecked = false;
|
|
576
|
+
this.apiCall = new ApiCall();
|
|
577
|
+
}
|
|
578
|
+
async componentDidLoad() {
|
|
579
|
+
try {
|
|
580
|
+
await this.apiCall.AddStep(FlowSteps.Agreements);
|
|
581
|
+
}
|
|
582
|
+
catch (e) {
|
|
583
|
+
this.apiErrorEvent.emit(e);
|
|
584
|
+
}
|
|
553
585
|
}
|
|
554
586
|
componentWillLoad() {
|
|
555
587
|
this.openAgreements = false;
|
|
@@ -5210,10 +5242,18 @@ const endRedirectCss = "h1{font-family:'Inter', sans-serif;font-style:normal;fon
|
|
|
5210
5242
|
const EndRedirect = class {
|
|
5211
5243
|
constructor(hostRef) {
|
|
5212
5244
|
index.registerInstance(this, hostRef);
|
|
5245
|
+
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5246
|
+
this.apiCall = new ApiCall();
|
|
5213
5247
|
}
|
|
5214
|
-
componentDidLoad() {
|
|
5248
|
+
async componentDidLoad() {
|
|
5215
5249
|
Events.init(window);
|
|
5216
5250
|
Events.flowCompleted();
|
|
5251
|
+
try {
|
|
5252
|
+
await this.apiCall.AddStep(FlowSteps.End);
|
|
5253
|
+
}
|
|
5254
|
+
catch (e) {
|
|
5255
|
+
this.apiErrorEvent.emit(e);
|
|
5256
|
+
}
|
|
5217
5257
|
}
|
|
5218
5258
|
render() {
|
|
5219
5259
|
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, CompleteValues.Title), index.h("p", { class: "main-text font-size-18 mt-8 text-center" }, CompleteValues.Description)), index.h("div", { class: "buletin-container" }, index.h("div", { class: "container-coin" }, index.h("div", { class: "coin-scale" }, index.h("div", { class: "coin-flip" }, index.h("img", { class: "w-40 coin", src: completeSvg }))))), index.h("div", { class: "text-center" }, index.h("p", { class: "font-weight-900 font-size-3 color-black-2 text-center mt-20" }, CompleteValues.Message), index.h("p", null, state.requestId)), index.h("div", { class: "btn-buletin" }, index.h("p", { class: "main-text font-size-18 text-center mb-0" }, CompleteValues.FooterText)))));
|
|
@@ -5720,6 +5760,14 @@ const IdDoubleSide = class {
|
|
|
5720
5760
|
this.flow.verificationFinished = true;
|
|
5721
5761
|
this.endFlow();
|
|
5722
5762
|
}
|
|
5763
|
+
async componentDidLoad() {
|
|
5764
|
+
try {
|
|
5765
|
+
await this.apiCall.AddStep(FlowSteps.CiBack);
|
|
5766
|
+
}
|
|
5767
|
+
catch (e) {
|
|
5768
|
+
this.apiErrorEvent.emit(e);
|
|
5769
|
+
}
|
|
5770
|
+
}
|
|
5723
5771
|
async uploadPhoto() {
|
|
5724
5772
|
if (this.flow.photoFile == null || this.flow.photoDone) {
|
|
5725
5773
|
return;
|
|
@@ -5860,6 +5908,14 @@ const IdSingleSide = class {
|
|
|
5860
5908
|
}
|
|
5861
5909
|
}
|
|
5862
5910
|
}
|
|
5911
|
+
async componentDidLoad() {
|
|
5912
|
+
try {
|
|
5913
|
+
await this.apiCall.AddStep(FlowSteps.CiFront);
|
|
5914
|
+
}
|
|
5915
|
+
catch (e) {
|
|
5916
|
+
this.apiErrorEvent.emit(e);
|
|
5917
|
+
}
|
|
5918
|
+
}
|
|
5863
5919
|
async uploadPhoto() {
|
|
5864
5920
|
if (this.idFlow.photoFile == null || this.idFlow.photoDone) {
|
|
5865
5921
|
return;
|
|
@@ -6302,9 +6358,15 @@ const LandingValidation = class {
|
|
|
6302
6358
|
this.apiCall = new ApiCall();
|
|
6303
6359
|
await this.initRequest();
|
|
6304
6360
|
}
|
|
6305
|
-
componentDidLoad() {
|
|
6361
|
+
async componentDidLoad() {
|
|
6306
6362
|
Events.init(window);
|
|
6307
6363
|
Events.flowStarted();
|
|
6364
|
+
try {
|
|
6365
|
+
await this.apiCall.AddStep(FlowSteps.Landing);
|
|
6366
|
+
}
|
|
6367
|
+
catch (e) {
|
|
6368
|
+
this.apiErrorEvent.emit(e);
|
|
6369
|
+
}
|
|
6308
6370
|
}
|
|
6309
6371
|
async initRequest() {
|
|
6310
6372
|
if (state.hasIdBack) {
|
|
@@ -9258,6 +9320,12 @@ const MobileRedirect = class {
|
|
|
9258
9320
|
async componentDidLoad() {
|
|
9259
9321
|
Events.init(window);
|
|
9260
9322
|
Events.flowStarted();
|
|
9323
|
+
try {
|
|
9324
|
+
await this.apiCall.AddStep(FlowSteps.MobileRedirect);
|
|
9325
|
+
}
|
|
9326
|
+
catch (e) {
|
|
9327
|
+
this.apiErrorEvent.emit(e);
|
|
9328
|
+
}
|
|
9261
9329
|
await this.delay(5000);
|
|
9262
9330
|
await this.checkStatus();
|
|
9263
9331
|
while (this.orderStatus == OrderStatuses.Capturing || this.orderStatus == OrderStatuses.Waiting) {
|
|
@@ -9457,6 +9525,7 @@ const SmsCodeValidation = class {
|
|
|
9457
9525
|
}
|
|
9458
9526
|
async doAction() {
|
|
9459
9527
|
try {
|
|
9528
|
+
this.canSend = false;
|
|
9460
9529
|
if (state.flowStatus == FlowStatus.CODE || state.flowStatus == FlowStatus.CODEERROR) {
|
|
9461
9530
|
var codeChecked = await this.apiCall.CheckOTPCode(state.requestId, this.code);
|
|
9462
9531
|
if (codeChecked === true) {
|
|
@@ -9494,6 +9563,19 @@ const SmsCodeValidation = class {
|
|
|
9494
9563
|
this.buttonText = CodeValidationValues.Button;
|
|
9495
9564
|
}
|
|
9496
9565
|
}
|
|
9566
|
+
async componentDidLoad() {
|
|
9567
|
+
try {
|
|
9568
|
+
if (state.flowStatus == FlowStatus.PHONE) {
|
|
9569
|
+
await this.apiCall.AddStep(FlowSteps.OtpSend);
|
|
9570
|
+
}
|
|
9571
|
+
if (state.flowStatus == FlowStatus.CODE) {
|
|
9572
|
+
await this.apiCall.AddStep(FlowSteps.OtpCheck);
|
|
9573
|
+
}
|
|
9574
|
+
}
|
|
9575
|
+
catch (e) {
|
|
9576
|
+
this.apiErrorEvent.emit(e);
|
|
9577
|
+
}
|
|
9578
|
+
}
|
|
9497
9579
|
handleChangePhone(ev) {
|
|
9498
9580
|
let value = ev.target ? ev.target.value : '';
|
|
9499
9581
|
this.phoneNumber = value.replace(/\D/g, '');
|
|
@@ -9545,6 +9627,14 @@ const UserLiveness = class {
|
|
|
9545
9627
|
};
|
|
9546
9628
|
this.apiCall = new ApiCall();
|
|
9547
9629
|
}
|
|
9630
|
+
async componentDidLoad() {
|
|
9631
|
+
try {
|
|
9632
|
+
await this.apiCall.AddStep(FlowSteps.Selfie);
|
|
9633
|
+
}
|
|
9634
|
+
catch (e) {
|
|
9635
|
+
this.apiErrorEvent.emit(e);
|
|
9636
|
+
}
|
|
9637
|
+
}
|
|
9548
9638
|
componentWillLoad() {
|
|
9549
9639
|
this.showHowTo = true;
|
|
9550
9640
|
}
|
|
@@ -2,6 +2,8 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
import store from '../../../helpers/store';
|
|
3
3
|
import { AgreementInfoValues } from '../../../helpers/textValues';
|
|
4
4
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
5
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
6
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
5
7
|
export class AgreementInfo {
|
|
6
8
|
constructor() {
|
|
7
9
|
this.agreementsChecked = undefined;
|
|
@@ -10,6 +12,15 @@ export class AgreementInfo {
|
|
|
10
12
|
this.openTerms = undefined;
|
|
11
13
|
this.agreementsChecked = false;
|
|
12
14
|
this.termsChecked = false;
|
|
15
|
+
this.apiCall = new ApiCall();
|
|
16
|
+
}
|
|
17
|
+
async componentDidLoad() {
|
|
18
|
+
try {
|
|
19
|
+
await this.apiCall.AddStep(FlowSteps.Agreements);
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
this.apiErrorEvent.emit(e);
|
|
23
|
+
}
|
|
13
24
|
}
|
|
14
25
|
componentWillLoad() {
|
|
15
26
|
this.openAgreements = false;
|
|
@@ -61,6 +72,24 @@ export class AgreementInfo {
|
|
|
61
72
|
"openTerms": {}
|
|
62
73
|
};
|
|
63
74
|
}
|
|
75
|
+
static get events() {
|
|
76
|
+
return [{
|
|
77
|
+
"method": "apiErrorEvent",
|
|
78
|
+
"name": "apiError",
|
|
79
|
+
"bubbles": true,
|
|
80
|
+
"cancelable": true,
|
|
81
|
+
"composed": true,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": ""
|
|
85
|
+
},
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "any",
|
|
88
|
+
"resolved": "any",
|
|
89
|
+
"references": {}
|
|
90
|
+
}
|
|
91
|
+
}];
|
|
92
|
+
}
|
|
64
93
|
static get listeners() {
|
|
65
94
|
return [{
|
|
66
95
|
"name": "agreementAcceptance",
|
|
@@ -4,10 +4,21 @@ import { CompleteValues } from '../../../helpers/textValues';
|
|
|
4
4
|
import completeImg from '../../../assets/complete.svg';
|
|
5
5
|
import store from '../../../helpers/store';
|
|
6
6
|
import Events from '../../../helpers/Events';
|
|
7
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
8
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
7
9
|
export class EndRedirect {
|
|
8
|
-
|
|
10
|
+
constructor() {
|
|
11
|
+
this.apiCall = new ApiCall();
|
|
12
|
+
}
|
|
13
|
+
async componentDidLoad() {
|
|
9
14
|
Events.init(window);
|
|
10
15
|
Events.flowCompleted();
|
|
16
|
+
try {
|
|
17
|
+
await this.apiCall.AddStep(FlowSteps.End);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
this.apiErrorEvent.emit(e);
|
|
21
|
+
}
|
|
11
22
|
}
|
|
12
23
|
render() {
|
|
13
24
|
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, CompleteValues.Title), h("p", { class: "main-text font-size-18 mt-8 text-center" }, CompleteValues.Description)), h("div", { class: "buletin-container" }, h("div", { class: "container-coin" }, h("div", { class: "coin-scale" }, h("div", { class: "coin-flip" }, h("img", { class: "w-40 coin", src: completeImg }))))), h("div", { class: "text-center" }, h("p", { class: "font-weight-900 font-size-3 color-black-2 text-center mt-20" }, CompleteValues.Message), h("p", null, store.requestId)), h("div", { class: "btn-buletin" }, h("p", { class: "main-text font-size-18 text-center mb-0" }, CompleteValues.FooterText)))));
|
|
@@ -23,4 +34,22 @@ export class EndRedirect {
|
|
|
23
34
|
"$": ["end-redirect.css"]
|
|
24
35
|
};
|
|
25
36
|
}
|
|
37
|
+
static get events() {
|
|
38
|
+
return [{
|
|
39
|
+
"method": "apiErrorEvent",
|
|
40
|
+
"name": "apiError",
|
|
41
|
+
"bubbles": true,
|
|
42
|
+
"cancelable": true,
|
|
43
|
+
"composed": true,
|
|
44
|
+
"docs": {
|
|
45
|
+
"tags": [],
|
|
46
|
+
"text": ""
|
|
47
|
+
},
|
|
48
|
+
"complexType": {
|
|
49
|
+
"original": "any",
|
|
50
|
+
"resolved": "any",
|
|
51
|
+
"references": {}
|
|
52
|
+
}
|
|
53
|
+
}];
|
|
54
|
+
}
|
|
26
55
|
}
|
|
@@ -3,6 +3,7 @@ import { ApiCall } from '../../../helpers/ApiCall';
|
|
|
3
3
|
import store from '../../../helpers/store';
|
|
4
4
|
import { Stream } from '../../../helpers/Stream';
|
|
5
5
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
6
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
6
7
|
// import { IDPose } from '../../libs/IDML5Detector/IDPose';
|
|
7
8
|
export class IdDoubleSide {
|
|
8
9
|
constructor() {
|
|
@@ -103,6 +104,14 @@ export class IdDoubleSide {
|
|
|
103
104
|
this.flow.verificationFinished = true;
|
|
104
105
|
this.endFlow();
|
|
105
106
|
}
|
|
107
|
+
async componentDidLoad() {
|
|
108
|
+
try {
|
|
109
|
+
await this.apiCall.AddStep(FlowSteps.CiBack);
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
this.apiErrorEvent.emit(e);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
106
115
|
async uploadPhoto() {
|
|
107
116
|
if (this.flow.photoFile == null || this.flow.photoDone) {
|
|
108
117
|
return;
|
|
@@ -3,6 +3,7 @@ import { ApiCall } from '../../../helpers/ApiCall';
|
|
|
3
3
|
import store from '../../../helpers/store';
|
|
4
4
|
import { Stream } from '../../../helpers/Stream';
|
|
5
5
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
6
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
6
7
|
// import { IDPose } from '../../libs/IDML5Detector/IDPose';
|
|
7
8
|
export class IdSingleSide {
|
|
8
9
|
constructor() {
|
|
@@ -66,6 +67,14 @@ export class IdSingleSide {
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
}
|
|
70
|
+
async componentDidLoad() {
|
|
71
|
+
try {
|
|
72
|
+
await this.apiCall.AddStep(FlowSteps.CiFront);
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
this.apiErrorEvent.emit(e);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
69
78
|
async uploadPhoto() {
|
|
70
79
|
if (this.idFlow.photoFile == null || this.idFlow.photoDone) {
|
|
71
80
|
return;
|
|
@@ -9,6 +9,7 @@ import store from '../../../helpers/store';
|
|
|
9
9
|
import Events from '../../../helpers/Events';
|
|
10
10
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
11
11
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
12
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
12
13
|
export class LandingValidation {
|
|
13
14
|
constructor() {
|
|
14
15
|
this.device = undefined;
|
|
@@ -18,9 +19,15 @@ export class LandingValidation {
|
|
|
18
19
|
this.apiCall = new ApiCall();
|
|
19
20
|
await this.initRequest();
|
|
20
21
|
}
|
|
21
|
-
componentDidLoad() {
|
|
22
|
+
async componentDidLoad() {
|
|
22
23
|
Events.init(window);
|
|
23
24
|
Events.flowStarted();
|
|
25
|
+
try {
|
|
26
|
+
await this.apiCall.AddStep(FlowSteps.Landing);
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
this.apiErrorEvent.emit(e);
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
async initRequest() {
|
|
26
33
|
if (store.hasIdBack) {
|
|
@@ -6,6 +6,7 @@ import { ApiCall } from '../../../helpers/ApiCall';
|
|
|
6
6
|
import Events from '../../../helpers/Events';
|
|
7
7
|
import { OrderStatuses } from '../../../models/OrderStatuses';
|
|
8
8
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
9
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
9
10
|
export class MobileRedirect {
|
|
10
11
|
constructor() {
|
|
11
12
|
this.delay = ms => new Promise(res => setTimeout(res, ms));
|
|
@@ -43,6 +44,12 @@ export class MobileRedirect {
|
|
|
43
44
|
async componentDidLoad() {
|
|
44
45
|
Events.init(window);
|
|
45
46
|
Events.flowStarted();
|
|
47
|
+
try {
|
|
48
|
+
await this.apiCall.AddStep(FlowSteps.MobileRedirect);
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
this.apiErrorEvent.emit(e);
|
|
52
|
+
}
|
|
46
53
|
await this.delay(5000);
|
|
47
54
|
await this.checkStatus();
|
|
48
55
|
while (this.orderStatus == OrderStatuses.Capturing || this.orderStatus == OrderStatuses.Waiting) {
|
|
@@ -3,6 +3,7 @@ import { ApiCall } from '../../../helpers/ApiCall';
|
|
|
3
3
|
import store from '../../../helpers/store';
|
|
4
4
|
import { PhoneValidationValues, CodeValidationValues } from '../../../helpers/textValues';
|
|
5
5
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
6
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
6
7
|
export class SmsCodeValidation {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.title = undefined;
|
|
@@ -16,6 +17,7 @@ export class SmsCodeValidation {
|
|
|
16
17
|
}
|
|
17
18
|
async doAction() {
|
|
18
19
|
try {
|
|
20
|
+
this.canSend = false;
|
|
19
21
|
if (store.flowStatus == FlowStatus.CODE || store.flowStatus == FlowStatus.CODEERROR) {
|
|
20
22
|
var codeChecked = await this.apiCall.CheckOTPCode(store.requestId, this.code);
|
|
21
23
|
if (codeChecked === true) {
|
|
@@ -53,6 +55,19 @@ export class SmsCodeValidation {
|
|
|
53
55
|
this.buttonText = CodeValidationValues.Button;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
58
|
+
async componentDidLoad() {
|
|
59
|
+
try {
|
|
60
|
+
if (store.flowStatus == FlowStatus.PHONE) {
|
|
61
|
+
await this.apiCall.AddStep(FlowSteps.OtpSend);
|
|
62
|
+
}
|
|
63
|
+
if (store.flowStatus == FlowStatus.CODE) {
|
|
64
|
+
await this.apiCall.AddStep(FlowSteps.OtpCheck);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
this.apiErrorEvent.emit(e);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
56
71
|
handleChangePhone(ev) {
|
|
57
72
|
let value = ev.target ? ev.target.value : '';
|
|
58
73
|
this.phoneNumber = value.replace(/\D/g, '');
|
|
@@ -3,6 +3,7 @@ import { ApiCall } from '../../../helpers/ApiCall';
|
|
|
3
3
|
import store from '../../../helpers/store';
|
|
4
4
|
import { Stream } from '../../../helpers/Stream';
|
|
5
5
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
6
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
6
7
|
export class UserLiveness {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.device = undefined;
|
|
@@ -17,6 +18,14 @@ export class UserLiveness {
|
|
|
17
18
|
};
|
|
18
19
|
this.apiCall = new ApiCall();
|
|
19
20
|
}
|
|
21
|
+
async componentDidLoad() {
|
|
22
|
+
try {
|
|
23
|
+
await this.apiCall.AddStep(FlowSteps.Selfie);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
this.apiErrorEvent.emit(e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
20
29
|
componentWillLoad() {
|
|
21
30
|
this.showHowTo = true;
|
|
22
31
|
}
|
|
@@ -2,6 +2,7 @@ import { OrderStatuses } from '../models/OrderStatuses';
|
|
|
2
2
|
import store from './store';
|
|
3
3
|
import { ApiUrls } from './textValues';
|
|
4
4
|
import { FlowStatus } from '../models/FlowStatus';
|
|
5
|
+
import { FlowSteps } from '../models/FlowSteps';
|
|
5
6
|
export class ApiCall {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.toBase64 = (file) => new Promise((resolve, reject) => {
|
|
@@ -117,6 +118,11 @@ export class ApiCall {
|
|
|
117
118
|
}
|
|
118
119
|
catch (_a) { }
|
|
119
120
|
}
|
|
121
|
+
async AddStep(step) {
|
|
122
|
+
let data = { requestId: store.requestId, step: FlowSteps[step] };
|
|
123
|
+
let result = await this.post(this.urls.AddStep, JSON.stringify(data));
|
|
124
|
+
return result.saved;
|
|
125
|
+
}
|
|
120
126
|
async AbortRequest() {
|
|
121
127
|
let result = await this.post(this.urls.AbortRequest, JSON.stringify({ requestId: store.requestId }));
|
|
122
128
|
return result.saved;
|
|
@@ -119,6 +119,7 @@ export class ApiUrls {
|
|
|
119
119
|
this.SendLink = this.uriEnv + 'validation/otp/sendlink';
|
|
120
120
|
this.GetStatus = this.uriEnv + 'validation/identity/status';
|
|
121
121
|
this.AddLog = this.uriEnv + 'validation/logs/add';
|
|
122
|
+
this.AddStep = this.uriEnv + 'validation/logs/step';
|
|
122
123
|
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export var FlowSteps;
|
|
2
|
+
(function (FlowSteps) {
|
|
3
|
+
FlowSteps[FlowSteps["MobileRedirect"] = 0] = "MobileRedirect";
|
|
4
|
+
FlowSteps[FlowSteps["Landing"] = 1] = "Landing";
|
|
5
|
+
FlowSteps[FlowSteps["Agreements"] = 2] = "Agreements";
|
|
6
|
+
FlowSteps[FlowSteps["OtpSend"] = 3] = "OtpSend";
|
|
7
|
+
FlowSteps[FlowSteps["OtpCheck"] = 4] = "OtpCheck";
|
|
8
|
+
FlowSteps[FlowSteps["CiFrontHowTo"] = 5] = "CiFrontHowTo";
|
|
9
|
+
FlowSteps[FlowSteps["CiFront"] = 6] = "CiFront";
|
|
10
|
+
FlowSteps[FlowSteps["CiBackHowTo"] = 7] = "CiBackHowTo";
|
|
11
|
+
FlowSteps[FlowSteps["CiBack"] = 8] = "CiBack";
|
|
12
|
+
FlowSteps[FlowSteps["SelfieHowTo"] = 9] = "SelfieHowTo";
|
|
13
|
+
FlowSteps[FlowSteps["Selfie"] = 10] = "Selfie";
|
|
14
|
+
FlowSteps[FlowSteps["End"] = 11] = "End";
|
|
15
|
+
})(FlowSteps || (FlowSteps = {}));
|
|
@@ -333,6 +333,7 @@ class ApiUrls {
|
|
|
333
333
|
this.SendLink = this.uriEnv + 'validation/otp/sendlink';
|
|
334
334
|
this.GetStatus = this.uriEnv + 'validation/identity/status';
|
|
335
335
|
this.AddLog = this.uriEnv + 'validation/logs/add';
|
|
336
|
+
this.AddStep = this.uriEnv + 'validation/logs/step';
|
|
336
337
|
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
337
338
|
}
|
|
338
339
|
}
|
|
@@ -385,6 +386,22 @@ onChange('phoneValidation', value => {
|
|
|
385
386
|
sessionStorage.setItem(SessionKeys.PhoneValidationKey, String(value));
|
|
386
387
|
});
|
|
387
388
|
|
|
389
|
+
var FlowSteps;
|
|
390
|
+
(function (FlowSteps) {
|
|
391
|
+
FlowSteps[FlowSteps["MobileRedirect"] = 0] = "MobileRedirect";
|
|
392
|
+
FlowSteps[FlowSteps["Landing"] = 1] = "Landing";
|
|
393
|
+
FlowSteps[FlowSteps["Agreements"] = 2] = "Agreements";
|
|
394
|
+
FlowSteps[FlowSteps["OtpSend"] = 3] = "OtpSend";
|
|
395
|
+
FlowSteps[FlowSteps["OtpCheck"] = 4] = "OtpCheck";
|
|
396
|
+
FlowSteps[FlowSteps["CiFrontHowTo"] = 5] = "CiFrontHowTo";
|
|
397
|
+
FlowSteps[FlowSteps["CiFront"] = 6] = "CiFront";
|
|
398
|
+
FlowSteps[FlowSteps["CiBackHowTo"] = 7] = "CiBackHowTo";
|
|
399
|
+
FlowSteps[FlowSteps["CiBack"] = 8] = "CiBack";
|
|
400
|
+
FlowSteps[FlowSteps["SelfieHowTo"] = 9] = "SelfieHowTo";
|
|
401
|
+
FlowSteps[FlowSteps["Selfie"] = 10] = "Selfie";
|
|
402
|
+
FlowSteps[FlowSteps["End"] = 11] = "End";
|
|
403
|
+
})(FlowSteps || (FlowSteps = {}));
|
|
404
|
+
|
|
388
405
|
class ApiCall {
|
|
389
406
|
constructor() {
|
|
390
407
|
this.toBase64 = (file) => new Promise((resolve, reject) => {
|
|
@@ -500,6 +517,11 @@ class ApiCall {
|
|
|
500
517
|
}
|
|
501
518
|
catch (_a) { }
|
|
502
519
|
}
|
|
520
|
+
async AddStep(step) {
|
|
521
|
+
let data = { requestId: state.requestId, step: FlowSteps[step] };
|
|
522
|
+
let result = await this.post(this.urls.AddStep, JSON.stringify(data));
|
|
523
|
+
return result.saved;
|
|
524
|
+
}
|
|
503
525
|
async AbortRequest() {
|
|
504
526
|
let result = await this.post(this.urls.AbortRequest, JSON.stringify({ requestId: state.requestId }));
|
|
505
527
|
return result.saved;
|
|
@@ -540,12 +562,22 @@ const agreementInfoCss = "";
|
|
|
540
562
|
const AgreementInfo = class {
|
|
541
563
|
constructor(hostRef) {
|
|
542
564
|
registerInstance(this, hostRef);
|
|
565
|
+
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
543
566
|
this.agreementsChecked = undefined;
|
|
544
567
|
this.termsChecked = undefined;
|
|
545
568
|
this.openAgreements = undefined;
|
|
546
569
|
this.openTerms = undefined;
|
|
547
570
|
this.agreementsChecked = false;
|
|
548
571
|
this.termsChecked = false;
|
|
572
|
+
this.apiCall = new ApiCall();
|
|
573
|
+
}
|
|
574
|
+
async componentDidLoad() {
|
|
575
|
+
try {
|
|
576
|
+
await this.apiCall.AddStep(FlowSteps.Agreements);
|
|
577
|
+
}
|
|
578
|
+
catch (e) {
|
|
579
|
+
this.apiErrorEvent.emit(e);
|
|
580
|
+
}
|
|
549
581
|
}
|
|
550
582
|
componentWillLoad() {
|
|
551
583
|
this.openAgreements = false;
|
|
@@ -5206,10 +5238,18 @@ const endRedirectCss = "h1{font-family:'Inter', sans-serif;font-style:normal;fon
|
|
|
5206
5238
|
const EndRedirect = class {
|
|
5207
5239
|
constructor(hostRef) {
|
|
5208
5240
|
registerInstance(this, hostRef);
|
|
5241
|
+
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
5242
|
+
this.apiCall = new ApiCall();
|
|
5209
5243
|
}
|
|
5210
|
-
componentDidLoad() {
|
|
5244
|
+
async componentDidLoad() {
|
|
5211
5245
|
Events.init(window);
|
|
5212
5246
|
Events.flowCompleted();
|
|
5247
|
+
try {
|
|
5248
|
+
await this.apiCall.AddStep(FlowSteps.End);
|
|
5249
|
+
}
|
|
5250
|
+
catch (e) {
|
|
5251
|
+
this.apiErrorEvent.emit(e);
|
|
5252
|
+
}
|
|
5213
5253
|
}
|
|
5214
5254
|
render() {
|
|
5215
5255
|
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, CompleteValues.Title), h("p", { class: "main-text font-size-18 mt-8 text-center" }, CompleteValues.Description)), h("div", { class: "buletin-container" }, h("div", { class: "container-coin" }, h("div", { class: "coin-scale" }, h("div", { class: "coin-flip" }, h("img", { class: "w-40 coin", src: completeSvg }))))), h("div", { class: "text-center" }, h("p", { class: "font-weight-900 font-size-3 color-black-2 text-center mt-20" }, CompleteValues.Message), h("p", null, state.requestId)), h("div", { class: "btn-buletin" }, h("p", { class: "main-text font-size-18 text-center mb-0" }, CompleteValues.FooterText)))));
|
|
@@ -5716,6 +5756,14 @@ const IdDoubleSide = class {
|
|
|
5716
5756
|
this.flow.verificationFinished = true;
|
|
5717
5757
|
this.endFlow();
|
|
5718
5758
|
}
|
|
5759
|
+
async componentDidLoad() {
|
|
5760
|
+
try {
|
|
5761
|
+
await this.apiCall.AddStep(FlowSteps.CiBack);
|
|
5762
|
+
}
|
|
5763
|
+
catch (e) {
|
|
5764
|
+
this.apiErrorEvent.emit(e);
|
|
5765
|
+
}
|
|
5766
|
+
}
|
|
5719
5767
|
async uploadPhoto() {
|
|
5720
5768
|
if (this.flow.photoFile == null || this.flow.photoDone) {
|
|
5721
5769
|
return;
|
|
@@ -5856,6 +5904,14 @@ const IdSingleSide = class {
|
|
|
5856
5904
|
}
|
|
5857
5905
|
}
|
|
5858
5906
|
}
|
|
5907
|
+
async componentDidLoad() {
|
|
5908
|
+
try {
|
|
5909
|
+
await this.apiCall.AddStep(FlowSteps.CiFront);
|
|
5910
|
+
}
|
|
5911
|
+
catch (e) {
|
|
5912
|
+
this.apiErrorEvent.emit(e);
|
|
5913
|
+
}
|
|
5914
|
+
}
|
|
5859
5915
|
async uploadPhoto() {
|
|
5860
5916
|
if (this.idFlow.photoFile == null || this.idFlow.photoDone) {
|
|
5861
5917
|
return;
|
|
@@ -6298,9 +6354,15 @@ const LandingValidation = class {
|
|
|
6298
6354
|
this.apiCall = new ApiCall();
|
|
6299
6355
|
await this.initRequest();
|
|
6300
6356
|
}
|
|
6301
|
-
componentDidLoad() {
|
|
6357
|
+
async componentDidLoad() {
|
|
6302
6358
|
Events.init(window);
|
|
6303
6359
|
Events.flowStarted();
|
|
6360
|
+
try {
|
|
6361
|
+
await this.apiCall.AddStep(FlowSteps.Landing);
|
|
6362
|
+
}
|
|
6363
|
+
catch (e) {
|
|
6364
|
+
this.apiErrorEvent.emit(e);
|
|
6365
|
+
}
|
|
6304
6366
|
}
|
|
6305
6367
|
async initRequest() {
|
|
6306
6368
|
if (state.hasIdBack) {
|
|
@@ -9254,6 +9316,12 @@ const MobileRedirect = class {
|
|
|
9254
9316
|
async componentDidLoad() {
|
|
9255
9317
|
Events.init(window);
|
|
9256
9318
|
Events.flowStarted();
|
|
9319
|
+
try {
|
|
9320
|
+
await this.apiCall.AddStep(FlowSteps.MobileRedirect);
|
|
9321
|
+
}
|
|
9322
|
+
catch (e) {
|
|
9323
|
+
this.apiErrorEvent.emit(e);
|
|
9324
|
+
}
|
|
9257
9325
|
await this.delay(5000);
|
|
9258
9326
|
await this.checkStatus();
|
|
9259
9327
|
while (this.orderStatus == OrderStatuses.Capturing || this.orderStatus == OrderStatuses.Waiting) {
|
|
@@ -9453,6 +9521,7 @@ const SmsCodeValidation = class {
|
|
|
9453
9521
|
}
|
|
9454
9522
|
async doAction() {
|
|
9455
9523
|
try {
|
|
9524
|
+
this.canSend = false;
|
|
9456
9525
|
if (state.flowStatus == FlowStatus.CODE || state.flowStatus == FlowStatus.CODEERROR) {
|
|
9457
9526
|
var codeChecked = await this.apiCall.CheckOTPCode(state.requestId, this.code);
|
|
9458
9527
|
if (codeChecked === true) {
|
|
@@ -9490,6 +9559,19 @@ const SmsCodeValidation = class {
|
|
|
9490
9559
|
this.buttonText = CodeValidationValues.Button;
|
|
9491
9560
|
}
|
|
9492
9561
|
}
|
|
9562
|
+
async componentDidLoad() {
|
|
9563
|
+
try {
|
|
9564
|
+
if (state.flowStatus == FlowStatus.PHONE) {
|
|
9565
|
+
await this.apiCall.AddStep(FlowSteps.OtpSend);
|
|
9566
|
+
}
|
|
9567
|
+
if (state.flowStatus == FlowStatus.CODE) {
|
|
9568
|
+
await this.apiCall.AddStep(FlowSteps.OtpCheck);
|
|
9569
|
+
}
|
|
9570
|
+
}
|
|
9571
|
+
catch (e) {
|
|
9572
|
+
this.apiErrorEvent.emit(e);
|
|
9573
|
+
}
|
|
9574
|
+
}
|
|
9493
9575
|
handleChangePhone(ev) {
|
|
9494
9576
|
let value = ev.target ? ev.target.value : '';
|
|
9495
9577
|
this.phoneNumber = value.replace(/\D/g, '');
|
|
@@ -9541,6 +9623,14 @@ const UserLiveness = class {
|
|
|
9541
9623
|
};
|
|
9542
9624
|
this.apiCall = new ApiCall();
|
|
9543
9625
|
}
|
|
9626
|
+
async componentDidLoad() {
|
|
9627
|
+
try {
|
|
9628
|
+
await this.apiCall.AddStep(FlowSteps.Selfie);
|
|
9629
|
+
}
|
|
9630
|
+
catch (e) {
|
|
9631
|
+
this.apiErrorEvent.emit(e);
|
|
9632
|
+
}
|
|
9633
|
+
}
|
|
9544
9634
|
componentWillLoad() {
|
|
9545
9635
|
this.showHowTo = true;
|
|
9546
9636
|
}
|