Adding admin view votes. (#225)

* Adding admin view votes.

* Forgot to add endpoints.

* v0.19.2-alpha.1
This commit is contained in:
Dessalines 2024-01-03 13:54:56 -05:00 committed by GitHub
parent 79b59ecd21
commit 81684bc84e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 71 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "lemmy-js-client",
"version": "0.19.0",
"version": "0.19.2-alpha.1",
"description": "A javascript / typescript client for Lemmy",
"repository": "https://github.com/LemmyNet/lemmy-js-client",
"license": "AGPL-3.0",

View file

@ -134,6 +134,10 @@ import { UpdateTotp } from "./types/UpdateTotp";
import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
import { SuccessResponse } from "./types/SuccessResponse";
import { LoginToken } from "./types/LoginToken";
import { ListPostLikes } from "./types/ListPostLikes";
import { ListPostLikesResponse } from "./types/ListPostLikesResponse";
import { ListCommentLikes } from "./types/ListCommentLikes";
import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
enum HttpType {
Get = "GET",
@ -615,6 +619,19 @@ export class LemmyHttp {
);
}
/**
* List a post's likes. Admin-only.
*
* `HTTP.GET /post/like`
*/
listPostLikes(form: ListPostLikes) {
return this.#wrapper<ListPostLikes, ListPostLikesResponse>(
HttpType.Get,
"/post/like/list",
form,
);
}
/**
* Save a post.
*
@ -758,6 +775,19 @@ export class LemmyHttp {
);
}
/**
* List a comment's likes. Admin-only.
*
* `HTTP.GET //like`
*/
listCommentLikes(form: ListCommentLikes) {
return this.#wrapper<ListCommentLikes, ListCommentLikesResponse>(
HttpType.Get,
"/comment/like/list",
form,
);
}
/**
* Save a comment.
*

View file

@ -117,10 +117,14 @@ export { InstanceWithFederationState } from "./types/InstanceWithFederationState
export { Language } from "./types/Language";
export { LanguageId } from "./types/LanguageId";
export { LemmyErrorType } from "./types/LemmyErrorType";
export { ListCommentLikes } from "./types/ListCommentLikes";
export { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
export { ListCommentReports } from "./types/ListCommentReports";
export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
export { ListCommunities } from "./types/ListCommunities";
export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
export { ListPostLikes } from "./types/ListPostLikes";
export { ListPostLikesResponse } from "./types/ListPostLikesResponse";
export { ListPostReports } from "./types/ListPostReports";
export { ListPostReportsResponse } from "./types/ListPostReportsResponse";
export { ListPrivateMessageReports } from "./types/ListPrivateMessageReports";
@ -238,6 +242,7 @@ export { TransferCommunity } from "./types/TransferCommunity";
export { UpdateTotp } from "./types/UpdateTotp";
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
export { VerifyEmail } from "./types/VerifyEmail";
export { VoteView } from "./types/VoteView";
export {
UploadImage,
UploadImageResponse,

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId";
export interface ListCommentLikes {
comment_id: CommentId;
page?: /* integer */ number;
limit?: /* integer */ number;
}

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { VoteView } from "./VoteView";
export interface ListCommentLikesResponse {
comment_likes: Array<VoteView>;
}

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PostId } from "./PostId";
export interface ListPostLikes {
post_id: PostId;
page?: /* integer */ number;
limit?: /* integer */ number;
}

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { VoteView } from "./VoteView";
export interface ListPostLikesResponse {
post_likes: Array<VoteView>;
}

7
src/types/VoteView.ts Normal file
View file

@ -0,0 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Person } from "./Person";
export interface VoteView {
creator: Person;
score: number;
}