mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-01 01:59:55 +00:00
parent
e88a992d25
commit
52b456827d
5 changed files with 28 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "lemmy-js-client",
|
||||
"description": "A javascript / typescript client for Lemmy",
|
||||
"version": "0.13.1-rc.1",
|
||||
"version": "0.13.4-rc.1",
|
||||
"author": "Dessalines <tyhou13@gmx.com>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "./dist/index.js",
|
||||
|
|
|
@ -109,6 +109,8 @@ import {
|
|||
BlockPersonResponse,
|
||||
GetReportCount,
|
||||
GetReportCountResponse,
|
||||
GetUnreadCount,
|
||||
GetUnreadCountResponse,
|
||||
} from './interfaces/api/person';
|
||||
|
||||
import { VERSION } from './interfaces/others';
|
||||
|
@ -637,6 +639,13 @@ export class LemmyHttp {
|
|||
return this.wrapper(HttpType.Get, '/user/report_count', form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get your unread counts
|
||||
*/
|
||||
async getUnreadCount(form: GetUnreadCount): Promise<GetUnreadCountResponse> {
|
||||
return this.wrapper(HttpType.Get, '/user/unread_count', form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an admin to your site.
|
||||
*/
|
||||
|
|
|
@ -275,6 +275,16 @@ export interface GetReportCountResponse {
|
|||
post_reports: number;
|
||||
}
|
||||
|
||||
export interface GetUnreadCount {
|
||||
auth: string;
|
||||
}
|
||||
|
||||
export interface GetUnreadCountResponse {
|
||||
replies: number;
|
||||
mentions: number;
|
||||
private_messages: number;
|
||||
}
|
||||
|
||||
export interface BlockPerson {
|
||||
person_id: number;
|
||||
block: boolean;
|
||||
|
|
|
@ -74,6 +74,7 @@ export enum UserOperation {
|
|||
ResolvePostReport,
|
||||
ListPostReports,
|
||||
GetReportCount,
|
||||
GetUnreadCount,
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -73,6 +73,7 @@ import {
|
|||
ChangePassword,
|
||||
BlockPerson,
|
||||
GetReportCount,
|
||||
GetUnreadCount,
|
||||
} from './interfaces/api/person';
|
||||
import { UserJoin, PostJoin, CommunityJoin } from './interfaces/api/websocket';
|
||||
import { UserOperation } from './interfaces/others';
|
||||
|
@ -508,6 +509,12 @@ export class LemmyWebsocket {
|
|||
return wrapper(UserOperation.GetReportCount, form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get your unread counts
|
||||
*/
|
||||
getUnreadCount(form: GetUnreadCount) {
|
||||
return wrapper(UserOperation.GetUnreadCount, form);
|
||||
}
|
||||
/**
|
||||
* Delete your account.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue