@memori.ai/memori-api-client
Version:
React library to integrate a Memori in your app or website
44 lines • 1.98 kB
JavaScript
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 (filters) => apiFetcher(`/UserChatLogsByTokenPaged`, {
method: 'POST',
apiUrl,
body: {
...filters,
},
}),
});
//# sourceMappingURL=chatLogs.js.map