sales-frontend-components 0.0.127 → 0.0.128
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/index.cjs.js +16 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +16 -16
- package/dist/index.esm.js.map +1 -1
- package/package.json +11 -11
package/dist/index.cjs.js
CHANGED
|
@@ -3919,9 +3919,9 @@ const useRemoteIdentityVerification = ({
|
|
|
3919
3919
|
rivsRqstId: remoteIdentityVerificationSystemRequestId,
|
|
3920
3920
|
...rivSearchParams
|
|
3921
3921
|
});
|
|
3922
|
-
return { fullUrl: `${rivHost}/?${urlParams.toString()}`,
|
|
3922
|
+
return { fullUrl: `${rivHost}/?${urlParams.toString()}`, rivsRequestId: remoteIdentityVerificationSystemRequestId };
|
|
3923
3923
|
};
|
|
3924
|
-
const createMessageHandler = ({
|
|
3924
|
+
const createMessageHandler = ({ rivsRequestId }, cleanup) => {
|
|
3925
3925
|
return (event) => {
|
|
3926
3926
|
try {
|
|
3927
3927
|
const response = typeof event.data === "string" ? JSON.parse(decodeURIComponent(event.data)) : event.data;
|
|
@@ -3940,12 +3940,12 @@ const useRemoteIdentityVerification = ({
|
|
|
3940
3940
|
case VERIFICATION_CODES.ATTEMPT_EXCEEDED:
|
|
3941
3941
|
case VERIFICATION_CODES.SERVER_ERROR:
|
|
3942
3942
|
console.log("=====\uBE44\uB300\uBA74\uC778\uC99D \uC2E4\uD328!=====", { result, code });
|
|
3943
|
-
onError?.({ result, code }, {
|
|
3943
|
+
onError?.({ result, code }, { rivsRequestId });
|
|
3944
3944
|
cleanup?.();
|
|
3945
3945
|
break;
|
|
3946
3946
|
case VERIFICATION_CODES.SUCCESS:
|
|
3947
3947
|
console.log("=====\uBE44\uB300\uBA74\uC778\uC99D \uC131\uACF5!=====", { result, code });
|
|
3948
|
-
onSuccess?.({ result, code }, {
|
|
3948
|
+
onSuccess?.({ result, code }, { rivsRequestId });
|
|
3949
3949
|
cleanup?.();
|
|
3950
3950
|
break;
|
|
3951
3951
|
default:
|
|
@@ -3965,7 +3965,7 @@ const useRemoteIdentityVerificationIframe = (config) => {
|
|
|
3965
3965
|
const { createMessageHandler, createRemoteIdentityVerificationUrl } = useRemoteIdentityVerification(config);
|
|
3966
3966
|
const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
|
|
3967
3967
|
const [remoteIdentityVerificationUrl, setRemoteIdentityVerificationUrl] = React.useState("");
|
|
3968
|
-
const [
|
|
3968
|
+
const [rivsRequestId, setRivsRequestId] = React.useState("");
|
|
3969
3969
|
const [isCreatingUrl, setIsCreatingUrl] = React.useState(false);
|
|
3970
3970
|
const [isIframeLoaded, setIsIframeLoaded] = React.useState(false);
|
|
3971
3971
|
const createIframeUrl = async () => {
|
|
@@ -3975,9 +3975,9 @@ const useRemoteIdentityVerificationIframe = (config) => {
|
|
|
3975
3975
|
setIsCreatingUrl(true);
|
|
3976
3976
|
setIsIframeLoaded(false);
|
|
3977
3977
|
try {
|
|
3978
|
-
const { fullUrl,
|
|
3978
|
+
const { fullUrl, rivsRequestId: rivsRequestId2 } = await createRemoteIdentityVerificationUrl();
|
|
3979
3979
|
setRemoteIdentityVerificationUrl(fullUrl);
|
|
3980
|
-
|
|
3980
|
+
setRivsRequestId(rivsRequestId2);
|
|
3981
3981
|
} catch (error) {
|
|
3982
3982
|
console.error("Failed to create URL:", error);
|
|
3983
3983
|
throw error;
|
|
@@ -3997,13 +3997,13 @@ const useRemoteIdentityVerificationIframe = (config) => {
|
|
|
3997
3997
|
result: "N",
|
|
3998
3998
|
code: VERIFICATION_CODES.TOKEN_ERROR
|
|
3999
3999
|
},
|
|
4000
|
-
{
|
|
4000
|
+
{ rivsRequestId: "" }
|
|
4001
4001
|
);
|
|
4002
4002
|
}
|
|
4003
4003
|
};
|
|
4004
4004
|
const closeRivIframe = () => {
|
|
4005
4005
|
setRemoteIdentityVerificationUrl("");
|
|
4006
|
-
|
|
4006
|
+
setRivsRequestId("");
|
|
4007
4007
|
setIsIframeLoaded(false);
|
|
4008
4008
|
closeModal();
|
|
4009
4009
|
};
|
|
@@ -4011,10 +4011,10 @@ const useRemoteIdentityVerificationIframe = (config) => {
|
|
|
4011
4011
|
if (!remoteIdentityVerificationUrl) {
|
|
4012
4012
|
return;
|
|
4013
4013
|
}
|
|
4014
|
-
const messageHandler = createMessageHandler({
|
|
4014
|
+
const messageHandler = createMessageHandler({ rivsRequestId }, closeRivIframe);
|
|
4015
4015
|
salesFrontendUtils.MessageEventManager.getInstance().registerHandler("riv-iframe-handler", messageHandler);
|
|
4016
4016
|
return () => salesFrontendUtils.MessageEventManager.getInstance().unregisterHandler("riv-iframe-handler");
|
|
4017
|
-
}, [remoteIdentityVerificationUrl,
|
|
4017
|
+
}, [remoteIdentityVerificationUrl, rivsRequestId]);
|
|
4018
4018
|
const RivIframe = ({
|
|
4019
4019
|
width = "100%",
|
|
4020
4020
|
height = "100%",
|
|
@@ -4072,7 +4072,7 @@ const useRemoteIdentityVerificationIframe = (config) => {
|
|
|
4072
4072
|
const useRemoteIdentityVerificationPopup = (config) => {
|
|
4073
4073
|
const { createRemoteIdentityVerificationUrl, createMessageHandler } = useRemoteIdentityVerification(config);
|
|
4074
4074
|
const [isCreatingUrl, setIsCreatingUrl] = React.useState(false);
|
|
4075
|
-
const [
|
|
4075
|
+
const [rivsRequestId, setRivsRequestId] = React.useState("");
|
|
4076
4076
|
const popupRef = React.useRef(null);
|
|
4077
4077
|
const openPopup = async (target = "_blank", features) => {
|
|
4078
4078
|
if (popupRef.current && !popupRef.current.closed) {
|
|
@@ -4080,13 +4080,13 @@ const useRemoteIdentityVerificationPopup = (config) => {
|
|
|
4080
4080
|
}
|
|
4081
4081
|
setIsCreatingUrl(true);
|
|
4082
4082
|
try {
|
|
4083
|
-
const { fullUrl,
|
|
4083
|
+
const { fullUrl, rivsRequestId: rivsRequestId2 } = await createRemoteIdentityVerificationUrl();
|
|
4084
4084
|
const popup = window.open(fullUrl, target, features);
|
|
4085
4085
|
if (!popup) {
|
|
4086
4086
|
await salesFrontendDesignSystem.ModalUtils.alert("\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574\uC8FC\uC138\uC694.");
|
|
4087
4087
|
return;
|
|
4088
4088
|
}
|
|
4089
|
-
|
|
4089
|
+
setRivsRequestId(rivsRequestId2);
|
|
4090
4090
|
popupRef.current = popup;
|
|
4091
4091
|
} catch (error) {
|
|
4092
4092
|
console.error("openPopup error::", error);
|
|
@@ -4099,10 +4099,10 @@ const useRemoteIdentityVerificationPopup = (config) => {
|
|
|
4099
4099
|
popupRef.current = null;
|
|
4100
4100
|
};
|
|
4101
4101
|
React.useEffect(() => {
|
|
4102
|
-
const messageHandler = createMessageHandler({
|
|
4102
|
+
const messageHandler = createMessageHandler({ rivsRequestId }, cleanPopup);
|
|
4103
4103
|
salesFrontendUtils.MessageEventManager.getInstance().registerHandler("riv-popup-handler", messageHandler);
|
|
4104
4104
|
return () => salesFrontendUtils.MessageEventManager.getInstance().unregisterHandler("riv-popup-handler");
|
|
4105
|
-
}, [
|
|
4105
|
+
}, [rivsRequestId]);
|
|
4106
4106
|
return {
|
|
4107
4107
|
openPopup,
|
|
4108
4108
|
isCreatingUrl
|