@memori.ai/memori-api-client
Version:
React library to integrate a Memori in your app or website
71 lines • 2.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const apiFetcher_1 = require("../apiFetcher");
exports.default = (apiUrl) => ({
pwlUserLogin: (user) => (0, apiFetcher_1.apiFetcher)('/PwlLogin', {
apiUrl,
body: { ...user },
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',
}),
loginWithOTP: (user) => (0, apiFetcher_1.apiFetcher)(`/LoginWithOTP`, {
apiUrl,
method: 'POST',
body: { ...user },
}),
validateOTPCode: (otpCode, tenant, userName, eMail) => (0, apiFetcher_1.apiFetcher)(`/ValidateOTPCode`, {
apiUrl,
method: 'POST',
body: { userName, eMail, otpCode, tenant },
}),
refreshTemporarySession: (refreshTemporarySessionSpecs) => (0, apiFetcher_1.apiFetcher)('/RefreshTemporarySession', {
apiUrl,
body: refreshTemporarySessionSpecs,
method: 'POST',
}),
});
//# sourceMappingURL=userPwl.js.map