@droppii-org/chat-sdk 0.0.35 → 0.0.37

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.
Files changed (55) hide show
  1. package/dist/components/conversation/ConversationBySessionItem.js +2 -1
  2. package/dist/components/conversation/DeskConversationList.d.ts.map +1 -1
  3. package/dist/components/conversation/DeskConversationList.js +15 -1
  4. package/dist/components/message/MessageHeader.d.ts +9 -0
  5. package/dist/components/message/MessageHeader.d.ts.map +1 -1
  6. package/dist/components/message/MessageHeader.js +122 -2
  7. package/dist/components/message/SelectSession.d.ts +9 -0
  8. package/dist/components/message/SelectSession.d.ts.map +1 -0
  9. package/dist/components/message/SelectSession.js +21 -0
  10. package/dist/components/message/footer/ToolbarPlugin.js +7 -7
  11. package/dist/components/message/item/TextMessage.js +2 -2
  12. package/dist/components/message/item/index.d.ts.map +1 -1
  13. package/dist/components/message/item/index.js +3 -5
  14. package/dist/components/session/DeskAssignedSession.d.ts.map +1 -1
  15. package/dist/components/session/DeskAssignedSession.js +38 -26
  16. package/dist/constants/index.d.ts +1 -12
  17. package/dist/constants/index.d.ts.map +1 -1
  18. package/dist/constants/index.js +1 -12
  19. package/dist/context/ChatContext.d.ts.map +1 -1
  20. package/dist/context/ChatContext.js +2 -1
  21. package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
  22. package/dist/hooks/global/useGlobalEvent.js +15 -1
  23. package/dist/hooks/message/useMessage.d.ts.map +1 -1
  24. package/dist/hooks/message/useMessage.js +19 -5
  25. package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
  26. package/dist/hooks/message/useSendMessage.js +14 -1
  27. package/dist/hooks/session/useGetSession.d.ts.map +1 -1
  28. package/dist/hooks/session/useGetSession.js +1 -0
  29. package/dist/hooks/session/useUpdateSession.d.ts +10 -0
  30. package/dist/hooks/session/useUpdateSession.d.ts.map +1 -0
  31. package/dist/hooks/session/useUpdateSession.js +19 -0
  32. package/dist/hooks/user/useAuth.d.ts.map +1 -1
  33. package/dist/hooks/user/useAuth.js +13 -10
  34. package/dist/layout/index.d.ts.map +1 -1
  35. package/dist/layout/index.js +0 -2
  36. package/dist/locales/vi/common.json +10 -2
  37. package/dist/services/query.d.ts +1 -0
  38. package/dist/services/query.d.ts.map +1 -1
  39. package/dist/services/query.js +1 -0
  40. package/dist/services/routes.d.ts +1 -0
  41. package/dist/services/routes.d.ts.map +1 -1
  42. package/dist/services/routes.js +1 -0
  43. package/dist/store/session.js +2 -2
  44. package/dist/styles/global.css +1 -1
  45. package/dist/types/chat.d.ts +20 -1
  46. package/dist/types/chat.d.ts.map +1 -1
  47. package/dist/types/chat.js +22 -0
  48. package/dist/types/dto.d.ts +20 -3
  49. package/dist/types/dto.d.ts.map +1 -1
  50. package/dist/utils/common.d.ts +2 -1
  51. package/dist/utils/common.d.ts.map +1 -1
  52. package/dist/utils/common.js +7 -2
  53. package/dist/utils/events.d.ts +2 -0
  54. package/dist/utils/events.d.ts.map +1 -1
  55. package/package.json +1 -1
@@ -1,12 +1,13 @@
1
1
  import { useEffect } from "react";
2
2
  import { DChatSDK } from "../../constants/sdk";
3
3
  import { CbEvents, MessageType, SessionType, } from "@openim/wasm-client-sdk";
4
- import { ConnectStatus, CustomType, SyncStatus } from "../../types/chat";
4
+ import { BusinessNotificationType, ConnectStatus, CustomType, SyncStatus, } from "../../types/chat";
5
5
  import { pushNewMessage, updateOneMessage } from "../message/useMessage";
6
6
  import { useChatContext } from "../../context/ChatContext";
7
7
  import useConversationStore from "../../store/conversation";
8
8
  import useAuthStore from "../../store/auth";
9
9
  import { useRefetchChatToken } from "../../hooks/init/useChatToken";
10
+ import { updateSession } from "../session/useUpdateSession";
10
11
  const notPushType = [MessageType.TypingMessage, MessageType.RevokeMessage];
11
12
  export const useGlobalEvent = () => {
12
13
  const { user } = useChatContext();
@@ -120,6 +121,15 @@ export const useGlobalEvent = () => {
120
121
  const syncFailedHandler = () => {
121
122
  updateSyncStatus(SyncStatus.Failed);
122
123
  };
124
+ const businessNotificationHandler = ({ data, }) => {
125
+ switch (data.key) {
126
+ case BusinessNotificationType.SESSION_STATE_UPDATED:
127
+ updateSession(JSON.parse(data.data || "{}"));
128
+ break;
129
+ default:
130
+ break;
131
+ }
132
+ };
123
133
  const setIMListener = () => {
124
134
  //account
125
135
  DChatSDK.on(CbEvents.OnUserTokenExpired, userTokenHandler);
@@ -138,6 +148,8 @@ export const useGlobalEvent = () => {
138
148
  // conversation
139
149
  DChatSDK.on(CbEvents.OnConversationChanged, conversationChangeHandler);
140
150
  DChatSDK.on(CbEvents.OnNewConversation, newConversationHandler);
151
+ //busines notification
152
+ DChatSDK.on(CbEvents.OnRecvCustomBusinessMessage, businessNotificationHandler);
141
153
  };
142
154
  const disposeIMListener = () => {
143
155
  //account
@@ -156,6 +168,8 @@ export const useGlobalEvent = () => {
156
168
  // conversation
157
169
  DChatSDK.off(CbEvents.OnConversationChanged, conversationChangeHandler);
158
170
  DChatSDK.off(CbEvents.OnNewConversation, newConversationHandler);
171
+ //busines notification
172
+ DChatSDK.off(CbEvents.OnRecvCustomBusinessMessage, businessNotificationHandler);
159
173
  };
160
174
  // conversation
161
175
  const conversationChangeHandler = ({ data }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"useMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQ7E,eAAO,MAAM,kBAAkB,eAa9B,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,gBAAgB,MAAM,EACtB,oBAAoB,MAAM;;;;;qBAML,WAAW,EAAE;;;;;;qBAAb,WAAW,EAAE;;;;;;CAmMnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,SACpB,CAAC;AAChC,eAAO,MAAM,gBAAgB,GAAI,SAAS,WAAW,SACpB,CAAC;AAElC,eAAO,MAAM,kBAAkB,GAC7B,aAAa,WAAW,EAAE,EAC1B,SAAS,WAAW,EACpB,WAAW,MAAM,GAAG,MAAM,KACzB,WAAW,GAAG,SAiBhB,CAAC"}
1
+ {"version":3,"file":"useMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQ7E,eAAO,MAAM,kBAAkB,eAa9B,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,gBAAgB,MAAM,EACtB,oBAAoB,MAAM;;;;;qBAML,WAAW,EAAE;;;;;;qBAAb,WAAW,EAAE;;;;;;CAsMnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,SACpB,CAAC;AAChC,eAAO,MAAM,gBAAgB,GAAI,SAAS,WAAW,SACpB,CAAC;AAElC,eAAO,MAAM,kBAAkB,GAC7B,aAAa,WAAW,EAAE,EAC1B,SAAS,WAAW,EACpB,WAAW,MAAM,GAAG,MAAM,KACzB,WAAW,GAAG,SAkBhB,CAAC"}
@@ -42,10 +42,11 @@ export const useMessage = (conversationId, searchClientMsgID) => {
42
42
  if (conversationId !== reqConversationID)
43
43
  return;
44
44
  setTimeout(() => setLoadState((preState) => {
45
- const messageList = [
45
+ let messageList = [
46
46
  ...(loadMore ? preState.messageList : []),
47
47
  ...data.messageList.toReversed(),
48
48
  ];
49
+ messageList = removeDuplicateMessages(messageList);
49
50
  return Object.assign(Object.assign({}, preState), { initLoading: false, hasMoreOld: !data.isEnd, messageList });
50
51
  }));
51
52
  }, {
@@ -65,10 +66,11 @@ export const useMessage = (conversationId, searchClientMsgID) => {
65
66
  if (conversationId !== reqConversationID)
66
67
  return;
67
68
  setTimeout(() => setLoadState((preState) => {
68
- const messageList = [
69
+ let messageList = [
69
70
  ...data.messageList.toReversed(),
70
71
  ...(loadMore ? preState.messageList : []),
71
72
  ];
73
+ messageList = removeDuplicateMessages(messageList);
72
74
  return Object.assign(Object.assign({}, preState), { initLoading: false, hasMoreNew: !data.isEnd, messageList });
73
75
  }));
74
76
  }, {
@@ -102,11 +104,12 @@ export const useMessage = (conversationId, searchClientMsgID) => {
102
104
  return;
103
105
  setTimeout(() => {
104
106
  setLoadState((preState) => {
105
- const messageList = [
107
+ let messageList = [
106
108
  ...dataNext.messageList.toReversed(),
107
109
  ...currentMessages,
108
110
  ...dataPrev.messageList.toReversed(),
109
111
  ];
112
+ messageList = removeDuplicateMessages(messageList);
110
113
  return Object.assign(Object.assign({}, preState), { initLoading: false, hasMoreOld: !dataPrev.isEnd, hasMoreNew: !dataNext.isEnd, messageList });
111
114
  });
112
115
  });
@@ -178,13 +181,24 @@ export const getVisibleNeighbor = (allMessages, current, direction) => {
178
181
  const currentIndex = allMessages.findIndex((m) => m.clientMsgID === current.clientMsgID);
179
182
  if (currentIndex === -1)
180
183
  return undefined;
181
- let index = direction === "prev" ? currentIndex + 1 : currentIndex - 1;
184
+ const step = direction === "prev" ? 1 : -1;
185
+ let index = currentIndex + step;
182
186
  while (index >= 0 && index < allMessages.length) {
183
187
  const candidate = allMessages[index];
184
188
  if (visibleTypeMessage.includes(candidate.contentType)) {
185
189
  return candidate;
186
190
  }
187
- index = direction === "prev" ? index - 1 : index + 1;
191
+ index += step;
188
192
  }
189
193
  return undefined;
190
194
  };
195
+ const removeDuplicateMessages = (messages) => {
196
+ const seen = new Set();
197
+ return messages.filter((msg) => {
198
+ if (seen.has(msg.clientMsgID)) {
199
+ return false;
200
+ }
201
+ seen.add(msg.clientMsgID);
202
+ return true;
203
+ });
204
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useSendMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,WAAW,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EA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MAAM,mBAAmB,gCAatE,CAAC;AAEF,eAAO,MAAM,cAAc;gDAiCpB;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB;wDAmCE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,UAAU,EAAE,CAAC;KACrB;CAyGJ,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,eAEvC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,KAUM,iBACN,CAAC"}
@@ -7,6 +7,7 @@ import { pushNewMessage, updateOneMessage } from "./useMessage";
7
7
  import { emit } from "../../utils/events";
8
8
  import useConversationStore from "../../store/conversation";
9
9
  import useAuthStore from "../../store/auth";
10
+ import { extractLinks } from "../../utils/common";
10
11
  export const createTextMessage = async (text) => {
11
12
  let textMessage = await DChatSDK.createTextMessage(text, new Date().getTime().toString())
12
13
  .then(({ data }) => {
@@ -90,7 +91,19 @@ export const useSendMessage = () => {
90
91
  const extendMessageInfo = generateExtendMessageInfo({
91
92
  richText,
92
93
  });
93
- const messageItem = Object.assign(Object.assign({}, textMessage), { ex: JSON.stringify(extendMessageInfo) || "{}" });
94
+ const urls = extractLinks(plainText);
95
+ const isUrlMessage = urls.length > 0;
96
+ let messageItem = Object.assign(Object.assign({}, textMessage), { ex: JSON.stringify(extendMessageInfo) || "{}" });
97
+ // if (isUrlMessage) {
98
+ // messageItem = {
99
+ // ...messageItem,
100
+ // contentType: CustomMessageType.URL,
101
+ // content: JSON.stringify({
102
+ // content: plainText,
103
+ // url: urls,
104
+ // }),
105
+ // } as unknown as MessageItem;
106
+ // }
94
107
  sendMessage(messageItem);
95
108
  }, [recvID, groupID, user, sendMessage]);
96
109
  const sendMergeMessage = useCallback(async ({ richText, plainText, files, }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"useGetSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/session/useGetSession.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAA+B,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOpE,eAAO,MAAM,aAAa,GACxB,QAAQ,cAAc,EACtB,UAAU;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FhC,CAAC"}
1
+ {"version":3,"file":"useGetSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/session/useGetSession.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAA+B,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOpE,eAAO,MAAM,aAAa,GACxB,QAAQ,cAAc,EACtB,UAAU;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FhC,CAAC"}
@@ -33,6 +33,7 @@ export const useGetSession = (filter, options) => {
33
33
  page: pageParam,
34
34
  pageSize: (options === null || options === void 0 ? void 0 : options.pageSize) || PAGE_SIZE,
35
35
  searchTerm: filter.searchTerm,
36
+ conversationIds: filter.conversationIds,
36
37
  };
37
38
  const res = await apiInstance.post(ENDPOINTS.chatService.getSessionsByTagOrStatus, params);
38
39
  //FIND NEW CONVERSATIONS
@@ -0,0 +1,10 @@
1
+ import { UpdateSessionResponse } from "../../types/dto";
2
+ interface UpdateSessionParams {
3
+ sessionId: string;
4
+ status?: string;
5
+ tag?: string;
6
+ }
7
+ export declare const useUpdateSession: () => import("@tanstack/react-query").UseMutationResult<any, Error, UpdateSessionParams, unknown>;
8
+ export declare const updateSession: (data: UpdateSessionResponse) => void;
9
+ export {};
10
+ //# sourceMappingURL=useUpdateSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/session/useUpdateSession.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,gBAAgB,mGAczB,CAAC;AAEL,eAAO,MAAM,aAAa,GAAI,MAAM,qBAAqB,SAC3B,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { useMutation } from "@tanstack/react-query";
3
+ import { QUERY_KEYS } from "../../services/query";
4
+ import { apiInstance } from "../../services/api";
5
+ import { ENDPOINTS } from "../../services/routes";
6
+ import useAuthStore from "../../store/auth";
7
+ import { emit } from "../../utils/events";
8
+ export const useUpdateSession = () => useMutation({
9
+ mutationKey: [QUERY_KEYS.UPDATE_SESSION],
10
+ mutationFn: async ({ sessionId, status, tag }) => {
11
+ const res = await apiInstance.put(ENDPOINTS.chatService.updateSession(sessionId), {
12
+ status,
13
+ tag,
14
+ applicationType: useAuthStore.getState().applicationType,
15
+ });
16
+ return res.data;
17
+ },
18
+ });
19
+ export const updateSession = (data) => emit("UPDATE_SESSION", data);
@@ -1 +1 @@
1
- {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/user/useAuth.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;CAwBxB,CAAC"}
1
+ {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/user/useAuth.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;CAyBxB,CAAC"}
@@ -7,16 +7,19 @@ export const useDChatAuth = () => {
7
7
  const initAuthStore = useAuthStore((state) => state.initAuthStore);
8
8
  const resetConversationStore = useConversationStore((state) => state.resetConversationStore);
9
9
  const logout = async () => {
10
- await Promise.resolve(resetConversationStore());
11
- await Promise.resolve(initAuthStore({
12
- chatToken: "",
13
- accessToken: "",
14
- apiAddress: "",
15
- wsAddress: "",
16
- platformID: Platform.Web,
17
- userID: "",
18
- applicationType: DChatApplicationType.OBEFE,
19
- }));
10
+ const results = await Promise.allSettled([
11
+ DChatSDK.deleteAllMsgFromLocal(),
12
+ resetConversationStore(),
13
+ initAuthStore({
14
+ chatToken: "",
15
+ accessToken: "",
16
+ apiAddress: "",
17
+ wsAddress: "",
18
+ platformID: Platform.Web,
19
+ userID: "",
20
+ applicationType: DChatApplicationType.OBEFE,
21
+ }),
22
+ ]);
20
23
  const res = await DChatSDK.logout();
21
24
  return res;
22
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.tsx"],"names":[],"mappings":"AAKA,OAAO,iBAAiB,CAAC;AAOzB,UAAU,eAAe;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AACD,QAAA,MAAM,UAAU,GAAI,cAAc,eAAe,4CAMhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.tsx"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,CAAC;AAKzB,UAAU,eAAe;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AACD,QAAA,MAAM,UAAU,GAAI,cAAc,eAAe,4CAKhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -3,11 +3,9 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useGlobalEvent } from "../hooks/global/useGlobalEvent";
4
4
  import dayjs from "dayjs";
5
5
  import "dayjs/locale/vi";
6
- import { useChatContext } from "../context/ChatContext";
7
6
  import { useSyncUsersInfo } from "../hooks/user/useUsersInfo";
8
7
  dayjs.locale("vi");
9
8
  const MainLayout = ({ children }) => {
10
- const { syncStatus, connectStatus } = useChatContext();
11
9
  useGlobalEvent();
12
10
  useSyncUsersInfo();
13
11
  return _jsx(_Fragment, { children: children });
@@ -17,11 +17,19 @@
17
17
  "unassigned": "Chưa phân công",
18
18
  "waiting_process": "Chờ xử lý",
19
19
  "in_process": "Đang xử lý",
20
- "completed": "Đã đóng",
20
+ "completed": "Hoàn thành",
21
21
  "awaiting_reply": "Chưa trả lời",
22
22
  "slow_processing": "Chậm xử lý",
23
23
  "temporarily_paused": "Tạm chờ",
24
24
  "see_more": "Xem thêm",
25
25
  "err_get_conversation": "Lỗi khi lấy thông tin cuộc trò chuyện",
26
- "enter_message": "Nhập tin nhắn"
26
+ "enter_message": "Nhập tin nhắn",
27
+ "update_session_status_title": "Cập nhật status",
28
+ "update_session_tag_title": "Cập nhật tag",
29
+ "cancel": "Hủy",
30
+ "update": "Cập nhật",
31
+ "update_session_status_failed": "Cập nhật status không thành công",
32
+ "update_session_tag_failed": "Cập nhật tag không thành công",
33
+ "customer": "Khách hàng",
34
+ "you": "Bạn"
27
35
  }
@@ -3,5 +3,6 @@ export declare const QUERY_KEYS: {
3
3
  GET_SESSION_SUMMARY: string;
4
4
  GET_SESSION_BY_TAG_OR_STATUS: string;
5
5
  SEARCH_MESSAGE: string;
6
+ UPDATE_SESSION: string;
6
7
  };
7
8
  //# sourceMappingURL=query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/services/query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;CAKtB,CAAC"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/services/query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC"}
@@ -3,4 +3,5 @@ export const QUERY_KEYS = {
3
3
  GET_SESSION_SUMMARY: "GET_SESSION_SUMMARY",
4
4
  GET_SESSION_BY_TAG_OR_STATUS: "GET_SESSION_BY_TAG_OR_STATUS",
5
5
  SEARCH_MESSAGE: "SEARCH_MESSAGE",
6
+ UPDATE_SESSION: "UPDATE_SESSION",
6
7
  };
@@ -4,6 +4,7 @@ export declare const ENDPOINTS: {
4
4
  getSessionSummary: string;
5
5
  getSessionsByTagOrStatus: string;
6
6
  searchMessage: string;
7
+ updateSession: (sessionId: string) => string;
7
8
  };
8
9
  identityService: {
9
10
  getToken: string;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/services/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/services/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;mCAMS,MAAM;;;;;;;;CASpC,CAAC"}
@@ -4,6 +4,7 @@ export const ENDPOINTS = {
4
4
  getSessionSummary: "chat-service/v1/crm/sessions/assigned/summary",
5
5
  getSessionsByTagOrStatus: "chat-service/v1/crm/sessions/assigned/query",
6
6
  searchMessage: "chat-service/v1/messages/search",
7
+ updateSession: (sessionId) => `chat-service/v1/crm/sessions/${sessionId}`,
7
8
  },
8
9
  identityService: {
9
10
  getToken: "/identity-service/v1/identity/get-token",
@@ -1,8 +1,8 @@
1
1
  import { create } from "zustand";
2
- import { SESSION_STATUS_ENUM } from "../constants";
2
+ import { SessionStatus } from "../types/chat";
3
3
  const useSessionStore = create((set, get) => ({
4
4
  filterSummary: {
5
- status: SESSION_STATUS_ENUM.IN_PROCESS,
5
+ status: SessionStatus.IN_PROCESS,
6
6
  tag: undefined,
7
7
  },
8
8
  setFilterSummary: (filterSummary) => set({ filterSummary }),
@@ -1 +1 @@
1
- *,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-7{left:1.75rem}.right-\[-8px\]{right:-8px}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-\[-8px\]{top:-8px}.\!z-\[9999\]{z-index:9999!important}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-\[-4px\]{margin-bottom:-4px}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.grid{display:grid}.aspect-square{aspect-ratio:1/1}.\!h-full{height:100%!important}.h-5{height:1.25rem}.h-8{height:2rem}.h-\[32px\]{height:32px}.h-\[36px\]{height:36px}.h-\[48px\]{height:48px}.h-\[600px\]{height:600px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-\[140px\]{max-height:140px}.min-h-\[64px\]{min-height:64px}.w-1{width:.25rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-80{width:20rem}.w-\[320px\]{width:320px}.w-\[32px\]{width:32px}.w-\[36px\]{width:36px}.w-\[400px\]{width:400px}.w-\[48px\]{width:48px}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-\[0\.8\]{flex:0.8}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.-translate-y-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-px{gap:1px}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-indigo-500{--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.bg-black\/30{background-color:rgba(0,0,0,.3)}.bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-2{padding-bottom:.5rem}.pl-4{padding-left:1rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-right{text-align:right}.\!align-\[-4px\]{vertical-align:-4px!important}.\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.\!text-amber-500{--tw-text-opacity:1!important;color:rgb(245 158 11/var(--tw-text-opacity,1))!important}.\!text-orange-400{--tw-text-opacity:1!important;color:rgb(251 146 60/var(--tw-text-opacity,1))!important}.\!text-purple-500{--tw-text-opacity:1!important;color:rgb(168 85 247/var(--tw-text-opacity,1))!important}.\!text-red-500{--tw-text-opacity:1!important;color:rgb(239 68 68/var(--tw-text-opacity,1))!important}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ant-tabs-tab{margin:0!important;min-width:80px!important;justify-content:center!important;align-items:center!important}.ant-tabs-content,.ant-tabs-content-holder,.ant-tabs-tabpane{height:100%}.zoom-in-out-element{animation:zoom-in-zoom-out 1.5s ease none}@keyframes zoom-in-zoom-out{0%{scale:100%}25%{scale:125%}50%{scale:100%}75%{scale:125%}to{scale:100%}}.hover\:rounded-sm:hover{border-radius:.125rem}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.hover\:bg-gray-600:hover{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\:text-base{font-size:1rem;line-height:1.5rem}}
1
+ *,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-7{left:1.75rem}.right-\[-8px\]{right:-8px}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-\[-8px\]{top:-8px}.\!z-\[9999\]{z-index:9999!important}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-\[-4px\]{margin-bottom:-4px}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.grid{display:grid}.aspect-square{aspect-ratio:1/1}.\!h-full{height:100%!important}.h-2{height:.5rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-\[32px\]{height:32px}.h-\[36px\]{height:36px}.h-\[48px\]{height:48px}.h-\[600px\]{height:600px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-\[140px\]{max-height:140px}.min-h-\[64px\]{min-height:64px}.w-1{width:.25rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-80{width:20rem}.w-\[320px\]{width:320px}.w-\[32px\]{width:32px}.w-\[36px\]{width:36px}.w-\[400px\]{width:400px}.w-\[48px\]{width:48px}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\[64px\]{min-width:64px}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-\[0\.8\]{flex:0.8}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.-translate-y-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-px{gap:1px}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-indigo-500{--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.bg-amber-100{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(245 158 11/var(--tw-bg-opacity,1))}.bg-black\/30{background-color:rgba(0,0,0,.3)}.bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity,1))}.bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity,1))}.bg-orange-500{--tw-bg-opacity:1;background-color:rgb(249 115 22/var(--tw-bg-opacity,1))}.bg-purple-100{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity,1))}.bg-purple-500{--tw-bg-opacity:1;background-color:rgb(168 85 247/var(--tw-bg-opacity,1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-2{padding-bottom:.5rem}.pl-4{padding-left:1rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-right{text-align:right}.\!align-\[-4px\]{vertical-align:-4px!important}.\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.\!text-amber-500{--tw-text-opacity:1!important;color:rgb(245 158 11/var(--tw-text-opacity,1))!important}.\!text-orange-400{--tw-text-opacity:1!important;color:rgb(251 146 60/var(--tw-text-opacity,1))!important}.\!text-purple-500{--tw-text-opacity:1!important;color:rgb(168 85 247/var(--tw-text-opacity,1))!important}.\!text-red-500{--tw-text-opacity:1!important;color:rgb(239 68 68/var(--tw-text-opacity,1))!important}.text-amber-500{--tw-text-opacity:1;color:rgb(245 158 11/var(--tw-text-opacity,1))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.text-purple-500{--tw-text-opacity:1;color:rgb(168 85 247/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ant-tabs-tab{margin:0!important;min-width:80px!important;justify-content:center!important;align-items:center!important}.ant-tabs-content,.ant-tabs-content-holder,.ant-tabs-tabpane{height:100%}.zoom-in-out-element{animation:zoom-in-zoom-out 1.5s ease none}@keyframes zoom-in-zoom-out{0%{scale:100%}25%{scale:125%}50%{scale:100%}75%{scale:125%}to{scale:100%}}.no-transform{transform:none!important;perspective:none!important;filter:none!important}.hover\:rounded-sm:hover{border-radius:.125rem}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.hover\:bg-gray-600:hover{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\:text-base{font-size:1rem;line-height:1.5rem}}
@@ -1,4 +1,4 @@
1
- import { FileMsgParamsByURL, ImageMsgParamsByURL, Platform, SelfUserInfo, VideoMsgParamsByURL } from "@openim/wasm-client-sdk";
1
+ import { FileMsgParamsByURL, ImageMsgParamsByURL, MessageType, Platform, SelfUserInfo, VideoMsgParamsByURL } from "@openim/wasm-client-sdk";
2
2
  import { UploadFile } from "antd";
3
3
  export declare enum DChatApplicationType {
4
4
  OBEFE = "OBEFE"
@@ -20,6 +20,10 @@ export declare enum CustomType {
20
20
  CallingCancel = 203,
21
21
  CallingHungup = 204
22
22
  }
23
+ export declare enum CustomMessageType {
24
+ URL = 160
25
+ }
26
+ export type DChatMessageType = CustomMessageType | MessageType;
23
27
  export interface ChatContextType {
24
28
  user: SelfUserInfo | null;
25
29
  connectStatus: ConnectStatus;
@@ -94,4 +98,19 @@ export interface DChatInitAndLoginConfig {
94
98
  userID: string;
95
99
  applicationType: DChatApplicationType;
96
100
  }
101
+ export declare enum SessionStatus {
102
+ UNASSIGNED = "UNASSIGNED",
103
+ WAITING_PROCESS = "WAITING_PROCESS",
104
+ IN_PROCESS = "IN_PROCESS",
105
+ COMPLETED = "COMPLETED"
106
+ }
107
+ export declare enum SessionTag {
108
+ NONE = "NONE",
109
+ SLOW_PROCESSING = "SLOW_PROCESSING",
110
+ AWAITING_REPLY = "AWAITING_REPLY",
111
+ TEMPORARILY_PAUSED = "TEMPORARILY_PAUSED"
112
+ }
113
+ export declare enum BusinessNotificationType {
114
+ SESSION_STATE_UPDATED = "SESSION_STATE_UPDATED"
115
+ }
97
116
  //# sourceMappingURL=chat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,oBAAY,oBAAoB;IAC9B,KAAK,UAAU;CAChB;AAED,oBAAY,aAAa;IACvB,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,UAAU,IAAI;CACf;AAED,oBAAY,UAAU;IACpB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,oBAAY,UAAU;IACpB,aAAa,MAAM;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C,qBAAqB,0BAA0B;CAChD"}
@@ -22,3 +22,25 @@ export var CustomType;
22
22
  CustomType[CustomType["CallingCancel"] = 203] = "CallingCancel";
23
23
  CustomType[CustomType["CallingHungup"] = 204] = "CallingHungup";
24
24
  })(CustomType || (CustomType = {}));
25
+ export var CustomMessageType;
26
+ (function (CustomMessageType) {
27
+ CustomMessageType[CustomMessageType["URL"] = 160] = "URL";
28
+ })(CustomMessageType || (CustomMessageType = {}));
29
+ export var SessionStatus;
30
+ (function (SessionStatus) {
31
+ SessionStatus["UNASSIGNED"] = "UNASSIGNED";
32
+ SessionStatus["WAITING_PROCESS"] = "WAITING_PROCESS";
33
+ SessionStatus["IN_PROCESS"] = "IN_PROCESS";
34
+ SessionStatus["COMPLETED"] = "COMPLETED";
35
+ })(SessionStatus || (SessionStatus = {}));
36
+ export var SessionTag;
37
+ (function (SessionTag) {
38
+ SessionTag["NONE"] = "NONE";
39
+ SessionTag["SLOW_PROCESSING"] = "SLOW_PROCESSING";
40
+ SessionTag["AWAITING_REPLY"] = "AWAITING_REPLY";
41
+ SessionTag["TEMPORARILY_PAUSED"] = "TEMPORARILY_PAUSED";
42
+ })(SessionTag || (SessionTag = {}));
43
+ export var BusinessNotificationType;
44
+ (function (BusinessNotificationType) {
45
+ BusinessNotificationType["SESSION_STATE_UPDATED"] = "SESSION_STATE_UPDATED";
46
+ })(BusinessNotificationType || (BusinessNotificationType = {}));
@@ -1,6 +1,6 @@
1
1
  import { MessageItem, MessageType } from "@openim/wasm-client-sdk";
2
- import { SessionStatus, SessionStatusItem, Tag, TagItem } from "../store/type";
3
- import { DChatApplicationType } from "./chat";
2
+ import { SessionStatusItem, TagItem } from "../store/type";
3
+ import { BusinessNotificationType, DChatApplicationType, SessionStatus, SessionTag } from "./chat";
4
4
  export interface BaseResponse<T> {
5
5
  statusCode: number;
6
6
  message: any;
@@ -37,10 +37,27 @@ export interface ISessionSummaryResponse {
37
37
  }
38
38
  export interface SessionByTagOrStatusRequest {
39
39
  applicationType: DChatApplicationType;
40
- tag?: Tag;
40
+ tag?: SessionTag;
41
41
  status?: SessionStatus;
42
42
  page: number;
43
43
  pageSize: number;
44
44
  searchTerm?: string;
45
+ conversationIds?: string[];
46
+ }
47
+ export interface UpdateSessionResponse {
48
+ id: string;
49
+ botId: string;
50
+ ownerId: string;
51
+ supporterId?: string;
52
+ conversationId: string;
53
+ status: SessionStatus;
54
+ startSeq: number;
55
+ endSeq: number;
56
+ tag: SessionTag;
57
+ applicationType: DChatApplicationType;
58
+ }
59
+ export interface BusinessNotification<T> {
60
+ data: T;
61
+ key: BusinessNotificationType;
45
62
  }
46
63
  //# sourceMappingURL=dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../src/types/dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eA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,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,wBAAwB,CAAC;CAC/B"}
@@ -1,9 +1,10 @@
1
1
  export declare function renderFileSize(bytes: number): string;
2
- export declare const parseLatestMessage: (latestMsg: string, currentUserId?: string) => string;
2
+ export declare const parseLatestMessage: (latestMsg: string, currentUserId?: string, t?: any) => string;
3
3
  export declare const highlightSearch: (text: string, keyword: string, maxLength?: number) => string;
4
4
  interface FormatOptions {
5
5
  hasTime?: boolean;
6
6
  }
7
7
  export declare function formatTimestamp(timestamp: number, options?: FormatOptions): string;
8
+ export declare function extractLinks(text: string): string[];
8
9
  export {};
9
10
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAapD;AAED,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,EACjB,gBAAgB,MAAM,WAgCvB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,kBAAc,WA2Cf,CAAC;AAEF,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAiBR"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAapD;AAED,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,EACjB,gBAAgB,MAAM,EACtB,IAAI,GAAG,WAgCR,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,kBAAc,WA2Cf,CAAC;AAEF,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAiBR;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKnD"}
@@ -12,7 +12,7 @@ export function renderFileSize(bytes) {
12
12
  }
13
13
  return `${size.toFixed(1)} ${units[index]}`;
14
14
  }
15
- export const parseLatestMessage = (latestMsg, currentUserId) => {
15
+ export const parseLatestMessage = (latestMsg, currentUserId, t) => {
16
16
  var _a;
17
17
  if (!latestMsg)
18
18
  return "";
@@ -20,7 +20,7 @@ export const parseLatestMessage = (latestMsg, currentUserId) => {
20
20
  const msgData = JSON.parse(latestMsg);
21
21
  const contentType = msgData === null || msgData === void 0 ? void 0 : msgData.contentType;
22
22
  const isMe = currentUserId && msgData.sendID === currentUserId;
23
- const sender = isMe ? "Me" : (msgData === null || msgData === void 0 ? void 0 : msgData.senderNickname) || msgData.sendID;
23
+ const sender = isMe ? t("you") : t("customer");
24
24
  switch (contentType) {
25
25
  case MessageType.TextMessage:
26
26
  if ((_a = msgData.textElem) === null || _a === void 0 ? void 0 : _a.content) {
@@ -93,3 +93,8 @@ export function formatTimestamp(timestamp, options) {
93
93
  // khác năm
94
94
  return hasTime ? date.format(`HH:mm DD/MM YYYY`) : date.format("DD/MM YYYY");
95
95
  }
96
+ export function extractLinks(text) {
97
+ // Regex match http:// hoặc https:// và domain
98
+ const urlRegex = /(https?:\/\/[^\s]+)/g;
99
+ return text.match(urlRegex) || [];
100
+ }
@@ -1,9 +1,11 @@
1
1
  import { MessageItem } from "@openim/wasm-client-sdk";
2
+ import { UpdateSessionResponse } from "../types/dto";
2
3
  type EmitterEvents = {
3
4
  CHAT_LIST_SCROLL_TO_BOTTOM: void;
4
5
  CHAT_LIST_SCROLL_TO_MESSAGE: string;
5
6
  PUSH_NEW_MSG: MessageItem;
6
7
  UPDATE_ONE_MSG: MessageItem;
8
+ UPDATE_SESSION: UpdateSessionResponse;
7
9
  };
8
10
  declare const emitter: import("mitt").Emitter<EmitterEvents>;
9
11
  export declare const emit: {
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,KAAK,aAAa,GAAG;IACnB,0BAA0B,EAAE,IAAI,CAAC;IACjC,2BAA2B,EAAE,MAAM,CAAC;IAEpC,YAAY,EAAE,WAAW,CAAC;IAC1B,cAAc,EAAE,WAAW,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,OAAO,uCAAwB,CAAC;AAEtC,eAAO,MAAM,IAAI;;;CAAe,CAAC;AAEjC,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,KAAK,aAAa,GAAG;IACnB,0BAA0B,EAAE,IAAI,CAAC;IACjC,2BAA2B,EAAE,MAAM,CAAC;IAEpC,YAAY,EAAE,WAAW,CAAC;IAC1B,cAAc,EAAE,WAAW,CAAC;IAE5B,cAAc,EAAE,qBAAqB,CAAC;CACvC,CAAC;AAEF,QAAA,MAAM,OAAO,uCAAwB,CAAC;AAEtC,eAAO,MAAM,IAAI;;;CAAe,CAAC;AAEjC,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-sdk",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "Droppii React Chat SDK",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",