gbc-kyc-kit 3.0.11 → 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,7 +18422,7 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18421
18422
  handleSubmit: handleSubmitCsv
18422
18423
  } = useForm();
18423
18424
  const onSubmitCsv = async () => {
18424
- var _a, _b;
18425
+ var _a;
18425
18426
  setIsLoading(true);
18426
18427
  try {
18427
18428
  const res = await authorize();
@@ -18442,7 +18443,6 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18442
18443
  };
18443
18444
  setDataReq(parseReq.bodyParams);
18444
18445
  const resOfBlacklistBatch = await request2(parseReq);
18445
- console.log(resOfBlacklistBatch, "Res blacklist batch");
18446
18446
  const {
18447
18447
  batchSize,
18448
18448
  id,
@@ -18476,9 +18476,13 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18476
18476
  });
18477
18477
  } catch (error) {
18478
18478
  let message2 = "Error interno de la aplicai\xF3n";
18479
- console.log(error, "Error en batch");
18480
- const status2 = (_a = error.response.status) != null ? _a : "Error no controlado";
18481
- const data2 = (_b = error.response.data) != null ? _b : "No logramos obtener la data";
18479
+ const {
18480
+ status: status2,
18481
+ data: data2
18482
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
18483
+ status: "Error desconocido",
18484
+ data: {}
18485
+ };
18482
18486
  await saveDataToDB({
18483
18487
  data: {
18484
18488
  csvFile,
@@ -39420,7 +39424,7 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39420
39424
  handleSubmit: simpleHandleSubmit
39421
39425
  } = useForm();
39422
39426
  const onSendSubmitDocument = async () => {
39423
- var _a;
39427
+ var _a, _b, _c, _d, _e;
39424
39428
  setIsLoading(true);
39425
39429
  try {
39426
39430
  const res = await authorize();
@@ -39430,10 +39434,11 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39430
39434
  };
39431
39435
  const parseReq = {
39432
39436
  method: "POST",
39433
- path: "api/v1/kyc-kit/document/recognition",
39437
+ path: "api/v1/onboarding/validate",
39434
39438
  inProduction,
39435
39439
  customHeaders,
39436
- bodyParams: base64
39440
+ bodyParams: base64,
39441
+ service: "services"
39437
39442
  };
39438
39443
  try {
39439
39444
  const res2 = await request2(parseReq);
@@ -39464,7 +39469,9 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39464
39469
  let message2 = "";
39465
39470
  const {
39466
39471
  status: status2
39467
- } = error.response;
39472
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
39473
+ status: "Error desconocido"
39474
+ };
39468
39475
  const data2 = await saveDataToDB({
39469
39476
  data: {
39470
39477
  first_image: base64.firstImage,
@@ -39482,9 +39489,9 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39482
39489
  ...error,
39483
39490
  countAttempts: data2.count_try
39484
39491
  });
39485
- 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)
39486
39493
  setUploadDocumentByPhone(true);
39487
- 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) {
39488
39495
  message2 = error.response.data.message;
39489
39496
  } else if (status2 === 500) {
39490
39497
  message2 = {
@@ -39981,11 +39988,8 @@ function SideDocsSelector({
39981
39988
  return;
39982
39989
  const [track] = streamRef.current.getVideoTracks();
39983
39990
  const capabilities = (_a = track.getCapabilities) == null ? void 0 : _a.call(track);
39984
- const settings = (_b = track.getSettings) == null ? void 0 : _b.call(track);
39985
- console.log("focus capabilities:", capabilities);
39986
- console.log("focus settings:", settings);
39991
+ (_b = track.getSettings) == null ? void 0 : _b.call(track);
39987
39992
  if (!capabilities || !capabilities.focusMode) {
39988
- console.warn("No se puede acceder a las capacidades de enfoque");
39989
39993
  return;
39990
39994
  }
39991
39995
  try {
@@ -40045,7 +40049,6 @@ function SideDocsSelector({
40045
40049
  const handleSwitchCamera = () => {
40046
40050
  setCurrentCameraIndex((prevIndex) => (prevIndex + 1) % cameras.length);
40047
40051
  };
40048
- console.log("Activate Camera: ", activateCamera, "Distinto de HideCapture Button: ", !hideCaptureButton, "Distinto de Upload document By Phone: ", !uploadDocumentByPhone, "Cantidad de cameras: ", cameras.length);
40049
40052
  return /* @__PURE__ */ jsxs(Box$1, {
40050
40053
  sx: {
40051
40054
  width: "100%"
@@ -40745,8 +40748,6 @@ function DocumentReader({
40745
40748
  uploadDocumentByPhone,
40746
40749
  setUploadDocumentByPhone
40747
40750
  } = DocumentReaderController(dataDocument, clientId, authorize, eventId, source2, inProduction, countryCodeAllowed, validateVpn, successMessage, dualModeRequired);
40748
- console.log(isLoading, countryCodeAllowed, countryCode);
40749
- console.log(isLoading, countryCodeAllowed !== null, !countryCode);
40750
40751
  return /* @__PURE__ */ jsxs("div", {
40751
40752
  className: `kit-gbc ${mode} without-shadow ocr`,
40752
40753
  children: [/* @__PURE__ */ jsx$1(k$2, {
@@ -40877,14 +40878,13 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40877
40878
  handleSubmit: simpleHandleSubmit
40878
40879
  } = useForm();
40879
40880
  const onSendSubmitSelfie = async () => {
40880
- var _a, _b;
40881
+ var _a, _b, _c, _d;
40881
40882
  setIsLoading(true);
40882
40883
  try {
40883
40884
  const res = await authorize();
40884
40885
  const customHeaders = {
40885
40886
  client_id: clientId,
40886
- access_token: res,
40887
- Authorization: "Bearer WGpKbGFSNlJXV29hVnFqVjlIbA=="
40887
+ access_token: res
40888
40888
  };
40889
40889
  try {
40890
40890
  const res2 = await fetchFaceMatch(picBase64, url, inProduction, customHeaders);
@@ -40912,12 +40912,14 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40912
40912
  let message2 = "";
40913
40913
  const {
40914
40914
  status: status2
40915
- } = error.response;
40915
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
40916
+ status: "Error desconocido"
40917
+ };
40916
40918
  await saveDataToDB({
40917
40919
  data: {
40918
40920
  first_image: url,
40919
40921
  second_image: picBase64,
40920
- 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,
40921
40923
  status_code: status2
40922
40924
  },
40923
40925
  component: "facematch",
@@ -40927,7 +40929,7 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40927
40929
  clientId,
40928
40930
  geolocation
40929
40931
  });
40930
- 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) {
40931
40933
  message2 = error.response.data.message;
40932
40934
  } else if (status2 === 500) {
40933
40935
  message2 = {
@@ -41194,11 +41196,11 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41194
41196
  }
41195
41197
  }, [data2]);
41196
41198
  const onSendSubmitLiveness = async () => {
41199
+ var _a;
41197
41200
  try {
41198
41201
  const customHeaders = {
41199
41202
  client_id: clientId,
41200
- access_token: token2,
41201
- Authorization: "Bearer WGpKbGFSNlJXV29hVnFqVjlIbA=="
41203
+ access_token: token2
41202
41204
  };
41203
41205
  try {
41204
41206
  faceMatch ? await fetchFaceMatch(faceMatch, `data:image/jpeg;base64,${data2.images[0]}`, inProduction, customHeaders).then((res) => {
@@ -41223,7 +41225,9 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41223
41225
  let message2 = "";
41224
41226
  const {
41225
41227
  status: status2
41226
- } = error.response;
41228
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
41229
+ status: "Error desconocido"
41230
+ };
41227
41231
  saveDataToDB({
41228
41232
  data: {
41229
41233
  similarity: 0,