mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-12-23 11:21:27 +00:00
parent
e88a992d25
commit
52b456827d
5 changed files with 28 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.13.1-rc.1",
|
"version": "0.13.4-rc.1",
|
||||||
"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",
|
||||||
|
|
|
@ -109,6 +109,8 @@ import {
|
||||||
BlockPersonResponse,
|
BlockPersonResponse,
|
||||||
GetReportCount,
|
GetReportCount,
|
||||||
GetReportCountResponse,
|
GetReportCountResponse,
|
||||||
|
GetUnreadCount,
|
||||||
|
GetUnreadCountResponse,
|
||||||
} from './interfaces/api/person';
|
} from './interfaces/api/person';
|
||||||
|
|
||||||
import { VERSION } from './interfaces/others';
|
import { VERSION } from './interfaces/others';
|
||||||
|
@ -637,6 +639,13 @@ export class LemmyHttp {
|
||||||
return this.wrapper(HttpType.Get, '/user/report_count', form);
|
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.
|
* Add an admin to your site.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -275,6 +275,16 @@ export interface GetReportCountResponse {
|
||||||
post_reports: number;
|
post_reports: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GetUnreadCount {
|
||||||
|
auth: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetUnreadCountResponse {
|
||||||
|
replies: number;
|
||||||
|
mentions: number;
|
||||||
|
private_messages: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface BlockPerson {
|
export interface BlockPerson {
|
||||||
person_id: number;
|
person_id: number;
|
||||||
block: boolean;
|
block: boolean;
|
||||||
|
|
|
@ -74,6 +74,7 @@ export enum UserOperation {
|
||||||
ResolvePostReport,
|
ResolvePostReport,
|
||||||
ListPostReports,
|
ListPostReports,
|
||||||
GetReportCount,
|
GetReportCount,
|
||||||
|
GetUnreadCount,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -73,6 +73,7 @@ import {
|
||||||
ChangePassword,
|
ChangePassword,
|
||||||
BlockPerson,
|
BlockPerson,
|
||||||
GetReportCount,
|
GetReportCount,
|
||||||
|
GetUnreadCount,
|
||||||
} from './interfaces/api/person';
|
} from './interfaces/api/person';
|
||||||
import { UserJoin, PostJoin, CommunityJoin } from './interfaces/api/websocket';
|
import { UserJoin, PostJoin, CommunityJoin } from './interfaces/api/websocket';
|
||||||
import { UserOperation } from './interfaces/others';
|
import { UserOperation } from './interfaces/others';
|
||||||
|
@ -508,6 +509,12 @@ export class LemmyWebsocket {
|
||||||
return wrapper(UserOperation.GetReportCount, form);
|
return wrapper(UserOperation.GetReportCount, form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get your unread counts
|
||||||
|
*/
|
||||||
|
getUnreadCount(form: GetUnreadCount) {
|
||||||
|
return wrapper(UserOperation.GetUnreadCount, form);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Delete your account.
|
* Delete your account.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue