@ekyc_qoobiss/qbs-ect-cmp 3.5.0 → 3.5.2
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_18.cjs.entry.js +92 -27
- package/dist/collection/components/base-component.js +14 -2
- package/dist/collection/components/common/how-to-info/how-to-info.js +27 -7
- package/dist/collection/components/common/id-back-capture/id-back-capture.js +9 -0
- package/dist/collection/components/common/id-capture/id-capture.js +9 -0
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +9 -0
- package/dist/collection/components/flow/end-redirect/end-redirect.js +1 -9
- package/dist/collection/helpers/ApiCall.js +34 -4
- package/dist/collection/models/FlowSteps.js +11 -2
- package/dist/esm/agreement-check_18.entry.js +92 -27
- package/dist/qbs-ect-cmp/{p-f500a873.entry.js → p-8a378193.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/base-component.d.ts +2 -1
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +5 -0
- package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +1 -0
- package/dist/types/components/common/id-capture/id-capture.d.ts +1 -0
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +1 -0
- package/dist/types/components/flow/end-redirect/end-redirect.d.ts +0 -1
- package/dist/types/components.d.ts +1 -0
- package/dist/types/models/FlowSteps.d.ts +11 -2
- package/package.json +1 -1
|
@@ -413,11 +413,20 @@ var FlowSteps;
|
|
|
413
413
|
FlowSteps[FlowSteps["Agreements"] = 'agreements'] = "Agreements";
|
|
414
414
|
FlowSteps[FlowSteps["OtpSend"] = 'otp-send'] = "OtpSend";
|
|
415
415
|
FlowSteps[FlowSteps["OtpCheck"] = 'otp-check'] = "OtpCheck";
|
|
416
|
-
FlowSteps[FlowSteps["CiFrontHowTo"] = 'ci-front-how-to'] = "CiFrontHowTo";
|
|
417
416
|
FlowSteps[FlowSteps["CiFront"] = 'ci-front'] = "CiFront";
|
|
418
|
-
FlowSteps[FlowSteps["
|
|
417
|
+
FlowSteps[FlowSteps["CiFrontHowTo"] = 'ci-front-how-to'] = "CiFrontHowTo";
|
|
418
|
+
FlowSteps[FlowSteps["CiFrontHoldAnimation"] = 'ci-front-hold-animation'] = "CiFrontHoldAnimation";
|
|
419
|
+
FlowSteps[FlowSteps["CiFrontTiltAnimation"] = 'ci-front-tilt-animation'] = "CiFrontTiltAnimation";
|
|
420
|
+
FlowSteps[FlowSteps["CiFrontCapture"] = 'ci-front-capture'] = "CiFrontCapture";
|
|
419
421
|
FlowSteps[FlowSteps["CiBack"] = 'ci-back'] = "CiBack";
|
|
422
|
+
FlowSteps[FlowSteps["CiBackHowTo"] = 'ci-back-how-to'] = "CiBackHowTo";
|
|
423
|
+
FlowSteps[FlowSteps["CiBackHoldAnimation"] = 'ci-back-hold-animation'] = "CiBackHoldAnimation";
|
|
424
|
+
FlowSteps[FlowSteps["CiBackTiltAnimation"] = 'ci-back-tilt-animation'] = "CiBackTiltAnimation";
|
|
425
|
+
FlowSteps[FlowSteps["CiBackCapture"] = 'ci-back-capture'] = "CiBackCapture";
|
|
420
426
|
FlowSteps[FlowSteps["SelfieHowTo"] = 'selfie-how-to'] = "SelfieHowTo";
|
|
427
|
+
FlowSteps[FlowSteps["SelfieHoldAnimation"] = 'selfie-hold-animation'] = "SelfieHoldAnimation";
|
|
428
|
+
FlowSteps[FlowSteps["SelfieTiltAnimation"] = 'selfie-tilt-animation'] = "SelfieTiltAnimation";
|
|
429
|
+
FlowSteps[FlowSteps["SelfieCapture"] = 'selfie-capture'] = "SelfieCapture";
|
|
421
430
|
FlowSteps[FlowSteps["Selfie"] = 'selfie'] = "Selfie";
|
|
422
431
|
FlowSteps[FlowSteps["End"] = 'end'] = "End";
|
|
423
432
|
FlowSteps[FlowSteps["CameraError"] = 'camera-error'] = "CameraError";
|
|
@@ -494,11 +503,27 @@ class ApiCall {
|
|
|
494
503
|
}
|
|
495
504
|
this.AddLog('Error in post ', ex);
|
|
496
505
|
try {
|
|
497
|
-
|
|
506
|
+
var request2 = new Request(state.apiBaseUrl + url, {
|
|
507
|
+
method: 'POST',
|
|
508
|
+
body: data,
|
|
509
|
+
headers: {
|
|
510
|
+
'Content-Type': 'application/json',
|
|
511
|
+
'Authorization': 'IDKYC-TOKEN ' + state.token,
|
|
512
|
+
},
|
|
513
|
+
});
|
|
514
|
+
return await this.http(request2);
|
|
498
515
|
}
|
|
499
516
|
catch (ex2) {
|
|
500
517
|
this.AddLog('Error in post ', ex2);
|
|
501
|
-
|
|
518
|
+
var request3 = new Request(state.apiBaseUrl + url, {
|
|
519
|
+
method: 'POST',
|
|
520
|
+
body: data,
|
|
521
|
+
headers: {
|
|
522
|
+
'Content-Type': 'application/json',
|
|
523
|
+
'Authorization': 'IDKYC-TOKEN ' + state.token,
|
|
524
|
+
},
|
|
525
|
+
});
|
|
526
|
+
return await this.http(request3);
|
|
502
527
|
}
|
|
503
528
|
}
|
|
504
529
|
}
|
|
@@ -519,11 +544,25 @@ class ApiCall {
|
|
|
519
544
|
}
|
|
520
545
|
this.AddLog('Error in get ', ex);
|
|
521
546
|
try {
|
|
522
|
-
|
|
547
|
+
var request2 = new Request(state.apiBaseUrl + url, {
|
|
548
|
+
method: 'GET',
|
|
549
|
+
headers: {
|
|
550
|
+
'Content-Type': 'application/json',
|
|
551
|
+
'Authorization': 'IDKYC-TOKEN ' + state.token,
|
|
552
|
+
},
|
|
553
|
+
});
|
|
554
|
+
return await this.http(request2);
|
|
523
555
|
}
|
|
524
556
|
catch (ex2) {
|
|
525
557
|
this.AddLog('Error in get ', ex2);
|
|
526
|
-
|
|
558
|
+
var request3 = new Request(state.apiBaseUrl + url, {
|
|
559
|
+
method: 'GET',
|
|
560
|
+
headers: {
|
|
561
|
+
'Content-Type': 'application/json',
|
|
562
|
+
'Authorization': 'IDKYC-TOKEN ' + state.token,
|
|
563
|
+
},
|
|
564
|
+
});
|
|
565
|
+
return await this.http(request3);
|
|
527
566
|
}
|
|
528
567
|
}
|
|
529
568
|
}
|
|
@@ -834,6 +873,18 @@ class BaseComponent {
|
|
|
834
873
|
setErrorCallback(callback) {
|
|
835
874
|
this.processError = callback;
|
|
836
875
|
}
|
|
876
|
+
async logStep(flowStep, flowMoment) {
|
|
877
|
+
Events.flowEvent(flowStep, flowMoment);
|
|
878
|
+
try {
|
|
879
|
+
await this.apiCall.AddStep(flowStep, flowMoment);
|
|
880
|
+
}
|
|
881
|
+
catch (e) {
|
|
882
|
+
if (this.apiErrorEvent)
|
|
883
|
+
this.apiErrorEvent.emit(e);
|
|
884
|
+
else
|
|
885
|
+
this.processError(e, `${flowStep}-${flowMoment}`);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
837
888
|
async initialize() {
|
|
838
889
|
Events.flowEvent(this.flowStep, FlowMoments.Initialized);
|
|
839
890
|
try {
|
|
@@ -843,7 +894,7 @@ class BaseComponent {
|
|
|
843
894
|
if (this.apiErrorEvent)
|
|
844
895
|
this.apiErrorEvent.emit(e);
|
|
845
896
|
else
|
|
846
|
-
this.processError(e, FlowMoments.Initialized);
|
|
897
|
+
this.processError(e, `${this.flowStep}-${FlowMoments.Initialized}`);
|
|
847
898
|
}
|
|
848
899
|
}
|
|
849
900
|
async finalize() {
|
|
@@ -855,7 +906,7 @@ class BaseComponent {
|
|
|
855
906
|
if (this.apiErrorEvent)
|
|
856
907
|
this.apiErrorEvent.emit(e);
|
|
857
908
|
else
|
|
858
|
-
this.processError(e, FlowMoments.
|
|
909
|
+
this.processError(e, `${this.flowStep}-${FlowMoments.Finalized}`);
|
|
859
910
|
}
|
|
860
911
|
}
|
|
861
912
|
}
|
|
@@ -5557,17 +5608,9 @@ const completeSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODMiIGhlaWdodD0iO
|
|
|
5557
5608
|
const endRedirectCss = "h1{font-family:'Inter', sans-serif;font-style:normal;font-weight:900;font-size:4vh;line-height:4vh;letter-spacing:0.01em;color:#1f2024}p{font-family:'Inter', sans-serif;font-style:normal;font-weight:400;font-size:2vh;line-height:3vh;color:#1f2024;text-align:justify}.container{gap:10rem;text-align:center}.greet{color:rgb(73, 78, 79);visibility:hidden;animation-name:rise;animation-delay:1s;animation-fill-mode:forwards}@keyframes rise{0%{visibility:hidden}50%{visibility:visible}100%{visibility:visible}}.container-coin{background-color:transparent;perspective:1000px;rotate:120deg 0deg}.coin-flip{animation:flip 0.4s ease-in;animation-delay:0.5s;transform-style:preserve-3d;animation-fill-mode:forwards;visibility:hidden}.coin-scale{animation:show 0.4s ease-in;animation-delay:0.5s;transform-style:preserve-3d;animation-fill-mode:forwards}.coin{margin-top:10rem}@keyframes flip{0%{transform:rotateX(140deg);visibility:visible}25%{transform:rotateX(120deg);visibility:visible}50%{transform:rotateX(90deg);visibility:visible}75%{transform:rotateX(75deg);visibility:visible}100%{transform:rotateX(0deg);visibility:visible}}@keyframes show{0%{transform:scale(0)}25%{transform:scale(0.2)}40%{transform:scale(0.4)}50%{transform:scale(0.5)}60%{transform:scale(0.6)}70%{transform:scale(0.7)}100%{transform:scale(1)}}";
|
|
5558
5609
|
|
|
5559
5610
|
const EndRedirect = class {
|
|
5560
|
-
constructor(hostRef) {
|
|
5561
|
-
index.registerInstance(this, hostRef);
|
|
5562
|
-
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5563
|
-
this.baseComponent = new BaseComponent(FlowSteps.End);
|
|
5564
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
5565
|
-
}
|
|
5611
|
+
constructor(hostRef) { index.registerInstance(this, hostRef); this.apiErrorEvent = index.createEvent(this, "apiError", 7); }
|
|
5566
5612
|
async componentDidLoad() {
|
|
5567
5613
|
Events.flowCompleted();
|
|
5568
|
-
if (state.environment !== 'DEMO') {
|
|
5569
|
-
await this.baseComponent.initialize();
|
|
5570
|
-
}
|
|
5571
5614
|
}
|
|
5572
5615
|
render() {
|
|
5573
5616
|
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)))));
|
|
@@ -5593,15 +5636,12 @@ ErrorEnd.style = errorEndCss;
|
|
|
5593
5636
|
const howToInfoCss = "";
|
|
5594
5637
|
|
|
5595
5638
|
const HowToInfo = class {
|
|
5596
|
-
constructor(hostRef) {
|
|
5597
|
-
|
|
5598
|
-
this.
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
this.
|
|
5602
|
-
this.imagePath = undefined;
|
|
5603
|
-
this.buttonText = undefined;
|
|
5604
|
-
this.buttonEnabled = undefined;
|
|
5639
|
+
constructor(hostRef) { index.registerInstance(this, hostRef); this.eventHowToInfoDone = index.createEvent(this, "howToInfoDone", 7); this.apiErrorEvent = index.createEvent(this, "apiError", 7); this.idSide = undefined; this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
|
|
5640
|
+
async componentDidLoad() {
|
|
5641
|
+
await this.baseComponent.initialize();
|
|
5642
|
+
}
|
|
5643
|
+
disconnectedCallback() {
|
|
5644
|
+
this.baseComponent.finalize();
|
|
5605
5645
|
}
|
|
5606
5646
|
buttonClick() {
|
|
5607
5647
|
this.buttonEnabled = false;
|
|
@@ -5615,18 +5655,22 @@ const HowToInfo = class {
|
|
|
5615
5655
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
|
|
5616
5656
|
this.buttonText = HowToValues.IdButton;
|
|
5617
5657
|
if (this.idSide == 'front') {
|
|
5658
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiFrontHowTo);
|
|
5618
5659
|
this.subTitle = HowToValues.IdSubTitileFace;
|
|
5619
5660
|
}
|
|
5620
5661
|
if (this.idSide == 'back') {
|
|
5662
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiBackHowTo);
|
|
5621
5663
|
this.subTitle = HowToValues.IdSubTitileBack;
|
|
5622
5664
|
}
|
|
5623
5665
|
}
|
|
5624
5666
|
if (state.flowStatus == FlowStatus.LIVENESS) {
|
|
5667
|
+
this.baseComponent = new BaseComponent(FlowSteps.SelfieHowTo);
|
|
5625
5668
|
this.topTitle = HowToValues.SelfieTitile;
|
|
5626
5669
|
this.subTitle = HowToValues.SelfieSubTitile;
|
|
5627
5670
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
|
|
5628
5671
|
this.buttonText = HowToValues.SelfieButton;
|
|
5629
5672
|
}
|
|
5673
|
+
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
5630
5674
|
}
|
|
5631
5675
|
render() {
|
|
5632
5676
|
let sub = this.subTitle != '' ? index.h("p", { class: "font-size-2" }, this.subTitle) : null;
|
|
@@ -5779,14 +5823,17 @@ const IdBackCapture = class {
|
|
|
5779
5823
|
this.verified = false;
|
|
5780
5824
|
this.cameras = new Cameras();
|
|
5781
5825
|
this.showDemo = true;
|
|
5826
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiBackHoldAnimation);
|
|
5782
5827
|
}
|
|
5783
5828
|
async eventChangeTitle(event) {
|
|
5829
|
+
this.baseComponent.logStep(FlowSteps.CiBackTiltAnimation, FlowMoments.Initialized);
|
|
5784
5830
|
this.showDemo = true;
|
|
5785
5831
|
this.titleMesage = IdCaptureValues.IDPoseMapping[event.detail];
|
|
5786
5832
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.BackTilted];
|
|
5787
5833
|
this.demoVideo.play();
|
|
5788
5834
|
await delay(IdCaptureValues.VideoLenght);
|
|
5789
5835
|
this.showDemo = false;
|
|
5836
|
+
this.baseComponent.logStep(FlowSteps.CiBackTiltAnimation, FlowMoments.Finalized);
|
|
5790
5837
|
}
|
|
5791
5838
|
eventVideoStarted(event) {
|
|
5792
5839
|
this.videoStarted = true;
|
|
@@ -5799,6 +5846,7 @@ const IdBackCapture = class {
|
|
|
5799
5846
|
}
|
|
5800
5847
|
}
|
|
5801
5848
|
async componentDidLoad() {
|
|
5849
|
+
this.baseComponent.logStep(FlowSteps.CiBackHoldAnimation, FlowMoments.Initialized);
|
|
5802
5850
|
this.titleMesage = IdCaptureValues.TtileRotate;
|
|
5803
5851
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
5804
5852
|
this.demoVideo.play();
|
|
@@ -5807,10 +5855,12 @@ const IdBackCapture = class {
|
|
|
5807
5855
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.BackStraight];
|
|
5808
5856
|
this.demoVideo.play();
|
|
5809
5857
|
await delay(IdCaptureValues.VideoLenght);
|
|
5858
|
+
this.baseComponent.logStep(FlowSteps.CiBackHoldAnimation, FlowMoments.Finalized);
|
|
5810
5859
|
this.showDemo = false;
|
|
5811
5860
|
this.openCamera();
|
|
5812
5861
|
}
|
|
5813
5862
|
async openCamera() {
|
|
5863
|
+
this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
|
|
5814
5864
|
var constraints = this.cameras.GetConstraints(state.cameraId, state.device);
|
|
5815
5865
|
setTimeout(() => {
|
|
5816
5866
|
navigator.mediaDevices
|
|
@@ -5853,6 +5903,7 @@ const IdBackCapture = class {
|
|
|
5853
5903
|
this.captureTaken = true;
|
|
5854
5904
|
let res = await Stream.getInstance().takePhoto();
|
|
5855
5905
|
this.photoIsReady(res);
|
|
5906
|
+
this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Finalized);
|
|
5856
5907
|
}
|
|
5857
5908
|
render() {
|
|
5858
5909
|
let cameraStyle;
|
|
@@ -5893,14 +5944,17 @@ const IdCapture = class {
|
|
|
5893
5944
|
this.verified = false;
|
|
5894
5945
|
this.cameras = new Cameras();
|
|
5895
5946
|
this.showDemo = true;
|
|
5947
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiFrontHoldAnimation);
|
|
5896
5948
|
}
|
|
5897
5949
|
async eventChangeTitle(event) {
|
|
5950
|
+
this.baseComponent.logStep(FlowSteps.CiFrontTiltAnimation, FlowMoments.Initialized);
|
|
5898
5951
|
this.showDemo = true;
|
|
5899
5952
|
this.titleMesage = IdCaptureValues.IDPoseMapping[event.detail];
|
|
5900
5953
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
|
|
5901
5954
|
this.demoVideo.play();
|
|
5902
5955
|
await delay(IdCaptureValues.VideoLenght);
|
|
5903
5956
|
this.showDemo = false;
|
|
5957
|
+
this.baseComponent.logStep(FlowSteps.CiFrontTiltAnimation, FlowMoments.Finalized);
|
|
5904
5958
|
}
|
|
5905
5959
|
eventVideoStarted(event) {
|
|
5906
5960
|
this.videoStarted = true;
|
|
@@ -5914,13 +5968,16 @@ const IdCapture = class {
|
|
|
5914
5968
|
}
|
|
5915
5969
|
}
|
|
5916
5970
|
async componentDidLoad() {
|
|
5971
|
+
this.baseComponent.logStep(FlowSteps.CiFrontHoldAnimation, FlowMoments.Initialized);
|
|
5917
5972
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Straight];
|
|
5918
5973
|
this.demoVideo.play();
|
|
5919
5974
|
await delay(IdCaptureValues.VideoLenght);
|
|
5975
|
+
this.baseComponent.logStep(FlowSteps.CiFrontHoldAnimation, FlowMoments.Finalized);
|
|
5920
5976
|
this.showDemo = false;
|
|
5921
5977
|
this.openCamera();
|
|
5922
5978
|
}
|
|
5923
5979
|
async openCamera() {
|
|
5980
|
+
this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
|
|
5924
5981
|
var constraints = this.cameras.GetConstraints(state.cameraId, state.device);
|
|
5925
5982
|
setTimeout(() => {
|
|
5926
5983
|
navigator.mediaDevices
|
|
@@ -5952,6 +6009,7 @@ const IdCapture = class {
|
|
|
5952
6009
|
this.captureTaken = true;
|
|
5953
6010
|
let res = await Stream.getInstance().takePhoto();
|
|
5954
6011
|
this.photoIsReady(res);
|
|
6012
|
+
this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Finalized);
|
|
5955
6013
|
}
|
|
5956
6014
|
async verificationFinished() {
|
|
5957
6015
|
if (this.verified)
|
|
@@ -6374,7 +6432,7 @@ function v4(options, buf, offset) {
|
|
|
6374
6432
|
}
|
|
6375
6433
|
|
|
6376
6434
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
6377
|
-
const version$1 = "3.5.
|
|
6435
|
+
const version$1 = "3.5.2";
|
|
6378
6436
|
const description = "Person Identification Component";
|
|
6379
6437
|
const main = "./dist/index.cjs.js";
|
|
6380
6438
|
const module$1 = "./dist/index.js";
|
|
@@ -9800,6 +9858,7 @@ const SelfieCapture = class {
|
|
|
9800
9858
|
this.cameras = new Cameras();
|
|
9801
9859
|
this.demoEnded = false;
|
|
9802
9860
|
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
9861
|
+
this.baseComponent = new BaseComponent(FlowSteps.SelfieHoldAnimation);
|
|
9803
9862
|
}
|
|
9804
9863
|
async eventChangeTitle(event) {
|
|
9805
9864
|
// this.stopAnimation = false;
|
|
@@ -9807,11 +9866,13 @@ const SelfieCapture = class {
|
|
|
9807
9866
|
this.titleMesage = SelfieCaptureValues.FinalTitle;
|
|
9808
9867
|
}
|
|
9809
9868
|
else {
|
|
9869
|
+
this.baseComponent.logStep(FlowSteps.SelfieTiltAnimation, FlowMoments.Initialized);
|
|
9810
9870
|
this.titleMesage = SelfieCaptureValues.FacePoseMapping[event.detail];
|
|
9811
9871
|
this.demoEnded = false;
|
|
9812
9872
|
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[event.detail];
|
|
9813
9873
|
this.demoVideo.play();
|
|
9814
9874
|
await delay(SelfieCaptureValues.VideoLenght);
|
|
9875
|
+
this.baseComponent.logStep(FlowSteps.SelfieTiltAnimation, FlowMoments.Finalized);
|
|
9815
9876
|
this.demoEnded = true;
|
|
9816
9877
|
}
|
|
9817
9878
|
}
|
|
@@ -9830,13 +9891,16 @@ const SelfieCapture = class {
|
|
|
9830
9891
|
}
|
|
9831
9892
|
}
|
|
9832
9893
|
async componentDidLoad() {
|
|
9894
|
+
this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Initialized);
|
|
9833
9895
|
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
|
|
9834
9896
|
this.demoVideo.play();
|
|
9835
9897
|
await delay(SelfieCaptureValues.VideoLenght);
|
|
9898
|
+
this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Finalized);
|
|
9836
9899
|
this.demoEnded = true;
|
|
9837
9900
|
this.openCamera();
|
|
9838
9901
|
}
|
|
9839
9902
|
async openCamera() {
|
|
9903
|
+
this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
|
|
9840
9904
|
const constraints = this.cameras.GetConstraints('', state.device, true);
|
|
9841
9905
|
setTimeout(() => {
|
|
9842
9906
|
navigator.mediaDevices
|
|
@@ -9867,6 +9931,7 @@ const SelfieCapture = class {
|
|
|
9867
9931
|
this.captureTaken = true;
|
|
9868
9932
|
let res = await Stream.getInstance().takePhoto();
|
|
9869
9933
|
this.photoIsReady(res);
|
|
9934
|
+
this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Finalized);
|
|
9870
9935
|
}
|
|
9871
9936
|
verificationFinished() {
|
|
9872
9937
|
if (this.verified)
|
|
@@ -21,6 +21,18 @@ export class BaseComponent {
|
|
|
21
21
|
setErrorCallback(callback) {
|
|
22
22
|
this.processError = callback;
|
|
23
23
|
}
|
|
24
|
+
async logStep(flowStep, flowMoment) {
|
|
25
|
+
Events.flowEvent(flowStep, flowMoment);
|
|
26
|
+
try {
|
|
27
|
+
await this.apiCall.AddStep(flowStep, flowMoment);
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
if (this.apiErrorEvent)
|
|
31
|
+
this.apiErrorEvent.emit(e);
|
|
32
|
+
else
|
|
33
|
+
this.processError(e, `${flowStep}-${flowMoment}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
24
36
|
async initialize() {
|
|
25
37
|
Events.flowEvent(this.flowStep, FlowMoments.Initialized);
|
|
26
38
|
try {
|
|
@@ -30,7 +42,7 @@ export class BaseComponent {
|
|
|
30
42
|
if (this.apiErrorEvent)
|
|
31
43
|
this.apiErrorEvent.emit(e);
|
|
32
44
|
else
|
|
33
|
-
this.processError(e, FlowMoments.Initialized);
|
|
45
|
+
this.processError(e, `${this.flowStep}-${FlowMoments.Initialized}`);
|
|
34
46
|
}
|
|
35
47
|
}
|
|
36
48
|
async finalize() {
|
|
@@ -42,7 +54,7 @@ export class BaseComponent {
|
|
|
42
54
|
if (this.apiErrorEvent)
|
|
43
55
|
this.apiErrorEvent.emit(e);
|
|
44
56
|
else
|
|
45
|
-
this.processError(e, FlowMoments.
|
|
57
|
+
this.processError(e, `${this.flowStep}-${FlowMoments.Finalized}`);
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
}
|
|
@@ -2,14 +2,15 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
import { HowToValues } from '../../../helpers/textValues';
|
|
3
3
|
import store from '../../../helpers/store';
|
|
4
4
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
5
|
+
import { BaseComponent } from '../../base-component';
|
|
6
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
5
7
|
export class HowToInfo {
|
|
6
|
-
constructor() {
|
|
7
|
-
|
|
8
|
-
this.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.
|
|
12
|
-
this.buttonEnabled = undefined;
|
|
8
|
+
constructor() { this.idSide = undefined; this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
|
|
9
|
+
async componentDidLoad() {
|
|
10
|
+
await this.baseComponent.initialize();
|
|
11
|
+
}
|
|
12
|
+
disconnectedCallback() {
|
|
13
|
+
this.baseComponent.finalize();
|
|
13
14
|
}
|
|
14
15
|
buttonClick() {
|
|
15
16
|
this.buttonEnabled = false;
|
|
@@ -23,18 +24,22 @@ export class HowToInfo {
|
|
|
23
24
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
|
|
24
25
|
this.buttonText = HowToValues.IdButton;
|
|
25
26
|
if (this.idSide == 'front') {
|
|
27
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiFrontHowTo);
|
|
26
28
|
this.subTitle = HowToValues.IdSubTitileFace;
|
|
27
29
|
}
|
|
28
30
|
if (this.idSide == 'back') {
|
|
31
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiBackHowTo);
|
|
29
32
|
this.subTitle = HowToValues.IdSubTitileBack;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
if (store.flowStatus == FlowStatus.LIVENESS) {
|
|
36
|
+
this.baseComponent = new BaseComponent(FlowSteps.SelfieHowTo);
|
|
33
37
|
this.topTitle = HowToValues.SelfieTitile;
|
|
34
38
|
this.subTitle = HowToValues.SelfieSubTitile;
|
|
35
39
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
|
|
36
40
|
this.buttonText = HowToValues.SelfieButton;
|
|
37
41
|
}
|
|
42
|
+
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
38
43
|
}
|
|
39
44
|
render() {
|
|
40
45
|
let sub = this.subTitle != '' ? h("p", { class: "font-size-2" }, this.subTitle) : null;
|
|
@@ -97,6 +102,21 @@ export class HowToInfo {
|
|
|
97
102
|
"resolved": "any",
|
|
98
103
|
"references": {}
|
|
99
104
|
}
|
|
105
|
+
}, {
|
|
106
|
+
"method": "apiErrorEvent",
|
|
107
|
+
"name": "apiError",
|
|
108
|
+
"bubbles": true,
|
|
109
|
+
"cancelable": true,
|
|
110
|
+
"composed": true,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "any",
|
|
117
|
+
"resolved": "any",
|
|
118
|
+
"references": {}
|
|
119
|
+
}
|
|
100
120
|
}];
|
|
101
121
|
}
|
|
102
122
|
}
|
|
@@ -7,6 +7,8 @@ import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
|
|
|
7
7
|
import { IDPose } from '../../../libs/IDML5Detector/IDPose';
|
|
8
8
|
import { delay } from '../../../utils/utils';
|
|
9
9
|
import store from '../../../helpers/store';
|
|
10
|
+
import { BaseComponent } from '../../base-component';
|
|
11
|
+
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
10
12
|
// import { IDPose } from '../../libs/IDML5Detector/IDPose';
|
|
11
13
|
export class IdBackCapture {
|
|
12
14
|
// @State() private animationPath: string;
|
|
@@ -26,14 +28,17 @@ export class IdBackCapture {
|
|
|
26
28
|
this.verified = false;
|
|
27
29
|
this.cameras = new Cameras();
|
|
28
30
|
this.showDemo = true;
|
|
31
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiBackHoldAnimation);
|
|
29
32
|
}
|
|
30
33
|
async eventChangeTitle(event) {
|
|
34
|
+
this.baseComponent.logStep(FlowSteps.CiBackTiltAnimation, FlowMoments.Initialized);
|
|
31
35
|
this.showDemo = true;
|
|
32
36
|
this.titleMesage = IdCaptureValues.IDPoseMapping[event.detail];
|
|
33
37
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.BackTilted];
|
|
34
38
|
this.demoVideo.play();
|
|
35
39
|
await delay(IdCaptureValues.VideoLenght);
|
|
36
40
|
this.showDemo = false;
|
|
41
|
+
this.baseComponent.logStep(FlowSteps.CiBackTiltAnimation, FlowMoments.Finalized);
|
|
37
42
|
}
|
|
38
43
|
eventVideoStarted(event) {
|
|
39
44
|
this.videoStarted = true;
|
|
@@ -46,6 +51,7 @@ export class IdBackCapture {
|
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
async componentDidLoad() {
|
|
54
|
+
this.baseComponent.logStep(FlowSteps.CiBackHoldAnimation, FlowMoments.Initialized);
|
|
49
55
|
this.titleMesage = IdCaptureValues.TtileRotate;
|
|
50
56
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
51
57
|
this.demoVideo.play();
|
|
@@ -54,10 +60,12 @@ export class IdBackCapture {
|
|
|
54
60
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.BackStraight];
|
|
55
61
|
this.demoVideo.play();
|
|
56
62
|
await delay(IdCaptureValues.VideoLenght);
|
|
63
|
+
this.baseComponent.logStep(FlowSteps.CiBackHoldAnimation, FlowMoments.Finalized);
|
|
57
64
|
this.showDemo = false;
|
|
58
65
|
this.openCamera();
|
|
59
66
|
}
|
|
60
67
|
async openCamera() {
|
|
68
|
+
this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
|
|
61
69
|
var constraints = this.cameras.GetConstraints(store.cameraId, store.device);
|
|
62
70
|
setTimeout(() => {
|
|
63
71
|
navigator.mediaDevices
|
|
@@ -100,6 +108,7 @@ export class IdBackCapture {
|
|
|
100
108
|
this.captureTaken = true;
|
|
101
109
|
let res = await Stream.getInstance().takePhoto();
|
|
102
110
|
this.photoIsReady(res);
|
|
111
|
+
this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Finalized);
|
|
103
112
|
}
|
|
104
113
|
render() {
|
|
105
114
|
let cameraStyle;
|
|
@@ -7,6 +7,8 @@ import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
|
|
|
7
7
|
import { IDPose } from '../../../libs/IDML5Detector/IDPose';
|
|
8
8
|
import { delay } from '../../../utils/utils';
|
|
9
9
|
import store from '../../../helpers/store';
|
|
10
|
+
import { BaseComponent } from '../../base-component';
|
|
11
|
+
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
10
12
|
// import { IDPose } from '../../libs/IDML5Detector/IDPose';
|
|
11
13
|
export class IdCapture {
|
|
12
14
|
// @State() private animationPath: string;
|
|
@@ -26,14 +28,17 @@ export class IdCapture {
|
|
|
26
28
|
this.verified = false;
|
|
27
29
|
this.cameras = new Cameras();
|
|
28
30
|
this.showDemo = true;
|
|
31
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiFrontHoldAnimation);
|
|
29
32
|
}
|
|
30
33
|
async eventChangeTitle(event) {
|
|
34
|
+
this.baseComponent.logStep(FlowSteps.CiFrontTiltAnimation, FlowMoments.Initialized);
|
|
31
35
|
this.showDemo = true;
|
|
32
36
|
this.titleMesage = IdCaptureValues.IDPoseMapping[event.detail];
|
|
33
37
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
|
|
34
38
|
this.demoVideo.play();
|
|
35
39
|
await delay(IdCaptureValues.VideoLenght);
|
|
36
40
|
this.showDemo = false;
|
|
41
|
+
this.baseComponent.logStep(FlowSteps.CiFrontTiltAnimation, FlowMoments.Finalized);
|
|
37
42
|
}
|
|
38
43
|
eventVideoStarted(event) {
|
|
39
44
|
this.videoStarted = true;
|
|
@@ -47,13 +52,16 @@ export class IdCapture {
|
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
54
|
async componentDidLoad() {
|
|
55
|
+
this.baseComponent.logStep(FlowSteps.CiFrontHoldAnimation, FlowMoments.Initialized);
|
|
50
56
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Straight];
|
|
51
57
|
this.demoVideo.play();
|
|
52
58
|
await delay(IdCaptureValues.VideoLenght);
|
|
59
|
+
this.baseComponent.logStep(FlowSteps.CiFrontHoldAnimation, FlowMoments.Finalized);
|
|
53
60
|
this.showDemo = false;
|
|
54
61
|
this.openCamera();
|
|
55
62
|
}
|
|
56
63
|
async openCamera() {
|
|
64
|
+
this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
|
|
57
65
|
var constraints = this.cameras.GetConstraints(store.cameraId, store.device);
|
|
58
66
|
setTimeout(() => {
|
|
59
67
|
navigator.mediaDevices
|
|
@@ -85,6 +93,7 @@ export class IdCapture {
|
|
|
85
93
|
this.captureTaken = true;
|
|
86
94
|
let res = await Stream.getInstance().takePhoto();
|
|
87
95
|
this.photoIsReady(res);
|
|
96
|
+
this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Finalized);
|
|
88
97
|
}
|
|
89
98
|
async verificationFinished() {
|
|
90
99
|
if (this.verified)
|
|
@@ -6,6 +6,8 @@ import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
|
|
|
6
6
|
import { FacePose } from '../../../libs/FaceML5Detector/FacePose';
|
|
7
7
|
import { delay } from '../../../utils/utils';
|
|
8
8
|
import store from '../../../helpers/store';
|
|
9
|
+
import { BaseComponent } from '../../base-component';
|
|
10
|
+
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
9
11
|
export class SelfieCapture {
|
|
10
12
|
// @State() private animationPath: string;
|
|
11
13
|
constructor() {
|
|
@@ -27,6 +29,7 @@ export class SelfieCapture {
|
|
|
27
29
|
this.cameras = new Cameras();
|
|
28
30
|
this.demoEnded = false;
|
|
29
31
|
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
32
|
+
this.baseComponent = new BaseComponent(FlowSteps.SelfieHoldAnimation);
|
|
30
33
|
}
|
|
31
34
|
async eventChangeTitle(event) {
|
|
32
35
|
// this.stopAnimation = false;
|
|
@@ -34,11 +37,13 @@ export class SelfieCapture {
|
|
|
34
37
|
this.titleMesage = SelfieCaptureValues.FinalTitle;
|
|
35
38
|
}
|
|
36
39
|
else {
|
|
40
|
+
this.baseComponent.logStep(FlowSteps.SelfieTiltAnimation, FlowMoments.Initialized);
|
|
37
41
|
this.titleMesage = SelfieCaptureValues.FacePoseMapping[event.detail];
|
|
38
42
|
this.demoEnded = false;
|
|
39
43
|
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[event.detail];
|
|
40
44
|
this.demoVideo.play();
|
|
41
45
|
await delay(SelfieCaptureValues.VideoLenght);
|
|
46
|
+
this.baseComponent.logStep(FlowSteps.SelfieTiltAnimation, FlowMoments.Finalized);
|
|
42
47
|
this.demoEnded = true;
|
|
43
48
|
}
|
|
44
49
|
}
|
|
@@ -57,13 +62,16 @@ export class SelfieCapture {
|
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
async componentDidLoad() {
|
|
65
|
+
this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Initialized);
|
|
60
66
|
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
|
|
61
67
|
this.demoVideo.play();
|
|
62
68
|
await delay(SelfieCaptureValues.VideoLenght);
|
|
69
|
+
this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Finalized);
|
|
63
70
|
this.demoEnded = true;
|
|
64
71
|
this.openCamera();
|
|
65
72
|
}
|
|
66
73
|
async openCamera() {
|
|
74
|
+
this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
|
|
67
75
|
const constraints = this.cameras.GetConstraints('', store.device, true);
|
|
68
76
|
setTimeout(() => {
|
|
69
77
|
navigator.mediaDevices
|
|
@@ -94,6 +102,7 @@ export class SelfieCapture {
|
|
|
94
102
|
this.captureTaken = true;
|
|
95
103
|
let res = await Stream.getInstance().takePhoto();
|
|
96
104
|
this.photoIsReady(res);
|
|
105
|
+
this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Finalized);
|
|
97
106
|
}
|
|
98
107
|
verificationFinished() {
|
|
99
108
|
if (this.verified)
|
|
@@ -4,18 +4,10 @@ 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 { FlowSteps } from '../../../models/FlowSteps';
|
|
8
|
-
import { BaseComponent } from '../../base-component';
|
|
9
7
|
export class EndRedirect {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.baseComponent = new BaseComponent(FlowSteps.End);
|
|
12
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
13
|
-
}
|
|
8
|
+
constructor() { }
|
|
14
9
|
async componentDidLoad() {
|
|
15
10
|
Events.flowCompleted();
|
|
16
|
-
if (store.environment !== 'DEMO') {
|
|
17
|
-
await this.baseComponent.initialize();
|
|
18
|
-
}
|
|
19
11
|
}
|
|
20
12
|
render() {
|
|
21
13
|
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)))));
|
|
@@ -68,11 +68,27 @@ export class ApiCall {
|
|
|
68
68
|
}
|
|
69
69
|
this.AddLog('Error in post ', ex);
|
|
70
70
|
try {
|
|
71
|
-
|
|
71
|
+
var request2 = new Request(store.apiBaseUrl + url, {
|
|
72
|
+
method: 'POST',
|
|
73
|
+
body: data,
|
|
74
|
+
headers: {
|
|
75
|
+
'Content-Type': 'application/json',
|
|
76
|
+
'Authorization': 'IDKYC-TOKEN ' + store.token,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
return await this.http(request2);
|
|
72
80
|
}
|
|
73
81
|
catch (ex2) {
|
|
74
82
|
this.AddLog('Error in post ', ex2);
|
|
75
|
-
|
|
83
|
+
var request3 = new Request(store.apiBaseUrl + url, {
|
|
84
|
+
method: 'POST',
|
|
85
|
+
body: data,
|
|
86
|
+
headers: {
|
|
87
|
+
'Content-Type': 'application/json',
|
|
88
|
+
'Authorization': 'IDKYC-TOKEN ' + store.token,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
return await this.http(request3);
|
|
76
92
|
}
|
|
77
93
|
}
|
|
78
94
|
}
|
|
@@ -93,11 +109,25 @@ export class ApiCall {
|
|
|
93
109
|
}
|
|
94
110
|
this.AddLog('Error in get ', ex);
|
|
95
111
|
try {
|
|
96
|
-
|
|
112
|
+
var request2 = new Request(store.apiBaseUrl + url, {
|
|
113
|
+
method: 'GET',
|
|
114
|
+
headers: {
|
|
115
|
+
'Content-Type': 'application/json',
|
|
116
|
+
'Authorization': 'IDKYC-TOKEN ' + store.token,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
return await this.http(request2);
|
|
97
120
|
}
|
|
98
121
|
catch (ex2) {
|
|
99
122
|
this.AddLog('Error in get ', ex2);
|
|
100
|
-
|
|
123
|
+
var request3 = new Request(store.apiBaseUrl + url, {
|
|
124
|
+
method: 'GET',
|
|
125
|
+
headers: {
|
|
126
|
+
'Content-Type': 'application/json',
|
|
127
|
+
'Authorization': 'IDKYC-TOKEN ' + store.token,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
return await this.http(request3);
|
|
101
131
|
}
|
|
102
132
|
}
|
|
103
133
|
}
|