[+] SDK for settings/get settings/set

pull/29/head
Azalea 2024-04-01 23:51:13 -04:00
parent 44bab8c0c7
commit ba13bfd9ad
2 changed files with 16 additions and 1 deletions

View File

@ -114,3 +114,11 @@ export interface MusicMeta {
}
export type AllMusic = { [key: string]: MusicMeta }
export interface GameOption {
name: string
desc: string
key: string
value: any
type: "Boolean"
}

View File

@ -6,7 +6,7 @@ import type {
GenericGameSummary,
GenericRanking,
TrendEntry,
AquaNetUser
AquaNetUser, GameOption
} from "./generalTypes";
import type { GameName } from "./scoring";
@ -153,3 +153,10 @@ export const DATA = {
allMusic: (game: GameName): Promise<AllMusic> =>
fetch(`${DATA_HOST}/d/${game}/00/all-music.json`).then(it => it.json())
}
export const SETTING = {
get: (): Promise<GameOption[]> =>
post('/api/v2/settings/get', {}),
set: (key: string, value: string) =>
post('/api/v2/settings/set', { key, value }),
}