@ekyc_qoobiss/qbs-ect-cmp 2.1.19 → 2.1.21

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.
@@ -5333,11 +5333,13 @@ const EndRedirect = class {
5333
5333
  async componentDidLoad() {
5334
5334
  Events.init(window);
5335
5335
  Events.flowCompleted();
5336
- try {
5337
- await this.apiCall.AddStep(FlowSteps.End);
5338
- }
5339
- catch (e) {
5340
- this.apiErrorEvent.emit(e);
5336
+ if (state.environment !== 'DEMO') {
5337
+ try {
5338
+ await this.apiCall.AddStep(FlowSteps.End);
5339
+ }
5340
+ catch (e) {
5341
+ this.apiErrorEvent.emit(e);
5342
+ }
5341
5343
  }
5342
5344
  }
5343
5345
  render() {
@@ -5423,6 +5425,7 @@ class Cameras {
5423
5425
  const settings = track.getSettings();
5424
5426
  let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
5425
5427
  facingMode = facingMode === 'e' ? 'environment' : facingMode;
5428
+ facingMode = facingMode === 'u' ? 'user' : facingMode;
5426
5429
  allDevices.push({
5427
5430
  deviceId: device.deviceId,
5428
5431
  name: device.label,
@@ -5439,6 +5442,7 @@ class Cameras {
5439
5442
  const capabilities = track.getCapabilities();
5440
5443
  let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
5441
5444
  facingMode = facingMode === 'e' ? 'environment' : facingMode;
5445
+ facingMode = facingMode === 'u' ? 'user' : facingMode;
5442
5446
  allDevices.push({
5443
5447
  deviceId: device.deviceId,
5444
5448
  name: device.label,
@@ -5512,10 +5516,10 @@ class Cameras {
5512
5516
  static async InitCameras(device) {
5513
5517
  try {
5514
5518
  let cam = new Cameras();
5515
- let cameras = await cam.GetCameras(device);
5519
+ let cameras = (await cam.GetCameras(device)).filter(c => c.facingMode == 'environment');
5516
5520
  var recommCamera = cam.GetRecommendedCamera(cameras);
5517
5521
  state.cameraIds = cameras.map(camera => camera.deviceId);
5518
- state.cameraId = recommCamera.deviceId;
5522
+ state.cameraId = recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId;
5519
5523
  return true;
5520
5524
  }
5521
5525
  catch (e) {
@@ -6178,7 +6182,7 @@ function v4(options, buf, offset) {
6178
6182
  }
6179
6183
 
6180
6184
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
6181
- const version$1 = "2.1.19";
6185
+ const version$1 = "2.1.21";
6182
6186
  const description = "Person Identification Component";
6183
6187
  const main = "./dist/index.cjs.js";
6184
6188
  const module$1 = "./dist/index.js";
@@ -6437,6 +6441,10 @@ const IdentificationComponent = class {
6437
6441
  if (state.initialised) {
6438
6442
  return;
6439
6443
  }
6444
+ if (state.environment == 'DEMO') {
6445
+ state.initialised = true;
6446
+ return;
6447
+ }
6440
6448
  try {
6441
6449
  if (state.debug)
6442
6450
  this.apiCall.AddLog(this.logInit);
@@ -6537,11 +6545,13 @@ const LandingValidation = class {
6537
6545
  async componentDidLoad() {
6538
6546
  Events.init(window);
6539
6547
  Events.flowStarted();
6540
- try {
6541
- await this.apiCall.AddStep(FlowSteps.Landing);
6542
- }
6543
- catch (e) {
6544
- this.apiErrorEvent.emit(e);
6548
+ if (state.environment !== 'DEMO') {
6549
+ try {
6550
+ await this.apiCall.AddStep(FlowSteps.Landing);
6551
+ }
6552
+ catch (e) {
6553
+ this.apiErrorEvent.emit(e);
6554
+ }
6545
6555
  }
6546
6556
  }
6547
6557
  async initRequest() {
@@ -6555,6 +6565,10 @@ const LandingValidation = class {
6555
6565
  async startFlow() {
6556
6566
  if (state.initialised) {
6557
6567
  this.buttonDisabled = true;
6568
+ if (state.environment === 'DEMO') {
6569
+ state.flowStatus = FlowStatus.COMPLETE;
6570
+ return;
6571
+ }
6558
6572
  if (!(await Cameras.InitCameras(this.device))) {
6559
6573
  if (this.device.isIos)
6560
6574
  sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
@@ -13,11 +13,13 @@ export class EndRedirect {
13
13
  async componentDidLoad() {
14
14
  Events.init(window);
15
15
  Events.flowCompleted();
16
- try {
17
- await this.apiCall.AddStep(FlowSteps.End);
18
- }
19
- catch (e) {
20
- this.apiErrorEvent.emit(e);
16
+ if (store.environment !== 'DEMO') {
17
+ try {
18
+ await this.apiCall.AddStep(FlowSteps.End);
19
+ }
20
+ catch (e) {
21
+ this.apiErrorEvent.emit(e);
22
+ }
21
23
  }
22
24
  }
23
25
  render() {
@@ -25,11 +25,13 @@ export class LandingValidation {
25
25
  async componentDidLoad() {
26
26
  Events.init(window);
27
27
  Events.flowStarted();
28
- try {
29
- await this.apiCall.AddStep(FlowSteps.Landing);
30
- }
31
- catch (e) {
32
- this.apiErrorEvent.emit(e);
28
+ if (store.environment !== 'DEMO') {
29
+ try {
30
+ await this.apiCall.AddStep(FlowSteps.Landing);
31
+ }
32
+ catch (e) {
33
+ this.apiErrorEvent.emit(e);
34
+ }
33
35
  }
34
36
  }
35
37
  async initRequest() {
@@ -43,6 +45,10 @@ export class LandingValidation {
43
45
  async startFlow() {
44
46
  if (store.initialised) {
45
47
  this.buttonDisabled = true;
48
+ if (store.environment === 'DEMO') {
49
+ store.flowStatus = FlowStatus.COMPLETE;
50
+ return;
51
+ }
46
52
  if (!(await Cameras.InitCameras(this.device))) {
47
53
  if (this.device.isIos)
48
54
  sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
@@ -196,6 +196,10 @@ export class IdentificationComponent {
196
196
  if (store.initialised) {
197
197
  return;
198
198
  }
199
+ if (store.environment == 'DEMO') {
200
+ store.initialised = true;
201
+ return;
202
+ }
199
203
  try {
200
204
  if (store.debug)
201
205
  this.apiCall.AddLog(this.logInit);
@@ -13,6 +13,7 @@ export class Cameras {
13
13
  const settings = track.getSettings();
14
14
  let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
15
15
  facingMode = facingMode === 'e' ? 'environment' : facingMode;
16
+ facingMode = facingMode === 'u' ? 'user' : facingMode;
16
17
  allDevices.push({
17
18
  deviceId: device.deviceId,
18
19
  name: device.label,
@@ -29,6 +30,7 @@ export class Cameras {
29
30
  const capabilities = track.getCapabilities();
30
31
  let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
31
32
  facingMode = facingMode === 'e' ? 'environment' : facingMode;
33
+ facingMode = facingMode === 'u' ? 'user' : facingMode;
32
34
  allDevices.push({
33
35
  deviceId: device.deviceId,
34
36
  name: device.label,
@@ -102,10 +104,10 @@ export class Cameras {
102
104
  static async InitCameras(device) {
103
105
  try {
104
106
  let cam = new Cameras();
105
- let cameras = await cam.GetCameras(device);
107
+ let cameras = (await cam.GetCameras(device)).filter(c => c.facingMode == 'environment');
106
108
  var recommCamera = cam.GetRecommendedCamera(cameras);
107
109
  store.cameraIds = cameras.map(camera => camera.deviceId);
108
- store.cameraId = recommCamera.deviceId;
110
+ store.cameraId = recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId;
109
111
  return true;
110
112
  }
111
113
  catch (e) {
@@ -5329,11 +5329,13 @@ const EndRedirect = class {
5329
5329
  async componentDidLoad() {
5330
5330
  Events.init(window);
5331
5331
  Events.flowCompleted();
5332
- try {
5333
- await this.apiCall.AddStep(FlowSteps.End);
5334
- }
5335
- catch (e) {
5336
- this.apiErrorEvent.emit(e);
5332
+ if (state.environment !== 'DEMO') {
5333
+ try {
5334
+ await this.apiCall.AddStep(FlowSteps.End);
5335
+ }
5336
+ catch (e) {
5337
+ this.apiErrorEvent.emit(e);
5338
+ }
5337
5339
  }
5338
5340
  }
5339
5341
  render() {
@@ -5419,6 +5421,7 @@ class Cameras {
5419
5421
  const settings = track.getSettings();
5420
5422
  let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
5421
5423
  facingMode = facingMode === 'e' ? 'environment' : facingMode;
5424
+ facingMode = facingMode === 'u' ? 'user' : facingMode;
5422
5425
  allDevices.push({
5423
5426
  deviceId: device.deviceId,
5424
5427
  name: device.label,
@@ -5435,6 +5438,7 @@ class Cameras {
5435
5438
  const capabilities = track.getCapabilities();
5436
5439
  let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
5437
5440
  facingMode = facingMode === 'e' ? 'environment' : facingMode;
5441
+ facingMode = facingMode === 'u' ? 'user' : facingMode;
5438
5442
  allDevices.push({
5439
5443
  deviceId: device.deviceId,
5440
5444
  name: device.label,
@@ -5508,10 +5512,10 @@ class Cameras {
5508
5512
  static async InitCameras(device) {
5509
5513
  try {
5510
5514
  let cam = new Cameras();
5511
- let cameras = await cam.GetCameras(device);
5515
+ let cameras = (await cam.GetCameras(device)).filter(c => c.facingMode == 'environment');
5512
5516
  var recommCamera = cam.GetRecommendedCamera(cameras);
5513
5517
  state.cameraIds = cameras.map(camera => camera.deviceId);
5514
- state.cameraId = recommCamera.deviceId;
5518
+ state.cameraId = recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId;
5515
5519
  return true;
5516
5520
  }
5517
5521
  catch (e) {
@@ -6174,7 +6178,7 @@ function v4(options, buf, offset) {
6174
6178
  }
6175
6179
 
6176
6180
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
6177
- const version$1 = "2.1.19";
6181
+ const version$1 = "2.1.21";
6178
6182
  const description = "Person Identification Component";
6179
6183
  const main = "./dist/index.cjs.js";
6180
6184
  const module = "./dist/index.js";
@@ -6433,6 +6437,10 @@ const IdentificationComponent = class {
6433
6437
  if (state.initialised) {
6434
6438
  return;
6435
6439
  }
6440
+ if (state.environment == 'DEMO') {
6441
+ state.initialised = true;
6442
+ return;
6443
+ }
6436
6444
  try {
6437
6445
  if (state.debug)
6438
6446
  this.apiCall.AddLog(this.logInit);
@@ -6533,11 +6541,13 @@ const LandingValidation = class {
6533
6541
  async componentDidLoad() {
6534
6542
  Events.init(window);
6535
6543
  Events.flowStarted();
6536
- try {
6537
- await this.apiCall.AddStep(FlowSteps.Landing);
6538
- }
6539
- catch (e) {
6540
- this.apiErrorEvent.emit(e);
6544
+ if (state.environment !== 'DEMO') {
6545
+ try {
6546
+ await this.apiCall.AddStep(FlowSteps.Landing);
6547
+ }
6548
+ catch (e) {
6549
+ this.apiErrorEvent.emit(e);
6550
+ }
6541
6551
  }
6542
6552
  }
6543
6553
  async initRequest() {
@@ -6551,6 +6561,10 @@ const LandingValidation = class {
6551
6561
  async startFlow() {
6552
6562
  if (state.initialised) {
6553
6563
  this.buttonDisabled = true;
6564
+ if (state.environment === 'DEMO') {
6565
+ state.flowStatus = FlowStatus.COMPLETE;
6566
+ return;
6567
+ }
6554
6568
  if (!(await Cameras.InitCameras(this.device))) {
6555
6569
  if (this.device.isIos)
6556
6570
  sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');