mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add instance config endpoint
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user