gbc-kyc-kit 2.0.3 → 2.0.5

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,13 @@ 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
+ console.log(list);
23547
+ const names = list.names.split(" | ");
23574
23548
  return /* @__PURE__ */ jsxs("div", {
23575
23549
  className: "accordion-item",
23576
23550
  children: [/* @__PURE__ */ jsx("h2", {
@@ -23586,19 +23560,14 @@ function ListsAccordion({
23586
23560
  children: /* @__PURE__ */ jsxs("div", {
23587
23561
  className: "w-100",
23588
23562
  children: [/* @__PURE__ */ jsx("div", {
23589
- children: parseName(value)
23590
- }), /* @__PURE__ */ jsxs("div", {
23563
+ children: list.list_category
23564
+ }), /* @__PURE__ */ jsx("div", {
23591
23565
  className: "description",
23592
- children: [/* @__PURE__ */ jsxs("div", {
23566
+ children: /* @__PURE__ */ jsxs("div", {
23593
23567
  children: [/* @__PURE__ */ jsx("b", {
23594
23568
  children: "Lista: "
23595
- }), list[0]]
23596
- }), !lib$1(country) && /* @__PURE__ */ jsxs("div", {
23597
- className: "me-3",
23598
- children: [/* @__PURE__ */ jsx("b", {
23599
- children: "Pa\xEDs: "
23600
- }), " ", country]
23601
- })]
23569
+ }), list.list_id]
23570
+ })
23602
23571
  })]
23603
23572
  })
23604
23573
  })
@@ -23610,8 +23579,10 @@ function ListsAccordion({
23610
23579
  children: /* @__PURE__ */ jsx("div", {
23611
23580
  className: "accordion-body",
23612
23581
  children: /* @__PURE__ */ jsx("code", {
23613
- children: list.map((detail, i2) => {
23614
- return detail;
23582
+ children: names.map((name, i2) => {
23583
+ return /* @__PURE__ */ jsx("div", {
23584
+ children: name
23585
+ }, i2);
23615
23586
  })
23616
23587
  })
23617
23588
  })
@@ -23620,6 +23591,9 @@ function ListsAccordion({
23620
23591
  })
23621
23592
  });
23622
23593
  }
23594
+ ListsAccordion.propTypes = {
23595
+ lists: PropTypes.arrayOf(PropTypes.any).isRequired
23596
+ };
23623
23597
  const common = {
23624
23598
  black: "#000",
23625
23599
  white: "#fff"
@@ -40937,26 +40911,6 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
40937
40911
  const [dualMode, setDualMode] = useState(dualModeRequired);
40938
40912
  const webcamRef = useRef(null);
40939
40913
  const [activateCamera, setActivateCamera] = useState(false);
40940
- const [videoDimensions, setVideoDimensions] = useState({
40941
- width: 300,
40942
- height: 300 / 9 / 16
40943
- });
40944
- useEffect(() => {
40945
- const updateVideoDimensions = () => {
40946
- const aspectRatio = window.innerHeight > window.innerWidth ? 9 / 16 : 16 / 9;
40947
- const width2 = 300;
40948
- const height2 = width2 / aspectRatio;
40949
- setVideoDimensions({
40950
- width: width2,
40951
- height: height2
40952
- });
40953
- };
40954
- updateVideoDimensions();
40955
- window.addEventListener("resize", updateVideoDimensions);
40956
- return () => {
40957
- window.removeEventListener("resize", updateVideoDimensions);
40958
- };
40959
- }, []);
40960
40914
  useEffect(() => {
40961
40915
  if (countryCodeAllowed && (geolocation == null ? void 0 : geolocation.data_connection.isocode)) {
40962
40916
  if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.data_connection.isocode))) {
@@ -40989,7 +40943,7 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
40989
40943
  client_id: clientId,
40990
40944
  access_token: res2
40991
40945
  };
40992
- const parseReq2 = {
40946
+ const parseReq = {
40993
40947
  method: "POST",
40994
40948
  path: "api/v1/kyc-kit/document/recognition",
40995
40949
  inProduction,
@@ -40997,7 +40951,7 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
40997
40951
  bodyParams: base64
40998
40952
  };
40999
40953
  try {
41000
- const res22 = await request2(parseReq2);
40954
+ const res22 = await request2(parseReq);
41001
40955
  const fullData = res22.data.data;
41002
40956
  const dataOcrSaved = await saveDataToDB({
41003
40957
  data: {
@@ -41072,9 +41026,16 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
41072
41026
  setActivateCamera(false);
41073
41027
  };
41074
41028
  const videoConstraints = {
41075
- width: videoDimensions.width,
41076
- height: videoDimensions.height,
41077
- facingMode: "environment"
41029
+ width: {
41030
+ ideal: 1280
41031
+ },
41032
+ height: {
41033
+ ideal: 720
41034
+ },
41035
+ aspectRatio: {
41036
+ ideal: 16 / 9
41037
+ },
41038
+ facingMode: "user"
41078
41039
  };
41079
41040
  return {
41080
41041
  onSendSubmitDocument,
@@ -41096,37 +41057,6 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
41096
41057
  videoConstraints
41097
41058
  };
41098
41059
  };
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
41060
  const validateErrorMessageOCR = (message) => {
41131
41061
  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
41062
  };
@@ -41692,10 +41622,11 @@ DocumentReader.propTypes = {
41692
41622
  source: propTypes.exports.PropTypes.string,
41693
41623
  eventId: propTypes.exports.PropTypes.string,
41694
41624
  validateVpn: propTypes.exports.PropTypes.bool,
41695
- dualModeRequired: propTypes.exports.PropTypes.bool
41625
+ dualModeRequired: propTypes.exports.PropTypes.bool,
41626
+ successMessage: propTypes.exports.PropTypes.string
41696
41627
  };
41697
41628
  const fetchFaceMatch = async (faceMatch, selfie, inProduction, customHeaders) => {
41698
- const parseReq2 = {
41629
+ const parseReq = {
41699
41630
  method: "POST",
41700
41631
  path: "api/v1/kyc-kit/facematch",
41701
41632
  inProduction,
@@ -41706,7 +41637,7 @@ const fetchFaceMatch = async (faceMatch, selfie, inProduction, customHeaders) =>
41706
41637
  }
41707
41638
  };
41708
41639
  try {
41709
- const res2 = await request2(parseReq2);
41640
+ const res2 = await request2(parseReq);
41710
41641
  return res2.data;
41711
41642
  } catch (error) {
41712
41643
  console.log(error);
@@ -42096,14 +42027,14 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
42096
42027
  client_id: clientId,
42097
42028
  access_token: token2
42098
42029
  };
42099
- const parseReq2 = {
42030
+ const parseReq = {
42100
42031
  method: "POST",
42101
42032
  path: "api/v1/kyc-kit/liveness/check",
42102
42033
  inProduction,
42103
42034
  customHeaders
42104
42035
  };
42105
42036
  try {
42106
- await request2(parseReq2);
42037
+ await request2(parseReq);
42107
42038
  faceMatch ? await fetchFaceMatch(faceMatch, `data:image/jpeg;base64,${data2.images[0]}`, inProduction, customHeaders).then((res2) => {
42108
42039
  setSimilarity(res2.data.similarity);
42109
42040
  setMessage(successMessage ? successMessage : "Verificaci\xF3n de identidad completada");
@@ -43427,8 +43358,40 @@ LivenessCheck.propTypes = {
43427
43358
  source: propTypes.exports.PropTypes.string,
43428
43359
  faceMatch: propTypes.exports.PropTypes.string,
43429
43360
  dataLiveness: propTypes.exports.PropTypes.func.isRequired,
43430
- validateVpn: propTypes.exports.PropTypes.bool
43361
+ validateVpn: propTypes.exports.PropTypes.bool,
43362
+ successMessage: propTypes.exports.PropTypes.string
43363
+ };
43364
+ const UploadIcon = () => {
43365
+ return /* @__PURE__ */ jsxs("svg", {
43366
+ xmlns: "http://www.w3.org/2000/svg",
43367
+ viewBox: "0 0 486.3 486.3",
43368
+ children: [/* @__PURE__ */ jsx("path", {
43369
+ 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"
43370
+ }), /* @__PURE__ */ jsx("path", {
43371
+ 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"
43372
+ })]
43373
+ });
43431
43374
  };
43375
+ function UploadDocument({
43376
+ message,
43377
+ id,
43378
+ subtitle,
43379
+ className
43380
+ }) {
43381
+ return /* @__PURE__ */ jsx("div", {
43382
+ className: `wrap-upload-animation ${className}`,
43383
+ children: /* @__PURE__ */ jsxs("div", {
43384
+ className: "first-animation",
43385
+ children: [/* @__PURE__ */ jsx(UploadIcon, {}), /* @__PURE__ */ jsx("p", {
43386
+ className: "title",
43387
+ children: message
43388
+ }), /* @__PURE__ */ jsx("p", {
43389
+ className: "subtitle",
43390
+ children: subtitle
43391
+ })]
43392
+ })
43393
+ }, id);
43394
+ }
43432
43395
  var csv = { exports: {} };
43433
43396
  (function(module) {
43434
43397
  (function(root2, factory) {