29 lines
627 B
TypeScript
29 lines
627 B
TypeScript
import type { MastodonObject } from './base';
|
|
import { fetchAPI, type InstanceInfo } from './util';
|
|
|
|
export interface MastodonAccount extends MastodonObject {
|
|
fqn: string;
|
|
display_name: string;
|
|
acct: string;
|
|
url: string;
|
|
|
|
avatar: string;
|
|
avatar_static: string;
|
|
|
|
note: string;
|
|
|
|
bot: boolean;
|
|
|
|
fields: {
|
|
name: string;
|
|
value: string;
|
|
verified_at: string | null;
|
|
}[];
|
|
}
|
|
|
|
export async function fetchAccount(instance: InstanceInfo, id: string): Promise<MastodonAccount> {
|
|
return await fetchAPI(instance, '/api/v1/accounts/' + id)
|
|
.then((r) => r.json())
|
|
.then((b) => b as MastodonAccount);
|
|
}
|