mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-26 14:21:12 +00:00
Adding bannedpersons endpoint.
This commit is contained in:
parent
c4827a62c0
commit
fb4472f5f4
5 changed files with 28 additions and 1 deletions
11
src/http.ts
11
src/http.ts
|
@ -38,6 +38,7 @@ import {
|
||||||
import {
|
import {
|
||||||
AddAdmin,
|
AddAdmin,
|
||||||
AddAdminResponse,
|
AddAdminResponse,
|
||||||
|
BannedPersonsResponse,
|
||||||
BanPerson,
|
BanPerson,
|
||||||
BanPersonResponse,
|
BanPersonResponse,
|
||||||
BlockPerson,
|
BlockPerson,
|
||||||
|
@ -48,6 +49,7 @@ import {
|
||||||
DeleteAccountResponse,
|
DeleteAccountResponse,
|
||||||
DeletePrivateMessage,
|
DeletePrivateMessage,
|
||||||
EditPrivateMessage,
|
EditPrivateMessage,
|
||||||
|
GetBannedPersons,
|
||||||
GetCaptchaResponse,
|
GetCaptchaResponse,
|
||||||
GetPersonDetails,
|
GetPersonDetails,
|
||||||
GetPersonDetailsResponse,
|
GetPersonDetailsResponse,
|
||||||
|
@ -584,6 +586,15 @@ export class LemmyHttp {
|
||||||
return this.wrapper(HttpType.Post, "/user/ban", form);
|
return this.wrapper(HttpType.Post, "/user/ban", form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of banned users
|
||||||
|
*/
|
||||||
|
async getBannedPersons(
|
||||||
|
form: GetBannedPersons
|
||||||
|
): Promise<BannedPersonsResponse> {
|
||||||
|
return this.wrapper(HttpType.Get, "/user/banned", form);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Block a person.
|
* Block a person.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -315,3 +315,11 @@ export interface BlockPersonResponse {
|
||||||
person_view: PersonViewSafe;
|
person_view: PersonViewSafe;
|
||||||
blocked: boolean;
|
blocked: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GetBannedPersons {
|
||||||
|
auth: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BannedPersonsResponse {
|
||||||
|
banned: PersonViewSafe[];
|
||||||
|
}
|
||||||
|
|
|
@ -131,7 +131,6 @@ export interface GetSiteResponse {
|
||||||
*/
|
*/
|
||||||
site_view?: SiteView;
|
site_view?: SiteView;
|
||||||
admins: PersonViewSafe[];
|
admins: PersonViewSafe[];
|
||||||
banned: PersonViewSafe[];
|
|
||||||
online: number;
|
online: number;
|
||||||
version: string;
|
version: string;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -46,6 +46,7 @@ export enum UserOperation {
|
||||||
ListRegistrationApplications,
|
ListRegistrationApplications,
|
||||||
ApproveRegistrationApplication,
|
ApproveRegistrationApplication,
|
||||||
BanPerson,
|
BanPerson,
|
||||||
|
GetBannedPersons,
|
||||||
Search,
|
Search,
|
||||||
ResolveObject,
|
ResolveObject,
|
||||||
MarkAllAsRead,
|
MarkAllAsRead,
|
||||||
|
|
|
@ -33,6 +33,7 @@ import {
|
||||||
DeleteAccount,
|
DeleteAccount,
|
||||||
DeletePrivateMessage,
|
DeletePrivateMessage,
|
||||||
EditPrivateMessage,
|
EditPrivateMessage,
|
||||||
|
GetBannedPersons,
|
||||||
GetPersonDetails,
|
GetPersonDetails,
|
||||||
GetPersonMentions,
|
GetPersonMentions,
|
||||||
GetPrivateMessages,
|
GetPrivateMessages,
|
||||||
|
@ -401,6 +402,13 @@ export class LemmyWebsocket {
|
||||||
return wrapper(UserOperation.BanPerson, form);
|
return wrapper(UserOperation.BanPerson, form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of banned users
|
||||||
|
*/
|
||||||
|
getBannedPersons(form: GetBannedPersons) {
|
||||||
|
return wrapper(UserOperation.GetBannedPersons, form);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an admin to your site.
|
* Add an admin to your site.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue