gbc-kyc-kit 3.0.10 → 3.0.12

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.
@@ -18129,28 +18129,32 @@ Q.loading = (t2, e2) => H(t2, S("default", { isLoading: true, autoClose: false,
18129
18129
  B.delete(t2.containerId || t2), 0 === B.size && v$1.off(0).off(1).off(5);
18130
18130
  });
18131
18131
  function ErrorHandler(error) {
18132
- var _a;
18132
+ var _a, _b, _c, _d;
18133
18133
  let message = "Error interno de la App, consultar con soporte.";
18134
18134
  const {
18135
18135
  code
18136
- } = error == null ? void 0 : error.response.data;
18136
+ } = (_b = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) != null ? _b : {
18137
+ code: "400"
18138
+ };
18137
18139
  const {
18138
18140
  status
18139
- } = (_a = error.response) == null ? void 0 : _a.status;
18141
+ } = (_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status) != null ? _d : {
18142
+ status: "Error desconocido"
18143
+ };
18140
18144
  if (code === "A1050") {
18141
- console.log(error.response.data.message);
18145
+ console.log(error == null ? void 0 : error.response.data.message);
18142
18146
  message = "No se pudo procesar la consulta, por favor contacte con soporte.";
18143
18147
  } else if (code === 22007) {
18144
- console.log(error.response.data.message);
18148
+ console.log(error == null ? void 0 : error.response.data.message);
18145
18149
  message = "Documento no reconocido";
18146
18150
  } else if (code === 504) {
18147
- console.log(error.response.data.message);
18151
+ console.log(error == null ? void 0 : error.response.data.message);
18148
18152
  message = "M\xE1ximo de consultas, por favor contacte con soporte.";
18149
18153
  } else if (code === "020") {
18150
- console.log(error.response.data.message);
18151
- message = error.response.data.message;
18154
+ console.log(error == null ? void 0 : error.response.data.message);
18155
+ message = error == null ? void 0 : error.response.data.message;
18152
18156
  } else if (status === "429") {
18153
- console.log(error.response.data);
18157
+ console.log(error == null ? void 0 : error.response.data);
18154
18158
  }
18155
18159
  console.log(code, "code", message, "message");
18156
18160
  Q.error(message, {
@@ -18261,7 +18265,6 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18261
18265
  const [csvFile, setCsvFile] = useState(null);
18262
18266
  const fileInputRef = useRef(null);
18263
18267
  const [batchData, setBatchData] = useState({});
18264
- console.log(inProduction);
18265
18268
  useEffect(() => {
18266
18269
  var _a;
18267
18270
  if (countryCodeAllowed && (geolocation == null ? void 0 : geolocation.data_connection.isocode)) {
@@ -18314,9 +18317,8 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18314
18317
  birth_date: ""
18315
18318
  }
18316
18319
  });
18317
- console.log(errorsDoc);
18318
18320
  const onSendSubmitDocument = async (data2) => {
18319
- var _a, _b;
18321
+ var _a, _b, _c, _d;
18320
18322
  const {
18321
18323
  first_name,
18322
18324
  second_name,
@@ -18329,8 +18331,7 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18329
18331
  const res = await authorize();
18330
18332
  const customHeaders = {
18331
18333
  client_id: clientId,
18332
- access_token: res,
18333
- Authorization: "Bearer WGpKbGFSNlJXV29hVnFqVjlIbA=="
18334
+ access_token: res
18334
18335
  };
18335
18336
  const parseReq = {
18336
18337
  method: "POST",
@@ -18401,7 +18402,7 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18401
18402
  clientId,
18402
18403
  geolocation
18403
18404
  });
18404
- if (error.response.data.message) {
18405
+ if ((_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) {
18405
18406
  message2 = error.response.data;
18406
18407
  } else if (status2 === 500) {
18407
18408
  message2 = "Error de consulta - Verificar con el proveedor";
@@ -18421,6 +18422,7 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18421
18422
  handleSubmit: handleSubmitCsv
18422
18423
  } = useForm();
18423
18424
  const onSubmitCsv = async () => {
18425
+ var _a;
18424
18426
  setIsLoading(true);
18425
18427
  try {
18426
18428
  const res = await authorize();
@@ -18441,7 +18443,6 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18441
18443
  };
18442
18444
  setDataReq(parseReq.bodyParams);
18443
18445
  const resOfBlacklistBatch = await request2(parseReq);
18444
- console.log(resOfBlacklistBatch, "Res blacklist batch");
18445
18446
  const {
18446
18447
  batchSize,
18447
18448
  id,
@@ -18475,11 +18476,13 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18475
18476
  });
18476
18477
  } catch (error) {
18477
18478
  let message2 = "Error interno de la aplicai\xF3n";
18478
- console.log(error, "Error en batch");
18479
18479
  const {
18480
18480
  status: status2,
18481
18481
  data: data2
18482
- } = error.response;
18482
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
18483
+ status: "Error desconocido",
18484
+ data: {}
18485
+ };
18483
18486
  await saveDataToDB({
18484
18487
  data: {
18485
18488
  csvFile,
@@ -39421,7 +39424,7 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39421
39424
  handleSubmit: simpleHandleSubmit
39422
39425
  } = useForm();
39423
39426
  const onSendSubmitDocument = async () => {
39424
- var _a;
39427
+ var _a, _b, _c, _d, _e;
39425
39428
  setIsLoading(true);
39426
39429
  try {
39427
39430
  const res = await authorize();
@@ -39431,10 +39434,11 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39431
39434
  };
39432
39435
  const parseReq = {
39433
39436
  method: "POST",
39434
- path: "api/v1/kyc-kit/document/recognition",
39437
+ path: "api/v1/onboarding/validate",
39435
39438
  inProduction,
39436
39439
  customHeaders,
39437
- bodyParams: base64
39440
+ bodyParams: base64,
39441
+ service: "services"
39438
39442
  };
39439
39443
  try {
39440
39444
  const res2 = await request2(parseReq);
@@ -39465,7 +39469,9 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39465
39469
  let message2 = "";
39466
39470
  const {
39467
39471
  status: status2
39468
- } = error.response;
39472
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
39473
+ status: "Error desconocido"
39474
+ };
39469
39475
  const data2 = await saveDataToDB({
39470
39476
  data: {
39471
39477
  first_image: base64.firstImage,
@@ -39483,9 +39489,9 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39483
39489
  ...error,
39484
39490
  countAttempts: data2.count_try
39485
39491
  });
39486
- if (error.response.data.code === "020" && data2.count_try > 3)
39492
+ if (((_c = (_b = error == null ? void 0 : error.response) == null ? void 0 : _b.data) == null ? void 0 : _c.code) === "020" && data2.count_try > 3)
39487
39493
  setUploadDocumentByPhone(true);
39488
- if ((_a = error.response.data) == null ? void 0 : _a.message) {
39494
+ if ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) {
39489
39495
  message2 = error.response.data.message;
39490
39496
  } else if (status2 === 500) {
39491
39497
  message2 = {
@@ -39982,11 +39988,8 @@ function SideDocsSelector({
39982
39988
  return;
39983
39989
  const [track] = streamRef.current.getVideoTracks();
39984
39990
  const capabilities = (_a = track.getCapabilities) == null ? void 0 : _a.call(track);
39985
- const settings = (_b = track.getSettings) == null ? void 0 : _b.call(track);
39986
- console.log("focus capabilities:", capabilities);
39987
- console.log("focus settings:", settings);
39991
+ (_b = track.getSettings) == null ? void 0 : _b.call(track);
39988
39992
  if (!capabilities || !capabilities.focusMode) {
39989
- console.warn("No se puede acceder a las capacidades de enfoque");
39990
39993
  return;
39991
39994
  }
39992
39995
  try {
@@ -40046,7 +40049,6 @@ function SideDocsSelector({
40046
40049
  const handleSwitchCamera = () => {
40047
40050
  setCurrentCameraIndex((prevIndex) => (prevIndex + 1) % cameras.length);
40048
40051
  };
40049
- console.log("Activate Camera: ", activateCamera, "Distinto de HideCapture Button: ", !hideCaptureButton, "Distinto de Upload document By Phone: ", !uploadDocumentByPhone, "Cantidad de cameras: ", cameras.length);
40050
40052
  return /* @__PURE__ */ jsxs(Box$1, {
40051
40053
  sx: {
40052
40054
  width: "100%"
@@ -40746,8 +40748,6 @@ function DocumentReader({
40746
40748
  uploadDocumentByPhone,
40747
40749
  setUploadDocumentByPhone
40748
40750
  } = DocumentReaderController(dataDocument, clientId, authorize, eventId, source2, inProduction, countryCodeAllowed, validateVpn, successMessage, dualModeRequired);
40749
- console.log(isLoading, countryCodeAllowed, countryCode);
40750
- console.log(isLoading, countryCodeAllowed !== null, !countryCode);
40751
40751
  return /* @__PURE__ */ jsxs("div", {
40752
40752
  className: `kit-gbc ${mode} without-shadow ocr`,
40753
40753
  children: [/* @__PURE__ */ jsx$1(k$2, {
@@ -40878,14 +40878,13 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40878
40878
  handleSubmit: simpleHandleSubmit
40879
40879
  } = useForm();
40880
40880
  const onSendSubmitSelfie = async () => {
40881
- var _a, _b;
40881
+ var _a, _b, _c, _d;
40882
40882
  setIsLoading(true);
40883
40883
  try {
40884
40884
  const res = await authorize();
40885
40885
  const customHeaders = {
40886
40886
  client_id: clientId,
40887
- access_token: res,
40888
- Authorization: "Bearer WGpKbGFSNlJXV29hVnFqVjlIbA=="
40887
+ access_token: res
40889
40888
  };
40890
40889
  try {
40891
40890
  const res2 = await fetchFaceMatch(picBase64, url, inProduction, customHeaders);
@@ -40913,12 +40912,14 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40913
40912
  let message2 = "";
40914
40913
  const {
40915
40914
  status: status2
40916
- } = error.response;
40915
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
40916
+ status: "Error desconocido"
40917
+ };
40917
40918
  await saveDataToDB({
40918
40919
  data: {
40919
40920
  first_image: url,
40920
40921
  second_image: picBase64,
40921
- similarity: ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.similarity) ? res.data.similarity : null,
40922
+ similarity: ((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.similarity) ? res.data.similarity : null,
40922
40923
  status_code: status2
40923
40924
  },
40924
40925
  component: "facematch",
@@ -40928,7 +40929,7 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40928
40929
  clientId,
40929
40930
  geolocation
40930
40931
  });
40931
- if ((_b = error.response.data) == null ? void 0 : _b.message) {
40932
+ if ((_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) {
40932
40933
  message2 = error.response.data.message;
40933
40934
  } else if (status2 === 500) {
40934
40935
  message2 = {
@@ -41195,11 +41196,11 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41195
41196
  }
41196
41197
  }, [data2]);
41197
41198
  const onSendSubmitLiveness = async () => {
41199
+ var _a;
41198
41200
  try {
41199
41201
  const customHeaders = {
41200
41202
  client_id: clientId,
41201
- access_token: token2,
41202
- Authorization: "Bearer WGpKbGFSNlJXV29hVnFqVjlIbA=="
41203
+ access_token: token2
41203
41204
  };
41204
41205
  try {
41205
41206
  faceMatch ? await fetchFaceMatch(faceMatch, `data:image/jpeg;base64,${data2.images[0]}`, inProduction, customHeaders).then((res) => {
@@ -41224,7 +41225,9 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41224
41225
  let message2 = "";
41225
41226
  const {
41226
41227
  status: status2
41227
- } = error.response;
41228
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
41229
+ status: "Error desconocido"
41230
+ };
41228
41231
  saveDataToDB({
41229
41232
  data: {
41230
41233
  similarity: 0,