UNPKG

@memori.ai/memori-api-client

Version:

React library to integrate a Memori in your app or website

50 lines 2.27 kB
import { apiFetcher } from '../apiFetcher'; export default (apiUrl) => ({ getChatLogs: async (sessionId, dateFrom, dateTo) => apiFetcher(`/ChatLogs/${sessionId}${dateFrom ? `/${dateFrom}` : ''}${dateFrom && dateTo ? `/${dateTo}` : ''}`, { method: 'GET', apiUrl, }), getChatLogsPaged: async (sessionId, filters) => apiFetcher(`/ChatLogsPaged/${sessionId}`, { method: 'POST', apiUrl, body: filters, }), getChatLogsByUser: async (sessionId, dateFrom, dateTo) => apiFetcher(`/CurrentUserChatLogs/${sessionId}${dateFrom ? `/${dateFrom}` : ''}${dateFrom && dateTo ? `/${dateTo}` : ''}`, { method: 'GET', apiUrl, }), getSessionChatLogs: async (sessionId, chatLogSessionID) => apiFetcher(`/SessionChatLogs/${sessionId}/${chatLogSessionID}`, { method: 'GET', apiUrl, }), getUserChatLogs: async (sessionId, userID, dateFrom, dateTo) => apiFetcher(`/UserChatLogs/${sessionId}/${userID}${dateFrom ? `/${dateFrom}` : ''}${dateFrom && dateTo ? `/${dateTo}` : ''}`, { method: 'GET', apiUrl, }), deleteChatLogs: async (sessionId, dateFrom, dateTo) => apiFetcher(`/ChatLogs/${sessionId}${dateFrom ? `/${dateFrom}` : ''}${dateFrom && dateTo ? `/${dateTo}` : ''}`, { method: 'DELETE', apiUrl, }), deleteChatLog: async (sessionId, chatLogId) => apiFetcher(`/ChatLog/${sessionId}/${chatLogId}`, { method: 'DELETE', apiUrl, }), getUserChatLogsByToken: async (loginToken, memoriID, dateFrom, dateTo) => apiFetcher(`/UserChatLogsByToken/${loginToken}/${memoriID}${dateFrom ? `/${dateFrom}` : ''}${dateFrom && dateTo ? `/${dateTo}` : ''}`, { method: 'GET', apiUrl, }), getUserChatLogsByTokenPaged: async (loginToken, memoriID, from, howMany, dateFrom, dateTo, showChatsWithNoHistory) => apiFetcher(`/UserChatLogsByTokenPaged`, { method: 'POST', apiUrl, body: { loginToken: loginToken, memoriID: memoriID, dateFrom: dateFrom, dateTo: dateTo, from: from, howMany: howMany, showChatsWithNoHistory: showChatsWithNoHistory, }, }), }); //# sourceMappingURL=chatLogs.js.map