mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-29 15:51:12 +00:00
Adding ResolveObject to the API. Fixes #27
This commit is contained in:
parent
0fb3e3b7e4
commit
acd538e699
3 changed files with 22 additions and 0 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ export enum UserOperation {
|
|||
AddAdmin,
|
||||
BanPerson,
|
||||
Search,
|
||||
ResolveObject,
|
||||
MarkAllAsRead,
|
||||
SaveUserSettings,
|
||||
TransferCommunity,
|
||||
|
|
Loading…
Reference in a new issue