gbc-kyc-kit 3.0.11 → 3.0.13

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