Adding ResolveObject to the API. Fixes #27

This commit is contained in:
Dessalines 2021-08-19 20:34:14 -04:00
parent 0fb3e3b7e4
commit acd538e699
3 changed files with 22 additions and 0 deletions

View file

@ -56,6 +56,8 @@ import {
GetSiteConfig,
GetSiteConfigResponse,
GetSiteResponse,
ResolveObject,
ResolveObjectResponse,
SaveSiteConfig,
Search,
SearchResponse,
@ -181,6 +183,13 @@ export class LemmyHttp {
return this.wrapper(HttpType.Get, '/search', form);
}
/**
* Fetch a non-local / federated object.
*/
async resolveObject(form: ResolveObject): Promise<ResolveObjectResponse> {
return this.wrapper(HttpType.Get, '/resolve_object', form);
}
/**
* Create a new community.
*/

View file

@ -167,3 +167,15 @@ export interface FederatedInstances {
allowed?: string[];
blocked?: string[];
}
export interface ResolveObject {
q: string;
auth?: string;
}
export interface ResolveObjectResponse {
comment?: CommentView;
post?: PostView;
community?: CommunityView;
person?: PersonViewSafe;
}

View file

@ -44,6 +44,7 @@ export enum UserOperation {
AddAdmin,
BanPerson,
Search,
ResolveObject,
MarkAllAsRead,
SaveUserSettings,
TransferCommunity,