vesant-sdk 1.2.0 → 1.3.1
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/dist/{client-BWp5FI3x.d.ts → client-B6fUFAUM.d.mts} +2 -1
- package/dist/{client-BIfLMfuC.d.mts → client-DoczGA6L.d.ts} +2 -1
- package/dist/client-DzElM7u-.d.mts +238 -0
- package/dist/client-DzElM7u-.d.ts +238 -0
- package/dist/compliance/index.d.mts +5 -4
- package/dist/compliance/index.d.ts +5 -4
- package/dist/compliance/index.js +306 -98
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +306 -98
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.d.mts +100 -0
- package/dist/decisions/index.d.ts +100 -0
- package/dist/decisions/index.js +607 -0
- package/dist/decisions/index.js.map +1 -0
- package/dist/decisions/index.mjs +605 -0
- package/dist/decisions/index.mjs.map +1 -0
- package/dist/geolocation/index.d.mts +4 -3
- package/dist/geolocation/index.d.ts +4 -3
- package/dist/geolocation/index.js +306 -98
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +306 -98
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +15 -7
- package/dist/index.d.ts +15 -7
- package/dist/index.js +676 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +667 -91
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +4 -3
- package/dist/kyc/core.d.ts +4 -3
- package/dist/kyc/core.js +284 -29
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +284 -29
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +46 -3
- package/dist/kyc/index.d.ts +46 -3
- package/dist/kyc/index.js +284 -29
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +284 -29
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +9 -5
- package/dist/react.d.ts +9 -5
- package/dist/react.js +422 -99
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +322 -4
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +4 -4
- package/dist/risk-profile/index.d.ts +4 -4
- package/dist/risk-profile/index.js +249 -29
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +249 -29
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.d.mts +96 -0
- package/dist/scores/index.d.ts +96 -0
- package/dist/scores/index.js +594 -0
- package/dist/scores/index.js.map +1 -0
- package/dist/scores/index.mjs +591 -0
- package/dist/scores/index.mjs.map +1 -0
- package/dist/{types-DfHLp_tz.d.ts → types-DLC7Sfy5.d.ts} +1 -1
- package/dist/types-DZHongaK.d.mts +61 -0
- package/dist/types-DZHongaK.d.ts +61 -0
- package/dist/{types-DKCQN4C5.d.mts → types-jaLuzruy.d.mts} +1 -1
- package/dist/webhooks/index.d.mts +176 -0
- package/dist/webhooks/index.d.ts +176 -0
- package/dist/webhooks/index.js +193 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/index.mjs +188 -0
- package/dist/webhooks/index.mjs.map +1 -0
- package/package.json +25 -2
- package/dist/types-BpKxSXGF.d.mts +0 -177
- package/dist/types-BpKxSXGF.d.ts +0 -177
package/dist/react.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useRef, useCallback, useEffect, createElement } from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
2
3
|
|
|
3
4
|
// src/geolocation/hooks.ts
|
|
4
5
|
|
|
5
6
|
// src/core/version.ts
|
|
6
|
-
var SDK_VERSION = "1.
|
|
7
|
+
var SDK_VERSION = "1.3.0";
|
|
7
8
|
|
|
8
9
|
// src/shared/browser-utils.ts
|
|
9
10
|
function generateUUID() {
|
|
@@ -847,6 +848,288 @@ function useCustomerProfile(client, customerId, options = {}) {
|
|
|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jxwYXRoIGQ9Ik0xNyAxN0gxNy4wMU0xNS42IDE0SDE4QzE4LjkzMTkgMTQgMTkuMzk3OCAxNCAxOS43NjU0IDE0LjE1MjJDMjAuMjU1NCAxNC4zNTUyIDIwLjY0NDggMTQuNzQ0NiAyMC44NDc4IDE1LjIzNDZDMjEgMTUuNjAyMiAyMSAxNi4wNjgxIDIxIDE3QzIxIDE3LjkzMTkgMjEgMTguMzk3OCAyMC44NDc4IDE4Ljc2NTRDMjAuNjQ0OCAxOS4yNTU0IDIwLjI1NTQgMTkuNjQ0OCAxOS43NjU0IDE5Ljg0NzhDMTkuMzk3OCAyMCAxOC45MzE5IDIwIDE4IDIwSDZDNS4wNjgxMiAyMCA0LjYwMjE4IDIwIDQuMjM0NjMgMTkuODQ3OEMzLjc0NDU4IDE5LjY0NDggMy4zNTUyMyAxOS4yNTU0IDMuMTUyMjQgMTguNzY1NEMzIDE4LjM5NzggMyAxNy45MzE5IDMgMTdDMyAxNi4wNjgxIDMgMTUuNjAyMiAzLjE1MjI0IDE1LjIzNDZDMy4zNTUyMyAxNC43NDQ2IDMuNzQ0NTggMTQuMzU1MiA0LjIzNDYzIDE0LjE1MjJDNC42MDIxOCAxNCA1LjA2ODEyIDE0IDYgMTRIOC40TTEyIDE1VjRNMTIgNEwxNSA3TTEyIDRMOSA3IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8L3N2Zz4=";
|
|
857
|
+
|
|
858
|
+
// src/kyc/FaceCaptureModal.tsx
|
|
859
|
+
var fileToBase64 = (file) => {
|
|
860
|
+
return new Promise((resolve, reject) => {
|
|
861
|
+
const reader = new FileReader();
|
|
862
|
+
reader.readAsDataURL(file);
|
|
863
|
+
reader.onload = () => resolve(reader.result);
|
|
864
|
+
reader.onerror = (error) => reject(error);
|
|
865
|
+
});
|
|
866
|
+
};
|
|
867
|
+
function FaceCaptureModal({
|
|
868
|
+
onCapture,
|
|
869
|
+
onCancel
|
|
870
|
+
}) {
|
|
871
|
+
const inputRef = useRef(null);
|
|
872
|
+
const [isProcessing, setIsProcessing] = useState(false);
|
|
873
|
+
const [isHoveringPrimary, setIsHoveringPrimary] = useState(false);
|
|
874
|
+
const [isHoveringCancel, setIsHoveringCancel] = useState(false);
|
|
875
|
+
const [isHoveringClose, setIsHoveringClose] = useState(false);
|
|
876
|
+
const isMobile = /Mobi|Android/i.test(navigator.userAgent);
|
|
877
|
+
const handleFileChange = async (e) => {
|
|
878
|
+
const file = e.target.files?.[0];
|
|
879
|
+
if (!file) return;
|
|
880
|
+
setIsProcessing(true);
|
|
881
|
+
try {
|
|
882
|
+
const base64 = await fileToBase64(file);
|
|
883
|
+
setTimeout(() => {
|
|
884
|
+
onCapture(base64);
|
|
885
|
+
}, 300);
|
|
886
|
+
} catch (error) {
|
|
887
|
+
console.error("Error processing image:", error);
|
|
888
|
+
setIsProcessing(false);
|
|
889
|
+
}
|
|
890
|
+
};
|
|
891
|
+
const overlayStyle = {
|
|
892
|
+
position: "fixed",
|
|
893
|
+
inset: 0,
|
|
894
|
+
background: "rgba(0, 0, 0, 0.6)",
|
|
895
|
+
backdropFilter: "blur(4px)",
|
|
896
|
+
display: "flex",
|
|
897
|
+
alignItems: "center",
|
|
898
|
+
justifyContent: "center",
|
|
899
|
+
zIndex: 999999,
|
|
900
|
+
padding: "16px",
|
|
901
|
+
animation: "fadeIn 0.2s ease-out"
|
|
902
|
+
};
|
|
903
|
+
const modalStyle = {
|
|
904
|
+
background: "#ffffff",
|
|
905
|
+
borderRadius: "16px",
|
|
906
|
+
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
907
|
+
width: "100%",
|
|
908
|
+
maxWidth: "448px",
|
|
909
|
+
animation: "zoomIn 0.2s ease-out"
|
|
910
|
+
};
|
|
911
|
+
const headerStyle = {
|
|
912
|
+
position: "relative",
|
|
913
|
+
padding: "24px 24px 16px",
|
|
914
|
+
borderBottom: "1px solid #f3f4f6"
|
|
915
|
+
};
|
|
916
|
+
const closeButtonStyle = {
|
|
917
|
+
position: "absolute",
|
|
918
|
+
top: "16px",
|
|
919
|
+
right: "16px",
|
|
920
|
+
padding: "8px",
|
|
921
|
+
background: isHoveringClose ? "#f3f4f6" : "transparent",
|
|
922
|
+
border: "none",
|
|
923
|
+
borderRadius: "9999px",
|
|
924
|
+
cursor: "pointer",
|
|
925
|
+
transition: "background-color 0.2s",
|
|
926
|
+
display: "flex",
|
|
927
|
+
alignItems: "center",
|
|
928
|
+
justifyContent: "center"
|
|
929
|
+
};
|
|
930
|
+
const titleStyle = {
|
|
931
|
+
fontSize: "24px",
|
|
932
|
+
fontWeight: 600,
|
|
933
|
+
color: "#111827",
|
|
934
|
+
margin: 0
|
|
935
|
+
};
|
|
936
|
+
const subtitleStyle = {
|
|
937
|
+
fontSize: "14px",
|
|
938
|
+
color: "#6b7280",
|
|
939
|
+
marginTop: "4px"
|
|
940
|
+
};
|
|
941
|
+
const contentStyle = {
|
|
942
|
+
padding: "32px 24px"
|
|
943
|
+
};
|
|
944
|
+
const visualGuideContainerStyle = {
|
|
945
|
+
marginBottom: "32px",
|
|
946
|
+
display: "flex",
|
|
947
|
+
justifyContent: "center"
|
|
948
|
+
};
|
|
949
|
+
const visualGuideStyle = {
|
|
950
|
+
position: "relative"
|
|
951
|
+
};
|
|
952
|
+
const circleStyle = {
|
|
953
|
+
width: "128px",
|
|
954
|
+
height: "128px",
|
|
955
|
+
borderRadius: "50%",
|
|
956
|
+
background: "linear-gradient(135deg, rgba(0, 188, 125, 0.2) 0%, rgba(0, 188, 125, 0.05) 100%)",
|
|
957
|
+
display: "flex",
|
|
958
|
+
alignItems: "center",
|
|
959
|
+
justifyContent: "center"
|
|
960
|
+
};
|
|
961
|
+
const badgeStyle = {
|
|
962
|
+
position: "absolute",
|
|
963
|
+
top: "-4px",
|
|
964
|
+
right: "-4px",
|
|
965
|
+
width: "32px",
|
|
966
|
+
height: "32px",
|
|
967
|
+
background: "#ffffff",
|
|
968
|
+
borderRadius: "50%",
|
|
969
|
+
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
|
|
970
|
+
display: "flex",
|
|
971
|
+
alignItems: "center",
|
|
972
|
+
justifyContent: "center"
|
|
973
|
+
};
|
|
974
|
+
const instructionsBoxStyle = {
|
|
975
|
+
background: "linear-gradient(135deg, #f9fafb 0%, rgba(243, 244, 246, 0.5) 100%)",
|
|
976
|
+
borderRadius: "12px",
|
|
977
|
+
padding: "16px",
|
|
978
|
+
marginBottom: "24px"
|
|
979
|
+
};
|
|
980
|
+
const instructionsTitleStyle = {
|
|
981
|
+
fontSize: "14px",
|
|
982
|
+
fontWeight: 500,
|
|
983
|
+
color: "#111827",
|
|
984
|
+
marginBottom: "8px"
|
|
985
|
+
};
|
|
986
|
+
const instructionsListStyle = {
|
|
987
|
+
fontSize: "12px",
|
|
988
|
+
color: "#6b7280",
|
|
989
|
+
listStyle: "none",
|
|
990
|
+
padding: 0,
|
|
991
|
+
margin: 0
|
|
992
|
+
};
|
|
993
|
+
const instructionItemStyle = {
|
|
994
|
+
display: "flex",
|
|
995
|
+
alignItems: "flex-start",
|
|
996
|
+
marginBottom: "6px"
|
|
997
|
+
};
|
|
998
|
+
const bulletStyle = {
|
|
999
|
+
color: "#00bc7d",
|
|
1000
|
+
marginRight: "8px",
|
|
1001
|
+
flexShrink: 0
|
|
1002
|
+
};
|
|
1003
|
+
const buttonsContainerStyle = {
|
|
1004
|
+
display: "flex",
|
|
1005
|
+
flexDirection: "column",
|
|
1006
|
+
gap: "12px"
|
|
1007
|
+
};
|
|
1008
|
+
const primaryButtonStyle = {
|
|
1009
|
+
width: "100%",
|
|
1010
|
+
background: isProcessing ? "#d1d5db" : isHoveringPrimary ? "#00a86d" : "#00bc7d",
|
|
1011
|
+
color: "#ffffff",
|
|
1012
|
+
fontWeight: 500,
|
|
1013
|
+
padding: "14px 24px",
|
|
1014
|
+
borderRadius: "12px",
|
|
1015
|
+
border: "none",
|
|
1016
|
+
cursor: isProcessing ? "not-allowed" : "pointer",
|
|
1017
|
+
transition: "all 0.2s",
|
|
1018
|
+
display: "flex",
|
|
1019
|
+
alignItems: "center",
|
|
1020
|
+
justifyContent: "center",
|
|
1021
|
+
gap: "12px",
|
|
1022
|
+
boxShadow: isProcessing ? "none" : isHoveringPrimary ? "0 20px 25px -5px rgba(0, 188, 125, 0.3)" : "0 10px 15px -3px rgba(0, 188, 125, 0.2)",
|
|
1023
|
+
fontSize: "16px"
|
|
1024
|
+
};
|
|
1025
|
+
const cancelButtonStyle = {
|
|
1026
|
+
width: "100%",
|
|
1027
|
+
background: isProcessing ? "#f3f4f6" : isHoveringCancel ? "#f9fafb" : "#ffffff",
|
|
1028
|
+
color: "#374151",
|
|
1029
|
+
fontWeight: 500,
|
|
1030
|
+
padding: "14px 24px",
|
|
1031
|
+
borderRadius: "12px",
|
|
1032
|
+
border: "2px solid #e5e7eb",
|
|
1033
|
+
cursor: isProcessing ? "not-allowed" : "pointer",
|
|
1034
|
+
transition: "all 0.2s",
|
|
1035
|
+
fontSize: "16px"
|
|
1036
|
+
};
|
|
1037
|
+
const footerStyle = {
|
|
1038
|
+
padding: "0 24px 24px"
|
|
1039
|
+
};
|
|
1040
|
+
const footerTextStyle = {
|
|
1041
|
+
fontSize: "12px",
|
|
1042
|
+
textAlign: "center",
|
|
1043
|
+
color: "#9ca3af",
|
|
1044
|
+
margin: 0
|
|
1045
|
+
};
|
|
1046
|
+
const spinnerStyle = {
|
|
1047
|
+
width: "20px",
|
|
1048
|
+
height: "20px",
|
|
1049
|
+
border: "2px solid rgba(255, 255, 255, 0.3)",
|
|
1050
|
+
borderTopColor: "#ffffff",
|
|
1051
|
+
borderRadius: "50%",
|
|
1052
|
+
animation: "spin 0.6s linear infinite"
|
|
1053
|
+
};
|
|
1054
|
+
const hiddenInputStyle = {
|
|
1055
|
+
display: "none"
|
|
1056
|
+
};
|
|
1057
|
+
const styleTag = /* @__PURE__ */ React.createElement("style", null, `
|
|
1058
|
+
@keyframes fadeIn {
|
|
1059
|
+
from {
|
|
1060
|
+
opacity: 0;
|
|
1061
|
+
}
|
|
1062
|
+
to {
|
|
1063
|
+
opacity: 1;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
@keyframes zoomIn {
|
|
1068
|
+
from {
|
|
1069
|
+
opacity: 0;
|
|
1070
|
+
transform: scale(0.95);
|
|
1071
|
+
}
|
|
1072
|
+
to {
|
|
1073
|
+
opacity: 1;
|
|
1074
|
+
transform: scale(1);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
@keyframes spin {
|
|
1079
|
+
from {
|
|
1080
|
+
transform: rotate(0deg);
|
|
1081
|
+
}
|
|
1082
|
+
to {
|
|
1083
|
+
transform: rotate(360deg);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
`);
|
|
1087
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, styleTag, /* @__PURE__ */ React.createElement("div", { style: overlayStyle }, /* @__PURE__ */ React.createElement("div", { style: modalStyle }, /* @__PURE__ */ React.createElement("div", { style: headerStyle }, /* @__PURE__ */ React.createElement(
|
|
1088
|
+
"button",
|
|
1089
|
+
{
|
|
1090
|
+
onClick: onCancel,
|
|
1091
|
+
onMouseEnter: () => setIsHoveringClose(true),
|
|
1092
|
+
onMouseLeave: () => setIsHoveringClose(false),
|
|
1093
|
+
style: closeButtonStyle,
|
|
1094
|
+
"aria-label": "Close"
|
|
1095
|
+
},
|
|
1096
|
+
/* @__PURE__ */ React.createElement("img", { src: Close, alt: "Close Icon", width: 16, height: 16 })
|
|
1097
|
+
), /* @__PURE__ */ React.createElement("h2", { style: titleStyle }, "Face Verification"), /* @__PURE__ */ React.createElement("p", { style: subtitleStyle }, "Please capture or upload a clear photo of your face")), /* @__PURE__ */ React.createElement("div", { style: contentStyle }, /* @__PURE__ */ React.createElement("div", { style: visualGuideContainerStyle }, /* @__PURE__ */ React.createElement("div", { style: visualGuideStyle }, /* @__PURE__ */ React.createElement("div", { style: circleStyle }, /* @__PURE__ */ React.createElement("img", { src: Camera, alt: "Camera Icon", width: 48, height: 48 })), /* @__PURE__ */ React.createElement("div", { style: badgeStyle }, /* @__PURE__ */ React.createElement("img", { src: Done, alt: "Check Icon", width: 16, height: 16 })))), /* @__PURE__ */ React.createElement("div", { style: instructionsBoxStyle }, /* @__PURE__ */ React.createElement("h3", { style: instructionsTitleStyle }, "Tips for best results:"), /* @__PURE__ */ React.createElement("ul", { style: instructionsListStyle }, /* @__PURE__ */ React.createElement("li", { style: instructionItemStyle }, /* @__PURE__ */ React.createElement("span", { style: bulletStyle }, "\u2022"), /* @__PURE__ */ React.createElement("span", null, "Ensure good lighting on your face")), /* @__PURE__ */ React.createElement("li", { style: instructionItemStyle }, /* @__PURE__ */ React.createElement("span", { style: bulletStyle }, "\u2022"), /* @__PURE__ */ React.createElement("span", null, "Remove glasses or accessories if possible")), /* @__PURE__ */ React.createElement("li", { style: instructionItemStyle }, /* @__PURE__ */ React.createElement("span", { style: bulletStyle }, "\u2022"), /* @__PURE__ */ React.createElement("span", null, "Look directly at the camera")))), /* @__PURE__ */ React.createElement(
|
|
1098
|
+
"input",
|
|
1099
|
+
{
|
|
1100
|
+
ref: inputRef,
|
|
1101
|
+
type: "file",
|
|
1102
|
+
accept: "image/*",
|
|
1103
|
+
capture: isMobile ? "user" : void 0,
|
|
1104
|
+
style: hiddenInputStyle,
|
|
1105
|
+
onChange: handleFileChange,
|
|
1106
|
+
disabled: isProcessing
|
|
1107
|
+
}
|
|
1108
|
+
), /* @__PURE__ */ React.createElement("div", { style: buttonsContainerStyle }, /* @__PURE__ */ React.createElement(
|
|
1109
|
+
"button",
|
|
1110
|
+
{
|
|
1111
|
+
onClick: () => inputRef.current?.click(),
|
|
1112
|
+
onMouseEnter: () => setIsHoveringPrimary(true),
|
|
1113
|
+
onMouseLeave: () => setIsHoveringPrimary(false),
|
|
1114
|
+
disabled: isProcessing,
|
|
1115
|
+
style: primaryButtonStyle
|
|
1116
|
+
},
|
|
1117
|
+
isProcessing ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { style: spinnerStyle }), /* @__PURE__ */ React.createElement("span", null, "Processing...")) : /* @__PURE__ */ React.createElement(React.Fragment, null, isMobile ? /* @__PURE__ */ React.createElement("img", { src: Camera, alt: "Camera Icon", width: 20, height: 20 }) : /* @__PURE__ */ React.createElement("img", { src: Upload, alt: "Upload Icon", width: 20, height: 20 }), /* @__PURE__ */ React.createElement("span", null, isMobile ? "Capture Photo" : "Upload Photo"))
|
|
1118
|
+
), /* @__PURE__ */ React.createElement(
|
|
1119
|
+
"button",
|
|
1120
|
+
{
|
|
1121
|
+
onClick: onCancel,
|
|
1122
|
+
onMouseEnter: () => setIsHoveringCancel(true),
|
|
1123
|
+
onMouseLeave: () => setIsHoveringCancel(false),
|
|
1124
|
+
disabled: isProcessing,
|
|
1125
|
+
style: cancelButtonStyle
|
|
1126
|
+
},
|
|
1127
|
+
"Cancel"
|
|
1128
|
+
))), /* @__PURE__ */ React.createElement("div", { style: footerStyle }, /* @__PURE__ */ React.createElement("p", { style: footerTextStyle }, "Your photo will be securely processed and used only for verification purposes")))));
|
|
1129
|
+
}
|
|
1130
|
+
var FaceCaptureModal_default = FaceCaptureModal;
|
|
1131
|
+
|
|
1132
|
+
// src/kyc/hooks.ts
|
|
850
1133
|
function useAutoFetch(autoFetch, fetchFn) {
|
|
851
1134
|
useEffect(() => {
|
|
852
1135
|
if (autoFetch) {
|
|
@@ -1127,7 +1410,7 @@ function useKycPreferences(client, autoFetch = true) {
|
|
|
1127
1410
|
refresh: fetchPreferences
|
|
1128
1411
|
};
|
|
1129
1412
|
}
|
|
1130
|
-
function
|
|
1413
|
+
function fileToBase642(file) {
|
|
1131
1414
|
return new Promise((resolve, reject) => {
|
|
1132
1415
|
const reader = new FileReader();
|
|
1133
1416
|
reader.onload = () => {
|
|
@@ -1183,7 +1466,42 @@ function getRiskColor(risk) {
|
|
|
1183
1466
|
};
|
|
1184
1467
|
return colorMap[risk] || "#6b7280";
|
|
1185
1468
|
}
|
|
1469
|
+
function useReuseKYCSubmission(client) {
|
|
1470
|
+
const verifyFace = (reference, token) => {
|
|
1471
|
+
return new Promise((resolve, reject) => {
|
|
1472
|
+
const container = document.createElement("div");
|
|
1473
|
+
document.body.appendChild(container);
|
|
1474
|
+
const root = createRoot(container);
|
|
1475
|
+
const cleanup = () => {
|
|
1476
|
+
root.unmount();
|
|
1477
|
+
document.body.removeChild(container);
|
|
1478
|
+
};
|
|
1479
|
+
const modal = createElement(FaceCaptureModal_default, {
|
|
1480
|
+
onCapture: async (base64) => {
|
|
1481
|
+
try {
|
|
1482
|
+
const resp = await client.submitReuseKycSession({
|
|
1483
|
+
proof: base64,
|
|
1484
|
+
reference,
|
|
1485
|
+
token
|
|
1486
|
+
});
|
|
1487
|
+
resolve(resp);
|
|
1488
|
+
} catch (error) {
|
|
1489
|
+
reject(error instanceof Error ? error : new Error("Face verification failed"));
|
|
1490
|
+
} finally {
|
|
1491
|
+
cleanup();
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
onCancel: () => {
|
|
1495
|
+
cleanup();
|
|
1496
|
+
resolve(null);
|
|
1497
|
+
}
|
|
1498
|
+
});
|
|
1499
|
+
root.render(modal);
|
|
1500
|
+
});
|
|
1501
|
+
};
|
|
1502
|
+
return { verifyFace };
|
|
1503
|
+
}
|
|
1186
1504
|
|
|
1187
|
-
export { createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
|
|
1505
|
+
export { createDeviceFingerprint, fileToBase642 as fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useReuseKYCSubmission, useTransactionVerification };
|
|
1188
1506
|
//# sourceMappingURL=react.mjs.map
|
|
1189
1507
|
//# sourceMappingURL=react.mjs.map
|