UNPKG

@memori.ai/memori-api-client

Version:

React library to integrate a Memori in your app or website

34 lines 1.18 kB
import { apiFetcher } from '../apiFetcher'; export default (apiUrl) => ({ getAllFunctions: async (sessionId) => apiFetcher(`/Functions/${sessionId}`, { method: 'GET', apiUrl, }), getFunctionsPaginated: async (sessionId, from, howMany) => apiFetcher(`/Functions/${sessionId}/${from}/${howMany}`, { method: 'GET', apiUrl, }), getFunction: async (sessionId, functionID) => apiFetcher(`/Function/${sessionId}/${functionID}`, { method: 'GET', apiUrl, }), patchFunction: async (sessionId, func) => apiFetcher(`/Function/${sessionId}/${func.functionID}`, { method: 'PATCH', apiUrl, body: func, }), deleteFunction: async (sessionId, functionID) => apiFetcher(`/Function/${sessionId}/${functionID}`, { method: 'DELETE', apiUrl, }), createFunction: async (sessionId, func) => apiFetcher(`/Function/${sessionId}`, { method: 'POST', apiUrl, body: func, }), getMacroFunctions: async (sessionId) => apiFetcher(`/MacroFunctions/${sessionId}`, { method: 'GET', apiUrl, }), }); //# sourceMappingURL=functions.js.map