gbc-kyc-kit 3.0.9 → 3.0.11

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