UNPKG

@memori.ai/memori-api-client

Version:

React library to integrate a Memori in your app or website

34 lines 1.24 kB
import { apiFetcher } from '../apiFetcher'; export default (apiUrl) => ({ getMemories: async (sessionId, type) => apiFetcher(`/Memories/${sessionId}${type ? `/${type}` : ''}`, { method: 'GET', apiUrl, }), getMemoriesPaginated: async (sessionId, from, howMany, type) => apiFetcher(`/Memories/${sessionId}/${from}/${howMany}${type ? `/${type}` : ''}`, { method: 'GET', apiUrl, }), getMemory: async (sessionId, memoryId) => apiFetcher(`/Memory/${sessionId}/${memoryId}`, { method: 'GET', apiUrl, }), patchMemory: async (sessionId, memory) => apiFetcher(`/Memory/${sessionId}/${memory.memoryID}`, { method: 'PATCH', apiUrl, body: memory, }), deleteMemory: async (sessionId, memoryId) => apiFetcher(`/Memory/${sessionId}/${memoryId}`, { method: 'DELETE', apiUrl, }), postMemory: async (sessionId, memory) => apiFetcher(`/Memory/${sessionId}`, { method: 'POST', apiUrl, body: memory, }), getMemoryAccess: async (sessionId, memoryId) => apiFetcher(`/MemoryAccess/${sessionId}/${memoryId}`, { method: 'GET', apiUrl, }), }); //# sourceMappingURL=memories.js.map