@ekyc_qoobiss/qbs-ect-cmp 3.5.1 → 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.
@@ -409,11 +409,20 @@ var FlowSteps;
409
409
  FlowSteps[FlowSteps["Agreements"] = 'agreements'] = "Agreements";
410
410
  FlowSteps[FlowSteps["OtpSend"] = 'otp-send'] = "OtpSend";
411
411
  FlowSteps[FlowSteps["OtpCheck"] = 'otp-check'] = "OtpCheck";
412
- FlowSteps[FlowSteps["CiFrontHowTo"] = 'ci-front-how-to'] = "CiFrontHowTo";
413
412
  FlowSteps[FlowSteps["CiFront"] = 'ci-front'] = "CiFront";
414
- FlowSteps[FlowSteps["CiBackHowTo"] = 'ci-back-how-to'] = "CiBackHowTo";
413
+ FlowSteps[FlowSteps["CiFrontHowTo"] = 'ci-front-how-to'] = "CiFrontHowTo";
414
+ FlowSteps[FlowSteps["CiFrontHoldAnimation"] = 'ci-front-hold-animation'] = "CiFrontHoldAnimation";
415
+ FlowSteps[FlowSteps["CiFrontTiltAnimation"] = 'ci-front-tilt-animation'] = "CiFrontTiltAnimation";
416
+ FlowSteps[FlowSteps["CiFrontCapture"] = 'ci-front-capture'] = "CiFrontCapture";
415
417
  FlowSteps[FlowSteps["CiBack"] = 'ci-back'] = "CiBack";
418
+ FlowSteps[FlowSteps["CiBackHowTo"] = 'ci-back-how-to'] = "CiBackHowTo";
419
+ FlowSteps[FlowSteps["CiBackHoldAnimation"] = 'ci-back-hold-animation'] = "CiBackHoldAnimation";
420
+ FlowSteps[FlowSteps["CiBackTiltAnimation"] = 'ci-back-tilt-animation'] = "CiBackTiltAnimation";
421
+ FlowSteps[FlowSteps["CiBackCapture"] = 'ci-back-capture'] = "CiBackCapture";
416
422
  FlowSteps[FlowSteps["SelfieHowTo"] = 'selfie-how-to'] = "SelfieHowTo";
423
+ FlowSteps[FlowSteps["SelfieHoldAnimation"] = 'selfie-hold-animation'] = "SelfieHoldAnimation";
424
+ FlowSteps[FlowSteps["SelfieTiltAnimation"] = 'selfie-tilt-animation'] = "SelfieTiltAnimation";
425
+ FlowSteps[FlowSteps["SelfieCapture"] = 'selfie-capture'] = "SelfieCapture";
417
426
  FlowSteps[FlowSteps["Selfie"] = 'selfie'] = "Selfie";
418
427
  FlowSteps[FlowSteps["End"] = 'end'] = "End";
419
428
  FlowSteps[FlowSteps["CameraError"] = 'camera-error'] = "CameraError";
@@ -860,6 +869,18 @@ class BaseComponent {
860
869
  setErrorCallback(callback) {
861
870
  this.processError = callback;
862
871
  }
872
+ async logStep(flowStep, flowMoment) {
873
+ Events.flowEvent(flowStep, flowMoment);
874
+ try {
875
+ await this.apiCall.AddStep(flowStep, flowMoment);
876
+ }
877
+ catch (e) {
878
+ if (this.apiErrorEvent)
879
+ this.apiErrorEvent.emit(e);
880
+ else
881
+ this.processError(e, `${flowStep}-${flowMoment}`);
882
+ }
883
+ }
863
884
  async initialize() {
864
885
  Events.flowEvent(this.flowStep, FlowMoments.Initialized);
865
886
  try {
@@ -869,7 +890,7 @@ class BaseComponent {
869
890
  if (this.apiErrorEvent)
870
891
  this.apiErrorEvent.emit(e);
871
892
  else
872
- this.processError(e, FlowMoments.Initialized);
893
+ this.processError(e, `${this.flowStep}-${FlowMoments.Initialized}`);
873
894
  }
874
895
  }
875
896
  async finalize() {
@@ -881,7 +902,7 @@ class BaseComponent {
881
902
  if (this.apiErrorEvent)
882
903
  this.apiErrorEvent.emit(e);
883
904
  else
884
- this.processError(e, FlowMoments.Initialized);
905
+ this.processError(e, `${this.flowStep}-${FlowMoments.Finalized}`);
885
906
  }
886
907
  }
887
908
  }
@@ -5583,17 +5604,9 @@ const completeSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODMiIGhlaWdodD0iO
5583
5604
  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)}}";
5584
5605
 
5585
5606
  const EndRedirect = class {
5586
- constructor(hostRef) {
5587
- registerInstance(this, hostRef);
5588
- this.apiErrorEvent = createEvent(this, "apiError", 7);
5589
- this.baseComponent = new BaseComponent(FlowSteps.End);
5590
- this.baseComponent.setEventEmitter(this.apiErrorEvent);
5591
- }
5607
+ constructor(hostRef) { registerInstance(this, hostRef); this.apiErrorEvent = createEvent(this, "apiError", 7); }
5592
5608
  async componentDidLoad() {
5593
5609
  Events.flowCompleted();
5594
- if (state.environment !== 'DEMO') {
5595
- await this.baseComponent.initialize();
5596
- }
5597
5610
  }
5598
5611
  render() {
5599
5612
  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)))));
@@ -5619,15 +5632,12 @@ ErrorEnd.style = errorEndCss;
5619
5632
  const howToInfoCss = "";
5620
5633
 
5621
5634
  const HowToInfo = class {
5622
- constructor(hostRef) {
5623
- registerInstance(this, hostRef);
5624
- this.eventHowToInfoDone = createEvent(this, "howToInfoDone", 7);
5625
- this.idSide = undefined;
5626
- this.topTitle = undefined;
5627
- this.subTitle = undefined;
5628
- this.imagePath = undefined;
5629
- this.buttonText = undefined;
5630
- this.buttonEnabled = undefined;
5635
+ constructor(hostRef) { registerInstance(this, hostRef); this.eventHowToInfoDone = createEvent(this, "howToInfoDone", 7); this.apiErrorEvent = createEvent(this, "apiError", 7); this.idSide = undefined; this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
5636
+ async componentDidLoad() {
5637
+ await this.baseComponent.initialize();
5638
+ }
5639
+ disconnectedCallback() {
5640
+ this.baseComponent.finalize();
5631
5641
  }
5632
5642
  buttonClick() {
5633
5643
  this.buttonEnabled = false;
@@ -5641,18 +5651,22 @@ const HowToInfo = class {
5641
5651
  this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
5642
5652
  this.buttonText = HowToValues.IdButton;
5643
5653
  if (this.idSide == 'front') {
5654
+ this.baseComponent = new BaseComponent(FlowSteps.CiFrontHowTo);
5644
5655
  this.subTitle = HowToValues.IdSubTitileFace;
5645
5656
  }
5646
5657
  if (this.idSide == 'back') {
5658
+ this.baseComponent = new BaseComponent(FlowSteps.CiBackHowTo);
5647
5659
  this.subTitle = HowToValues.IdSubTitileBack;
5648
5660
  }
5649
5661
  }
5650
5662
  if (state.flowStatus == FlowStatus.LIVENESS) {
5663
+ this.baseComponent = new BaseComponent(FlowSteps.SelfieHowTo);
5651
5664
  this.topTitle = HowToValues.SelfieTitile;
5652
5665
  this.subTitle = HowToValues.SelfieSubTitile;
5653
5666
  this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
5654
5667
  this.buttonText = HowToValues.SelfieButton;
5655
5668
  }
5669
+ this.baseComponent.setEventEmitter(this.apiErrorEvent);
5656
5670
  }
5657
5671
  render() {
5658
5672
  let sub = this.subTitle != '' ? h("p", { class: "font-size-2" }, this.subTitle) : null;
@@ -5805,14 +5819,17 @@ const IdBackCapture = class {
5805
5819
  this.verified = false;
5806
5820
  this.cameras = new Cameras();
5807
5821
  this.showDemo = true;
5822
+ this.baseComponent = new BaseComponent(FlowSteps.CiBackHoldAnimation);
5808
5823
  }
5809
5824
  async eventChangeTitle(event) {
5825
+ this.baseComponent.logStep(FlowSteps.CiBackTiltAnimation, FlowMoments.Initialized);
5810
5826
  this.showDemo = true;
5811
5827
  this.titleMesage = IdCaptureValues.IDPoseMapping[event.detail];
5812
5828
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.BackTilted];
5813
5829
  this.demoVideo.play();
5814
5830
  await delay(IdCaptureValues.VideoLenght);
5815
5831
  this.showDemo = false;
5832
+ this.baseComponent.logStep(FlowSteps.CiBackTiltAnimation, FlowMoments.Finalized);
5816
5833
  }
5817
5834
  eventVideoStarted(event) {
5818
5835
  this.videoStarted = true;
@@ -5825,6 +5842,7 @@ const IdBackCapture = class {
5825
5842
  }
5826
5843
  }
5827
5844
  async componentDidLoad() {
5845
+ this.baseComponent.logStep(FlowSteps.CiBackHoldAnimation, FlowMoments.Initialized);
5828
5846
  this.titleMesage = IdCaptureValues.TtileRotate;
5829
5847
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
5830
5848
  this.demoVideo.play();
@@ -5833,10 +5851,12 @@ const IdBackCapture = class {
5833
5851
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.BackStraight];
5834
5852
  this.demoVideo.play();
5835
5853
  await delay(IdCaptureValues.VideoLenght);
5854
+ this.baseComponent.logStep(FlowSteps.CiBackHoldAnimation, FlowMoments.Finalized);
5836
5855
  this.showDemo = false;
5837
5856
  this.openCamera();
5838
5857
  }
5839
5858
  async openCamera() {
5859
+ this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
5840
5860
  var constraints = this.cameras.GetConstraints(state.cameraId, state.device);
5841
5861
  setTimeout(() => {
5842
5862
  navigator.mediaDevices
@@ -5879,6 +5899,7 @@ const IdBackCapture = class {
5879
5899
  this.captureTaken = true;
5880
5900
  let res = await Stream.getInstance().takePhoto();
5881
5901
  this.photoIsReady(res);
5902
+ this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Finalized);
5882
5903
  }
5883
5904
  render() {
5884
5905
  let cameraStyle;
@@ -5919,14 +5940,17 @@ const IdCapture = class {
5919
5940
  this.verified = false;
5920
5941
  this.cameras = new Cameras();
5921
5942
  this.showDemo = true;
5943
+ this.baseComponent = new BaseComponent(FlowSteps.CiFrontHoldAnimation);
5922
5944
  }
5923
5945
  async eventChangeTitle(event) {
5946
+ this.baseComponent.logStep(FlowSteps.CiFrontTiltAnimation, FlowMoments.Initialized);
5924
5947
  this.showDemo = true;
5925
5948
  this.titleMesage = IdCaptureValues.IDPoseMapping[event.detail];
5926
5949
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
5927
5950
  this.demoVideo.play();
5928
5951
  await delay(IdCaptureValues.VideoLenght);
5929
5952
  this.showDemo = false;
5953
+ this.baseComponent.logStep(FlowSteps.CiFrontTiltAnimation, FlowMoments.Finalized);
5930
5954
  }
5931
5955
  eventVideoStarted(event) {
5932
5956
  this.videoStarted = true;
@@ -5940,13 +5964,16 @@ const IdCapture = class {
5940
5964
  }
5941
5965
  }
5942
5966
  async componentDidLoad() {
5967
+ this.baseComponent.logStep(FlowSteps.CiFrontHoldAnimation, FlowMoments.Initialized);
5943
5968
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Straight];
5944
5969
  this.demoVideo.play();
5945
5970
  await delay(IdCaptureValues.VideoLenght);
5971
+ this.baseComponent.logStep(FlowSteps.CiFrontHoldAnimation, FlowMoments.Finalized);
5946
5972
  this.showDemo = false;
5947
5973
  this.openCamera();
5948
5974
  }
5949
5975
  async openCamera() {
5976
+ this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
5950
5977
  var constraints = this.cameras.GetConstraints(state.cameraId, state.device);
5951
5978
  setTimeout(() => {
5952
5979
  navigator.mediaDevices
@@ -5978,6 +6005,7 @@ const IdCapture = class {
5978
6005
  this.captureTaken = true;
5979
6006
  let res = await Stream.getInstance().takePhoto();
5980
6007
  this.photoIsReady(res);
6008
+ this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Finalized);
5981
6009
  }
5982
6010
  async verificationFinished() {
5983
6011
  if (this.verified)
@@ -6400,7 +6428,7 @@ function v4(options, buf, offset) {
6400
6428
  }
6401
6429
 
6402
6430
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
6403
- const version$1 = "3.5.1";
6431
+ const version$1 = "3.5.2";
6404
6432
  const description = "Person Identification Component";
6405
6433
  const main = "./dist/index.cjs.js";
6406
6434
  const module = "./dist/index.js";
@@ -9826,6 +9854,7 @@ const SelfieCapture = class {
9826
9854
  this.cameras = new Cameras();
9827
9855
  this.demoEnded = false;
9828
9856
  this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
9857
+ this.baseComponent = new BaseComponent(FlowSteps.SelfieHoldAnimation);
9829
9858
  }
9830
9859
  async eventChangeTitle(event) {
9831
9860
  // this.stopAnimation = false;
@@ -9833,11 +9862,13 @@ const SelfieCapture = class {
9833
9862
  this.titleMesage = SelfieCaptureValues.FinalTitle;
9834
9863
  }
9835
9864
  else {
9865
+ this.baseComponent.logStep(FlowSteps.SelfieTiltAnimation, FlowMoments.Initialized);
9836
9866
  this.titleMesage = SelfieCaptureValues.FacePoseMapping[event.detail];
9837
9867
  this.demoEnded = false;
9838
9868
  this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[event.detail];
9839
9869
  this.demoVideo.play();
9840
9870
  await delay(SelfieCaptureValues.VideoLenght);
9871
+ this.baseComponent.logStep(FlowSteps.SelfieTiltAnimation, FlowMoments.Finalized);
9841
9872
  this.demoEnded = true;
9842
9873
  }
9843
9874
  }
@@ -9856,13 +9887,16 @@ const SelfieCapture = class {
9856
9887
  }
9857
9888
  }
9858
9889
  async componentDidLoad() {
9890
+ this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Initialized);
9859
9891
  this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
9860
9892
  this.demoVideo.play();
9861
9893
  await delay(SelfieCaptureValues.VideoLenght);
9894
+ this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Finalized);
9862
9895
  this.demoEnded = true;
9863
9896
  this.openCamera();
9864
9897
  }
9865
9898
  async openCamera() {
9899
+ this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
9866
9900
  const constraints = this.cameras.GetConstraints('', state.device, true);
9867
9901
  setTimeout(() => {
9868
9902
  navigator.mediaDevices
@@ -9893,6 +9927,7 @@ const SelfieCapture = class {
9893
9927
  this.captureTaken = true;
9894
9928
  let res = await Stream.getInstance().takePhoto();
9895
9929
  this.photoIsReady(res);
9930
+ this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Finalized);
9896
9931
  }
9897
9932
  verificationFinished() {
9898
9933
  if (this.verified)