gbc-kyc-kit 2.0.4 → 2.0.6

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.
@@ -22099,13 +22099,13 @@ function isEmpty$5(val) {
22099
22099
  }
22100
22100
  var lib$1 = isEmpty$5;
22101
22101
  const fetchCheckIp = async (inProduction) => {
22102
- const parseReq2 = {
22102
+ const parseReq = {
22103
22103
  method: "GET",
22104
22104
  path: "api/v1/kyc-kit/check_ip",
22105
22105
  inProduction
22106
22106
  };
22107
22107
  try {
22108
- const res2 = await request2(parseReq2);
22108
+ const res2 = await request2(parseReq);
22109
22109
  return res2.data;
22110
22110
  } catch (error) {
22111
22111
  console.log(error);
@@ -22123,7 +22123,7 @@ const saveDataToDB = async ({ data: data2, component, eventId, inProduction, sou
22123
22123
  let customHeaders = {};
22124
22124
  geolocation && Object.assign(customHeaders, { check_ip: JSON.stringify(geolocation) });
22125
22125
  "csvFile" in data2 && Object.assign(customHeaders, { "Content-Type": "multipart/form-data" });
22126
- const parseReq2 = {
22126
+ const parseReq = {
22127
22127
  method: "POST",
22128
22128
  inProduction,
22129
22129
  path: `api/v1/kyc-kit/events/register/${component}/${source2}/${clientId}/${eventId}`,
@@ -22131,7 +22131,7 @@ const saveDataToDB = async ({ data: data2, component, eventId, inProduction, sou
22131
22131
  customHeaders
22132
22132
  };
22133
22133
  try {
22134
- const res2 = await request2(parseReq2);
22134
+ const res2 = await request2(parseReq);
22135
22135
  return res2.data;
22136
22136
  } catch (error) {
22137
22137
  return error;
@@ -22222,7 +22222,7 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
22222
22222
  client_id: clientId,
22223
22223
  access_token: res2
22224
22224
  };
22225
- const parseReq2 = {
22225
+ const parseReq = {
22226
22226
  method: "POST",
22227
22227
  path: "api/v2/kyc-kit/blacklist/validate",
22228
22228
  customHeaders,
@@ -22236,8 +22236,8 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
22236
22236
  birth_date: birth_date ? Date.parse(birth_date) : null
22237
22237
  }
22238
22238
  };
22239
- setDataReq(parseReq2.bodyParams);
22240
- const resOfBlacklist = await request2(parseReq2);
22239
+ setDataReq(parseReq.bodyParams);
22240
+ const resOfBlacklist = await request2(parseReq);
22241
22241
  const {
22242
22242
  match: match2,
22243
22243
  message: message2,
@@ -22280,7 +22280,7 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
22280
22280
  } = error.response;
22281
22281
  await saveDataToDB({
22282
22282
  data: {
22283
- ...parseReq.bodyParams,
22283
+ dataReq,
22284
22284
  status_code: 400
22285
22285
  },
22286
22286
  component: "blacklist",
@@ -22318,7 +22318,7 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
22318
22318
  access_token: res2,
22319
22319
  "Content-Type": "multipart/form-data"
22320
22320
  };
22321
- const parseReq2 = {
22321
+ const parseReq = {
22322
22322
  method: "POST",
22323
22323
  path: "api/v1/kyc-kit/blacklist/batch",
22324
22324
  customHeaders,
@@ -22327,8 +22327,8 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
22327
22327
  csvFile
22328
22328
  }
22329
22329
  };
22330
- setDataReq(parseReq2.bodyParams);
22331
- const resOfBlacklistBatch = await request2(parseReq2);
22330
+ setDataReq(parseReq.bodyParams);
22331
+ const resOfBlacklistBatch = await request2(parseReq);
22332
22332
  const {
22333
22333
  batchSize,
22334
22334
  id,
@@ -23538,39 +23538,14 @@ function ErrorAnimation({
23538
23538
  function ListsAccordion({
23539
23539
  lists
23540
23540
  }) {
23541
- function parseName(value) {
23542
- let name = value.replace(/[\[\]']+/g, "");
23543
- return name = name.replace(/\w\S*/g, (t2) => {
23544
- return t2.charAt(0).toUpperCase() + t2.substr(1).toLowerCase();
23545
- });
23546
- }
23547
- function getCountry(list) {
23548
- let country = "";
23549
- const newArray = list.split(":");
23550
- if (newArray.length > 1) {
23551
- const address = newArray.includes(" Address");
23552
- if (address) {
23553
- country = newArray[newArray.length - 1];
23554
- }
23555
- }
23556
- return country;
23557
- }
23558
- const formatList = (list) => {
23559
- let country = "";
23560
- list.map((detail) => {
23561
- let countryData = getCountry(detail);
23562
- if (!lib$1(countryData)) {
23563
- country = countryData;
23564
- }
23565
- });
23566
- return country.replace(/[\[\]']+/g, "");
23567
- };
23541
+ console.log(lists);
23568
23542
  return /* @__PURE__ */ jsx("div", {
23569
23543
  className: "accordion",
23570
23544
  id: "accordionList",
23571
- children: lists.map((list, i) => {
23572
- const [name, value] = list[1].split(":");
23573
- let country = formatList(list);
23545
+ children: lists.length > 0 && lists.map((list, i) => {
23546
+ var _a, _b, _c;
23547
+ console.log(list);
23548
+ const names = list.names.split(" | ");
23574
23549
  return /* @__PURE__ */ jsxs("div", {
23575
23550
  className: "accordion-item",
23576
23551
  children: [/* @__PURE__ */ jsx("h2", {
@@ -23586,18 +23561,17 @@ function ListsAccordion({
23586
23561
  children: /* @__PURE__ */ jsxs("div", {
23587
23562
  className: "w-100",
23588
23563
  children: [/* @__PURE__ */ jsx("div", {
23589
- children: parseName(value)
23564
+ children: list.list_category
23590
23565
  }), /* @__PURE__ */ jsxs("div", {
23591
23566
  className: "description",
23592
23567
  children: [/* @__PURE__ */ jsxs("div", {
23593
23568
  children: [/* @__PURE__ */ jsx("b", {
23594
23569
  children: "Lista: "
23595
- }), list[0]]
23596
- }), !lib$1(country) && /* @__PURE__ */ jsxs("div", {
23597
- className: "me-3",
23570
+ }), list.list_id]
23571
+ }), /* @__PURE__ */ jsxs("div", {
23598
23572
  children: [/* @__PURE__ */ jsx("b", {
23599
- children: "Pa\xEDs: "
23600
- }), " ", country]
23573
+ children: "\xDAltima actualizaci\xF3n: "
23574
+ }), list.last_update]
23601
23575
  })]
23602
23576
  })]
23603
23577
  })
@@ -23607,19 +23581,44 @@ function ListsAccordion({
23607
23581
  className: "accordion-collapse collapse",
23608
23582
  "aria-labelledby": `heading-${i}`,
23609
23583
  "data-bs-parent": "#accordionList",
23610
- children: /* @__PURE__ */ jsx("div", {
23584
+ children: /* @__PURE__ */ jsxs("div", {
23611
23585
  className: "accordion-body",
23612
- children: /* @__PURE__ */ jsx("code", {
23613
- children: list.map((detail, i2) => {
23614
- return detail;
23586
+ children: [/* @__PURE__ */ jsxs("div", {
23587
+ className: "name-section",
23588
+ children: [/* @__PURE__ */ jsx("p", {
23589
+ children: "Coincidencia por nombre con:"
23590
+ }), names.map((name, i2) => {
23591
+ return /* @__PURE__ */ jsx("p", {
23592
+ children: name
23593
+ }, i2);
23594
+ })]
23595
+ }), ((_a = list == null ? void 0 : list.obs) == null ? void 0 : _a.birth_place) && /* @__PURE__ */ jsxs("div", {
23596
+ className: "birth_place_section",
23597
+ children: [/* @__PURE__ */ jsx("p", {
23598
+ children: "Lugar de nacimiento:"
23599
+ }), /* @__PURE__ */ jsx("p", {
23600
+ children: list.obs.birth_place
23601
+ })]
23602
+ }), ((_b = list == null ? void 0 : list.obs) == null ? void 0 : _b.authority) && /* @__PURE__ */ jsx("div", {
23603
+ className: "authority",
23604
+ children: /* @__PURE__ */ jsx("p", {
23605
+ children: list.obs.authority
23615
23606
  })
23616
- })
23607
+ }), ((_c = list == null ? void 0 : list.obs) == null ? void 0 : _c.case) && /* @__PURE__ */ jsx("div", {
23608
+ className: "others",
23609
+ children: /* @__PURE__ */ jsx("p", {
23610
+ children: list.obs.case
23611
+ })
23612
+ })]
23617
23613
  })
23618
23614
  })]
23619
23615
  }, i);
23620
23616
  })
23621
23617
  });
23622
23618
  }
23619
+ ListsAccordion.propTypes = {
23620
+ lists: PropTypes.arrayOf(PropTypes.any).isRequired
23621
+ };
23623
23622
  const common = {
23624
23623
  black: "#000",
23625
23624
  white: "#fff"
@@ -40989,7 +40988,7 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
40989
40988
  client_id: clientId,
40990
40989
  access_token: res2
40991
40990
  };
40992
- const parseReq2 = {
40991
+ const parseReq = {
40993
40992
  method: "POST",
40994
40993
  path: "api/v1/kyc-kit/document/recognition",
40995
40994
  inProduction,
@@ -40997,7 +40996,7 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
40997
40996
  bodyParams: base64
40998
40997
  };
40999
40998
  try {
41000
- const res22 = await request2(parseReq2);
40999
+ const res22 = await request2(parseReq);
41001
41000
  const fullData = res22.data.data;
41002
41001
  const dataOcrSaved = await saveDataToDB({
41003
41002
  data: {
@@ -41096,37 +41095,6 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
41096
41095
  videoConstraints
41097
41096
  };
41098
41097
  };
41099
- const UploadIcon = () => {
41100
- return /* @__PURE__ */ jsxs("svg", {
41101
- xmlns: "http://www.w3.org/2000/svg",
41102
- viewBox: "0 0 486.3 486.3",
41103
- children: [/* @__PURE__ */ jsx("path", {
41104
- d: "M395.5,135.8c-5.2-30.9-20.5-59.1-43.9-80.5c-26-23.8-59.8-36.9-95-36.9c-27.2,0-53.7,7.8-76.4,22.5\r c-18.9,12.2-34.6,28.7-45.7,48.1c-4.8-0.9-9.8-1.4-14.8-1.4c-42.5,0-77.1,34.6-77.1,77.1c0,5.5,0.6,10.8,1.6,16\r C16.7,200.7,0,232.9,0,267.2c0,27.7,10.3,54.6,29.1,75.9c19.3,21.8,44.8,34.7,72,36.2c0.3,0,0.5,0,0.8,0h86\r c7.5,0,13.5-6,13.5-13.5s-6-13.5-13.5-13.5h-85.6C61.4,349.8,27,310.9,27,267.1c0-28.3,15.2-54.7,39.7-69\r c5.7-3.3,8.1-10.2,5.9-16.4c-2-5.4-3-11.1-3-17.2c0-27.6,22.5-50.1,50.1-50.1c5.9,0,11.7,1,17.1,3c6.6,2.4,13.9-0.6,16.9-6.9\r c18.7-39.7,59.1-65.3,103-65.3c59,0,107.7,44.2,113.3,102.8c0.6,6.1,5.2,11,11.2,12c44.5,7.6,78.1,48.7,78.1,95.6\r c0,49.7-39.1,92.9-87.3,96.6h-73.7c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5h74.2c0.3,0,0.6,0,1,0c30.5-2.2,59-16.2,80.2-39.6\r c21.1-23.2,32.6-53,32.6-84C486.2,199.5,447.9,149.6,395.5,135.8z"
41105
- }), /* @__PURE__ */ jsx("path", {
41106
- d: "M324.2,280c5.3-5.3,5.3-13.8,0-19.1l-71.5-71.5c-2.5-2.5-6-4-9.5-4s-7,1.4-9.5,4l-71.5,71.5c-5.3,5.3-5.3,13.8,0,19.1\r c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4l48.5-48.5v222.9c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5V231.5l48.5,48.5\r C310.4,285.3,318.9,285.3,324.2,280z"
41107
- })]
41108
- });
41109
- };
41110
- function UploadDocument({
41111
- message,
41112
- id,
41113
- subtitle,
41114
- className
41115
- }) {
41116
- return /* @__PURE__ */ jsx("div", {
41117
- className: `wrap-upload-animation ${className}`,
41118
- children: /* @__PURE__ */ jsxs("div", {
41119
- className: "first-animation",
41120
- children: [/* @__PURE__ */ jsx(UploadIcon, {}), /* @__PURE__ */ jsx("p", {
41121
- className: "title",
41122
- children: message
41123
- }), /* @__PURE__ */ jsx("p", {
41124
- className: "subtitle",
41125
- children: subtitle
41126
- })]
41127
- })
41128
- }, id);
41129
- }
41130
41098
  const validateErrorMessageOCR = (message) => {
41131
41099
  return message === "Tipo de documento no v\xE1lido" || message === "Datos de la imagen no reconocidas" || message === "Dato no reconocido(Primer Nombre)" || message == "Dato no reconocido(Primer Apellido)" || message == "";
41132
41100
  };
@@ -41554,6 +41522,7 @@ function DocumentReader({
41554
41522
  setActivateCamera,
41555
41523
  videoConstraints
41556
41524
  } = DocumentReaderController(dataDocument, clientId, authorize, eventId, source2, inProduction, countryCodeAllowed, validateVpn, successMessage, dualModeRequired);
41525
+ console.log(dualModeRequired);
41557
41526
  return /* @__PURE__ */ jsxs("div", {
41558
41527
  className: `kit-gbc ${mode}`,
41559
41528
  children: [/* @__PURE__ */ jsx(k$3, {
@@ -41673,7 +41642,7 @@ function DocumentReader({
41673
41642
  type: "button",
41674
41643
  onClick: onUploadImage,
41675
41644
  children: "Capturar"
41676
- }), !status && Object.keys(base64).length > 0 && !activateCamera && lib$1(status) && /* @__PURE__ */ jsx(CustomButton, {
41645
+ }), !status && Object.keys(base64).length > 0 && !activateCamera && lib$1(status) && (!dualModeRequired || dualModeRequired && base64.secondImage) && /* @__PURE__ */ jsx(CustomButton, {
41677
41646
  type: "submit",
41678
41647
  children: "Procesar"
41679
41648
  })]
@@ -41692,10 +41661,11 @@ DocumentReader.propTypes = {
41692
41661
  source: propTypes.exports.PropTypes.string,
41693
41662
  eventId: propTypes.exports.PropTypes.string,
41694
41663
  validateVpn: propTypes.exports.PropTypes.bool,
41695
- dualModeRequired: propTypes.exports.PropTypes.bool
41664
+ dualModeRequired: propTypes.exports.PropTypes.bool,
41665
+ successMessage: propTypes.exports.PropTypes.string
41696
41666
  };
41697
41667
  const fetchFaceMatch = async (faceMatch, selfie, inProduction, customHeaders) => {
41698
- const parseReq2 = {
41668
+ const parseReq = {
41699
41669
  method: "POST",
41700
41670
  path: "api/v1/kyc-kit/facematch",
41701
41671
  inProduction,
@@ -41706,7 +41676,7 @@ const fetchFaceMatch = async (faceMatch, selfie, inProduction, customHeaders) =>
41706
41676
  }
41707
41677
  };
41708
41678
  try {
41709
- const res2 = await request2(parseReq2);
41679
+ const res2 = await request2(parseReq);
41710
41680
  return res2.data;
41711
41681
  } catch (error) {
41712
41682
  console.log(error);
@@ -42096,14 +42066,14 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
42096
42066
  client_id: clientId,
42097
42067
  access_token: token2
42098
42068
  };
42099
- const parseReq2 = {
42069
+ const parseReq = {
42100
42070
  method: "POST",
42101
42071
  path: "api/v1/kyc-kit/liveness/check",
42102
42072
  inProduction,
42103
42073
  customHeaders
42104
42074
  };
42105
42075
  try {
42106
- await request2(parseReq2);
42076
+ await request2(parseReq);
42107
42077
  faceMatch ? await fetchFaceMatch(faceMatch, `data:image/jpeg;base64,${data2.images[0]}`, inProduction, customHeaders).then((res2) => {
42108
42078
  setSimilarity(res2.data.similarity);
42109
42079
  setMessage(successMessage ? successMessage : "Verificaci\xF3n de identidad completada");
@@ -43427,8 +43397,40 @@ LivenessCheck.propTypes = {
43427
43397
  source: propTypes.exports.PropTypes.string,
43428
43398
  faceMatch: propTypes.exports.PropTypes.string,
43429
43399
  dataLiveness: propTypes.exports.PropTypes.func.isRequired,
43430
- validateVpn: propTypes.exports.PropTypes.bool
43400
+ validateVpn: propTypes.exports.PropTypes.bool,
43401
+ successMessage: propTypes.exports.PropTypes.string
43402
+ };
43403
+ const UploadIcon = () => {
43404
+ return /* @__PURE__ */ jsxs("svg", {
43405
+ xmlns: "http://www.w3.org/2000/svg",
43406
+ viewBox: "0 0 486.3 486.3",
43407
+ children: [/* @__PURE__ */ jsx("path", {
43408
+ d: "M395.5,135.8c-5.2-30.9-20.5-59.1-43.9-80.5c-26-23.8-59.8-36.9-95-36.9c-27.2,0-53.7,7.8-76.4,22.5\r c-18.9,12.2-34.6,28.7-45.7,48.1c-4.8-0.9-9.8-1.4-14.8-1.4c-42.5,0-77.1,34.6-77.1,77.1c0,5.5,0.6,10.8,1.6,16\r C16.7,200.7,0,232.9,0,267.2c0,27.7,10.3,54.6,29.1,75.9c19.3,21.8,44.8,34.7,72,36.2c0.3,0,0.5,0,0.8,0h86\r c7.5,0,13.5-6,13.5-13.5s-6-13.5-13.5-13.5h-85.6C61.4,349.8,27,310.9,27,267.1c0-28.3,15.2-54.7,39.7-69\r c5.7-3.3,8.1-10.2,5.9-16.4c-2-5.4-3-11.1-3-17.2c0-27.6,22.5-50.1,50.1-50.1c5.9,0,11.7,1,17.1,3c6.6,2.4,13.9-0.6,16.9-6.9\r c18.7-39.7,59.1-65.3,103-65.3c59,0,107.7,44.2,113.3,102.8c0.6,6.1,5.2,11,11.2,12c44.5,7.6,78.1,48.7,78.1,95.6\r c0,49.7-39.1,92.9-87.3,96.6h-73.7c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5h74.2c0.3,0,0.6,0,1,0c30.5-2.2,59-16.2,80.2-39.6\r c21.1-23.2,32.6-53,32.6-84C486.2,199.5,447.9,149.6,395.5,135.8z"
43409
+ }), /* @__PURE__ */ jsx("path", {
43410
+ d: "M324.2,280c5.3-5.3,5.3-13.8,0-19.1l-71.5-71.5c-2.5-2.5-6-4-9.5-4s-7,1.4-9.5,4l-71.5,71.5c-5.3,5.3-5.3,13.8,0,19.1\r c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4l48.5-48.5v222.9c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5V231.5l48.5,48.5\r C310.4,285.3,318.9,285.3,324.2,280z"
43411
+ })]
43412
+ });
43431
43413
  };
43414
+ function UploadDocument({
43415
+ message,
43416
+ id,
43417
+ subtitle,
43418
+ className
43419
+ }) {
43420
+ return /* @__PURE__ */ jsx("div", {
43421
+ className: `wrap-upload-animation ${className}`,
43422
+ children: /* @__PURE__ */ jsxs("div", {
43423
+ className: "first-animation",
43424
+ children: [/* @__PURE__ */ jsx(UploadIcon, {}), /* @__PURE__ */ jsx("p", {
43425
+ className: "title",
43426
+ children: message
43427
+ }), /* @__PURE__ */ jsx("p", {
43428
+ className: "subtitle",
43429
+ children: subtitle
43430
+ })]
43431
+ })
43432
+ }, id);
43433
+ }
43432
43434
  var csv = { exports: {} };
43433
43435
  (function(module) {
43434
43436
  (function(root2, factory) {