mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
28 lines
627 B
TypeScript
28 lines
627 B
TypeScript
import {request} from "./index";
|
|
|
|
interface Tld {
|
|
tld: string
|
|
contractTerminated: boolean
|
|
registryOperator: string
|
|
specification13: boolean
|
|
}
|
|
|
|
export async function getTldList(params: object): Promise<Tld[]> {
|
|
let page = 1
|
|
let response = (await request<Tld[]>({
|
|
url: 'tld',
|
|
params: {...params, page},
|
|
})).data
|
|
const tldList: Tld[] = response;
|
|
|
|
while (response.length !== 0) {
|
|
page++
|
|
response = (await request<Tld[]>({
|
|
url: 'tld',
|
|
params: {...params, page},
|
|
})).data
|
|
|
|
tldList.push(...response)
|
|
}
|
|
return tldList
|
|
} |