mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 23:26:38 +08:00
27 lines
823 B
TypeScript
27 lines
823 B
TypeScript
import {LegacyOpenFlareBaseService} from './legacy-base.service';
|
|
import type {DnsAccountItem, DnsAccountMutationPayload} from './types';
|
|
|
|
export class DnsAccountService extends LegacyOpenFlareBaseService {
|
|
protected static readonly basePath = '/api/dns-accounts';
|
|
|
|
static async list(): Promise<DnsAccountItem[]> {
|
|
return this.legacyGet<DnsAccountItem[]>('/');
|
|
}
|
|
|
|
static async create(
|
|
payload: DnsAccountMutationPayload,
|
|
): Promise<DnsAccountItem> {
|
|
return this.legacyPost<DnsAccountItem>('/', payload);
|
|
}
|
|
|
|
static async update(
|
|
id: number,
|
|
payload: DnsAccountMutationPayload,
|
|
): Promise<DnsAccountItem> {
|
|
return this.legacyPost<DnsAccountItem>(`/${id}/update`, payload);
|
|
}
|
|
|
|
static async delete(id: number): Promise<void> {
|
|
return this.legacyPost<void>(`/${id}/delete`);
|
|
}
|
|
} |