mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-29 07:41:12 +00:00
Adding admin view votes. (#225)
* Adding admin view votes. * Forgot to add endpoints. * v0.19.2-alpha.1
This commit is contained in:
parent
79b59ecd21
commit
81684bc84e
8 changed files with 71 additions and 1 deletions
|
@ -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",
|
||||
|
|
30
src/http.ts
30
src/http.ts
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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,
|
||||
|
|
8
src/types/ListCommentLikes.ts
Normal file
8
src/types/ListCommentLikes.ts
Normal 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;
|
||||
}
|
6
src/types/ListCommentLikesResponse.ts
Normal file
6
src/types/ListCommentLikesResponse.ts
Normal 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>;
|
||||
}
|
8
src/types/ListPostLikes.ts
Normal file
8
src/types/ListPostLikes.ts
Normal 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;
|
||||
}
|
6
src/types/ListPostLikesResponse.ts
Normal file
6
src/types/ListPostLikesResponse.ts
Normal 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
7
src/types/VoteView.ts
Normal 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;
|
||||
}
|
Loading…
Reference in a new issue