mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-01 01:59:55 +00:00
parent
0c63a87707
commit
a408457bcf
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.10",
|
"version": "0.11.4-rc.11",
|
||||||
"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",
|
||||||
|
|
|
@ -39,6 +39,8 @@ import {
|
||||||
GetPostResponse,
|
GetPostResponse,
|
||||||
GetPosts,
|
GetPosts,
|
||||||
GetPostsResponse,
|
GetPostsResponse,
|
||||||
|
GetSiteMetadata,
|
||||||
|
GetSiteMetadataResponse,
|
||||||
LockPost,
|
LockPost,
|
||||||
PostResponse,
|
PostResponse,
|
||||||
RemovePost,
|
RemovePost,
|
||||||
|
@ -238,6 +240,12 @@ export class LemmyHttp {
|
||||||
return this.wrapper(HttpType.Put, '/post/save', form);
|
return this.wrapper(HttpType.Put, '/post/save', form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getSiteMetadata(
|
||||||
|
form: GetSiteMetadata
|
||||||
|
): Promise<GetSiteMetadataResponse> {
|
||||||
|
return this.wrapper(HttpType.Get, '/post/site_metadata', form);
|
||||||
|
}
|
||||||
|
|
||||||
async createComment(form: CreateComment): Promise<CommentResponse> {
|
async createComment(form: CreateComment): Promise<CommentResponse> {
|
||||||
return this.wrapper(HttpType.Post, '/comment', form);
|
return this.wrapper(HttpType.Post, '/comment', form);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { SiteMetadata } from '..';
|
||||||
import {
|
import {
|
||||||
CommunityView,
|
CommunityView,
|
||||||
CommentView,
|
CommentView,
|
||||||
|
@ -141,3 +142,11 @@ export interface ListPostReports {
|
||||||
export interface ListPostReportsResponse {
|
export interface ListPostReportsResponse {
|
||||||
posts: PostReportView[];
|
posts: PostReportView[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GetSiteMetadata {
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetSiteMetadataResponse {
|
||||||
|
metadata: SiteMetadata;
|
||||||
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ export enum UserOperation {
|
||||||
PostJoin,
|
PostJoin,
|
||||||
CommunityJoin,
|
CommunityJoin,
|
||||||
ChangePassword,
|
ChangePassword,
|
||||||
|
GetSiteMetadata,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum SortType {
|
export enum SortType {
|
||||||
|
@ -106,3 +107,10 @@ export interface WebSocketJsonResponse<ResponseType> {
|
||||||
error?: string;
|
error?: string;
|
||||||
reconnect?: boolean;
|
reconnect?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SiteMetadata {
|
||||||
|
title?: string;
|
||||||
|
description?: string;
|
||||||
|
image?: string;
|
||||||
|
html?: string;
|
||||||
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import {
|
||||||
EditPost,
|
EditPost,
|
||||||
GetPost,
|
GetPost,
|
||||||
GetPosts,
|
GetPosts,
|
||||||
|
GetSiteMetadata,
|
||||||
LockPost,
|
LockPost,
|
||||||
RemovePost,
|
RemovePost,
|
||||||
SavePost,
|
SavePost,
|
||||||
|
@ -201,6 +202,10 @@ export class LemmyWebsocket {
|
||||||
return wrapper(UserOperation.SavePost, form);
|
return wrapper(UserOperation.SavePost, form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getSiteMetadata(form: GetSiteMetadata) {
|
||||||
|
return wrapper(UserOperation.GetSiteMetadata, form);
|
||||||
|
}
|
||||||
|
|
||||||
banFromCommunity(form: BanFromCommunity) {
|
banFromCommunity(form: BanFromCommunity) {
|
||||||
return wrapper(UserOperation.BanFromCommunity, form);
|
return wrapper(UserOperation.BanFromCommunity, form);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue