@ekyc_qoobiss/qbs-ect-cmp 3.6.44 → 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.
Files changed (46) hide show
  1. package/dist/cjs/{TranslationUtils-2d932eab.js → TranslationUtils-006f5c9e.js} +7 -0
  2. package/dist/cjs/agreement-check_17.cjs.entry.js +204 -290
  3. package/dist/cjs/random-actions.cjs.entry.js +1 -1
  4. package/dist/collection/components/base-component.js +11 -44
  5. package/dist/collection/components/common/agreement-check/agreement-check.js +0 -4
  6. package/dist/collection/components/common/camera-error/camera-error.js +3 -10
  7. package/dist/collection/components/common/capture-error/capture-error.js +3 -8
  8. package/dist/collection/components/common/how-to-info/how-to-info.js +2 -4
  9. package/dist/collection/components/common/id-capture/id-capture.js +2 -3
  10. package/dist/collection/components/common/selfie-capture/selfie-capture.js +1 -3
  11. package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -5
  12. package/dist/collection/components/flow/landing-validation/landing-validation.js +5 -11
  13. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +6 -7
  14. package/dist/collection/components/flow/process-id/process-id.js +10 -8
  15. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +5 -12
  16. package/dist/collection/components/flow/sms-send/sms-send.js +5 -11
  17. package/dist/collection/components/flow/user-liveness/user-liveness.js +7 -10
  18. package/dist/collection/components/identification-component/identification-component.js +10 -7
  19. package/dist/collection/helpers/ApiCall.js +6 -0
  20. package/dist/collection/models/FlowSteps.js +1 -0
  21. package/dist/esm/{TranslationUtils-0039c82d.js → TranslationUtils-13cb9b8c.js} +7 -0
  22. package/dist/esm/agreement-check_17.entry.js +204 -290
  23. package/dist/esm/random-actions.entry.js +1 -1
  24. package/dist/qbs-ect-cmp/p-004a2264.js +1 -0
  25. package/dist/qbs-ect-cmp/{p-fca9e256.entry.js → p-44d4faec.entry.js} +2 -2
  26. package/dist/qbs-ect-cmp/{p-0c1eead0.entry.js → p-c93d153b.entry.js} +1 -1
  27. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
  28. package/dist/types/components/base-component.d.ts +3 -12
  29. package/dist/types/components/common/agreement-check/agreement-check.d.ts +0 -1
  30. package/dist/types/components/common/camera-error/camera-error.d.ts +0 -1
  31. package/dist/types/components/common/capture-error/capture-error.d.ts +0 -1
  32. package/dist/types/components/common/how-to-info/how-to-info.d.ts +0 -1
  33. package/dist/types/components/common/id-capture/id-capture.d.ts +0 -1
  34. package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +0 -1
  35. package/dist/types/components/flow/agreement-info/agreement-info.d.ts +0 -1
  36. package/dist/types/components/flow/landing-validation/landing-validation.d.ts +0 -1
  37. package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +0 -1
  38. package/dist/types/components/flow/process-id/process-id.d.ts +1 -1
  39. package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +0 -1
  40. package/dist/types/components/flow/sms-send/sms-send.d.ts +0 -1
  41. package/dist/types/components/flow/user-liveness/user-liveness.d.ts +0 -1
  42. package/dist/types/components/identification-component/identification-component.d.ts +0 -1
  43. package/dist/types/helpers/ApiCall.d.ts +2 -0
  44. package/dist/types/models/FlowSteps.d.ts +2 -1
  45. package/package.json +1 -1
  46. package/dist/qbs-ect-cmp/p-b969ca3e.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
- this.baseComponent.apiCall.GenerateAgreement(data.detail.agreementType);
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 this.baseComponent.apiCall.AddLog(apiLogData, getLogMessage(this.order_id, this.redirect_id, this.token));
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
- this.baseComponent.apiCall.AddLog({ phase: 'debug mode' }, this.logInit);
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 this.baseComponent.apiCall.AddIdentificationRequest(store.device, packageJson.version);
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) => {
@@ -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) => {