@ekyc_qoobiss/qbs-ect-cmp 3.6.13 → 3.6.14

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.
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-5d6f9123.js';
2
- import { A as ApiCall, a as AgreementCheckValues, b as AgreementInfoValues, B as BaseComponent, F as FlowSteps, s as state, c as FlowStatus, S as Stream, V as VerificationMode, C as CameraErrorValues, M as MobileOS, d as SessionKeys, I as IdCaptureValues, e as SelfieCaptureValues, f as delay, E as Events, g as CompleteValues, H as HowToValues, h as Browser, i as FlowMoments, j as IDML5Detector, k as FaceML5Detector, l as getLogMessage, m as ML5, L as LandingValues, n as createCommonjsModule, o as MobileRedirectValues, O as OrderStatuses, p as FacePose, P as PhoneValidationValues, q as CodeValidationValues } from './Stream-57643e4d.js';
2
+ import { A as ApiCall, a as AgreementCheckValues, b as AgreementInfoValues, B as BaseComponent, F as FlowSteps, s as state, c as FlowStatus, S as Stream, V as VerificationMode, C as CameraErrorValues, M as MobileOS, d as SessionKeys, I as IdCaptureValues, e as SelfieCaptureValues, f as delay, E as Events, g as CompleteValues, H as HowToValues, h as Browser, i as FlowMoments, j as IDML5Detector, k as FaceML5Detector, l as getLogMessage, m as ML5, L as LandingValues, n as createCommonjsModule, o as MobileRedirectValues, O as OrderStatuses, p as FacePose, P as PhoneValidationValues, q as CodeValidationValues } from './Stream-d1fb2210.js';
3
3
 
4
4
  const agreementCheckCss = "";
5
5
 
@@ -892,7 +892,7 @@ function v4(options, buf, offset) {
892
892
  }
893
893
 
894
894
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
895
- const version$1 = "3.6.13";
895
+ const version$1 = "3.6.14";
896
896
  const description = "Person Identification Component";
897
897
  const main = "./dist/index.cjs.js";
898
898
  const module = "./dist/index.js";
@@ -4300,6 +4300,10 @@ var CaptureUploadTypes;
4300
4300
  CaptureUploadTypes["IdFront"] = "IdFront";
4301
4301
  CaptureUploadTypes["IdBack"] = "IdBack";
4302
4302
  CaptureUploadTypes["IdFrontVideo"] = "IdFrontVideo";
4303
+ CaptureUploadTypes["IdBackVideo"] = "IdBackVideo";
4304
+ CaptureUploadTypes["SelfieVideo"] = "SelfieVideo";
4305
+ CaptureUploadTypes["SelfieGestureVideo"] = "SelfieGestureVideo";
4306
+ CaptureUploadTypes["TiltVideo"] = "TiltVideo";
4303
4307
  CaptureUploadTypes["None"] = "None";
4304
4308
  })(CaptureUploadTypes || (CaptureUploadTypes = {}));
4305
4309
  var CaptureFlowStatus;
@@ -4333,23 +4337,21 @@ const ProcessId = class {
4333
4337
  photoDone: false,
4334
4338
  recordingDone: false,
4335
4339
  fileName: 'idImage.png',
4336
- file: null,
4337
- recoding: null,
4338
- uploadType: CaptureUploadTypes.IdFront,
4340
+ recName: 'idVideo.',
4341
+ photoType: CaptureUploadTypes.IdFront,
4342
+ recType: CaptureUploadTypes.IdFrontVideo,
4339
4343
  },
4340
4344
  back: null,
4341
4345
  tilt: null,
4342
- recordingData: [],
4343
- mimeType: '',
4344
4346
  };
4345
4347
  if (state.hasIdBack) {
4346
4348
  this.flow.back = {
4347
4349
  photoDone: false,
4348
4350
  recordingDone: false,
4349
4351
  fileName: 'idBackImage.png',
4350
- file: null,
4351
- recoding: null,
4352
- uploadType: CaptureUploadTypes.IdBack,
4352
+ recName: 'idBackVideo.',
4353
+ photoType: CaptureUploadTypes.IdBack,
4354
+ recType: CaptureUploadTypes.IdBackVideo,
4353
4355
  };
4354
4356
  }
4355
4357
  if (state.hasIdTilt) {
@@ -4357,9 +4359,9 @@ const ProcessId = class {
4357
4359
  photoDone: true,
4358
4360
  recordingDone: false,
4359
4361
  fileName: 'idTiltImage.png',
4360
- file: null,
4361
- recoding: null,
4362
- uploadType: CaptureUploadTypes.None,
4362
+ recName: 'idTiltVideo.',
4363
+ photoType: CaptureUploadTypes.None,
4364
+ recType: CaptureUploadTypes.TiltVideo,
4363
4365
  };
4364
4366
  }
4365
4367
  this.captureStep = CaptureFlowStatus.HowToFront;
@@ -4391,8 +4393,8 @@ const ProcessId = class {
4391
4393
  return;
4392
4394
  }
4393
4395
  try {
4394
- this.flow.front.file = new File([idPhoto], this.flow.front.fileName, { type: 'image/png' });
4395
- this.flow.front.photoDone = await this.uploadPhotos(this.flow.front.uploadType, this.flow.front.file);
4396
+ let frontCapture = new File([idPhoto], this.flow.front.fileName, { type: 'image/png' });
4397
+ this.flow.front.photoDone = await this.uploadPhotos(this.flow.front.photoType, frontCapture);
4396
4398
  await this.endFlow();
4397
4399
  }
4398
4400
  catch (e) {
@@ -4407,8 +4409,8 @@ const ProcessId = class {
4407
4409
  return;
4408
4410
  }
4409
4411
  try {
4410
- this.flow.back.file = new File([idPhoto], this.flow.back.fileName, { type: 'image/png' });
4411
- this.flow.back.photoDone = await this.uploadPhotos(this.flow.back.uploadType, this.flow.back.file);
4412
+ let backCapture = new File([idPhoto], this.flow.back.fileName, { type: 'image/png' });
4413
+ this.flow.back.photoDone = await this.uploadPhotos(this.flow.back.photoType, backCapture);
4412
4414
  await this.endFlow();
4413
4415
  }
4414
4416
  catch (e) {
@@ -4416,56 +4418,32 @@ const ProcessId = class {
4416
4418
  }
4417
4419
  }
4418
4420
  async capturedIdRecording(event) {
4419
- var recResults = event.detail;
4420
- if (recResults.RecordingChunks.length == 0 && this.recordingResultCount == 0) {
4421
+ let idRecording = event.detail;
4422
+ if (idRecording.size == 0 && this.recordingResultCount == 0) {
4421
4423
  this.recordingResultCount++;
4422
4424
  return;
4423
4425
  }
4424
- if (recResults.RecordingChunks.length == 0) {
4425
- await this.baseComponent.apiCall.AddLog({ message: 'Empty recording for ' + this.captureStep, blobData: recResults.RecordingChunks }, getLogMessage());
4426
- this.triggerErrorFlow();
4426
+ if (idRecording.size == 0) {
4427
+ await this.baseComponent.apiCall.AddLog({ message: 'Empty ID recording', blobData: idRecording }, getLogMessage());
4428
+ this.showTimeout = true;
4427
4429
  return;
4428
4430
  }
4429
- this.flow.mimeType = event.detail.MimeType;
4431
+ let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
4430
4432
  if (this.captureStep == CaptureFlowStatus.IdFront) {
4431
- this.flow.front.recoding = recResults.RecordingChunks;
4432
- this.flow.front.recordingDone = true;
4433
+ let frontRec = new File([idRecording], this.flow.front.recName + mimeType.extension, { type: mimeType.type });
4434
+ this.flow.front.recordingDone = await this.uploadRecording(this.flow.front.recType, frontRec);
4433
4435
  }
4434
4436
  if (this.captureStep == CaptureFlowStatus.IdBack) {
4435
- this.flow.back.recoding = recResults.RecordingChunks;
4436
- this.flow.back.recordingDone = true;
4437
+ let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
4438
+ this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
4437
4439
  }
4438
4440
  if (this.captureStep == CaptureFlowStatus.Tilt) {
4439
- this.flow.tilt.recoding = recResults.RecordingChunks;
4440
- this.flow.tilt.recordingDone = true;
4441
+ let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
4442
+ this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
4441
4443
  }
4442
4444
  await this.endFlow();
4443
4445
  this.recordingResultCount = 0;
4444
4446
  }
4445
- async getRecordingFile() {
4446
- let idRecording = new Blob(this.flow.recordingData, {
4447
- type: this.flow.mimeType,
4448
- });
4449
- if (idRecording.size == 0) {
4450
- await this.baseComponent.apiCall.AddLog({ message: 'Empty recording', blobData: idRecording }, getLogMessage());
4451
- this.triggerErrorFlow(true);
4452
- return;
4453
- }
4454
- let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
4455
- try {
4456
- var file = new File([idRecording], 'idVideo.' + mimeType.extension, { type: mimeType.type });
4457
- var uploadResult = this.uploadRecording('IdFrontVideo', file);
4458
- if (uploadResult) {
4459
- return true;
4460
- }
4461
- else {
4462
- this.triggerErrorFlow(true);
4463
- }
4464
- }
4465
- catch (e) {
4466
- this.triggerErrorFlow(true);
4467
- }
4468
- }
4469
4447
  async componentDidLoad() {
4470
4448
  await this.baseComponent.initialize();
4471
4449
  }
@@ -4499,31 +4477,24 @@ const ProcessId = class {
4499
4477
  triggerErrorFlow(restart = false) {
4500
4478
  if (restart) {
4501
4479
  this.captureStep = CaptureFlowStatus.IdFront;
4502
- this.flow.recordingData = [];
4503
4480
  }
4504
4481
  if (this.captureStep == CaptureFlowStatus.IdFront || restart) {
4505
- this.flow.front.file = null;
4506
4482
  this.flow.front.photoDone = false;
4507
4483
  this.flow.front.recordingDone = false;
4508
- this.flow.front.recoding = null;
4509
4484
  }
4510
4485
  if (this.captureStep == CaptureFlowStatus.IdBack || restart) {
4511
- this.flow.back.file = null;
4512
4486
  this.flow.back.photoDone = false;
4513
4487
  this.flow.back.recordingDone = false;
4514
- this.flow.back.recoding = null;
4515
4488
  }
4516
4489
  if (this.captureStep == CaptureFlowStatus.Tilt || restart) {
4517
4490
  this.flow.tilt.photoDone = true;
4518
4491
  this.flow.tilt.recordingDone = false;
4519
- this.flow.tilt.recoding = null;
4520
4492
  }
4521
4493
  this.showInvalid = true;
4522
4494
  }
4523
4495
  async endFlow() {
4524
4496
  if (this.captureStep == CaptureFlowStatus.IdFront) {
4525
4497
  if (this.flow.front.photoDone && this.flow.front.recordingDone) {
4526
- this.flow.recordingData.push(...this.flow.front.recoding);
4527
4498
  if (state.hasIdBack) {
4528
4499
  this.captureStep = CaptureFlowStatus.IdBack;
4529
4500
  }
@@ -4540,7 +4511,6 @@ const ProcessId = class {
4540
4511
  }
4541
4512
  if (this.captureStep == CaptureFlowStatus.IdBack && state.hasIdBack) {
4542
4513
  if (this.flow.back.photoDone && this.flow.back.recordingDone) {
4543
- this.flow.recordingData.push(...this.flow.back.recoding);
4544
4514
  if (state.hasIdTilt) {
4545
4515
  this.captureStep = CaptureFlowStatus.Tilt;
4546
4516
  }
@@ -4554,16 +4524,12 @@ const ProcessId = class {
4554
4524
  }
4555
4525
  if (this.captureStep == CaptureFlowStatus.Tilt && state.hasIdTilt) {
4556
4526
  if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
4557
- this.flow.recordingData.push(...this.flow.tilt.recoding);
4527
+ this.captureStep = CaptureFlowStatus.End;
4558
4528
  }
4559
4529
  else {
4560
4530
  return;
4561
4531
  }
4562
4532
  }
4563
- var recDone = await this.getRecordingFile();
4564
- if (recDone) {
4565
- this.captureStep = CaptureFlowStatus.End;
4566
- }
4567
4533
  if (this.captureStep != CaptureFlowStatus.End) {
4568
4534
  return;
4569
4535
  }
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-5d6f9123.js';
2
- import { B as BaseComponent, F as FlowSteps, l as getLogMessage, s as state, c as FlowStatus, S as Stream } from './Stream-57643e4d.js';
2
+ import { B as BaseComponent, F as FlowSteps, l as getLogMessage, s as state, c as FlowStatus, S as Stream } from './Stream-d1fb2210.js';
3
3
 
4
4
  const idDoubleSideCss = "";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-5d6f9123.js';
2
- import { B as BaseComponent, F as FlowSteps, l as getLogMessage, s as state, c as FlowStatus, S as Stream } from './Stream-57643e4d.js';
2
+ import { B as BaseComponent, F as FlowSteps, l as getLogMessage, s as state, c as FlowStatus, S as Stream } from './Stream-d1fb2210.js';
3
3
 
4
4
  const idSingleSideCss = "";
5
5
 
@@ -1 +1 @@
1
- import{r as i,c as t,h as s}from"./p-aacd7024.js";import{B as h,F as a,l as e,s as o,c as d,S as r}from"./p-ed7ad79f.js";const n=class{constructor(s){i(this,s),this.apiErrorEvent=t(this,"apiError",7),this.recordingResultCount=0,this.showTimeout=void 0,this.showInvalid=void 0,this.showHowTo=void 0,this.front=void 0,this.flow={photoDone:!1,recordingDone:!1,verificationFinished:!1,photoFile:null,photoFileName:"",photoUploadType:"",recordingFile:null,recordingFileName:"",recordingUploadType:""},this.baseComponent=new h(a.CiBack),this.baseComponent.setEventEmitter(this.apiErrorEvent)}componentWillLoad(){this.captureRetryCount=0,this.showHowTo=!0,this.flow.photoFileName="idImage.png",this.flow.recordingFileName="idVideo.",this.flow.photoUploadType="IdFront",this.flow.recordingUploadType="IdFrontVideo",this.front=!0}howToDone(){this.showHowTo=!1}timeElapsed(){this.showTimeout=!0}captureErrorDone(){1==this.showTimeout&&(this.showTimeout=!1),1==this.showInvalid&&(this.flow.photoFileName="idImage.png",this.flow.recordingFileName="idVideo.",this.flow.photoUploadType="IdFront",this.flow.recordingUploadType="IdFrontVideo",this.flow.photoFile=null,this.flow.recordingFile=null,this.flow.photoDone=!1,this.flow.recordingDone=!1,this.front=!0,this.showInvalid=!1)}async captureIdImage(i){let t=i.detail;if(0==t.size)return await this.baseComponent.apiCall.AddLog({message:"Empty id photo",blobData:t},e()),void this.triggerErrorFlow();try{this.flow.photoFile=new File([t],this.flow.photoFileName,{type:"image/png"}),this.uploadPhoto()}catch(i){this.apiErrorEvent.emit(i)}}async captureIdBackImage(i){let t=i.detail;if(0==t.size)return await this.baseComponent.apiCall.AddLog({message:"Empty id photo",blobData:t},e()),void this.triggerErrorFlow();try{this.flow.photoFile=new File([t],this.flow.photoFileName,{type:"image/png"}),this.uploadPhoto()}catch(i){this.apiErrorEvent.emit(i)}}async capturedIdRecording(i){let t=i.detail;if(0==t.size&&0==this.recordingResultCount)return void this.recordingResultCount++;if(0==t.size)return await this.baseComponent.apiCall.AddLog({message:"Empty recording",blobData:t},e()),void this.triggerErrorFlow();this.recordingResultCount=0;let s=t.type==r.mp4MimeType.type?r.mp4MimeType:r.webmMimeType;try{this.flow.recordingFile=new File([t],this.flow.recordingFileName+s.extension,{type:s.type}),this.uploadRecording()}catch(i){o.recordingRetryCount<3?(o.recordingRetryCount++,this.triggerErrorFlow()):this.apiErrorEvent.emit(i)}}async verificationFinished(i){this.flow.verificationFinished=!0,await this.endFlow()}async componentDidLoad(){await this.baseComponent.initialize()}async uploadPhoto(){null==this.flow.photoFile||this.flow.photoDone||(this.flow.photoDone=await this.baseComponent.apiCall.UploadFileForRequestB64(o.requestId,this.flow.photoUploadType,this.flow.photoFile),this.flow.photoDone?await this.endFlow():(this.switchCamera(),this.triggerErrorFlow()))}async uploadRecording(){null==this.flow.recordingFile||this.flow.recordingDone||(this.flow.recordingDone=await this.baseComponent.apiCall.UploadFileForRequestB64(o.requestId,this.flow.recordingUploadType,this.flow.recordingFile),this.flow.recordingDone?await this.endFlow():this.triggerErrorFlow())}triggerErrorFlow(){this.flow.photoFile=null,this.flow.recordingFile=null,this.showInvalid=!0}async endFlow(){if(this.flow.photoDone&&this.flow.recordingDone)return this.front?(this.flow.photoFileName="idBackImage.png",this.flow.recordingFileName="idBackVideo.",this.flow.photoUploadType="IdBack",this.flow.recordingUploadType="IdBackVideo",this.flow.photoFile=null,this.flow.recordingFile=null,this.flow.photoDone=!1,this.flow.recordingDone=!1,this.front=!1,void(this.showHowTo=!0)):void(this.flow.verificationFinished&&(o.recordingRetryCount=0,o.flowStatus=d.LIVENESS))}async disconnectedCallback(){await this.baseComponent.finalize()}switchCamera(){if(1==this.captureRetryCount){let i=o.cameraIds.indexOf(o.cameraId);o.cameraId=i===o.cameraIds.length-1?o.cameraIds[0]:o.cameraIds[i+1],this.captureRetryCount=0}else this.captureRetryCount++}render(){let i=s("capture-error",{type:"ID"}),t=s("id-capture",{id:"idFront"}),h=s("id-back-capture",{id:"idBack"}),a=s("how-to-info",{idSide:this.front?"front":"back"});return this.showHowTo?a:this.showInvalid||this.showTimeout?i:this.front?t:h}};n.style="";export{n as id_double_side}
1
+ import{r as i,c as t,h as s}from"./p-aacd7024.js";import{B as h,F as a,l as e,s as o,c as d,S as r}from"./p-73a2e58b.js";const n=class{constructor(s){i(this,s),this.apiErrorEvent=t(this,"apiError",7),this.recordingResultCount=0,this.showTimeout=void 0,this.showInvalid=void 0,this.showHowTo=void 0,this.front=void 0,this.flow={photoDone:!1,recordingDone:!1,verificationFinished:!1,photoFile:null,photoFileName:"",photoUploadType:"",recordingFile:null,recordingFileName:"",recordingUploadType:""},this.baseComponent=new h(a.CiBack),this.baseComponent.setEventEmitter(this.apiErrorEvent)}componentWillLoad(){this.captureRetryCount=0,this.showHowTo=!0,this.flow.photoFileName="idImage.png",this.flow.recordingFileName="idVideo.",this.flow.photoUploadType="IdFront",this.flow.recordingUploadType="IdFrontVideo",this.front=!0}howToDone(){this.showHowTo=!1}timeElapsed(){this.showTimeout=!0}captureErrorDone(){1==this.showTimeout&&(this.showTimeout=!1),1==this.showInvalid&&(this.flow.photoFileName="idImage.png",this.flow.recordingFileName="idVideo.",this.flow.photoUploadType="IdFront",this.flow.recordingUploadType="IdFrontVideo",this.flow.photoFile=null,this.flow.recordingFile=null,this.flow.photoDone=!1,this.flow.recordingDone=!1,this.front=!0,this.showInvalid=!1)}async captureIdImage(i){let t=i.detail;if(0==t.size)return await this.baseComponent.apiCall.AddLog({message:"Empty id photo",blobData:t},e()),void this.triggerErrorFlow();try{this.flow.photoFile=new File([t],this.flow.photoFileName,{type:"image/png"}),this.uploadPhoto()}catch(i){this.apiErrorEvent.emit(i)}}async captureIdBackImage(i){let t=i.detail;if(0==t.size)return await this.baseComponent.apiCall.AddLog({message:"Empty id photo",blobData:t},e()),void this.triggerErrorFlow();try{this.flow.photoFile=new File([t],this.flow.photoFileName,{type:"image/png"}),this.uploadPhoto()}catch(i){this.apiErrorEvent.emit(i)}}async capturedIdRecording(i){let t=i.detail;if(0==t.size&&0==this.recordingResultCount)return void this.recordingResultCount++;if(0==t.size)return await this.baseComponent.apiCall.AddLog({message:"Empty recording",blobData:t},e()),void this.triggerErrorFlow();this.recordingResultCount=0;let s=t.type==r.mp4MimeType.type?r.mp4MimeType:r.webmMimeType;try{this.flow.recordingFile=new File([t],this.flow.recordingFileName+s.extension,{type:s.type}),this.uploadRecording()}catch(i){o.recordingRetryCount<3?(o.recordingRetryCount++,this.triggerErrorFlow()):this.apiErrorEvent.emit(i)}}async verificationFinished(i){this.flow.verificationFinished=!0,await this.endFlow()}async componentDidLoad(){await this.baseComponent.initialize()}async uploadPhoto(){null==this.flow.photoFile||this.flow.photoDone||(this.flow.photoDone=await this.baseComponent.apiCall.UploadFileForRequestB64(o.requestId,this.flow.photoUploadType,this.flow.photoFile),this.flow.photoDone?await this.endFlow():(this.switchCamera(),this.triggerErrorFlow()))}async uploadRecording(){null==this.flow.recordingFile||this.flow.recordingDone||(this.flow.recordingDone=await this.baseComponent.apiCall.UploadFileForRequestB64(o.requestId,this.flow.recordingUploadType,this.flow.recordingFile),this.flow.recordingDone?await this.endFlow():this.triggerErrorFlow())}triggerErrorFlow(){this.flow.photoFile=null,this.flow.recordingFile=null,this.showInvalid=!0}async endFlow(){if(this.flow.photoDone&&this.flow.recordingDone)return this.front?(this.flow.photoFileName="idBackImage.png",this.flow.recordingFileName="idBackVideo.",this.flow.photoUploadType="IdBack",this.flow.recordingUploadType="IdBackVideo",this.flow.photoFile=null,this.flow.recordingFile=null,this.flow.photoDone=!1,this.flow.recordingDone=!1,this.front=!1,void(this.showHowTo=!0)):void(this.flow.verificationFinished&&(o.recordingRetryCount=0,o.flowStatus=d.LIVENESS))}async disconnectedCallback(){await this.baseComponent.finalize()}switchCamera(){if(1==this.captureRetryCount){let i=o.cameraIds.indexOf(o.cameraId);o.cameraId=i===o.cameraIds.length-1?o.cameraIds[0]:o.cameraIds[i+1],this.captureRetryCount=0}else this.captureRetryCount++}render(){let i=s("capture-error",{type:"ID"}),t=s("id-capture",{id:"idFront"}),h=s("id-back-capture",{id:"idBack"}),a=s("how-to-info",{idSide:this.front?"front":"back"});return this.showHowTo?a:this.showInvalid||this.showTimeout?i:this.front?t:h}};n.style="";export{n as id_double_side}