import {LegacyOpenFlareBaseService} from './legacy-base.service'; import type { DatabaseCleanupPayload, DatabaseCleanupResult, GeoIPLookupResult, OptionBatchPayload, OptionItem, } from './types'; export class OptionService extends LegacyOpenFlareBaseService { protected static override readonly basePath = '/api/option'; static list(): Promise { return this.legacyGet('/'); } static update(key: string, value: string): Promise { return this.legacyPost('/update', { key, value }); } static updateBatch(options: OptionItem[]): Promise { const payload: OptionBatchPayload = { options }; return this.legacyPost('/update-batch', payload); } static lookupGeoIP(provider: string, ip: string): Promise { return this.legacyPost('/geoip/lookup', { provider, ip }); } static cleanupDatabase( payload: DatabaseCleanupPayload, ): Promise { return this.legacyPost('/database/cleanup', payload); } }