@esvndev/es-react-template-chat 0.0.42 → 0.0.44
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/store/index.d.ts +3 -145
- package/dist/index.js +3 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -22
- package/dist/index.mjs.map +1 -1
- package/dist/request/chat/index.d.ts +28 -3
- package/dist/request/index.d.ts +50 -33
- package/dist/utility/stores/uploadFile.d.ts +5 -15
- package/package.json +3 -4
|
@@ -1,145 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
name?: string;
|
|
5
|
-
phone?: string;
|
|
6
|
-
email?: string;
|
|
7
|
-
address?: string;
|
|
8
|
-
avatar?: string;
|
|
9
|
-
gender?: string;
|
|
10
|
-
lastLogin?: string;
|
|
11
|
-
currentSession?: string;
|
|
12
|
-
status?: number;
|
|
13
|
-
isFriend?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface IFState {
|
|
16
|
-
checkInit: boolean;
|
|
17
|
-
chatRoomId?: string;
|
|
18
|
-
contactId?: string;
|
|
19
|
-
userLogin?: IUser;
|
|
20
|
-
listContact?: any;
|
|
21
|
-
typeChat: string;
|
|
22
|
-
active?: string;
|
|
23
|
-
loadChat?: number;
|
|
24
|
-
messageByGroup: any;
|
|
25
|
-
listHistory: any;
|
|
26
|
-
listChatType: any;
|
|
27
|
-
archiveStore: any[];
|
|
28
|
-
checkScroll: boolean;
|
|
29
|
-
listGeneralGroup: any;
|
|
30
|
-
pinnedMessages: any[];
|
|
31
|
-
typingUsers: any;
|
|
32
|
-
}
|
|
33
|
-
export declare const get_history: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
|
|
34
|
-
export declare const appChatSlice: import("@reduxjs/toolkit").Slice<IFState, {
|
|
35
|
-
selectChat(state: import("immer").WritableDraft<IFState>, action: {
|
|
36
|
-
payload: any;
|
|
37
|
-
type: string;
|
|
38
|
-
}): void;
|
|
39
|
-
selectContact(state: import("immer").WritableDraft<IFState>, action: {
|
|
40
|
-
payload: any;
|
|
41
|
-
type: string;
|
|
42
|
-
}): void;
|
|
43
|
-
selectType(state: import("immer").WritableDraft<IFState>, action: {
|
|
44
|
-
payload: any;
|
|
45
|
-
type: string;
|
|
46
|
-
}): void;
|
|
47
|
-
selectActive(state: import("immer").WritableDraft<IFState>, action: {
|
|
48
|
-
payload: any;
|
|
49
|
-
type: string;
|
|
50
|
-
}): void;
|
|
51
|
-
selectLoadChat(state: import("immer").WritableDraft<IFState>, action: {
|
|
52
|
-
payload: any;
|
|
53
|
-
type: string;
|
|
54
|
-
}): void;
|
|
55
|
-
selectByGroup(state: import("immer").WritableDraft<IFState>, action: {
|
|
56
|
-
payload: any;
|
|
57
|
-
type: string;
|
|
58
|
-
}): void;
|
|
59
|
-
setScroll(state: import("immer").WritableDraft<IFState>, action: {
|
|
60
|
-
payload: any;
|
|
61
|
-
type: string;
|
|
62
|
-
}): void;
|
|
63
|
-
addNewMessage(state: import("immer").WritableDraft<IFState>, action: {
|
|
64
|
-
payload: any;
|
|
65
|
-
type: string;
|
|
66
|
-
}): void;
|
|
67
|
-
addPinnedMessage(state: import("immer").WritableDraft<IFState>, action: {
|
|
68
|
-
payload: any;
|
|
69
|
-
type: string;
|
|
70
|
-
}): void;
|
|
71
|
-
deleteMessage(state: import("immer").WritableDraft<IFState>, action: {
|
|
72
|
-
payload: any;
|
|
73
|
-
type: string;
|
|
74
|
-
}): void;
|
|
75
|
-
setCountUnread(state: import("immer").WritableDraft<IFState>, action: {
|
|
76
|
-
payload: any;
|
|
77
|
-
type: string;
|
|
78
|
-
}): void;
|
|
79
|
-
setHistory(state: import("immer").WritableDraft<IFState>, action: {
|
|
80
|
-
payload: any;
|
|
81
|
-
type: string;
|
|
82
|
-
}): void;
|
|
83
|
-
setMessageByGroup(state: import("immer").WritableDraft<IFState>, action: {
|
|
84
|
-
payload: any;
|
|
85
|
-
type: string;
|
|
86
|
-
}): void;
|
|
87
|
-
updateMemberGroup(state: import("immer").WritableDraft<IFState>, action: {
|
|
88
|
-
payload: any;
|
|
89
|
-
type: string;
|
|
90
|
-
}): void;
|
|
91
|
-
removeChatRoom(state: import("immer").WritableDraft<IFState>, action: {
|
|
92
|
-
payload: any;
|
|
93
|
-
type: string;
|
|
94
|
-
}): void;
|
|
95
|
-
leaveGroup(state: import("immer").WritableDraft<IFState>, action: {
|
|
96
|
-
payload: any;
|
|
97
|
-
type: string;
|
|
98
|
-
}): void;
|
|
99
|
-
getGeneralGroup(state: import("immer").WritableDraft<IFState>, action: {
|
|
100
|
-
payload: any;
|
|
101
|
-
type: string;
|
|
102
|
-
}): void;
|
|
103
|
-
setGeneralGroup(state: import("immer").WritableDraft<IFState>, action: {
|
|
104
|
-
payload: any;
|
|
105
|
-
type: string;
|
|
106
|
-
}): void;
|
|
107
|
-
getNotification(state: import("immer").WritableDraft<IFState>, action: {
|
|
108
|
-
payload: any;
|
|
109
|
-
type: string;
|
|
110
|
-
}): void;
|
|
111
|
-
setListChatType(state: import("immer").WritableDraft<IFState>, action: {
|
|
112
|
-
payload: any;
|
|
113
|
-
type: string;
|
|
114
|
-
}): void;
|
|
115
|
-
setArchive(state: import("immer").WritableDraft<IFState>, action: {
|
|
116
|
-
payload: any;
|
|
117
|
-
type: string;
|
|
118
|
-
}): void;
|
|
119
|
-
setApproveStatus(state: import("immer").WritableDraft<IFState>, action: {
|
|
120
|
-
payload: any;
|
|
121
|
-
type: string;
|
|
122
|
-
}): void;
|
|
123
|
-
editGroupName(state: import("immer").WritableDraft<IFState>, action: {
|
|
124
|
-
payload: any;
|
|
125
|
-
type: string;
|
|
126
|
-
}): void;
|
|
127
|
-
editGroupAvatar(state: import("immer").WritableDraft<IFState>, action: {
|
|
128
|
-
payload: any;
|
|
129
|
-
type: string;
|
|
130
|
-
}): void;
|
|
131
|
-
editGroupTag(state: import("immer").WritableDraft<IFState>, action: {
|
|
132
|
-
payload: any;
|
|
133
|
-
type: string;
|
|
134
|
-
}): void;
|
|
135
|
-
userTyping(state: import("immer").WritableDraft<IFState>, action: {
|
|
136
|
-
payload: any;
|
|
137
|
-
type: string;
|
|
138
|
-
}): void;
|
|
139
|
-
recallMessage(state: import("immer").WritableDraft<IFState>, action: {
|
|
140
|
-
payload: any;
|
|
141
|
-
type: string;
|
|
142
|
-
}): void;
|
|
143
|
-
}, "appChat", "appChat", import("@reduxjs/toolkit").SliceSelectors<IFState>>;
|
|
144
|
-
export declare const selectChat: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/selectChat">, selectContact: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/selectContact">, selectType: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/selectType">, selectActive: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/selectActive">, selectLoadChat: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/selectLoadChat">, selectByGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/selectByGroup">, addNewMessage: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/addNewMessage">, setCountUnread: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/setCountUnread">, deleteMessage: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/deleteMessage">, recallMessage: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/recallMessage">, getNotification: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/getNotification">, removeChatRoom: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/removeChatRoom">, setListChatType: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/setListChatType">, setArchive: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/setArchive">, setApproveStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/setApproveStatus">, setHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/setHistory">, editGroupName: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/editGroupName">, setScroll: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/setScroll">, updateMemberGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/updateMemberGroup">, setMessageByGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/setMessageByGroup">, leaveGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/leaveGroup">, getGeneralGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/getGeneralGroup">, setGeneralGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/setGeneralGroup">, editGroupAvatar: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/editGroupAvatar">, editGroupTag: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/editGroupTag">, addPinnedMessage: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/addPinnedMessage">, userTyping: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "appChat/userTyping">;
|
|
145
|
-
export {};
|
|
1
|
+
export declare const get_history: any;
|
|
2
|
+
export declare const appChatSlice: any;
|
|
3
|
+
export declare const selectChat: any, selectContact: any, selectType: any, selectActive: any, selectLoadChat: any, selectByGroup: any, addNewMessage: any, setCountUnread: any, deleteMessage: any, recallMessage: any, getNotification: any, removeChatRoom: any, setListChatType: any, setArchive: any, setApproveStatus: any, setHistory: any, editGroupName: any, setScroll: any, updateMemberGroup: any, setMessageByGroup: any, leaveGroup: any, getGeneralGroup: any, setGeneralGroup: any, editGroupAvatar: any, editGroupTag: any, addPinnedMessage: any, userTyping: any;
|
package/dist/index.js
CHANGED
|
@@ -26242,17 +26242,6 @@ const encodeUUID = (uuid) => {
|
|
|
26242
26242
|
}
|
|
26243
26243
|
};
|
|
26244
26244
|
|
|
26245
|
-
const getToken = () => {
|
|
26246
|
-
let accessToken = localStorage.getItem('access_token');
|
|
26247
|
-
if (!accessToken) {
|
|
26248
|
-
const userData = localStorage.getItem('userData');
|
|
26249
|
-
if (userData && userData.length) {
|
|
26250
|
-
accessToken = JSON.parse(userData).id_token;
|
|
26251
|
-
}
|
|
26252
|
-
}
|
|
26253
|
-
return accessToken;
|
|
26254
|
-
};
|
|
26255
|
-
|
|
26256
26245
|
// ** Redux Imports
|
|
26257
26246
|
// Convert 1 bản ghi PinMessage từ backend thành object message dùng cho UI ghim
|
|
26258
26247
|
const mapPinRecordToMessage = (record) => {
|
|
@@ -26315,13 +26304,6 @@ const get_history = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, asyn
|
|
|
26315
26304
|
return thunkAPI.rejectWithValue({ error: error.message });
|
|
26316
26305
|
}
|
|
26317
26306
|
});
|
|
26318
|
-
// export const get_history = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
|
|
26319
|
-
// try {
|
|
26320
|
-
// return await api.chatApi.getHistory(params)
|
|
26321
|
-
// } catch (error: any) {
|
|
26322
|
-
// return thunkAPI.rejectWithValue({ error: error.response.data })
|
|
26323
|
-
// }
|
|
26324
|
-
// })
|
|
26325
26307
|
// export const get_message_by_group_cursor = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_MESSAGE_BY_GROUP_CURSOR, async (params, thunkAPI) => {
|
|
26326
26308
|
// try {
|
|
26327
26309
|
// return await api.chatApi.getMessageByGroupCursor(params.chatRoomId, params)
|
|
@@ -26793,7 +26775,6 @@ const appChatSlice = toolkit.createSlice({
|
|
|
26793
26775
|
}
|
|
26794
26776
|
},
|
|
26795
26777
|
extraReducers: builder => {
|
|
26796
|
-
console.log('extraReducers', builder);
|
|
26797
26778
|
// builder.addCase(contact_add.fulfilled, (state: IFState) => {
|
|
26798
26779
|
// state.checkInit = !state.checkInit
|
|
26799
26780
|
// })
|
|
@@ -26824,9 +26805,9 @@ const appChatSlice = toolkit.createSlice({
|
|
|
26824
26805
|
// builder.addCase(update_chat_room_member.fulfilled, (state: IFState) => {
|
|
26825
26806
|
// state.checkInit = !state.checkInit
|
|
26826
26807
|
// })
|
|
26827
|
-
builder.addCase(get_history.fulfilled, (state, action) => {
|
|
26828
|
-
|
|
26829
|
-
})
|
|
26808
|
+
// builder.addCase(get_history.fulfilled, (state: IFState, action) => {
|
|
26809
|
+
// state.listHistory = action.payload?.items
|
|
26810
|
+
// })
|
|
26830
26811
|
// builder.addCase(getPinMessageChatRoomApi.fulfilled, (state: IFState, action) => {
|
|
26831
26812
|
// // Backend trả về danh sách PinMessage (mảng / items / data)
|
|
26832
26813
|
// const payload = action.payload as any
|