kwikid-forms 0.6.45 → 0.6.47

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.
@@ -385,6 +385,10 @@ const FIELD_PROPERTIES = {
385
385
  isFacematchFromServer: false,
386
386
  sources: []
387
387
  },
388
+ liveliness: {
389
+ isEnabled: false,
390
+ isLivelinessFromServer: false
391
+ },
388
392
  watermark: {
389
393
  isEnabled: false,
390
394
  isWatermarkFromServer: false,
@@ -3911,9 +3915,13 @@ class KwikIDFormViewComponent {
3911
3915
  const image = response === null || response === void 0 ? void 0 : response.image_url;
3912
3916
  const imageOcr = response === null || response === void 0 ? void 0 : response.image_ocr;
3913
3917
  const imageFacematch = response === null || response === void 0 ? void 0 : response.image_facematch;
3918
+ const imageLiveliness = response === null || response === void 0 ? void 0 : response.image_liveliness;
3914
3919
  const imageWatermark = response === null || response === void 0 ? void 0 : response.image_watermark;
3915
- const imageData = imageOcr || imageFacematch || imageWatermark
3916
- ? Object.assign(Object.assign(Object.assign({ image }, (imageOcr && { ocr: imageOcr })), (imageFacematch && { facematch: imageFacematch })), (imageWatermark && { watermark: imageWatermark })) : image;
3920
+ const isCheckCameraFeatures = () => {
3921
+ return (imageOcr || imageLiveliness || imageFacematch || imageWatermark);
3922
+ };
3923
+ const imageData = isCheckCameraFeatures()
3924
+ ? Object.assign(Object.assign(Object.assign(Object.assign({ image }, (imageOcr && { ocr: imageOcr })), (imageFacematch && { facematch: imageFacematch })), (imageLiveliness && { liveliness: imageLiveliness })), (imageWatermark && { watermark: imageWatermark })) : image;
3917
3925
  this.formData[field.key] = getObjectDeepCopy([imageData]);
3918
3926
  this.cameraData[field.key] = getObjectDeepCopy(imageData);
3919
3927
  this.mediaFiles[field.key] = getObjectDeepCopy([imageData]);
@@ -4882,7 +4890,7 @@ class KwikIDFormViewComponent {
4882
4890
  * This is a api upload mocking method. Set's to loading at first at point when API is called and then changes the status to random status after 2 seconds of delay showing a mocked response from API.
4883
4891
  */
4884
4892
  uploadFile(field, file) {
4885
- var _a, _b, _c, _d, _e, _f;
4893
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4886
4894
  return __awaiter(this, void 0, void 0, function* () {
4887
4895
  switch (field.type) {
4888
4896
  case EFieldType.FILE:
@@ -4980,12 +4988,18 @@ class KwikIDFormViewComponent {
4980
4988
  watermarkPayload.data.push(watermarkSource);
4981
4989
  }
4982
4990
  }
4983
- const imageUploadPayload = Object.assign(Object.assign(Object.assign({ image: file }, ((ocrPayload === null || ocrPayload === void 0 ? void 0 : ocrPayload.isEnabled) && {
4991
+ let livelinessPayload = {};
4992
+ if (isNotEmptyValue((_h = (_g = field === null || field === void 0 ? void 0 : field.properties) === null || _g === void 0 ? void 0 : _g.features) === null || _h === void 0 ? void 0 : _h.liveliness)) {
4993
+ livelinessPayload = field.properties.features.liveliness;
4994
+ }
4995
+ const imageUploadPayload = Object.assign(Object.assign(Object.assign(Object.assign({ image: file }, ((ocrPayload === null || ocrPayload === void 0 ? void 0 : ocrPayload.isEnabled) && {
4984
4996
  ocr: ocrPayload
4985
4997
  })), ((facematchPayload === null || facematchPayload === void 0 ? void 0 : facematchPayload.isEnabled) && {
4986
4998
  facematch: facematchPayload
4987
4999
  })), ((watermarkPayload === null || watermarkPayload === void 0 ? void 0 : watermarkPayload.isEnabled) && {
4988
5000
  watermark: watermarkPayload
5001
+ })), ((livelinessPayload === null || livelinessPayload === void 0 ? void 0 : livelinessPayload.isEnabled) && {
5002
+ liveliness: livelinessPayload
4989
5003
  }));
4990
5004
  this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_IMAGE, {
4991
5005
  field_key: field.key,