@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.js CHANGED
@@ -26242,39 +26242,6 @@ const CHAT = {
26242
26242
  UPDATE_GROUP_TAG_API: `${BASE_URL}/api/chat/update-group-tag`
26243
26243
  }
26244
26244
  };
26245
- const UPLOADFILE = {
26246
- ACTION_TYPES: {
26247
- UPLOAD_FILE: 'UPLOADFILE/UPLOAD_FILE',
26248
- UPLOAD_IMAGE: 'UPLOADFILE/UPLOAD_IMAGE',
26249
- UPLOAD_FILE_MULTI: 'UPLOADFILE/UPLOAD_FILE_MULTI',
26250
- UPLOAD_IMAGE_MULTI: 'UPLOADFILE/UPLOAD_IMAGE_MULTI'
26251
- },
26252
- URL_API: {
26253
- UPLOAD_FILE_API: `${BASE_URL}/api/file/upload`,
26254
- UPLOAD_IMAGE_API: `${BASE_URL}/api/image/upload`,
26255
- EDITOR_UPLOAD_IMAGE: `${BASE_URL}/api/image/editor-upload`,
26256
- UPLOAD_FILE_MULTI_API: `${BASE_URL}/api/file/upload-mutil`,
26257
- UPLOAD_IMAGE_MULTI_API: `${BASE_URL}/api/image/upload-mutil`
26258
- }
26259
- };
26260
- const FORM_CONFIG = {
26261
- ACTION_TYPES: {
26262
- GET_ALL: 'FORM_CONFIG/GET_ALL',
26263
- GET_BY_ID: 'FORM_CONFIG/GET_BY_ID',
26264
- GET_BY_TYPE: 'FORM_CONFIG/GET_BY_TYPE',
26265
- ADD: 'FORM_CONFIG/ADD',
26266
- UPDATE: 'FORM_CONFIG/UPDATE',
26267
- DELETE: 'FORM_CONFIG/DELETE'
26268
- },
26269
- URL_API: {
26270
- GET_ALL_API: `${BASE_URL}/api/formconfig`,
26271
- GET_BY_ID_API: `${BASE_URL}/api/formconfig`,
26272
- GET_BY_TYPE_API: `${BASE_URL}/api/formconfig/type`,
26273
- ADD_API: `${BASE_URL}/api/formconfig`,
26274
- UPDATE_API: `${BASE_URL}/api/formconfig`,
26275
- DELETE_API: `${BASE_URL}/api/formconfig`
26276
- }
26277
- };
26278
26245
 
26279
26246
  function bind$4(fn, thisArg) {
26280
26247
  return function wrap() {
@@ -45815,47 +45782,6 @@ const encodeUUID = (uuid) => {
45815
45782
  }
45816
45783
  };
45817
45784
 
45818
- // import requester from '../requester'
45819
- // import { AxiosRequestConfig } from 'axios'
45820
- // import { getToken } from '../auth'
45821
- // import { CHAT } from '../../domain/constants'
45822
- // const { URL_API } = CHAT
45823
- // const config: AxiosRequestConfig = {
45824
- // headers: {
45825
- // Authorization: `Bearer ${getToken()}`
45826
- // }
45827
- // }
45828
- const chatApi = {
45829
- //getHistoryActive: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config),
45830
- //getHistory: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config),
45831
- getHistory: (params) => {
45832
- console.log('getHistory params', params);
45833
- },
45834
- // getMessageByGroupCursor: (id:string, params: any) => requester.get(`${URL_API.GET_MESSAGE_BY_GROUP_CURSOR_API}/${id}`, params, config),
45835
- // getInfo: (params: any) => requester.get(URL_API.GET_INFO_API, params, config),
45836
- // groups: (params: any) => requester.post(URL_API.GROUP_API, params, config),
45837
- // addMemberGroup: (params: any) => requester.post(`${URL_API.ADD_MEMBER_GROUP}`, params, config),
45838
- // senMessage: (id: string, params: any, tickerDto?: any) => requester.post(`${URL_API.SEN_MESSAGE_API}/${id}`, { ...params, tickerDto }, config),
45839
- // deleteMessage: (id: string, chatRoomId: string) => requester.delete(`${URL_API.MESSAGE_API}/${chatRoomId}/delete-message/${id}`, {}, config),
45840
- // recallMessage: (id: string, chatRoomId: string) => requester.put(`${URL_API.MESSAGE_API}/${chatRoomId}/recall-message/${id}`, {}, config),
45841
- // updateGroupAvatar: (params: any) => requester.put(URL_API.UPDATE_GROUP_AVATAR_API, params, config),
45842
- // getMessageByGroup: (params: any, paging: any) => requester.get(`${URL_API.GET_MESSAGE_BY_GROUP_API}/${params}`, paging, config),
45843
- // getMessageByContact: (params: any, paging: any) => requester.get(`${URL_API.GET_MESSAGE_BY_CONTACT_API}/${params}`, paging, config),
45844
- // contactAdd: (params: any) => requester.post(URL_API.CONTACT_ADD_API, params, config),
45845
- // getProfile: () => requester.get(URL_API.GET_PROFILE, {}, config),
45846
- // getUsers: (params: any) => requester.get(URL_API.GET_USERS, params, config),
45847
- // getContact: (params: any) => requester.get(URL_API.GET_CONTACT_API, params, config),
45848
- // updateChatRoomMember: (params: any) => requester.put(`${URL_API.CHAT_ROOM_MEMBER_API}/${params}`, {}, config),
45849
- // getPagingEmployeeApi: (params: any) => requester.get(URL_API.GET_PAGING_EMPLOYEE_API, params, config),
45850
- // connectChatRoomMemberApi: (params: any) => requester.post(URL_API.CONNECT_CHAT_ROOM_MEMBER_API, params, config),
45851
- // pinMessageChatRoomApi: (params: any) => requester.post(`${URL_API.PIN_MESSAGE_CHAT_ROOM_API}/${params.id}`, params, config),
45852
- // getPinMessagesByRoomApi: (chatRoomId: string) => requester.get(`${URL_API.GET_PIN_MESSAGE_CHAT_ROOM_API}/${chatRoomId}`, {}, config),
45853
- // deletePinMessageApi: (pinId: string) => requester.delete(`${URL_API.PIN_MESSAGE_CHAT_ROOM_API}/${pinId}`, {}, config),
45854
- // updateGroupTagApi: (params: any) => requester.put(URL_API.UPDATE_GROUP_TAG_API, params, config),
45855
- // createReminderApi: (params: any) => requester.post(URL_API.CREATE_REMINDER_API, params, config)
45856
- };
45857
- var chatApi$1 = { chatApi };
45858
-
45859
45785
  const responseBody = (response) => response.data;
45860
45786
  const requester = {
45861
45787
  get: (url, params = {}, config = {}) => axios$1.get(url, { params, ...config }).then(responseBody),
@@ -45878,126 +45804,42 @@ const getToken = () => {
45878
45804
  return accessToken;
45879
45805
  };
45880
45806
 
45881
- const config$1 = {
45882
- headers: {
45883
- Authorization: `Bearer ${getToken()}`
45884
- }
45885
- };
45886
- /**
45887
- * Dynamic API - API động cho ModalDynamic
45888
- * Hỗ trợ gọi API động dựa trên config từ server
45889
- */
45890
- const dynamicApi = {
45891
- /**
45892
- * Gọi API POST động
45893
- * @param url - Endpoint URL
45894
- * @param params - Body data
45895
- */
45896
- post: (url, params) => requester.post(`${BASE_URL}${url}`, params, config$1),
45897
- /**
45898
- * Gọi API GET động
45899
- * @param url - Endpoint URL
45900
- * @param params - Query params
45901
- */
45902
- get: (url, params) => requester.get(`${BASE_URL}${url}`, params || {}, config$1),
45903
- /**
45904
- * Gọi API PUT động
45905
- * @param url - Endpoint URL
45906
- * @param params - Body data
45907
- */
45908
- put: (url, params) => requester.put(`${BASE_URL}${url}`, params, config$1),
45909
- /**
45910
- * Gọi API DELETE động
45911
- * @param url - Endpoint URL
45912
- * @param params - Query params
45913
- */
45914
- delete: (url, params) => requester.delete(`${BASE_URL}/${url}`, params || {}, config$1),
45915
- /**
45916
- * Lấy form config từ server
45917
- * @param formType - Loại form (tasks, leaveApplication, etc.)
45918
- */
45919
- getFormConfig: (formType) => requester.get(`/api/form-config/${formType}`, {}, config$1),
45920
- /**
45921
- * Lấy options cho combobox từ server
45922
- * @param optionType - Loại option (employees, departments, etc.)
45923
- * @param params - Query params (filter, search, etc.)
45924
- */
45925
- getOptions: (optionType, params) => requester.get(`/api/options/${optionType}`, params || {}, config$1),
45926
- /**
45927
- * Lấy danh sách nhân viên
45928
- * @param params - Query params (departmentId, search, etc.)
45929
- */
45930
- getEmployees: (params) => requester.get('/api/employees/list-box', params || {}, config$1),
45931
- /**
45932
- * Lấy danh sách phòng ban
45933
- */
45934
- getDepartments: (params) => requester.get('/api/departments/list-box', params || {}, config$1),
45935
- /**
45936
- * Lấy danh sách Priority Level
45937
- */
45938
- getPriorityLevels: () => requester.get('/api/priority-levels/list-box', {}, config$1),
45939
- /**
45940
- * Lấy danh sách Status
45941
- */
45942
- getStatuses: (module) => requester.get(`/api/statuses/list-box/${module}`, {}, config$1),
45943
- /**
45944
- * Lấy danh sách Labels/Tags
45945
- */
45946
- getLabels: (module) => requester.get(`/api/labels/list-box/${module}`, {}, config$1),
45947
- /**
45948
- * Lấy danh sách Categories
45949
- */
45950
- getCategories: (module) => requester.get(`/api/categories/list-box/${module}`, {}, config$1),
45951
- /**
45952
- * Lấy danh sách Group Tasks
45953
- */
45954
- getGroupTasks: (params) => requester.get('/api/group-tasks/list-box', params || {}, config$1)
45955
- };
45956
- var dynamicApi$1 = { dynamicApi };
45957
-
45958
- const { URL_API } = FORM_CONFIG;
45807
+ // import requester from '../requester'
45808
+ const { URL_API } = CHAT;
45959
45809
  const config = {
45960
45810
  headers: {
45961
45811
  Authorization: `Bearer ${getToken()}`
45962
45812
  }
45963
45813
  };
45964
- const formConfigApi = {
45965
- getAll: () => requester.get(URL_API.GET_ALL_API, {}, config),
45966
- getById: (id) => requester.get(`${URL_API.GET_BY_ID_API}/${id}`, {}, config),
45967
- getByType: (type) => requester.get(`${URL_API.GET_BY_TYPE_API}/${type}`, {}, config),
45968
- create: (params) => requester.post(URL_API.ADD_API, params, config),
45969
- update: (id, params) => requester.put(`${URL_API.UPDATE_API}/${id}`, params, config),
45970
- delete: (id) => requester.delete(`${URL_API.DELETE_API}/${id}`, {}, config)
45971
- };
45972
- var formConfigApi$1 = { formConfigApi };
45973
-
45974
- const fileApi = {
45975
- uploadFile: (params, progressEvent) => requester.post(UPLOADFILE.URL_API.UPLOAD_FILE_API, params, {
45976
- headers: {
45977
- Authorization: `Bearer ${getToken()}`
45978
- },
45979
- onUploadProgress: progressEvent
45980
- }),
45981
- uploadMultiFile: (params, progressEvent) => requester.post(UPLOADFILE.URL_API.UPLOAD_FILE_MULTI_API, params, {
45982
- headers: {
45983
- Authorization: `Bearer ${getToken()}`
45984
- },
45985
- onUploadProgress: progressEvent
45986
- }),
45987
- uploadImage: (params, progressEvent) => requester.post(UPLOADFILE.URL_API.UPLOAD_IMAGE_API, params, {
45988
- headers: {
45989
- Authorization: `Bearer ${getToken()}`
45990
- },
45991
- onUploadProgress: progressEvent
45992
- })
45993
- };
45994
- var fileApi$1 = { fileApi };
45995
-
45996
- const api = {
45997
- ...chatApi$1,
45998
- ...dynamicApi$1,
45999
- ...formConfigApi$1,
46000
- ...fileApi$1
45814
+ const chatApi = {
45815
+ //getHistoryActive: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config),
45816
+ getHistory: (params) => requester.get(URL_API.GET_HISTORY_API, params, config)
45817
+ // getHistory: (params: any) => {
45818
+ // console.log('getHistory params', params)
45819
+ // return params
45820
+ // }
45821
+ // getMessageByGroupCursor: (id:string, params: any) => requester.get(`${URL_API.GET_MESSAGE_BY_GROUP_CURSOR_API}/${id}`, params, config),
45822
+ // getInfo: (params: any) => requester.get(URL_API.GET_INFO_API, params, config),
45823
+ // groups: (params: any) => requester.post(URL_API.GROUP_API, params, config),
45824
+ // addMemberGroup: (params: any) => requester.post(`${URL_API.ADD_MEMBER_GROUP}`, params, config),
45825
+ // senMessage: (id: string, params: any, tickerDto?: any) => requester.post(`${URL_API.SEN_MESSAGE_API}/${id}`, { ...params, tickerDto }, config),
45826
+ // deleteMessage: (id: string, chatRoomId: string) => requester.delete(`${URL_API.MESSAGE_API}/${chatRoomId}/delete-message/${id}`, {}, config),
45827
+ // recallMessage: (id: string, chatRoomId: string) => requester.put(`${URL_API.MESSAGE_API}/${chatRoomId}/recall-message/${id}`, {}, config),
45828
+ // updateGroupAvatar: (params: any) => requester.put(URL_API.UPDATE_GROUP_AVATAR_API, params, config),
45829
+ // getMessageByGroup: (params: any, paging: any) => requester.get(`${URL_API.GET_MESSAGE_BY_GROUP_API}/${params}`, paging, config),
45830
+ // getMessageByContact: (params: any, paging: any) => requester.get(`${URL_API.GET_MESSAGE_BY_CONTACT_API}/${params}`, paging, config),
45831
+ // contactAdd: (params: any) => requester.post(URL_API.CONTACT_ADD_API, params, config),
45832
+ // getProfile: () => requester.get(URL_API.GET_PROFILE, {}, config),
45833
+ // getUsers: (params: any) => requester.get(URL_API.GET_USERS, params, config),
45834
+ // getContact: (params: any) => requester.get(URL_API.GET_CONTACT_API, params, config),
45835
+ // updateChatRoomMember: (params: any) => requester.put(`${URL_API.CHAT_ROOM_MEMBER_API}/${params}`, {}, config),
45836
+ // getPagingEmployeeApi: (params: any) => requester.get(URL_API.GET_PAGING_EMPLOYEE_API, params, config),
45837
+ // connectChatRoomMemberApi: (params: any) => requester.post(URL_API.CONNECT_CHAT_ROOM_MEMBER_API, params, config),
45838
+ // pinMessageChatRoomApi: (params: any) => requester.post(`${URL_API.PIN_MESSAGE_CHAT_ROOM_API}/${params.id}`, params, config),
45839
+ // getPinMessagesByRoomApi: (chatRoomId: string) => requester.get(`${URL_API.GET_PIN_MESSAGE_CHAT_ROOM_API}/${chatRoomId}`, {}, config),
45840
+ // deletePinMessageApi: (pinId: string) => requester.delete(`${URL_API.PIN_MESSAGE_CHAT_ROOM_API}/${pinId}`, {}, config),
45841
+ // updateGroupTagApi: (params: any) => requester.put(URL_API.UPDATE_GROUP_TAG_API, params, config),
45842
+ // createReminderApi: (params: any) => requester.post(URL_API.CREATE_REMINDER_API, params, config)
46001
45843
  };
46002
45844
 
46003
45845
  // ** Redux Imports
@@ -46044,7 +45886,7 @@ const initialState = {
46044
45886
  };
46045
45887
  const get_history = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
46046
45888
  try {
46047
- return await api.chatApi.getHistory(params);
45889
+ return await chatApi.getHistory(params);
46048
45890
  }
46049
45891
  catch (error) {
46050
45892
  return thunkAPI.rejectWithValue({ error: error.response.data });