mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add ICANN-list tab
This commit is contained in:
14
assets/utils/api/icann-accreditations.ts
Normal file
14
assets/utils/api/icann-accreditations.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type {IcannAccreditation, Tld} from './index'
|
||||
import {request} from './index'
|
||||
|
||||
interface IcannAccreditationList {
|
||||
'hydra:totalItems': number
|
||||
'hydra:member': IcannAccreditation[]
|
||||
}
|
||||
|
||||
export async function getIcannAccreditations(params: object): Promise<IcannAccreditationList> {
|
||||
return (await request<IcannAccreditationList>({
|
||||
url: 'entities/icann-accreditations',
|
||||
params
|
||||
})).data
|
||||
}
|
||||
@@ -124,6 +124,16 @@ export interface TrackedDomains {
|
||||
'hydra:member': Domain[]
|
||||
}
|
||||
|
||||
export interface IcannAccreditation {
|
||||
handle: string
|
||||
icannAccreditation: {
|
||||
registrarName: string
|
||||
status: string
|
||||
date?: string
|
||||
updated?: string
|
||||
}
|
||||
}
|
||||
|
||||
export async function request<T = object, R = AxiosResponse<T>, D = object>(config: AxiosRequestConfig): Promise<R> {
|
||||
const axiosConfig: AxiosRequestConfig = {
|
||||
...config,
|
||||
|
||||
Reference in New Issue
Block a user