@daeryun/dr_components 1.2.17 → 1.2.19
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/components/Daeryuntalk/ChatButton.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatButton.tsx +1 -1
- package/dist/components/Daeryuntalk/ChatWidget.d.ts +1 -0
- package/dist/components/Daeryuntalk/ChatWidget.jsx +114 -31
- package/dist/components/Daeryuntalk/ChatWidget.tsx +120 -37
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +0 -9
- package/dist/components/Daeryuntalk/index.jsx +17 -1
- package/dist/components/Daeryuntalk/index.tsx +26 -2
- package/dist/components/DaeryuntalkBackup/ChatButton.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.jsx +123 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.tsx +157 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.d.ts +21 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.jsx +259 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.tsx +390 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.d.ts +16 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.jsx +50 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.tsx +108 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.d.ts +14 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.jsx +147 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.tsx +262 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.jsx +19 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.tsx +27 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.jsx +165 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.tsx +244 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.tsx +25 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.jsx +100 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.tsx +135 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.tsx +26 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.jsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.tsx +45 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.tsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.d.ts +3 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.tsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.tsx +233 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.jsx +198 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.tsx +295 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.jsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.tsx +75 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.jsx +138 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.tsx +177 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.jsx +154 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.tsx +221 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.d.ts +103 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.jsx +207 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.tsx +350 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.tsx +24 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.tsx +73 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.jsx +157 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.tsx +206 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.d.ts +19 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.jsx +94 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/HomeView.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/HomeView.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/HomeView.tsx +261 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.jsx +44 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.tsx +60 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.jsx +17 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.tsx +28 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.jsx +130 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.tsx +181 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.d.ts +23 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.tsx +70 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.jsx +22 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.tsx +30 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.jsx +98 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.tsx +138 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.jsx +104 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.jsx +141 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.tsx +278 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.jsx +25 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.d.ts +177 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.js +801 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.ts +1097 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.d.ts +131 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.js +1 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.ts +159 -0
- package/dist/components/DaeryuntalkBackup/_api/index.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.js +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.d.ts +5 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.js +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.js +25 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.ts +26 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.d.ts +109 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.js +254 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.ts +289 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.js +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.js +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.ts +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.d.ts +34 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.js +46 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.ts +56 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.d.ts +32 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.js +76 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.ts +81 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.d.ts +33 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.js +66 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.ts +71 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.d.ts +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.js +465 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.ts +595 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.tsx +17 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.js +112 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.ts +144 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.d.ts +44 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.js +534 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.ts +706 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.js +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.ts +23 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.js +109 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.ts +121 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.js +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.ts +73 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.js +42 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.ts +52 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.js +20 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.ts +30 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.d.ts +2 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.js +26 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.ts +43 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.d.ts +27 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.js +80 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.ts +101 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.js +66 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.ts +75 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.js +103 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.ts +136 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.js +94 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.ts +119 -0
- package/dist/components/DaeryuntalkBackup/_types/message.d.ts +92 -0
- package/dist/components/DaeryuntalkBackup/_types/message.js +25 -0
- package/dist/components/DaeryuntalkBackup/_types/message.ts +156 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.d.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.jsx +5 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.tsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.tsx +38 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.tsx +50 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.jsx +9 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/index.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/index.jsx +190 -0
- package/dist/components/DaeryuntalkBackup/index.tsx +261 -0
- package/dist/components/banner/TopBanner.jsx +2 -2
- package/dist/components/banner/TopBanner.tsx +4 -2
- package/dist/styles/globals.css +5 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ViewState } from '../../ChatHomeView';
|
|
3
|
+
interface IHistoryProps {
|
|
4
|
+
setViewState: Dispatch<SetStateAction<ViewState>>;
|
|
5
|
+
attendRoomByHistory: (chatNumber: string) => any;
|
|
6
|
+
startSelectedChat: (chatNumber: string) => any;
|
|
7
|
+
createNewChat: () => any;
|
|
8
|
+
goRequestPhone: ({ name, cellPhoneNumber }: {
|
|
9
|
+
name: string;
|
|
10
|
+
cellPhoneNumber: string;
|
|
11
|
+
}) => any;
|
|
12
|
+
goHistoryPhoneAuth: ({ name, cellPhoneNumber, certificationNumber }: {
|
|
13
|
+
name: string;
|
|
14
|
+
cellPhoneNumber: string;
|
|
15
|
+
certificationNumber: string;
|
|
16
|
+
}) => any;
|
|
17
|
+
chatInquiryNumber: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare const useHistoryView: ({ attendRoomByHistory, startSelectedChat, setViewState, createNewChat, goRequestPhone, goHistoryPhoneAuth, chatInquiryNumber }: IHistoryProps) => {
|
|
20
|
+
handleChatHistoryClick: (chatNumber: string) => Promise<void>;
|
|
21
|
+
handleNewStartChat: () => Promise<void>;
|
|
22
|
+
handleHistoryClick: () => Promise<void>;
|
|
23
|
+
handleGoRequestPhone: (name: string, cellPhoneNumber: string) => Promise<any>;
|
|
24
|
+
handleGoHistoryPhoneAuth: (name: string, cellPhoneNumber: string, certificationNumber: string) => Promise<any>;
|
|
25
|
+
handleBackClick: () => Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setViewState,
|
|
11
|
+
// setIsLoading,
|
|
12
|
+
createNewChat, goRequestPhone, goHistoryPhoneAuth,
|
|
13
|
+
// setPreviewState
|
|
14
|
+
chatInquiryNumber }) => {
|
|
15
|
+
const handleChatHistoryClick = (chatNumber) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
try {
|
|
18
|
+
// setIsLoading(true);
|
|
19
|
+
const response = yield attendRoomByHistory(chatNumber);
|
|
20
|
+
if (((_a = response === null || response === void 0 ? void 0 : response.result_info) === null || _a === void 0 ? void 0 : _a.result_cd) === 'OK' || ((_b = response === null || response === void 0 ? void 0 : response.result_info) === null || _b === void 0 ? void 0 : _b.result_type_cd) === 'OK') {
|
|
21
|
+
yield startSelectedChat(chatNumber);
|
|
22
|
+
setViewState('conversation');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
console.error('e', e);
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
// setIsLoading(false);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
// 히스토리 + conversatoion 에서 사용
|
|
33
|
+
const handleNewStartChat = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
// setIsLoading(true);
|
|
36
|
+
// 채팅 시작 - 새 문의 생성 또는 기존 문의 조회 처리
|
|
37
|
+
yield createNewChat();
|
|
38
|
+
// 대화 화면으로 전환
|
|
39
|
+
setViewState('conversation');
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error('신규 채팅 실패:', error);
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
// setIsLoading(false);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
// 히스토리 점유 인증번호 요청
|
|
49
|
+
const handleGoRequestPhone = (name, cellPhoneNumber) => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
+
const res = yield goRequestPhone({
|
|
51
|
+
name,
|
|
52
|
+
cellPhoneNumber
|
|
53
|
+
});
|
|
54
|
+
return res;
|
|
55
|
+
});
|
|
56
|
+
const handleGoHistoryPhoneAuth = (name, cellPhoneNumber, certificationNumber) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
+
const res = yield goHistoryPhoneAuth({
|
|
58
|
+
name,
|
|
59
|
+
cellPhoneNumber,
|
|
60
|
+
certificationNumber
|
|
61
|
+
});
|
|
62
|
+
return res;
|
|
63
|
+
});
|
|
64
|
+
const handleHistoryClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
+
// setPreviewState('history');
|
|
66
|
+
setViewState('history');
|
|
67
|
+
});
|
|
68
|
+
const handleBackClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
chatInquiryNumber && (yield startSelectedChat(chatInquiryNumber || ''));
|
|
70
|
+
setViewState('conversation');
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
handleChatHistoryClick,
|
|
74
|
+
handleNewStartChat,
|
|
75
|
+
handleHistoryClick,
|
|
76
|
+
handleGoRequestPhone,
|
|
77
|
+
handleGoHistoryPhoneAuth,
|
|
78
|
+
handleBackClick
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ViewState } from '../../ChatHomeView';
|
|
3
|
+
|
|
4
|
+
interface IHistoryProps {
|
|
5
|
+
// setIsLoading: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
setViewState: Dispatch<SetStateAction<ViewState>>;
|
|
7
|
+
attendRoomByHistory: (chatNumber: string) => any;
|
|
8
|
+
startSelectedChat: (chatNumber: string) => any;
|
|
9
|
+
createNewChat: () => any;
|
|
10
|
+
goRequestPhone: ({ name, cellPhoneNumber }: { name: string; cellPhoneNumber: string }) => any;
|
|
11
|
+
goHistoryPhoneAuth: ({
|
|
12
|
+
name,
|
|
13
|
+
cellPhoneNumber,
|
|
14
|
+
certificationNumber
|
|
15
|
+
}: {
|
|
16
|
+
name: string;
|
|
17
|
+
cellPhoneNumber: string;
|
|
18
|
+
certificationNumber: string;
|
|
19
|
+
}) => any;
|
|
20
|
+
chatInquiryNumber: string | null;
|
|
21
|
+
// setPreviewState: (state: ViewState) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const useHistoryView = ({
|
|
25
|
+
attendRoomByHistory,
|
|
26
|
+
startSelectedChat,
|
|
27
|
+
setViewState,
|
|
28
|
+
// setIsLoading,
|
|
29
|
+
createNewChat,
|
|
30
|
+
goRequestPhone,
|
|
31
|
+
goHistoryPhoneAuth,
|
|
32
|
+
// setPreviewState
|
|
33
|
+
chatInquiryNumber
|
|
34
|
+
}: IHistoryProps) => {
|
|
35
|
+
const handleChatHistoryClick = async (chatNumber: string) => {
|
|
36
|
+
try {
|
|
37
|
+
// setIsLoading(true);
|
|
38
|
+
const response = await attendRoomByHistory(chatNumber);
|
|
39
|
+
if (response?.result_info?.result_cd === 'OK' || response?.result_info?.result_type_cd === 'OK') {
|
|
40
|
+
await startSelectedChat(chatNumber);
|
|
41
|
+
setViewState('conversation');
|
|
42
|
+
}
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.error('e', e);
|
|
45
|
+
} finally {
|
|
46
|
+
// setIsLoading(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// 히스토리 + conversatoion 에서 사용
|
|
51
|
+
const handleNewStartChat = async () => {
|
|
52
|
+
try {
|
|
53
|
+
// setIsLoading(true);
|
|
54
|
+
// 채팅 시작 - 새 문의 생성 또는 기존 문의 조회 처리
|
|
55
|
+
await createNewChat();
|
|
56
|
+
// 대화 화면으로 전환
|
|
57
|
+
setViewState('conversation');
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error('신규 채팅 실패:', error);
|
|
60
|
+
} finally {
|
|
61
|
+
// setIsLoading(false);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// 히스토리 점유 인증번호 요청
|
|
66
|
+
const handleGoRequestPhone = async (name: string, cellPhoneNumber: string) => {
|
|
67
|
+
const res = await goRequestPhone({
|
|
68
|
+
name,
|
|
69
|
+
cellPhoneNumber
|
|
70
|
+
});
|
|
71
|
+
return res;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const handleGoHistoryPhoneAuth = async (name: string, cellPhoneNumber: string, certificationNumber: string) => {
|
|
75
|
+
const res = await goHistoryPhoneAuth({
|
|
76
|
+
name,
|
|
77
|
+
cellPhoneNumber,
|
|
78
|
+
certificationNumber
|
|
79
|
+
});
|
|
80
|
+
return res;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleHistoryClick = async () => {
|
|
84
|
+
// setPreviewState('history');
|
|
85
|
+
setViewState('history');
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const handleBackClick =async () => {
|
|
89
|
+
chatInquiryNumber && await startSelectedChat(chatInquiryNumber || '');
|
|
90
|
+
setViewState('conversation');
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
handleChatHistoryClick,
|
|
95
|
+
handleNewStartChat,
|
|
96
|
+
handleHistoryClick,
|
|
97
|
+
handleGoRequestPhone,
|
|
98
|
+
handleGoHistoryPhoneAuth,
|
|
99
|
+
handleBackClick
|
|
100
|
+
};
|
|
101
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ViewState } from '../../ChatHomeView';
|
|
3
|
+
import { IChatInquiryMainDataResponse } from '../../_api/daeryuntalk/type/response';
|
|
4
|
+
interface IHomeProps {
|
|
5
|
+
setIsLoading: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
setViewState: Dispatch<SetStateAction<ViewState>>;
|
|
7
|
+
retryInquiryMain: (channelNumber: string) => any;
|
|
8
|
+
inquiryMainData: IChatInquiryMainDataResponse | null;
|
|
9
|
+
startChat: (progressInquiryNumber?: string) => any;
|
|
10
|
+
preViewState: ViewState;
|
|
11
|
+
viewState: ViewState;
|
|
12
|
+
setPreviewState: (state: ViewState) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const useHomeView: ({ setIsLoading, setViewState, retryInquiryMain, inquiryMainData, startChat, preViewState, viewState, setPreviewState }: IHomeProps) => {
|
|
15
|
+
handleStartChat: () => Promise<void>;
|
|
16
|
+
handleHashStartChat: () => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
|
|
11
|
+
export const useHomeView = ({ setIsLoading, setViewState, retryInquiryMain, inquiryMainData, startChat, preViewState, viewState, setPreviewState }) => {
|
|
12
|
+
const toast = useDaeryunTalkToast();
|
|
13
|
+
const handleStartChat = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
try {
|
|
16
|
+
setIsLoading(true);
|
|
17
|
+
// 여기서 채널번호가 존재하지가 않음
|
|
18
|
+
const res = yield retryInquiryMain((inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_number) || '');
|
|
19
|
+
if (((_a = res === null || res === void 0 ? void 0 : res.result_info) === null || _a === void 0 ? void 0 : _a.result_cd) === 'OK' || ((_b = res === null || res === void 0 ? void 0 : res.result_info) === null || _b === void 0 ? void 0 : _b.result_type_cd) === 'OK') {
|
|
20
|
+
const startRes = yield startChat((_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.progress_inquiry_number);
|
|
21
|
+
if (startRes) {
|
|
22
|
+
// 대화 화면으로 전환
|
|
23
|
+
setViewState('conversation');
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
toast.error('문의 시작에 실패했습니다.');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
toast.error('채팅문의 시작에 실패했습니다.');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
console.error('채팅 시작 실패:', error);
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
setIsLoading(false);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const handleHashStartChat = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
setIsLoading(true);
|
|
43
|
+
yield startChat();
|
|
44
|
+
// 대화 화면으로 전환
|
|
45
|
+
setViewState('conversation');
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.error('채팅 시작 실패:', error);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
setIsLoading(false);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// const handleBackToHome = () => {
|
|
55
|
+
// if (preViewState === 'conversation') {
|
|
56
|
+
// setViewState('conversation');
|
|
57
|
+
// } else {
|
|
58
|
+
// setViewState('history');
|
|
59
|
+
// }
|
|
60
|
+
// };
|
|
61
|
+
return {
|
|
62
|
+
handleStartChat,
|
|
63
|
+
handleHashStartChat,
|
|
64
|
+
// handleBackToHome
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ViewState } from '../../ChatHomeView';
|
|
3
|
+
import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
|
|
4
|
+
import { IChatInquiryMainDataResponse } from '../../_api/daeryuntalk/type/response';
|
|
5
|
+
|
|
6
|
+
interface IHomeProps {
|
|
7
|
+
setIsLoading: Dispatch<SetStateAction<boolean>>;
|
|
8
|
+
setViewState: Dispatch<SetStateAction<ViewState>>;
|
|
9
|
+
retryInquiryMain: (channelNumber: string) => any;
|
|
10
|
+
inquiryMainData: IChatInquiryMainDataResponse | null;
|
|
11
|
+
startChat: (progressInquiryNumber?: string) => any;
|
|
12
|
+
preViewState: ViewState;
|
|
13
|
+
viewState: ViewState;
|
|
14
|
+
setPreviewState: (state: ViewState) => void;
|
|
15
|
+
}
|
|
16
|
+
export const useHomeView = ({
|
|
17
|
+
setIsLoading,
|
|
18
|
+
setViewState,
|
|
19
|
+
retryInquiryMain,
|
|
20
|
+
inquiryMainData,
|
|
21
|
+
startChat,
|
|
22
|
+
preViewState,
|
|
23
|
+
viewState,
|
|
24
|
+
setPreviewState
|
|
25
|
+
}: IHomeProps) => {
|
|
26
|
+
const toast = useDaeryunTalkToast();
|
|
27
|
+
const handleStartChat = async () => {
|
|
28
|
+
try {
|
|
29
|
+
setIsLoading(true);
|
|
30
|
+
// 여기서 채널번호가 존재하지가 않음
|
|
31
|
+
const res = await retryInquiryMain(inquiryMainData?.channel_number || '');
|
|
32
|
+
if (res?.result_info?.result_cd === 'OK' || res?.result_info?.result_type_cd === 'OK') {
|
|
33
|
+
const startRes = await startChat(res?.data?.progress_inquiry_number);
|
|
34
|
+
if (startRes) {
|
|
35
|
+
// 대화 화면으로 전환
|
|
36
|
+
setViewState('conversation');
|
|
37
|
+
} else {
|
|
38
|
+
toast.error('문의 시작에 실패했습니다.');
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
toast.error('채팅문의 시작에 실패했습니다.');
|
|
42
|
+
}
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error('채팅 시작 실패:', error);
|
|
45
|
+
} finally {
|
|
46
|
+
setIsLoading(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const handleHashStartChat = async () => {
|
|
51
|
+
try {
|
|
52
|
+
setIsLoading(true);
|
|
53
|
+
await startChat();
|
|
54
|
+
// 대화 화면으로 전환
|
|
55
|
+
setViewState('conversation');
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error('채팅 시작 실패:', error);
|
|
58
|
+
} finally {
|
|
59
|
+
setIsLoading(false);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
// const handleBackToHome = () => {
|
|
63
|
+
// if (preViewState === 'conversation') {
|
|
64
|
+
// setViewState('conversation');
|
|
65
|
+
// } else {
|
|
66
|
+
// setViewState('history');
|
|
67
|
+
// }
|
|
68
|
+
// };
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
handleStartChat,
|
|
72
|
+
handleHashStartChat,
|
|
73
|
+
// handleBackToHome
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChatInquiryDetailDataResponse, ChatMessage as ApiChatMessage } from '../_api/daeryuntalk/type/response';
|
|
2
|
+
import { Message } from '../_types/message';
|
|
3
|
+
import { MessageObject } from '../_types/message_object';
|
|
4
|
+
import { IInquiryWorkFlowUpdate } from '../_types/socket/workflow';
|
|
5
|
+
export declare const convertApiMessageToUiMessage: (apiMessage: ApiChatMessage, type: "live" | "basic" | "prev") => Message;
|
|
6
|
+
export declare const convertApiMessageObjectToUiMessageObject: (apiObject: ChatInquiryDetailDataResponse) => MessageObject;
|
|
7
|
+
export declare const convertSocketObjectToUiMessage: (obj: IInquiryWorkFlowUpdate) => MessageObject;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export const convertApiMessageToUiMessage = (apiMessage, type) => {
|
|
2
|
+
var _a, _b, _c;
|
|
3
|
+
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ type: type, messageNumber: apiMessage.message_number, plainText: apiMessage.plain_text,
|
|
4
|
+
// API에서 오는 모든 필드들
|
|
5
|
+
senderType: apiMessage.sender_type, messageType: apiMessage.message_type, messageStatus: apiMessage.message_status, userKey: apiMessage.user_key, inquiryNumber: apiMessage.inquiry_number, templateType: apiMessage.template_type, createdAt: new Date(apiMessage.created_at), updatedAt: apiMessage.updated_at ? new Date(apiMessage.updated_at) : undefined, language: apiMessage.language, timestamp: apiMessage.timestamp }, (apiMessage.rich_text && {
|
|
6
|
+
richText: {
|
|
7
|
+
version: ((_a = apiMessage.rich_text) === null || _a === void 0 ? void 0 : _a.version) || 0,
|
|
8
|
+
htmlContent: apiMessage.rich_text.html_content || '',
|
|
9
|
+
structuredData: ((_b = apiMessage === null || apiMessage === void 0 ? void 0 : apiMessage.rich_text) === null || _b === void 0 ? void 0 : _b.structured_data) || null
|
|
10
|
+
}
|
|
11
|
+
})), (apiMessage.blocks &&
|
|
12
|
+
apiMessage.blocks.length > 0 && {
|
|
13
|
+
blocks: apiMessage.blocks.map(block => (Object.assign({ type: block.type, value: block.value }, (block.icon_url && { iconUrl: block.icon_url }))))
|
|
14
|
+
})), (apiMessage.work_flow && {
|
|
15
|
+
workFlow: {
|
|
16
|
+
workFlowNumber: apiMessage.work_flow.work_flow_number,
|
|
17
|
+
optionExposureYn: apiMessage.work_flow.option_exposure_yn,
|
|
18
|
+
imageUrl: ((_c = apiMessage === null || apiMessage === void 0 ? void 0 : apiMessage.work_flow) === null || _c === void 0 ? void 0 : _c.image_url) || ''
|
|
19
|
+
}
|
|
20
|
+
})), (apiMessage.form && {
|
|
21
|
+
form: {
|
|
22
|
+
type: apiMessage.form.type,
|
|
23
|
+
inputs: apiMessage.form.inputs.length > 0
|
|
24
|
+
? apiMessage.form.inputs.map(item => {
|
|
25
|
+
return {
|
|
26
|
+
type: item.type,
|
|
27
|
+
label: item.label,
|
|
28
|
+
value: item.value,
|
|
29
|
+
readOnly: item.read_only,
|
|
30
|
+
bindingKey: item.binding_key
|
|
31
|
+
};
|
|
32
|
+
})
|
|
33
|
+
: [],
|
|
34
|
+
submittedAt: apiMessage.form.submitted_at || '',
|
|
35
|
+
submitButton: ''
|
|
36
|
+
}
|
|
37
|
+
})), (apiMessage.files && {
|
|
38
|
+
files: apiMessage.files.map(item => {
|
|
39
|
+
return {
|
|
40
|
+
fileNumber: item.file_number,
|
|
41
|
+
fileKey: item.file_key,
|
|
42
|
+
name: item.name,
|
|
43
|
+
type: item.type,
|
|
44
|
+
contentType: item.content_type,
|
|
45
|
+
size: item.size,
|
|
46
|
+
sequence: item.sequence,
|
|
47
|
+
thumbnailUrl: item.thumbnail_url,
|
|
48
|
+
originalUrl: item.original_url
|
|
49
|
+
};
|
|
50
|
+
})
|
|
51
|
+
}));
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
// API불러왔을 때용도
|
|
55
|
+
export const convertApiMessageObjectToUiMessageObject = (apiObject) => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
const result = {
|
|
58
|
+
exposeObjectListYn: apiObject.object_expose_info.expose_object_list_yn,
|
|
59
|
+
messageNumber: apiObject.object_expose_info.message_number,
|
|
60
|
+
workFlowNumber: apiObject.object_expose_info.work_flow_number,
|
|
61
|
+
objectList: (_a = apiObject === null || apiObject === void 0 ? void 0 : apiObject.object_expose_info.object_list) === null || _a === void 0 ? void 0 : _a.map(item => {
|
|
62
|
+
return {
|
|
63
|
+
objectNumber: item.object_number,
|
|
64
|
+
objectName: item.object_name,
|
|
65
|
+
iconImageUrl: item.icon_image_url,
|
|
66
|
+
sequence: item.sequence,
|
|
67
|
+
actionCode: item.action_code,
|
|
68
|
+
objectUiCode: item.object_ui_code,
|
|
69
|
+
linkUrl: (item === null || item === void 0 ? void 0 : item.link_url) || ''
|
|
70
|
+
};
|
|
71
|
+
}),
|
|
72
|
+
// work_flow_progress_stack 이걸로 통일 예정
|
|
73
|
+
workFlowProgressStack: (_b = apiObject === null || apiObject === void 0 ? void 0 : apiObject.work_flow_progress_stack) !== null && _b !== void 0 ? _b : [],
|
|
74
|
+
objectGroupUiCode: (apiObject === null || apiObject === void 0 ? void 0 : apiObject.object_expose_info.object_group_ui_code) || ''
|
|
75
|
+
};
|
|
76
|
+
return result;
|
|
77
|
+
};
|
|
78
|
+
// 소켓으로 받았을 떄용도
|
|
79
|
+
export const convertSocketObjectToUiMessage = (obj) => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
const result = {
|
|
82
|
+
exposeObjectListYn: true,
|
|
83
|
+
messageNumber: obj.message_number,
|
|
84
|
+
workFlowNumber: (obj === null || obj === void 0 ? void 0 : obj.work_flow_progress_stack)
|
|
85
|
+
? obj.work_flow_progress_stack[obj.work_flow_progress_stack.length - 1] || ''
|
|
86
|
+
: '',
|
|
87
|
+
objectList: (_a = obj === null || obj === void 0 ? void 0 : obj.object_list) === null || _a === void 0 ? void 0 : _a.map(item => {
|
|
88
|
+
return {
|
|
89
|
+
objectNumber: item.object_number,
|
|
90
|
+
objectName: item.object_name,
|
|
91
|
+
iconImageUrl: item.icon_image_url,
|
|
92
|
+
sequence: item.sequence,
|
|
93
|
+
actionCode: item.action_code,
|
|
94
|
+
objectUiCode: item.object_ui_code,
|
|
95
|
+
linkUrl: (item === null || item === void 0 ? void 0 : item.link_url) || ''
|
|
96
|
+
};
|
|
97
|
+
}),
|
|
98
|
+
// work_flow_progress_stack 이걸로 통일 예정
|
|
99
|
+
workFlowProgressStack: (_b = obj === null || obj === void 0 ? void 0 : obj.work_flow_progress_stack) !== null && _b !== void 0 ? _b : [],
|
|
100
|
+
objectGroupUiCode: (obj === null || obj === void 0 ? void 0 : obj.object_group_ui_code) || ''
|
|
101
|
+
};
|
|
102
|
+
return result;
|
|
103
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { ChatInquiryDetailDataResponse, ChatMessage as ApiChatMessage } from '../_api/daeryuntalk/type/response';
|
|
2
|
+
import { FormInputType, Message } from '../_types/message';
|
|
3
|
+
import { MessageObject } from '../_types/message_object';
|
|
4
|
+
import { IInquiryWorkFlowUpdate } from '../_types/socket/workflow';
|
|
5
|
+
|
|
6
|
+
export const convertApiMessageToUiMessage = (apiMessage: ApiChatMessage, type: 'live' | 'basic' | 'prev'): Message => {
|
|
7
|
+
const result: Message = {
|
|
8
|
+
type: type,
|
|
9
|
+
messageNumber: apiMessage.message_number,
|
|
10
|
+
plainText: apiMessage.plain_text,
|
|
11
|
+
|
|
12
|
+
// API에서 오는 모든 필드들
|
|
13
|
+
senderType: apiMessage.sender_type,
|
|
14
|
+
messageType: apiMessage.message_type,
|
|
15
|
+
messageStatus: apiMessage.message_status,
|
|
16
|
+
userKey: apiMessage.user_key,
|
|
17
|
+
inquiryNumber: apiMessage.inquiry_number,
|
|
18
|
+
templateType: apiMessage.template_type,
|
|
19
|
+
createdAt: new Date(apiMessage.created_at),
|
|
20
|
+
updatedAt: apiMessage.updated_at ? new Date(apiMessage.updated_at) : undefined,
|
|
21
|
+
language: apiMessage.language,
|
|
22
|
+
timestamp: apiMessage.timestamp,
|
|
23
|
+
|
|
24
|
+
// 팁탭 에디터 데이터
|
|
25
|
+
...(apiMessage.rich_text && {
|
|
26
|
+
richText: {
|
|
27
|
+
version: apiMessage.rich_text?.version || 0,
|
|
28
|
+
htmlContent: apiMessage.rich_text.html_content || '',
|
|
29
|
+
structuredData: apiMessage?.rich_text?.structured_data || null
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
// 블록 관련
|
|
34
|
+
...(apiMessage.blocks &&
|
|
35
|
+
apiMessage.blocks.length > 0 && {
|
|
36
|
+
blocks: apiMessage.blocks.map(block => ({
|
|
37
|
+
type: block.type,
|
|
38
|
+
value: block.value,
|
|
39
|
+
...(block.icon_url && { iconUrl: block.icon_url })
|
|
40
|
+
}))
|
|
41
|
+
}),
|
|
42
|
+
...(apiMessage.work_flow && {
|
|
43
|
+
workFlow: {
|
|
44
|
+
workFlowNumber: apiMessage.work_flow.work_flow_number,
|
|
45
|
+
optionExposureYn: apiMessage.work_flow.option_exposure_yn,
|
|
46
|
+
imageUrl: apiMessage?.work_flow?.image_url || ''
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
...(apiMessage.form && {
|
|
50
|
+
form: {
|
|
51
|
+
type: apiMessage.form.type,
|
|
52
|
+
inputs:
|
|
53
|
+
apiMessage.form.inputs.length > 0
|
|
54
|
+
? apiMessage.form.inputs.map(item => {
|
|
55
|
+
return {
|
|
56
|
+
type: item.type as FormInputType,
|
|
57
|
+
label: item.label,
|
|
58
|
+
value: item.value,
|
|
59
|
+
readOnly: item.read_only,
|
|
60
|
+
bindingKey: item.binding_key
|
|
61
|
+
};
|
|
62
|
+
})
|
|
63
|
+
: [],
|
|
64
|
+
submittedAt: apiMessage.form.submitted_at || '',
|
|
65
|
+
submitButton: ''
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
...(apiMessage.files && {
|
|
69
|
+
files: apiMessage.files.map(item => {
|
|
70
|
+
return {
|
|
71
|
+
fileNumber: item.file_number,
|
|
72
|
+
fileKey: item.file_key,
|
|
73
|
+
name: item.name,
|
|
74
|
+
type: item.type,
|
|
75
|
+
contentType: item.content_type,
|
|
76
|
+
size: item.size,
|
|
77
|
+
sequence: item.sequence,
|
|
78
|
+
thumbnailUrl: item.thumbnail_url,
|
|
79
|
+
originalUrl: item.original_url
|
|
80
|
+
};
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
};
|
|
84
|
+
return result;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// API불러왔을 때용도
|
|
88
|
+
export const convertApiMessageObjectToUiMessageObject = (apiObject: ChatInquiryDetailDataResponse): MessageObject => {
|
|
89
|
+
const result: MessageObject = {
|
|
90
|
+
exposeObjectListYn: apiObject.object_expose_info.expose_object_list_yn,
|
|
91
|
+
messageNumber: apiObject.object_expose_info.message_number,
|
|
92
|
+
workFlowNumber: apiObject.object_expose_info.work_flow_number,
|
|
93
|
+
objectList: apiObject?.object_expose_info.object_list?.map(item => {
|
|
94
|
+
return {
|
|
95
|
+
objectNumber: item.object_number,
|
|
96
|
+
objectName: item.object_name,
|
|
97
|
+
iconImageUrl: item.icon_image_url,
|
|
98
|
+
sequence: item.sequence,
|
|
99
|
+
actionCode: item.action_code,
|
|
100
|
+
objectUiCode: item.object_ui_code,
|
|
101
|
+
linkUrl: item?.link_url || ''
|
|
102
|
+
};
|
|
103
|
+
}),
|
|
104
|
+
// work_flow_progress_stack 이걸로 통일 예정
|
|
105
|
+
workFlowProgressStack: apiObject?.work_flow_progress_stack ?? [],
|
|
106
|
+
objectGroupUiCode: apiObject?.object_expose_info.object_group_ui_code || ''
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return result;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// 소켓으로 받았을 떄용도
|
|
113
|
+
export const convertSocketObjectToUiMessage = (obj: IInquiryWorkFlowUpdate): MessageObject => {
|
|
114
|
+
const result: MessageObject = {
|
|
115
|
+
exposeObjectListYn: true,
|
|
116
|
+
messageNumber: obj.message_number,
|
|
117
|
+
workFlowNumber: obj?.work_flow_progress_stack
|
|
118
|
+
? obj.work_flow_progress_stack[obj.work_flow_progress_stack.length - 1] || ''
|
|
119
|
+
: '',
|
|
120
|
+
objectList: obj?.object_list?.map(item => {
|
|
121
|
+
return {
|
|
122
|
+
objectNumber: item.object_number,
|
|
123
|
+
objectName: item.object_name,
|
|
124
|
+
iconImageUrl: item.icon_image_url,
|
|
125
|
+
sequence: item.sequence,
|
|
126
|
+
actionCode: item.action_code,
|
|
127
|
+
objectUiCode: item.object_ui_code,
|
|
128
|
+
linkUrl: item?.link_url || ''
|
|
129
|
+
};
|
|
130
|
+
}),
|
|
131
|
+
// work_flow_progress_stack 이걸로 통일 예정
|
|
132
|
+
workFlowProgressStack: obj?.work_flow_progress_stack ?? [],
|
|
133
|
+
objectGroupUiCode: obj?.object_group_ui_code || ''
|
|
134
|
+
};
|
|
135
|
+
return result;
|
|
136
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const formatFileSize: (size: number) => string;
|
|
2
|
+
export declare const formatDateToKorean: (timestamp: string) => string;
|
|
3
|
+
export declare const onlyNumbers: (phoneNumber: string) => string;
|
|
4
|
+
export declare const isEmptyHtml: (html: string | null | undefined) => boolean;
|
|
5
|
+
export declare const phoneCheck: (value: string) => {
|
|
6
|
+
phoneNumber: string;
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const nameFilter: (value: string) => {
|
|
10
|
+
name: string;
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const formatSecondsToMMSS: (seconds: number) => string;
|
|
14
|
+
export declare const formatTimestamp: (timestamp: string) => string;
|
|
15
|
+
export declare const stripHtmlTags: (input: string) => boolean;
|
|
16
|
+
export declare const decodeDoubleEscapedHtml: (escaped: string) => string;
|
|
17
|
+
export declare const consoleFn: (...args: any[]) => void;
|