@ekyc_qoobiss/qbs-ect-cmp 3.6.43 → 3.6.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{TranslationUtils-dd73945b.js → TranslationUtils-006f5c9e.js} +8 -1
- package/dist/cjs/agreement-check_17.cjs.entry.js +206 -292
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/components/base-component.js +11 -44
- package/dist/collection/components/common/agreement-check/agreement-check.js +0 -4
- package/dist/collection/components/common/camera-error/camera-error.js +3 -10
- package/dist/collection/components/common/capture-error/capture-error.js +3 -8
- package/dist/collection/components/common/how-to-info/how-to-info.js +2 -4
- package/dist/collection/components/common/id-capture/id-capture.js +2 -3
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +1 -3
- package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -5
- package/dist/collection/components/flow/landing-validation/landing-validation.js +5 -11
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +6 -7
- package/dist/collection/components/flow/process-id/process-id.js +10 -8
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +6 -13
- package/dist/collection/components/flow/sms-send/sms-send.js +6 -12
- package/dist/collection/components/flow/user-liveness/user-liveness.js +7 -10
- package/dist/collection/components/identification-component/identification-component.js +10 -7
- package/dist/collection/helpers/ApiCall.js +7 -1
- package/dist/collection/models/FlowSteps.js +1 -0
- package/dist/esm/{TranslationUtils-741a728a.js → TranslationUtils-13cb9b8c.js} +8 -1
- package/dist/esm/agreement-check_17.entry.js +206 -292
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/p-004a2264.js +1 -0
- package/dist/qbs-ect-cmp/{p-a4babb67.entry.js → p-44d4faec.entry.js} +2 -2
- package/dist/qbs-ect-cmp/{p-a130edd5.entry.js → p-c93d153b.entry.js} +1 -1
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/base-component.d.ts +3 -12
- package/dist/types/components/common/agreement-check/agreement-check.d.ts +0 -1
- package/dist/types/components/common/camera-error/camera-error.d.ts +0 -1
- package/dist/types/components/common/capture-error/capture-error.d.ts +0 -1
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +0 -1
- package/dist/types/components/common/id-capture/id-capture.d.ts +0 -1
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +0 -1
- package/dist/types/components/flow/agreement-info/agreement-info.d.ts +0 -1
- package/dist/types/components/flow/landing-validation/landing-validation.d.ts +0 -1
- package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +0 -1
- package/dist/types/components/flow/process-id/process-id.d.ts +1 -1
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +0 -1
- package/dist/types/components/flow/sms-send/sms-send.d.ts +0 -1
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +0 -1
- package/dist/types/components/identification-component/identification-component.d.ts +0 -1
- package/dist/types/helpers/ApiCall.d.ts +2 -0
- package/dist/types/models/FlowSteps.d.ts +2 -1
- package/dist/types/models/IAddRequest.d.ts +1 -1
- package/dist/types/models/IOtpCheck.d.ts +1 -1
- package/dist/types/models/IOtpSend.d.ts +1 -1
- package/package.json +1 -1
- package/dist/qbs-ect-cmp/p-87c689d6.js +0 -1
|
@@ -7,11 +7,12 @@ import Events from '../../helpers/Events';
|
|
|
7
7
|
import * as uuid from 'uuid';
|
|
8
8
|
import packageJson from '../../../package.json';
|
|
9
9
|
import { getLogMessage } from '../../utils/utils';
|
|
10
|
-
import { BaseComponent } from '../base-component';
|
|
11
10
|
import { Browser } from '../../models/IDevice';
|
|
12
11
|
import { FlowMoments, FlowSteps } from '../../models/FlowSteps';
|
|
13
12
|
// @ts-ignore
|
|
14
13
|
import loaderImg from '../../assets/loader.svg';
|
|
14
|
+
import { DeviceDetection } from '../../helpers/DeviceDetection';
|
|
15
|
+
import { ApiCall } from '../../helpers/ApiCall';
|
|
15
16
|
export class IdentificationComponent {
|
|
16
17
|
async onTokenChange(newValue, _oldValue) {
|
|
17
18
|
if (store.debug)
|
|
@@ -26,7 +27,7 @@ export class IdentificationComponent {
|
|
|
26
27
|
}
|
|
27
28
|
agreementAcceptanceEmitted(data) {
|
|
28
29
|
try {
|
|
29
|
-
|
|
30
|
+
ApiCall.instance.GenerateAgreement(data.detail.agreementType);
|
|
30
31
|
}
|
|
31
32
|
catch (e) {
|
|
32
33
|
this.apiErrorEmitter(e, 'Agreement Acceptance');
|
|
@@ -50,7 +51,7 @@ export class IdentificationComponent {
|
|
|
50
51
|
}
|
|
51
52
|
let apiLogData = { message: this.errorTitle, stack: this.errorMessage, zone };
|
|
52
53
|
try {
|
|
53
|
-
await
|
|
54
|
+
await ApiCall.instance.AddLog(apiLogData, getLogMessage(this.order_id, this.redirect_id, this.token));
|
|
54
55
|
}
|
|
55
56
|
catch (_g) { }
|
|
56
57
|
Events.flowError(this.errorTitle);
|
|
@@ -83,8 +84,6 @@ export class IdentificationComponent {
|
|
|
83
84
|
if (this.env && this.env != '') {
|
|
84
85
|
store.environment = this.env;
|
|
85
86
|
}
|
|
86
|
-
this.baseComponent = new BaseComponent(FlowSteps.ComponentLoaded);
|
|
87
|
-
this.baseComponent.setErrorCallback(this.apiErrorEmitter);
|
|
88
87
|
if (store.debug)
|
|
89
88
|
this.logInit = getLogMessage(this.order_id, this.redirect_id, this.token);
|
|
90
89
|
if (this.token) {
|
|
@@ -144,13 +143,17 @@ export class IdentificationComponent {
|
|
|
144
143
|
if (store.environment == 'DEMO') {
|
|
145
144
|
return;
|
|
146
145
|
}
|
|
146
|
+
if (!store.device) {
|
|
147
|
+
store.device = new DeviceDetection().getDevice();
|
|
148
|
+
}
|
|
149
|
+
ApiCall.getInstance();
|
|
147
150
|
if (store.device.browser == Browser.Mi) {
|
|
148
151
|
this.apiErrorEmitter('Mi Browser nu este acceptat. Va rugam utilizati Chrome.', 'Request Initialisation RequestId:' + store.requestId + ' RedirectId:' + store.redirectId);
|
|
149
152
|
return;
|
|
150
153
|
}
|
|
151
154
|
try {
|
|
152
155
|
if (store.debug)
|
|
153
|
-
|
|
156
|
+
ApiCall.instance.AddLog({ phase: 'debug mode' }, this.logInit);
|
|
154
157
|
}
|
|
155
158
|
catch (_a) { }
|
|
156
159
|
try {
|
|
@@ -159,7 +162,7 @@ export class IdentificationComponent {
|
|
|
159
162
|
this.redirect_id = store.redirectId;
|
|
160
163
|
}
|
|
161
164
|
if (store.token != '' && (store.requestId != '' || store.redirectId != '')) {
|
|
162
|
-
await
|
|
165
|
+
await ApiCall.instance.AddIdentificationRequest(store.device, packageJson.version);
|
|
163
166
|
if (!this.order_id || this.order_id == '') {
|
|
164
167
|
this.order_id = store.requestId;
|
|
165
168
|
}
|
|
@@ -4,6 +4,12 @@ import { ApiUrls } from './textValues';
|
|
|
4
4
|
import { FlowStatus } from '../models/FlowStatus';
|
|
5
5
|
import { FlowMoments, FlowSteps } from '../models/FlowSteps';
|
|
6
6
|
export class ApiCall {
|
|
7
|
+
static getInstance() {
|
|
8
|
+
if (!ApiCall.instance) {
|
|
9
|
+
ApiCall.instance = new ApiCall();
|
|
10
|
+
}
|
|
11
|
+
return ApiCall.instance;
|
|
12
|
+
}
|
|
7
13
|
constructor() {
|
|
8
14
|
this.serviceErrors = ['Service Unavailable', 'Unauthorized'];
|
|
9
15
|
this.toBase64 = (file) => new Promise((resolve, reject) => {
|
|
@@ -156,7 +162,7 @@ export class ApiCall {
|
|
|
156
162
|
store.requestId = jsonResp.requestId;
|
|
157
163
|
}
|
|
158
164
|
store.phoneNumber = jsonResp.phoneNumber;
|
|
159
|
-
store.flowStatus = FlowStatus[jsonResp.
|
|
165
|
+
store.flowStatus = FlowStatus[jsonResp.state];
|
|
160
166
|
return true;
|
|
161
167
|
}
|
|
162
168
|
async UploadFileForRequestB64(requestId, type, file) {
|
|
@@ -21,6 +21,7 @@ export var FlowSteps;
|
|
|
21
21
|
FlowSteps[FlowSteps["SelfieError"] = 'selfie-error'] = "SelfieError";
|
|
22
22
|
FlowSteps[FlowSteps["End"] = 'end'] = "End";
|
|
23
23
|
FlowSteps[FlowSteps["CameraError"] = 'camera-error'] = "CameraError";
|
|
24
|
+
FlowSteps[FlowSteps["Default"] = 'default'] = "Default";
|
|
24
25
|
})(FlowSteps || (FlowSteps = {}));
|
|
25
26
|
export var FlowMoments;
|
|
26
27
|
(function (FlowMoments) {
|
|
@@ -321,6 +321,7 @@ var FlowSteps;
|
|
|
321
321
|
FlowSteps[FlowSteps["SelfieError"] = 'selfie-error'] = "SelfieError";
|
|
322
322
|
FlowSteps[FlowSteps["End"] = 'end'] = "End";
|
|
323
323
|
FlowSteps[FlowSteps["CameraError"] = 'camera-error'] = "CameraError";
|
|
324
|
+
FlowSteps[FlowSteps["Default"] = 'default'] = "Default";
|
|
324
325
|
})(FlowSteps || (FlowSteps = {}));
|
|
325
326
|
var FlowMoments;
|
|
326
327
|
(function (FlowMoments) {
|
|
@@ -330,6 +331,12 @@ var FlowMoments;
|
|
|
330
331
|
})(FlowMoments || (FlowMoments = {}));
|
|
331
332
|
|
|
332
333
|
class ApiCall {
|
|
334
|
+
static getInstance() {
|
|
335
|
+
if (!ApiCall.instance) {
|
|
336
|
+
ApiCall.instance = new ApiCall();
|
|
337
|
+
}
|
|
338
|
+
return ApiCall.instance;
|
|
339
|
+
}
|
|
333
340
|
constructor() {
|
|
334
341
|
this.serviceErrors = ['Service Unavailable', 'Unauthorized'];
|
|
335
342
|
this.toBase64 = (file) => new Promise((resolve, reject) => {
|
|
@@ -482,7 +489,7 @@ class ApiCall {
|
|
|
482
489
|
state.requestId = jsonResp.requestId;
|
|
483
490
|
}
|
|
484
491
|
state.phoneNumber = jsonResp.phoneNumber;
|
|
485
|
-
state.flowStatus = FlowStatus[jsonResp.
|
|
492
|
+
state.flowStatus = FlowStatus[jsonResp.state];
|
|
486
493
|
return true;
|
|
487
494
|
}
|
|
488
495
|
async UploadFileForRequestB64(requestId, type, file) {
|