gbc-kyc-kit 3.4.7 → 3.4.9

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.
package/README.md CHANGED
@@ -16,7 +16,7 @@ or
16
16
  Import CSS component with:
17
17
 
18
18
  ```js
19
- import '../node_modules/gbc-kyc-kit/dist/style.css';
19
+ import 'gbc-kyc-kit/dist/styles.css';
20
20
  ```
21
21
 
22
22
  ## Style customization
@@ -74,7 +74,7 @@ async function getAccessToken() {
74
74
 
75
75
  const parseReq = {
76
76
  method: 'POST',
77
- url: 'https://services.globalbridgeconnections.com.py/oauth/access-token',
77
+ url: 'https://gbc-py-core-sandbox-api-products-rtm3lv2joa-uc.a.run.app/api-hub/oauth2/v1/generate_access_token',
78
78
  headers: customHeaders,
79
79
  data: {
80
80
  grant_type: 'client_credentials',
@@ -38726,7 +38726,15 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
38726
38726
  };
38727
38727
  try {
38728
38728
  const res2 = await request2(parseReq);
38729
- const fullData = res2.data.data;
38729
+ const {
38730
+ documents_image,
38731
+ ...rest
38732
+ } = res2.data.data;
38733
+ const fullData = {
38734
+ ...rest,
38735
+ first_image: (documents_image == null ? void 0 : documents_image.first_image) || "",
38736
+ second_image: (documents_image == null ? void 0 : documents_image.second_image) || ""
38737
+ };
38730
38738
  const dataOcrSaved = await saveDataToDB({
38731
38739
  data: {
38732
38740
  ...fullData,
@@ -38758,8 +38766,8 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
38758
38766
  };
38759
38767
  const data2 = await saveDataToDB({
38760
38768
  data: {
38761
- first_image: base64.firstImage,
38762
- second_image: Object.keys(base64).length > 1 ? base64.secondImage : "",
38769
+ first_image: (base64 == null ? void 0 : base64.firstImage) || "",
38770
+ second_image: (base64 == null ? void 0 : base64.secondImage) || "",
38763
38771
  status_code: status2
38764
38772
  },
38765
38773
  component: "ocr",
@@ -42661,7 +42669,7 @@ const V2OcrComponent = ({
42661
42669
  });
42662
42670
  };
42663
42671
  const name = "gbc-kyc-kit";
42664
- const version = "3.4.7";
42672
+ const version = "3.4.9";
42665
42673
  const description = "Componentes para el desarrollo de un Onboarding";
42666
42674
  const license = "MIT";
42667
42675
  const author = "Global Bridge Connections";
@@ -42732,7 +42740,7 @@ const dependencies = {
42732
42740
  "comma-separated-values": "^3.6.4",
42733
42741
  eslint: "^8.18.0",
42734
42742
  "eslint-plugin-react": "^7.30.1",
42735
- "gbc-kyc-kit": "^3.4.6",
42743
+ "gbc-kyc-kit": "^3.4.8",
42736
42744
  "image-compressor.js": "^1.1.4",
42737
42745
  "image-js": "^0.37.0",
42738
42746
  "is-empty": "^1.2.0",
@@ -44936,6 +44944,7 @@ const LivenessController = (dataLiveness, clientId, authorize, eventId, source2,
44936
44944
  async function getDataLiveness(sessionId, inProduction2, clientId2, dataLiveness2, facematch) {
44937
44945
  var _a, _b, _c;
44938
44946
  const accessToken2 = await authorize();
44947
+ let selfie = null;
44939
44948
  const customHeaders = {
44940
44949
  client_id: clientId2,
44941
44950
  access_token: accessToken2
@@ -44944,10 +44953,46 @@ const LivenessController = (dataLiveness, clientId, authorize, eventId, source2,
44944
44953
  try {
44945
44954
  const data22 = await getDataLivenessService(sessionId, inProduction2, clientId2, accessToken2);
44946
44955
  livenessImage = (_c = (_b = (_a = data22.liveness_checks) == null ? void 0 : _a[0]) == null ? void 0 : _b.reference_image) != null ? _c : null;
44956
+ if (facematch && livenessImage) {
44957
+ try {
44958
+ const dataFaceMatch = await fetchFaceMatch(facematch, livenessImage, inProduction2, customHeaders);
44959
+ selfie = dataFaceMatch.similarity.toFixed(2);
44960
+ await saveDataToDB({
44961
+ data: {
44962
+ first_image: facematch,
44963
+ second_image: livenessImage,
44964
+ similarity: selfie,
44965
+ status_code: 200
44966
+ },
44967
+ component: "facematch",
44968
+ eventId,
44969
+ source: source2,
44970
+ inProduction: inProduction2,
44971
+ clientId: clientId2,
44972
+ geolocation
44973
+ });
44974
+ } catch (error2) {
44975
+ console.log(error2);
44976
+ await saveDataToDB({
44977
+ data: {
44978
+ first_image: facematch,
44979
+ second_image: livenessImage,
44980
+ similarity: 0,
44981
+ status_code: 500
44982
+ },
44983
+ component: "facematch",
44984
+ eventId,
44985
+ source: source2,
44986
+ inProduction: inProduction2,
44987
+ clientId: clientId2,
44988
+ geolocation
44989
+ });
44990
+ }
44991
+ }
44947
44992
  const livenessRes = await saveDataToDB({
44948
44993
  data: {
44949
44994
  selfie: livenessImage,
44950
- similarity: null,
44995
+ similarity: selfie,
44951
44996
  face_result_code: livenessImage ? 0 : 500
44952
44997
  },
44953
44998
  component: "liveness",
@@ -44976,41 +45021,6 @@ const LivenessController = (dataLiveness, clientId, authorize, eventId, source2,
44976
45021
  dataLiveness2(livenessRes);
44977
45022
  return;
44978
45023
  }
44979
- if (facematch && livenessImage) {
44980
- try {
44981
- const dataFaceMatch = await fetchFaceMatch(facematch, livenessImage, inProduction2, customHeaders);
44982
- await saveDataToDB({
44983
- data: {
44984
- first_image: facematch,
44985
- second_image: livenessImage,
44986
- similarity: dataFaceMatch.similarity.toFixed(2),
44987
- status_code: 200
44988
- },
44989
- component: "facematch",
44990
- eventId,
44991
- source: source2,
44992
- inProduction: inProduction2,
44993
- clientId: clientId2,
44994
- geolocation
44995
- });
44996
- } catch (error2) {
44997
- console.log(error2);
44998
- await saveDataToDB({
44999
- data: {
45000
- first_image: facematch,
45001
- second_image: livenessImage,
45002
- similarity: 0,
45003
- status_code: 500
45004
- },
45005
- component: "facematch",
45006
- eventId,
45007
- source: source2,
45008
- inProduction: inProduction2,
45009
- clientId: clientId2,
45010
- geolocation
45011
- });
45012
- }
45013
- }
45014
45024
  }
45015
45025
  return {
45016
45026
  status,