import { CharactersResponse } from "@/data/schemas/character"; import { ApiPath } from "./api_path"; import { httpClient } from "./http_client"; import { type ApiEnvelope, unwrap } from "./response_helper"; export class CharacterApi { async getCharacters(): Promise { const envelope = await httpClient>(ApiPath.characters); return CharactersResponse.fromJson(unwrap(envelope)); } } export const characterApi = new CharacterApi();