UNPKG

@memori.ai/memori-api-client

Version:

React library to integrate a Memori in your app or website

56 lines 2.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const apiFetcher_1 = require("../apiFetcher"); exports.default = (apiUrl) => ({ pwlUserLogin: (user, redirectTo) => (0, apiFetcher_1.apiFetcher)('/PwlLogin', { apiUrl, body: { ...user, redirectTo: redirectTo !== null && redirectTo !== void 0 ? redirectTo : '' }, method: 'POST', }), pwlUserLogout: (authToken) => (0, apiFetcher_1.apiFetcher)(`/PwlLogout/${authToken}`, { apiUrl, method: 'POST', }), pwlGetCurrentUser: (authToken) => (0, apiFetcher_1.apiFetcher)(`/PwlUser/${authToken}`, { apiUrl, }), pwlGetUser: (authToken, userID) => (0, apiFetcher_1.apiFetcher)(`/PwlUser/${authToken}/${userID}`, { apiUrl, }), pwlGetUsersList: (authToken) => (0, apiFetcher_1.apiFetcher)(`/PwlUsers/${authToken}`, { apiUrl, }), pwlGetUsersListPaginated: (authToken, filters) => (0, apiFetcher_1.apiFetcher)(`/FilterPwlUsers/${authToken}`, { apiUrl, body: filters, method: 'POST', }), pwlDeleteUser: (authToken, userID) => (0, apiFetcher_1.apiFetcher)(`/PwlUser/${authToken}/${userID}`, { apiUrl, method: 'DELETE', }), pwlUpdateUser: (authToken, userID, user) => (0, apiFetcher_1.apiFetcher)(`/PwlUser/${authToken}/${userID}`, { apiUrl, method: 'PATCH', body: user, }), pwlRecoverUsername: (user) => (0, apiFetcher_1.apiFetcher)(`/RecoverPwlUserName`, { apiUrl, body: user, method: 'POST', }), pwlCreateUser: (authToken, user) => (0, apiFetcher_1.apiFetcher)(`/PwlUser/${authToken}`, { apiUrl, body: user, method: 'POST', }), pwlLoginWithJWT: (jwtToken, tenant, secretKey) => (0, apiFetcher_1.apiFetcher)('/LoginWithJWT', { apiUrl, body: { jwtToken, tenant }, headers: { 'X-Memori-Trusted-App': secretKey, }, method: 'POST', }), }); //# sourceMappingURL=userPwl.js.map