feat: add instance config endpoint

This commit is contained in:
Maël Gangloff
2024-08-04 15:49:38 +02:00
parent e413bfedc0
commit 7cf2375952
13 changed files with 115 additions and 23 deletions

View File

@@ -71,6 +71,11 @@ export interface Watchlist {
connector?: string
}
export interface InstanceConfig {
ssoLogin: boolean
limtedFeatures: boolean
}
export async function request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig): Promise<R> {
const axiosConfig: AxiosRequestConfig = {
...config,
@@ -84,6 +89,7 @@ export async function request<T = any, R = AxiosResponse<T>, D = any>(config: Ax
return await axios.request<T, R, D>(axiosConfig)
}
export * from './domain'
export * from './tld'
export * from './user'

View File

@@ -1,4 +1,4 @@
import {request, User} from "./index";
import {InstanceConfig, request, User} from "./index";
export async function login(email: string, password: string): Promise<boolean> {
@@ -16,3 +16,10 @@ export async function getUser(): Promise<User> {
})
return response.data
}
export async function getConfiguration(): Promise<InstanceConfig> {
const response = await request<InstanceConfig>({
url: 'config'
})
return response.data
}