gbc-kyc-kit 3.0.16 → 3.0.18

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();
@@ -18474,10 +18476,14 @@ const BlackListController = (clientId, authorize, inProduction, source2, eventId
18474
18476
  });
18475
18477
  } catch (error) {
18476
18478
  let message2 = "Error interno de la aplicai\xF3n";
18479
+ console.log(error);
18477
18480
  const {
18478
18481
  status: status2,
18479
18482
  data: data2
18480
- } = error.response;
18483
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
18484
+ status: "Error desconocido",
18485
+ data: {}
18486
+ };
18481
18487
  await saveDataToDB({
18482
18488
  data: {
18483
18489
  csvFile,
@@ -39419,7 +39425,7 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39419
39425
  handleSubmit: simpleHandleSubmit
39420
39426
  } = useForm();
39421
39427
  const onSendSubmitDocument = async () => {
39422
- var _a;
39428
+ var _a, _b, _c, _d, _e;
39423
39429
  setIsLoading(true);
39424
39430
  try {
39425
39431
  const res = await authorize();
@@ -39429,10 +39435,11 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39429
39435
  };
39430
39436
  const parseReq = {
39431
39437
  method: "POST",
39432
- path: "api/v1/kyc-kit/document/recognition",
39438
+ path: "api/v1/onboarding/validate",
39433
39439
  inProduction,
39434
39440
  customHeaders,
39435
- bodyParams: base64
39441
+ bodyParams: base64,
39442
+ service: "services"
39436
39443
  };
39437
39444
  try {
39438
39445
  const res2 = await request2(parseReq);
@@ -39463,7 +39470,9 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39463
39470
  let message2 = "";
39464
39471
  const {
39465
39472
  status: status2
39466
- } = error.response;
39473
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
39474
+ status: "Error desconocido"
39475
+ };
39467
39476
  const data2 = await saveDataToDB({
39468
39477
  data: {
39469
39478
  first_image: base64.firstImage,
@@ -39481,9 +39490,9 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39481
39490
  ...error,
39482
39491
  countAttempts: data2.count_try
39483
39492
  });
39484
- 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)
39485
39494
  setUploadDocumentByPhone(true);
39486
- 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) {
39487
39496
  message2 = error.response.data.message;
39488
39497
  } else if (status2 === 500) {
39489
39498
  message2 = {
@@ -39980,11 +39989,8 @@ function SideDocsSelector({
39980
39989
  return;
39981
39990
  const [track] = streamRef.current.getVideoTracks();
39982
39991
  const capabilities = (_a = track.getCapabilities) == null ? void 0 : _a.call(track);
39983
- const settings = (_b = track.getSettings) == null ? void 0 : _b.call(track);
39984
- console.log("focus capabilities:", capabilities);
39985
- console.log("focus settings:", settings);
39992
+ (_b = track.getSettings) == null ? void 0 : _b.call(track);
39986
39993
  if (!capabilities || !capabilities.focusMode) {
39987
- console.warn("No se puede acceder a las capacidades de enfoque");
39988
39994
  return;
39989
39995
  }
39990
39996
  try {
@@ -40044,7 +40050,6 @@ function SideDocsSelector({
40044
40050
  const handleSwitchCamera = () => {
40045
40051
  setCurrentCameraIndex((prevIndex) => (prevIndex + 1) % cameras.length);
40046
40052
  };
40047
- console.log("Activate Camera: ", activateCamera, "Distinto de HideCapture Button: ", !hideCaptureButton, "Distinto de Upload document By Phone: ", !uploadDocumentByPhone, "Cantidad de cameras: ", cameras.length);
40048
40053
  return /* @__PURE__ */ jsxs(Box$1, {
40049
40054
  sx: {
40050
40055
  width: "100%"
@@ -40744,8 +40749,6 @@ function DocumentReader({
40744
40749
  uploadDocumentByPhone,
40745
40750
  setUploadDocumentByPhone
40746
40751
  } = DocumentReaderController(dataDocument, clientId, authorize, eventId, source2, inProduction, countryCodeAllowed, validateVpn, successMessage, dualModeRequired);
40747
- console.log(isLoading, countryCodeAllowed, countryCode);
40748
- console.log(isLoading, countryCodeAllowed !== null, !countryCode);
40749
40752
  return /* @__PURE__ */ jsxs("div", {
40750
40753
  className: `kit-gbc ${mode} without-shadow ocr`,
40751
40754
  children: [/* @__PURE__ */ jsx$1(k$2, {
@@ -40876,14 +40879,13 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40876
40879
  handleSubmit: simpleHandleSubmit
40877
40880
  } = useForm();
40878
40881
  const onSendSubmitSelfie = async () => {
40879
- var _a, _b;
40882
+ var _a, _b, _c, _d;
40880
40883
  setIsLoading(true);
40881
40884
  try {
40882
40885
  const res = await authorize();
40883
40886
  const customHeaders = {
40884
40887
  client_id: clientId,
40885
- access_token: res,
40886
- Authorization: "Bearer WGpKbGFSNlJXV29hVnFqVjlIbA=="
40888
+ access_token: res
40887
40889
  };
40888
40890
  try {
40889
40891
  const res2 = await fetchFaceMatch(picBase64, url, inProduction, customHeaders);
@@ -40911,12 +40913,14 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40911
40913
  let message2 = "";
40912
40914
  const {
40913
40915
  status: status2
40914
- } = error.response;
40916
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
40917
+ status: "Error desconocido"
40918
+ };
40915
40919
  await saveDataToDB({
40916
40920
  data: {
40917
40921
  first_image: url,
40918
40922
  second_image: picBase64,
40919
- 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,
40920
40924
  status_code: status2
40921
40925
  },
40922
40926
  component: "facematch",
@@ -40926,7 +40930,7 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
40926
40930
  clientId,
40927
40931
  geolocation
40928
40932
  });
40929
- 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) {
40930
40934
  message2 = error.response.data.message;
40931
40935
  } else if (status2 === 500) {
40932
40936
  message2 = {
@@ -41133,37 +41137,42 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41133
41137
  const [failLiveness, setFailLiveness] = useState(false);
41134
41138
  const [dataFailLiveness, setDataFailLiveness] = useState({});
41135
41139
  const listener = (event) => {
41136
- var _a, _b, _c, _d, _e, _f;
41140
+ var _a, _b;
41137
41141
  if (event.detail) {
41138
41142
  if (event.detail.action === "PROCESS_FINISHED") {
41139
41143
  if (((_b = (_a = event.detail.data) == null ? void 0 : _a.response) == null ? void 0 : _b.code) == 0) {
41140
- onSendSubmitLiveness(event.detail.data.response);
41141
41144
  setData(event.detail.data.response);
41142
41145
  } else if (!failLiveness) {
41143
41146
  setFailLiveness(true);
41144
- saveDataToDB({
41145
- data: {
41146
- first_image: ((_d = (_c = dataFailLiveness.detail.data) == null ? void 0 : _c.response) == null ? void 0 : _d.images) ? "data:image/jpeg;base64," + dataFailLiveness.detail.data.response.images[0] : null,
41147
- face_result_code: ((_f = (_e = dataFailLiveness.detail.data) == null ? void 0 : _e.response) == null ? void 0 : _f.code) ? dataFailLiveness.detail.data.response.code : 250
41148
- },
41149
- component: "liveness",
41150
- eventId,
41151
- source: source2,
41152
- inProduction,
41153
- clientId,
41154
- geolocation
41155
- }).then((res) => {
41156
- dataLiveness({
41157
- countAttempts: res.count_try,
41158
- error: true
41159
- });
41160
- setFailLiveness(false);
41161
- setDataFailLiveness({});
41162
- });
41147
+ setDataFailLiveness(event);
41163
41148
  }
41164
41149
  }
41165
41150
  }
41166
41151
  };
41152
+ useEffect(() => {
41153
+ var _a, _b, _c, _d;
41154
+ if (failLiveness) {
41155
+ saveDataToDB({
41156
+ data: {
41157
+ first_image: ((_b = (_a = dataFailLiveness.detail.data) == null ? void 0 : _a.response) == null ? void 0 : _b.images) ? "data:image/jpeg;base64," + dataFailLiveness.detail.data.response.images[0] : null,
41158
+ face_result_code: ((_d = (_c = dataFailLiveness.detail.data) == null ? void 0 : _c.response) == null ? void 0 : _d.code) ? dataFailLiveness.detail.data.response.code : 250
41159
+ },
41160
+ component: "liveness",
41161
+ eventId,
41162
+ source: source2,
41163
+ inProduction,
41164
+ clientId,
41165
+ geolocation
41166
+ }).then((res) => {
41167
+ dataLiveness({
41168
+ countAttempts: res.count_try,
41169
+ error: true
41170
+ });
41171
+ setFailLiveness(false);
41172
+ setDataFailLiveness({});
41173
+ });
41174
+ }
41175
+ }, [failLiveness]);
41167
41176
  useEffect(() => {
41168
41177
  if (countryCodeAllowed && (geolocation == null ? void 0 : geolocation.data_connection.isocode)) {
41169
41178
  if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.data_connection.isocode))) {
@@ -41182,7 +41191,13 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41182
41191
  setMessage("");
41183
41192
  setIsLoading(false);
41184
41193
  };
41194
+ useEffect(() => {
41195
+ if (!lib$1(data2)) {
41196
+ onSendSubmitLiveness();
41197
+ }
41198
+ }, [data2]);
41185
41199
  const onSendSubmitLiveness = async () => {
41200
+ var _a;
41186
41201
  try {
41187
41202
  const customHeaders = {
41188
41203
  client_id: clientId,
@@ -41211,7 +41226,9 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41211
41226
  let message2 = "";
41212
41227
  const {
41213
41228
  status: status2
41214
- } = error.response;
41229
+ } = (_a = error == null ? void 0 : error.response) != null ? _a : {
41230
+ status: "Error desconocido"
41231
+ };
41215
41232
  saveDataToDB({
41216
41233
  data: {
41217
41234
  similarity: 0,
@@ -42500,8 +42517,7 @@ function LivenessCheck({
42500
42517
  message
42501
42518
  })]
42502
42519
  }) : lib$1(data2) && faceMatch || faceMatch === null ? /* @__PURE__ */ jsx$1("face-liveness", {
42503
- class: "liveness",
42504
- dataLiveness
42520
+ class: "liveness"
42505
42521
  }) : /* @__PURE__ */ jsx$1(Box$1, {
42506
42522
  className: `box-liveness ${isMobile_1 && "responsive"}`,
42507
42523
  children: similarity === 0 ? /* @__PURE__ */ jsxs(Box$1, {