feat(client): Add getAccountByUsername method

This commit is contained in:
Jesse Wierzbinski 2024-07-17 13:55:35 +02:00
parent 0c30b024cd
commit 0945a72a79
No known key found for this signature in database

View file

@ -546,6 +546,25 @@ export class LysandClient extends BaseClient {
return this.get<Account>(`/api/v1/accounts/${id}`, extra); return this.get<Account>(`/api/v1/accounts/${id}`, extra);
} }
/**
* GET /api/v1/accounts/id
*
* Lysand API only.
* @param username The username.
* @return An account.
*/
public getAccountByUsername(
username: string,
extra?: RequestInit,
): Promise<Output<Account>> {
return this.get<Account>(
`/api/v1/accounts/id?${new URLSearchParams({
username,
}).toString()}`,
extra,
);
}
/** /**
* GET /api/v1/accounts/:id/followers * GET /api/v1/accounts/:id/followers
* *