feat: expose domain dns records via api (#259)
This commit is contained in:
@@ -29,6 +29,14 @@ type VerifyDomainResponse = {
|
||||
type VerifyDomainResponseSuccess =
|
||||
paths["/v1/domains/{id}/verify"]["put"]["responses"]["200"]["content"]["application/json"];
|
||||
|
||||
type GetDomainResponse = {
|
||||
data: GetDomainResponseSuccess | null;
|
||||
error: ErrorResponse | null;
|
||||
};
|
||||
|
||||
type GetDomainResponseSuccess =
|
||||
paths["/v1/domains/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
||||
|
||||
export class Domains {
|
||||
constructor(private readonly usesend: UseSend) {
|
||||
this.usesend = usesend;
|
||||
@@ -54,4 +62,12 @@ export class Domains {
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
async get(id: number): Promise<GetDomainResponse> {
|
||||
const data = await this.usesend.get<GetDomainResponseSuccess>(
|
||||
`/domains/${id}`
|
||||
);
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,7 @@ export class Emails {
|
||||
const data = await this.usesend.get<GetEmailResponseSuccess>(
|
||||
`/emails/${id}`
|
||||
);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user