@esvndev/es-react-template-chat 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -26205,39 +26205,6 @@ const CHAT = {
26205
26205
  UPDATE_GROUP_TAG_API: `${BASE_URL}/api/chat/update-group-tag`
26206
26206
  }
26207
26207
  };
26208
- const UPLOADFILE = {
26209
- ACTION_TYPES: {
26210
- UPLOAD_FILE: 'UPLOADFILE/UPLOAD_FILE',
26211
- UPLOAD_IMAGE: 'UPLOADFILE/UPLOAD_IMAGE',
26212
- UPLOAD_FILE_MULTI: 'UPLOADFILE/UPLOAD_FILE_MULTI',
26213
- UPLOAD_IMAGE_MULTI: 'UPLOADFILE/UPLOAD_IMAGE_MULTI'
26214
- },
26215
- URL_API: {
26216
- UPLOAD_FILE_API: `${BASE_URL}/api/file/upload`,
26217
- UPLOAD_IMAGE_API: `${BASE_URL}/api/image/upload`,
26218
- EDITOR_UPLOAD_IMAGE: `${BASE_URL}/api/image/editor-upload`,
26219
- UPLOAD_FILE_MULTI_API: `${BASE_URL}/api/file/upload-mutil`,
26220
- UPLOAD_IMAGE_MULTI_API: `${BASE_URL}/api/image/upload-mutil`
26221
- }
26222
- };
26223
- const FORM_CONFIG = {
26224
- ACTION_TYPES: {
26225
- GET_ALL: 'FORM_CONFIG/GET_ALL',
26226
- GET_BY_ID: 'FORM_CONFIG/GET_BY_ID',
26227
- GET_BY_TYPE: 'FORM_CONFIG/GET_BY_TYPE',
26228
- ADD: 'FORM_CONFIG/ADD',
26229
- UPDATE: 'FORM_CONFIG/UPDATE',
26230
- DELETE: 'FORM_CONFIG/DELETE'
26231
- },
26232
- URL_API: {
26233
- GET_ALL_API: `${BASE_URL}/api/formconfig`,
26234
- GET_BY_ID_API: `${BASE_URL}/api/formconfig`,
26235
- GET_BY_TYPE_API: `${BASE_URL}/api/formconfig/type`,
26236
- ADD_API: `${BASE_URL}/api/formconfig`,
26237
- UPDATE_API: `${BASE_URL}/api/formconfig`,
26238
- DELETE_API: `${BASE_URL}/api/formconfig`
26239
- }
26240
- };
26241
26208
 
26242
26209
  function bind$4(fn, thisArg) {
26243
26210
  return function wrap() {
@@ -45778,47 +45745,6 @@ const encodeUUID = (uuid) => {
45778
45745
  }
45779
45746
  };
45780
45747
 
45781
- // import requester from '../requester'
45782
- // import { AxiosRequestConfig } from 'axios'
45783
- // import { getToken } from '../auth'
45784
- // import { CHAT } from '../../domain/constants'
45785
- // const { URL_API } = CHAT
45786
- // const config: AxiosRequestConfig = {
45787
- // headers: {
45788
- // Authorization: `Bearer ${getToken()}`
45789
- // }
45790
- // }
45791
- const chatApi = {
45792
- //getHistoryActive: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config),
45793
- //getHistory: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config),
45794
- getHistory: (params) => {
45795
- console.log('getHistory params', params);
45796
- },
45797
- // getMessageByGroupCursor: (id:string, params: any) => requester.get(`${URL_API.GET_MESSAGE_BY_GROUP_CURSOR_API}/${id}`, params, config),
45798
- // getInfo: (params: any) => requester.get(URL_API.GET_INFO_API, params, config),
45799
- // groups: (params: any) => requester.post(URL_API.GROUP_API, params, config),
45800
- // addMemberGroup: (params: any) => requester.post(`${URL_API.ADD_MEMBER_GROUP}`, params, config),
45801
- // senMessage: (id: string, params: any, tickerDto?: any) => requester.post(`${URL_API.SEN_MESSAGE_API}/${id}`, { ...params, tickerDto }, config),
45802
- // deleteMessage: (id: string, chatRoomId: string) => requester.delete(`${URL_API.MESSAGE_API}/${chatRoomId}/delete-message/${id}`, {}, config),
45803
- // recallMessage: (id: string, chatRoomId: string) => requester.put(`${URL_API.MESSAGE_API}/${chatRoomId}/recall-message/${id}`, {}, config),
45804
- // updateGroupAvatar: (params: any) => requester.put(URL_API.UPDATE_GROUP_AVATAR_API, params, config),
45805
- // getMessageByGroup: (params: any, paging: any) => requester.get(`${URL_API.GET_MESSAGE_BY_GROUP_API}/${params}`, paging, config),
45806
- // getMessageByContact: (params: any, paging: any) => requester.get(`${URL_API.GET_MESSAGE_BY_CONTACT_API}/${params}`, paging, config),
45807
- // contactAdd: (params: any) => requester.post(URL_API.CONTACT_ADD_API, params, config),
45808
- // getProfile: () => requester.get(URL_API.GET_PROFILE, {}, config),
45809
- // getUsers: (params: any) => requester.get(URL_API.GET_USERS, params, config),
45810
- // getContact: (params: any) => requester.get(URL_API.GET_CONTACT_API, params, config),
45811
- // updateChatRoomMember: (params: any) => requester.put(`${URL_API.CHAT_ROOM_MEMBER_API}/${params}`, {}, config),
45812
- // getPagingEmployeeApi: (params: any) => requester.get(URL_API.GET_PAGING_EMPLOYEE_API, params, config),
45813
- // connectChatRoomMemberApi: (params: any) => requester.post(URL_API.CONNECT_CHAT_ROOM_MEMBER_API, params, config),
45814
- // pinMessageChatRoomApi: (params: any) => requester.post(`${URL_API.PIN_MESSAGE_CHAT_ROOM_API}/${params.id}`, params, config),
45815
- // getPinMessagesByRoomApi: (chatRoomId: string) => requester.get(`${URL_API.GET_PIN_MESSAGE_CHAT_ROOM_API}/${chatRoomId}`, {}, config),
45816
- // deletePinMessageApi: (pinId: string) => requester.delete(`${URL_API.PIN_MESSAGE_CHAT_ROOM_API}/${pinId}`, {}, config),
45817
- // updateGroupTagApi: (params: any) => requester.put(URL_API.UPDATE_GROUP_TAG_API, params, config),
45818
- // createReminderApi: (params: any) => requester.post(URL_API.CREATE_REMINDER_API, params, config)
45819
- };
45820
- var chatApi$1 = { chatApi };
45821
-
45822
45748
  const responseBody = (response) => response.data;
45823
45749
  const requester = {
45824
45750
  get: (url, params = {}, config = {}) => axios$1.get(url, { params, ...config }).then(responseBody),
@@ -45841,126 +45767,42 @@ const getToken = () => {
45841
45767
  return accessToken;
45842
45768
  };
45843
45769
 
45844
- const config$1 = {
45845
- headers: {
45846
- Authorization: `Bearer ${getToken()}`
45847
- }
45848
- };
45849
- /**
45850
- * Dynamic API - API động cho ModalDynamic
45851
- * Hỗ trợ gọi API động dựa trên config từ server
45852
- */
45853
- const dynamicApi = {
45854
- /**
45855
- * Gọi API POST động
45856
- * @param url - Endpoint URL
45857
- * @param params - Body data
45858
- */
45859
- post: (url, params) => requester.post(`${BASE_URL}${url}`, params, config$1),
45860
- /**
45861
- * Gọi API GET động
45862
- * @param url - Endpoint URL
45863
- * @param params - Query params
45864
- */
45865
- get: (url, params) => requester.get(`${BASE_URL}${url}`, params || {}, config$1),
45866
- /**
45867
- * Gọi API PUT động
45868
- * @param url - Endpoint URL
45869
- * @param params - Body data
45870
- */
45871
- put: (url, params) => requester.put(`${BASE_URL}${url}`, params, config$1),
45872
- /**
45873
- * Gọi API DELETE động
45874
- * @param url - Endpoint URL
45875
- * @param params - Query params
45876
- */
45877
- delete: (url, params) => requester.delete(`${BASE_URL}/${url}`, params || {}, config$1),
45878
- /**
45879
- * Lấy form config từ server
45880
- * @param formType - Loại form (tasks, leaveApplication, etc.)
45881
- */
45882
- getFormConfig: (formType) => requester.get(`/api/form-config/${formType}`, {}, config$1),
45883
- /**
45884
- * Lấy options cho combobox từ server
45885
- * @param optionType - Loại option (employees, departments, etc.)
45886
- * @param params - Query params (filter, search, etc.)
45887
- */
45888
- getOptions: (optionType, params) => requester.get(`/api/options/${optionType}`, params || {}, config$1),
45889
- /**
45890
- * Lấy danh sách nhân viên
45891
- * @param params - Query params (departmentId, search, etc.)
45892
- */
45893
- getEmployees: (params) => requester.get('/api/employees/list-box', params || {}, config$1),
45894
- /**
45895
- * Lấy danh sách phòng ban
45896
- */
45897
- getDepartments: (params) => requester.get('/api/departments/list-box', params || {}, config$1),
45898
- /**
45899
- * Lấy danh sách Priority Level
45900
- */
45901
- getPriorityLevels: () => requester.get('/api/priority-levels/list-box', {}, config$1),
45902
- /**
45903
- * Lấy danh sách Status
45904
- */
45905
- getStatuses: (module) => requester.get(`/api/statuses/list-box/${module}`, {}, config$1),
45906
- /**
45907
- * Lấy danh sách Labels/Tags
45908
- */
45909
- getLabels: (module) => requester.get(`/api/labels/list-box/${module}`, {}, config$1),
45910
- /**
45911
- * Lấy danh sách Categories
45912
- */
45913
- getCategories: (module) => requester.get(`/api/categories/list-box/${module}`, {}, config$1),
45914
- /**
45915
- * Lấy danh sách Group Tasks
45916
- */
45917
- getGroupTasks: (params) => requester.get('/api/group-tasks/list-box', params || {}, config$1)
45918
- };
45919
- var dynamicApi$1 = { dynamicApi };
45920
-
45921
- const { URL_API } = FORM_CONFIG;
45770
+ // import requester from '../requester'
45771
+ const { URL_API } = CHAT;
45922
45772
  const config = {
45923
45773
  headers: {
45924
45774
  Authorization: `Bearer ${getToken()}`
45925
45775
  }
45926
45776
  };
45927
- const formConfigApi = {
45928
- getAll: () => requester.get(URL_API.GET_ALL_API, {}, config),
45929
- getById: (id) => requester.get(`${URL_API.GET_BY_ID_API}/${id}`, {}, config),
45930
- getByType: (type) => requester.get(`${URL_API.GET_BY_TYPE_API}/${type}`, {}, config),
45931
- create: (params) => requester.post(URL_API.ADD_API, params, config),
45932
- update: (id, params) => requester.put(`${URL_API.UPDATE_API}/${id}`, params, config),
45933
- delete: (id) => requester.delete(`${URL_API.DELETE_API}/${id}`, {}, config)
45934
- };
45935
- var formConfigApi$1 = { formConfigApi };
45936
-
45937
- const fileApi = {
45938
- uploadFile: (params, progressEvent) => requester.post(UPLOADFILE.URL_API.UPLOAD_FILE_API, params, {
45939
- headers: {
45940
- Authorization: `Bearer ${getToken()}`
45941
- },
45942
- onUploadProgress: progressEvent
45943
- }),
45944
- uploadMultiFile: (params, progressEvent) => requester.post(UPLOADFILE.URL_API.UPLOAD_FILE_MULTI_API, params, {
45945
- headers: {
45946
- Authorization: `Bearer ${getToken()}`
45947
- },
45948
- onUploadProgress: progressEvent
45949
- }),
45950
- uploadImage: (params, progressEvent) => requester.post(UPLOADFILE.URL_API.UPLOAD_IMAGE_API, params, {
45951
- headers: {
45952
- Authorization: `Bearer ${getToken()}`
45953
- },
45954
- onUploadProgress: progressEvent
45955
- })
45956
- };
45957
- var fileApi$1 = { fileApi };
45958
-
45959
- const api = {
45960
- ...chatApi$1,
45961
- ...dynamicApi$1,
45962
- ...formConfigApi$1,
45963
- ...fileApi$1
45777
+ const chatApi = {
45778
+ //getHistoryActive: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config),
45779
+ getHistory: (params) => requester.get(URL_API.GET_HISTORY_API, params, config)
45780
+ // getHistory: (params: any) => {
45781
+ // console.log('getHistory params', params)
45782
+ // return params
45783
+ // }
45784
+ // getMessageByGroupCursor: (id:string, params: any) => requester.get(`${URL_API.GET_MESSAGE_BY_GROUP_CURSOR_API}/${id}`, params, config),
45785
+ // getInfo: (params: any) => requester.get(URL_API.GET_INFO_API, params, config),
45786
+ // groups: (params: any) => requester.post(URL_API.GROUP_API, params, config),
45787
+ // addMemberGroup: (params: any) => requester.post(`${URL_API.ADD_MEMBER_GROUP}`, params, config),
45788
+ // senMessage: (id: string, params: any, tickerDto?: any) => requester.post(`${URL_API.SEN_MESSAGE_API}/${id}`, { ...params, tickerDto }, config),
45789
+ // deleteMessage: (id: string, chatRoomId: string) => requester.delete(`${URL_API.MESSAGE_API}/${chatRoomId}/delete-message/${id}`, {}, config),
45790
+ // recallMessage: (id: string, chatRoomId: string) => requester.put(`${URL_API.MESSAGE_API}/${chatRoomId}/recall-message/${id}`, {}, config),
45791
+ // updateGroupAvatar: (params: any) => requester.put(URL_API.UPDATE_GROUP_AVATAR_API, params, config),
45792
+ // getMessageByGroup: (params: any, paging: any) => requester.get(`${URL_API.GET_MESSAGE_BY_GROUP_API}/${params}`, paging, config),
45793
+ // getMessageByContact: (params: any, paging: any) => requester.get(`${URL_API.GET_MESSAGE_BY_CONTACT_API}/${params}`, paging, config),
45794
+ // contactAdd: (params: any) => requester.post(URL_API.CONTACT_ADD_API, params, config),
45795
+ // getProfile: () => requester.get(URL_API.GET_PROFILE, {}, config),
45796
+ // getUsers: (params: any) => requester.get(URL_API.GET_USERS, params, config),
45797
+ // getContact: (params: any) => requester.get(URL_API.GET_CONTACT_API, params, config),
45798
+ // updateChatRoomMember: (params: any) => requester.put(`${URL_API.CHAT_ROOM_MEMBER_API}/${params}`, {}, config),
45799
+ // getPagingEmployeeApi: (params: any) => requester.get(URL_API.GET_PAGING_EMPLOYEE_API, params, config),
45800
+ // connectChatRoomMemberApi: (params: any) => requester.post(URL_API.CONNECT_CHAT_ROOM_MEMBER_API, params, config),
45801
+ // pinMessageChatRoomApi: (params: any) => requester.post(`${URL_API.PIN_MESSAGE_CHAT_ROOM_API}/${params.id}`, params, config),
45802
+ // getPinMessagesByRoomApi: (chatRoomId: string) => requester.get(`${URL_API.GET_PIN_MESSAGE_CHAT_ROOM_API}/${chatRoomId}`, {}, config),
45803
+ // deletePinMessageApi: (pinId: string) => requester.delete(`${URL_API.PIN_MESSAGE_CHAT_ROOM_API}/${pinId}`, {}, config),
45804
+ // updateGroupTagApi: (params: any) => requester.put(URL_API.UPDATE_GROUP_TAG_API, params, config),
45805
+ // createReminderApi: (params: any) => requester.post(URL_API.CREATE_REMINDER_API, params, config)
45964
45806
  };
45965
45807
 
45966
45808
  // ** Redux Imports
@@ -46007,7 +45849,7 @@ const initialState = {
46007
45849
  };
46008
45850
  const get_history = createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
46009
45851
  try {
46010
- return await api.chatApi.getHistory(params);
45852
+ return await chatApi.getHistory(params);
46011
45853
  }
46012
45854
  catch (error) {
46013
45855
  return thunkAPI.rejectWithValue({ error: error.response.data });