mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-01 01:59:55 +00:00
Resolve endpoint (#28)
* Adding ResolveObject to the API. Fixes #27 * v0.11.4-rc.13 * v0.11.4-rc.14 * Forgot to add the websocket * v0.11.4-rc.15
This commit is contained in:
parent
0fb3e3b7e4
commit
f32772c2e1
5 changed files with 31 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "lemmy-js-client",
|
"name": "lemmy-js-client",
|
||||||
"description": "A javascript / typescript client for Lemmy",
|
"description": "A javascript / typescript client for Lemmy",
|
||||||
"version": "0.11.4-rc.12",
|
"version": "0.11.4-rc.15",
|
||||||
"author": "Dessalines <tyhou13@gmx.com>",
|
"author": "Dessalines <tyhou13@gmx.com>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|
|
@ -56,6 +56,8 @@ import {
|
||||||
GetSiteConfig,
|
GetSiteConfig,
|
||||||
GetSiteConfigResponse,
|
GetSiteConfigResponse,
|
||||||
GetSiteResponse,
|
GetSiteResponse,
|
||||||
|
ResolveObject,
|
||||||
|
ResolveObjectResponse,
|
||||||
SaveSiteConfig,
|
SaveSiteConfig,
|
||||||
Search,
|
Search,
|
||||||
SearchResponse,
|
SearchResponse,
|
||||||
|
@ -181,6 +183,13 @@ export class LemmyHttp {
|
||||||
return this.wrapper(HttpType.Get, '/search', form);
|
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.
|
* Create a new community.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -167,3 +167,15 @@ export interface FederatedInstances {
|
||||||
allowed?: string[];
|
allowed?: string[];
|
||||||
blocked?: 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,
|
AddAdmin,
|
||||||
BanPerson,
|
BanPerson,
|
||||||
Search,
|
Search,
|
||||||
|
ResolveObject,
|
||||||
MarkAllAsRead,
|
MarkAllAsRead,
|
||||||
SaveUserSettings,
|
SaveUserSettings,
|
||||||
TransferCommunity,
|
TransferCommunity,
|
||||||
|
|
|
@ -40,6 +40,7 @@ import {
|
||||||
GetModlog,
|
GetModlog,
|
||||||
GetSite,
|
GetSite,
|
||||||
GetSiteConfig,
|
GetSiteConfig,
|
||||||
|
ResolveObject,
|
||||||
SaveSiteConfig,
|
SaveSiteConfig,
|
||||||
Search,
|
Search,
|
||||||
TransferSite,
|
TransferSite,
|
||||||
|
@ -423,6 +424,13 @@ export class LemmyWebsocket {
|
||||||
return wrapper(UserOperation.Search, form);
|
return wrapper(UserOperation.Search, form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch a non-local / federated object.
|
||||||
|
*/
|
||||||
|
resolveObject(form: ResolveObject) {
|
||||||
|
return wrapper(UserOperation.ResolveObject, form);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark all replies as read.
|
* Mark all replies as read.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue