@ekyc_qoobiss/qbs-ect-cmp 3.6.28 → 3.6.30
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/{base-component-aa9e52bf.js → TranslationUtils-e23d3c71.js} +19 -234
- package/dist/cjs/agreement-check_19.cjs.entry.js +524 -284
- package/dist/cjs/random-actions.cjs.entry.js +5 -6
- package/dist/collection/components/base-component.js +0 -4
- package/dist/collection/components/common/agreement-check/agreement-check.js +6 -2
- package/dist/collection/components/common/camera-error/camera-error.js +7 -5
- package/dist/collection/components/common/capture-error/capture-error.js +12 -10
- package/dist/collection/components/common/how-to-info/how-to-info.js +11 -9
- package/dist/collection/components/common/id-back-capture/id-back-capture.js +8 -6
- package/dist/collection/components/common/id-capture/id-capture.js +6 -4
- package/dist/collection/components/common/id-tilt/id-tilt.js +6 -4
- package/dist/collection/components/common/random-actions/random-actions.js +5 -6
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +7 -5
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.js +8 -6
- package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -2
- package/dist/collection/components/flow/end-redirect/end-redirect.js +5 -4
- package/dist/collection/components/flow/landing-validation/landing-validation.js +5 -3
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +8 -6
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +12 -10
- package/dist/collection/helpers/ApiCall.js +4 -0
- package/dist/collection/helpers/TranslationUtils.js +15 -7
- package/dist/collection/helpers/textValues.js +1 -0
- package/dist/esm/{base-component-b7f50d31.js → TranslationUtils-7c1f0f39.js} +19 -233
- package/dist/esm/agreement-check_19.entry.js +316 -76
- package/dist/esm/random-actions.entry.js +5 -6
- package/dist/qbs-ect-cmp/p-16f9efd0.entry.js +1 -0
- package/dist/qbs-ect-cmp/p-d82d57ff.js +1 -0
- package/dist/qbs-ect-cmp/{p-c32a782a.entry.js → p-fea085b0.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/base-component.d.ts +0 -2
- package/dist/types/components/common/agreement-check/agreement-check.d.ts +2 -0
- package/dist/types/components/common/camera-error/camera-error.d.ts +1 -0
- package/dist/types/components/common/capture-error/capture-error.d.ts +1 -0
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +2 -1
- 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/id-tilt/id-tilt.d.ts +1 -0
- package/dist/types/components/common/random-actions/random-actions.d.ts +2 -2
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +2 -1
- package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +2 -1
- package/dist/types/components/flow/agreement-info/agreement-info.d.ts +2 -1
- package/dist/types/components/flow/end-redirect/end-redirect.d.ts +2 -1
- package/dist/types/components/flow/landing-validation/landing-validation.d.ts +1 -0
- package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +1 -0
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +2 -1
- package/dist/types/helpers/ApiCall.d.ts +2 -0
- package/dist/types/helpers/TranslationUtils.d.ts +1 -0
- package/dist/types/helpers/textValues.d.ts +1 -0
- package/package.json +1 -1
- package/dist/i18n/en.json +0 -100
- package/dist/i18n/ro.json +0 -100
- package/dist/i18n/ru.json +0 -100
- package/dist/qbs-ect-cmp/p-215a7e76.entry.js +0 -1
- package/dist/qbs-ect-cmp/p-7bedffaa.js +0 -1
|
@@ -262,6 +262,7 @@ class ApiUrls {
|
|
|
262
262
|
this.AddLog = this.uriEnv + 'validation/logs/add';
|
|
263
263
|
this.AddStep = this.uriEnv + 'validation/logs/step';
|
|
264
264
|
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
265
|
+
this.Translations = this.uriEnv + 'validation/translations/get';
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
268
|
|
|
@@ -558,177 +559,16 @@ class ApiCall {
|
|
|
558
559
|
let result = await this.post(this.urls.AbortRequest, JSON.stringify({ requestId: state.requestId }));
|
|
559
560
|
return result.saved;
|
|
560
561
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
(function (MobileOS) {
|
|
565
|
-
MobileOS["Android"] = "android";
|
|
566
|
-
MobileOS["iOS"] = "ios";
|
|
567
|
-
MobileOS["Unknown"] = "unknown";
|
|
568
|
-
MobileOS["WindowsPhone"] = "Windows Phone";
|
|
569
|
-
})(exports.MobileOS || (exports.MobileOS = {}));
|
|
570
|
-
var DesktopOS;
|
|
571
|
-
(function (DesktopOS) {
|
|
572
|
-
DesktopOS["Linux"] = "linux";
|
|
573
|
-
DesktopOS["MacOS"] = "mac_os";
|
|
574
|
-
DesktopOS["Unix"] = "unix";
|
|
575
|
-
DesktopOS["Unknown"] = "unknown";
|
|
576
|
-
DesktopOS["Windows"] = "windows";
|
|
577
|
-
})(DesktopOS || (DesktopOS = {}));
|
|
578
|
-
exports.Browser = void 0;
|
|
579
|
-
(function (Browser) {
|
|
580
|
-
Browser["Chrome"] = "chrome";
|
|
581
|
-
Browser["Firefox"] = "firefox";
|
|
582
|
-
Browser["Safari"] = "safari";
|
|
583
|
-
Browser["Mi"] = "mi";
|
|
584
|
-
Browser["Unknown"] = "unknown";
|
|
585
|
-
})(exports.Browser || (exports.Browser = {}));
|
|
586
|
-
|
|
587
|
-
class DeviceDetection {
|
|
588
|
-
constructor() {
|
|
589
|
-
var _a, _b, _c, _d;
|
|
590
|
-
this.supportedScreenOrientation = (_b = (_a = ((screen === null || screen === void 0 ? void 0 : screen.orientation) || {}).type) !== null && _a !== void 0 ? _a : screen.mozOrientation) !== null && _b !== void 0 ? _b : screen.msOrientation;
|
|
591
|
-
this.safariScreenOrientation = !(screen === null || screen === void 0 ? void 0 : screen.orientation) && matchMedia('(orientation: portrait)').matches ? 'portrait-primary' : 'landscape-primary';
|
|
592
|
-
this.initialScreenOrientation = (_d = (_c = this.supportedScreenOrientation) !== null && _c !== void 0 ? _c : this.safariScreenOrientation) !== null && _d !== void 0 ? _d : 'portrait-primary';
|
|
593
|
-
this.userAgent = navigator.userAgent || navigator.vendor || window.opera || undefined;
|
|
594
|
-
this.isMobile = this.isMobileDevice();
|
|
595
|
-
this.isTablet = this.isTabletDevice();
|
|
596
|
-
this.isDesktop = !this.isMobile && !this.isTablet;
|
|
597
|
-
}
|
|
598
|
-
// Device typology
|
|
599
|
-
isMobileDevice() {
|
|
600
|
-
const regexs = [/(Android)(.+)(Mobile)/i, /BlackBerry/i, /iPhone|iPod/i, /Opera Mini/i, /IEMobile/i];
|
|
601
|
-
return regexs.some(b => this.userAgent.match(b));
|
|
602
|
-
}
|
|
603
|
-
isTabletDevice() {
|
|
604
|
-
const regex = /(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/;
|
|
605
|
-
return regex.test(this.userAgent.toLowerCase());
|
|
606
|
-
}
|
|
607
|
-
// Device Operating System
|
|
608
|
-
getMobileOS() {
|
|
609
|
-
if (this.isMobileDevice()) {
|
|
610
|
-
if (/windows phone/i.test(this.userAgent))
|
|
611
|
-
return exports.MobileOS.WindowsPhone;
|
|
612
|
-
else if (/android/i.test(this.userAgent))
|
|
613
|
-
return exports.MobileOS.Android;
|
|
614
|
-
else if (/iPad|iPhone|iPod/.test(this.userAgent) && !window.MSStream)
|
|
615
|
-
return exports.MobileOS.iOS;
|
|
616
|
-
return exports.MobileOS.Unknown;
|
|
617
|
-
}
|
|
618
|
-
else
|
|
619
|
-
return undefined;
|
|
620
|
-
}
|
|
621
|
-
getDesktopOS() {
|
|
622
|
-
if (this.isDesktop) {
|
|
623
|
-
if (this.userAgent.indexOf('Win') !== -1)
|
|
624
|
-
return DesktopOS.Windows;
|
|
625
|
-
else if (this.userAgent.indexOf('Mac') !== -1)
|
|
626
|
-
return DesktopOS.MacOS;
|
|
627
|
-
else if (this.userAgent.indexOf('X11') !== -1)
|
|
628
|
-
return DesktopOS.Unix;
|
|
629
|
-
else if (this.userAgent.indexOf('Linux') !== -1)
|
|
630
|
-
return DesktopOS.Linux;
|
|
631
|
-
return DesktopOS.Unknown;
|
|
632
|
-
}
|
|
633
|
-
else
|
|
634
|
-
return undefined;
|
|
635
|
-
}
|
|
636
|
-
getDeviceOS() {
|
|
637
|
-
var _a;
|
|
638
|
-
return (_a = this.getMobileOS()) !== null && _a !== void 0 ? _a : this.getDesktopOS();
|
|
639
|
-
}
|
|
640
|
-
getBrowser() {
|
|
641
|
-
if (/XiaoMi/i.test(this.userAgent) || /MiuiBrowser/i.test(this.userAgent))
|
|
642
|
-
return exports.Browser.Mi;
|
|
643
|
-
var isChrome = /chrome/i.test(this.userAgent);
|
|
644
|
-
if (isChrome)
|
|
645
|
-
return exports.Browser.Chrome;
|
|
646
|
-
if (/firefox/i.test(navigator.userAgent))
|
|
647
|
-
return exports.Browser.Firefox;
|
|
648
|
-
else if (!isChrome && /safari/i.test(navigator.userAgent))
|
|
649
|
-
return exports.Browser.Safari;
|
|
650
|
-
else
|
|
651
|
-
return exports.Browser.Unknown;
|
|
652
|
-
}
|
|
653
|
-
getDevice() {
|
|
654
|
-
var device = {
|
|
655
|
-
isDesktop: this.isDesktop,
|
|
656
|
-
desktopOS: this.getDesktopOS(),
|
|
657
|
-
isWindowsDesktop: this.getDeviceOS() === DesktopOS.Windows,
|
|
658
|
-
isLinuxOrUnixDesktop: this.getDeviceOS() === DesktopOS.Linux || this.getDeviceOS() === DesktopOS.Unix,
|
|
659
|
-
isMobile: this.isMobile,
|
|
660
|
-
mobileOS: this.getMobileOS(),
|
|
661
|
-
isAndroidDevice: this.getDeviceOS() === exports.MobileOS.Android,
|
|
662
|
-
isAppleDevice: this.getDeviceOS() === exports.MobileOS.iOS || this.getDeviceOS() === DesktopOS.MacOS,
|
|
663
|
-
isUnknownMobileDevice: this.getDeviceOS() === exports.MobileOS.Unknown,
|
|
664
|
-
browser: this.getBrowser(),
|
|
665
|
-
isTablet: this.isTablet,
|
|
666
|
-
initialScreenOrientation: this.initialScreenOrientation,
|
|
667
|
-
};
|
|
668
|
-
return device;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
class Events {
|
|
673
|
-
static init(element) {
|
|
674
|
-
this.callingModule = element;
|
|
675
|
-
}
|
|
676
|
-
static flowEvent(step, moment) {
|
|
677
|
-
const eventName = `ect-${step.toString()}-${moment.toString()}-event`;
|
|
678
|
-
this.callingModule.dispatchEvent(new CustomEvent(eventName, {
|
|
679
|
-
detail: {},
|
|
680
|
-
bubbles: true,
|
|
681
|
-
cancelable: true,
|
|
682
|
-
composed: true,
|
|
683
|
-
}));
|
|
684
|
-
}
|
|
685
|
-
static flowStarted() {
|
|
686
|
-
this.callingModule.dispatchEvent(new CustomEvent('ect-started', {
|
|
687
|
-
detail: {},
|
|
688
|
-
bubbles: true,
|
|
689
|
-
cancelable: true,
|
|
690
|
-
composed: true,
|
|
691
|
-
}));
|
|
692
|
-
}
|
|
693
|
-
static flowAborted() {
|
|
694
|
-
sessionStorage.clear();
|
|
695
|
-
this.callingModule.dispatchEvent(new CustomEvent('ect-aborted', {
|
|
696
|
-
detail: {},
|
|
697
|
-
bubbles: true,
|
|
698
|
-
cancelable: true,
|
|
699
|
-
composed: true,
|
|
700
|
-
}));
|
|
701
|
-
}
|
|
702
|
-
static flowCompleted() {
|
|
703
|
-
sessionStorage.clear();
|
|
704
|
-
this.callingModule.dispatchEvent(new CustomEvent('ect-completed', {
|
|
705
|
-
detail: {},
|
|
706
|
-
bubbles: true,
|
|
707
|
-
cancelable: true,
|
|
708
|
-
composed: true,
|
|
709
|
-
}));
|
|
710
|
-
}
|
|
711
|
-
static flowError(error) {
|
|
712
|
-
sessionStorage.clear();
|
|
713
|
-
this.callingModule.dispatchEvent(new CustomEvent('ect-error', {
|
|
714
|
-
detail: { error },
|
|
715
|
-
bubbles: true,
|
|
716
|
-
cancelable: true,
|
|
717
|
-
composed: true,
|
|
718
|
-
}));
|
|
719
|
-
}
|
|
720
|
-
static tokenExpired() {
|
|
721
|
-
sessionStorage.clear();
|
|
722
|
-
this.callingModule.dispatchEvent(new CustomEvent('ect-session-expired', {
|
|
723
|
-
detail: {},
|
|
724
|
-
bubbles: true,
|
|
725
|
-
cancelable: true,
|
|
726
|
-
composed: true,
|
|
727
|
-
}));
|
|
562
|
+
async GetTranslations(langIso) {
|
|
563
|
+
let result = await this.get(this.urls.Translations + '?langIso=' + langIso);
|
|
564
|
+
return result;
|
|
728
565
|
}
|
|
729
566
|
}
|
|
730
567
|
|
|
731
568
|
class TranslationsController {
|
|
569
|
+
constructor() {
|
|
570
|
+
this.apiCall = new ApiCall();
|
|
571
|
+
}
|
|
732
572
|
async getValues() {
|
|
733
573
|
if (this.values) {
|
|
734
574
|
return this.values;
|
|
@@ -739,8 +579,13 @@ class TranslationsController {
|
|
|
739
579
|
}
|
|
740
580
|
}
|
|
741
581
|
getLocale(element = document.body) {
|
|
742
|
-
|
|
743
|
-
|
|
582
|
+
if (state.langIso && state.langIso != '') {
|
|
583
|
+
return state.langIso;
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
const closestElement = element.closest('[lang]');
|
|
587
|
+
return closestElement ? closestElement.lang : 'ro';
|
|
588
|
+
}
|
|
744
589
|
}
|
|
745
590
|
async fetchTranslations() {
|
|
746
591
|
const locale = this.getLocale();
|
|
@@ -750,11 +595,10 @@ class TranslationsController {
|
|
|
750
595
|
}
|
|
751
596
|
else {
|
|
752
597
|
try {
|
|
753
|
-
const result =
|
|
754
|
-
if (result
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
return data;
|
|
598
|
+
const result = this.apiCall.GetTranslations(locale);
|
|
599
|
+
if (result) {
|
|
600
|
+
sessionStorage.setItem(`i18n.${locale}`, JSON.stringify(result));
|
|
601
|
+
return result;
|
|
758
602
|
}
|
|
759
603
|
}
|
|
760
604
|
catch (exception) {
|
|
@@ -765,68 +609,9 @@ class TranslationsController {
|
|
|
765
609
|
}
|
|
766
610
|
const Translations = new TranslationsController();
|
|
767
611
|
|
|
768
|
-
class BaseComponent {
|
|
769
|
-
constructor(step) {
|
|
770
|
-
this.apiErrorEvent = null;
|
|
771
|
-
this.processError = null;
|
|
772
|
-
this.apiCall = new ApiCall();
|
|
773
|
-
if (step)
|
|
774
|
-
this.flowStep = step;
|
|
775
|
-
if (!state.device) {
|
|
776
|
-
state.device = new DeviceDetection().getDevice();
|
|
777
|
-
}
|
|
778
|
-
Translations.getValues().then(data => {
|
|
779
|
-
this.translations = data;
|
|
780
|
-
});
|
|
781
|
-
}
|
|
782
|
-
setEventEmitter(event) {
|
|
783
|
-
this.apiErrorEvent = event;
|
|
784
|
-
}
|
|
785
|
-
setErrorCallback(callback) {
|
|
786
|
-
this.processError = callback;
|
|
787
|
-
}
|
|
788
|
-
async logStep(step, moment) {
|
|
789
|
-
Events.flowEvent(step, moment);
|
|
790
|
-
try {
|
|
791
|
-
await this.apiCall.AddStep(step, moment);
|
|
792
|
-
}
|
|
793
|
-
catch (e) {
|
|
794
|
-
if (this.apiErrorEvent)
|
|
795
|
-
this.apiErrorEvent.emit(e);
|
|
796
|
-
else
|
|
797
|
-
this.processError(e, `${step}-${moment}`);
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
async initialize() {
|
|
801
|
-
Events.flowEvent(this.flowStep, exports.FlowMoments.Initialized);
|
|
802
|
-
try {
|
|
803
|
-
await this.apiCall.AddStep(this.flowStep, exports.FlowMoments.Initialized);
|
|
804
|
-
}
|
|
805
|
-
catch (e) {
|
|
806
|
-
if (this.apiErrorEvent)
|
|
807
|
-
this.apiErrorEvent.emit(e);
|
|
808
|
-
else
|
|
809
|
-
this.processError(e, `${this.flowStep}-${exports.FlowMoments.Initialized}`);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
async finalize() {
|
|
813
|
-
Events.flowEvent(this.flowStep, exports.FlowMoments.Finalized);
|
|
814
|
-
try {
|
|
815
|
-
await this.apiCall.AddStep(this.flowStep, exports.FlowMoments.Finalized);
|
|
816
|
-
}
|
|
817
|
-
catch (e) {
|
|
818
|
-
if (this.apiErrorEvent)
|
|
819
|
-
this.apiErrorEvent.emit(e);
|
|
820
|
-
else
|
|
821
|
-
this.processError(e, `${this.flowStep}-${exports.FlowMoments.Finalized}`);
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
|
|
826
612
|
exports.ApiCall = ApiCall;
|
|
827
|
-
exports.BaseComponent = BaseComponent;
|
|
828
|
-
exports.Events = Events;
|
|
829
613
|
exports.IdCaptureValues = IdCaptureValues;
|
|
830
614
|
exports.SelfieCaptureValues = SelfieCaptureValues;
|
|
831
615
|
exports.SessionKeys = SessionKeys;
|
|
616
|
+
exports.Translations = Translations;
|
|
832
617
|
exports.state = state;
|