56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { gqlApi, restApi } from '~/helpers/axiosConfig';
|
|
|
|
export default {
|
|
getUserDetails: () =>
|
|
gqlApi.post('', {
|
|
query: `query Me {
|
|
me {
|
|
uid
|
|
displayName
|
|
email
|
|
photoURL
|
|
isAdmin
|
|
createdOn
|
|
}
|
|
}`,
|
|
}),
|
|
refreshToken: () => restApi.get('/auth/refresh'),
|
|
elevateUser: () => restApi.get('/auth/verify/admin'),
|
|
getProviders: () => restApi.get('/auth/providers'),
|
|
sendMagicLink: (email: string) =>
|
|
restApi.post('/auth/signin?origin=admin', {
|
|
email,
|
|
}),
|
|
signInWithEmailLink: (
|
|
token: string | null,
|
|
deviceIdentifier: string | null,
|
|
) =>
|
|
restApi.post('/auth/verify', {
|
|
token,
|
|
deviceIdentifier,
|
|
}),
|
|
setupLocalAdmin: (username: string, password: string) =>
|
|
restApi.post('/auth/local/setup-admin', {
|
|
username,
|
|
password,
|
|
}),
|
|
signInLocal: (username: string, password: string) =>
|
|
restApi.post('/auth/local/signin', {
|
|
username,
|
|
password,
|
|
}),
|
|
createLocalUser: (username: string, password: string, displayName?: string) =>
|
|
restApi.post('/auth/local/users', {
|
|
username,
|
|
password,
|
|
displayName,
|
|
}),
|
|
getFirstTimeInfraSetupStatus: () => restApi.get('/site/setup'),
|
|
updateFirstTimeInfraSetupStatus: () => restApi.put('/site/setup'),
|
|
addOnBoardingConfigs: (config: Record<string, any>) =>
|
|
restApi.post('/onboarding/config', config),
|
|
getOnboardingStatus: () => restApi.get('/onboarding/status'),
|
|
getOnBoardingConfigs: (token: string) =>
|
|
restApi.get('/onboarding/config?token=' + token),
|
|
logout: () => restApi.get('/auth/logout'),
|
|
};
|