From 42874f034837b3bebae9c348d9ca19a698d58fdb Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 13 Mar 2024 15:40:53 -0400 Subject: [PATCH] Adding vote display modes and other additions from main. (#246) --- src/http.ts | 15 --------------- src/index.ts | 4 +--- src/types/CommentReportView.ts | 6 ++++++ src/types/ListMedia.ts | 6 ------ src/types/ListMediaResponse.ts | 6 ------ src/types/LocalUserView.ts | 2 ++ ...{LocalImage.ts => LocalUserVoteDisplayMode.ts} | 9 +++++---- src/types/PostReportView.ts | 9 +++++++++ src/types/SaveUserSettings.ts | 5 ++++- src/types/Site.ts | 2 -- 10 files changed, 27 insertions(+), 37 deletions(-) delete mode 100644 src/types/ListMedia.ts delete mode 100644 src/types/ListMediaResponse.ts rename src/types/{LocalImage.ts => LocalUserVoteDisplayMode.ts} (58%) diff --git a/src/http.ts b/src/http.ts index 6b1eb80..337399f 100644 --- a/src/http.ts +++ b/src/http.ts @@ -139,8 +139,6 @@ import { ListPostLikesResponse } from "./types/ListPostLikesResponse"; import { ListCommentLikes } from "./types/ListCommentLikes"; import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse"; import { HidePost } from "./types/HidePost"; -import { ListMedia } from "./types/ListMedia"; -import { ListMediaResponse } from "./types/ListMediaResponse"; enum HttpType { Get = "GET", @@ -292,19 +290,6 @@ export class LemmyHttp { ); } - /** - * List all the media for your user - * - * `HTTP.GET /user/list_media` - */ - listMedia(form: ListMedia) { - return this.#wrapper( - HttpType.Get, - "/user/list_media", - form, - ); - } - /** * Enable / Disable TOTP / two-factor authentication. * diff --git a/src/index.ts b/src/index.ts index 695fa45..8451c14 100644 --- a/src/index.ts +++ b/src/index.ts @@ -125,8 +125,6 @@ export { ListCommentReports } from "./types/ListCommentReports"; export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse"; export { ListCommunities } from "./types/ListCommunities"; export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse"; -export { ListMedia } from "./types/ListMedia"; -export { ListMediaResponse } from "./types/ListMediaResponse"; export { ListPostLikes } from "./types/ListPostLikes"; export { ListPostLikesResponse } from "./types/ListPostLikesResponse"; export { ListPostReports } from "./types/ListPostReports"; @@ -136,13 +134,13 @@ export { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageRep export { ListRegistrationApplications } from "./types/ListRegistrationApplications"; export { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse"; export { ListingType } from "./types/ListingType"; -export { LocalImage } from "./types/LocalImage"; export { LocalSite } from "./types/LocalSite"; export { LocalSiteId } from "./types/LocalSiteId"; export { LocalSiteRateLimit } from "./types/LocalSiteRateLimit"; export { LocalUser } from "./types/LocalUser"; export { LocalUserId } from "./types/LocalUserId"; export { LocalUserView } from "./types/LocalUserView"; +export { LocalUserVoteDisplayMode } from "./types/LocalUserVoteDisplayMode"; export { LockPost } from "./types/LockPost"; export { Login } from "./types/Login"; export { LoginResponse } from "./types/LoginResponse"; diff --git a/src/types/CommentReportView.ts b/src/types/CommentReportView.ts index c88f685..59ef498 100644 --- a/src/types/CommentReportView.ts +++ b/src/types/CommentReportView.ts @@ -5,6 +5,7 @@ import type { CommentReport } from "./CommentReport"; import type { Community } from "./Community"; import type { Person } from "./Person"; import type { Post } from "./Post"; +import type { SubscribedType } from "./SubscribedType"; export interface CommentReportView { comment_report: CommentReport; @@ -15,6 +16,11 @@ export interface CommentReportView { comment_creator: Person; counts: CommentAggregates; creator_banned_from_community: boolean; + creator_is_moderator: boolean; + creator_is_admin: boolean; + creator_blocked: boolean; + subscribed: SubscribedType; + saved: boolean; my_vote?: number; resolver?: Person; } diff --git a/src/types/ListMedia.ts b/src/types/ListMedia.ts deleted file mode 100644 index 618716f..0000000 --- a/src/types/ListMedia.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export interface ListMedia { - page?: /* integer */ number; - limit?: /* integer */ number; -} diff --git a/src/types/ListMediaResponse.ts b/src/types/ListMediaResponse.ts deleted file mode 100644 index ed042ff..0000000 --- a/src/types/ListMediaResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { LocalImage } from "./LocalImage"; - -export interface ListMediaResponse { - images: Array; -} diff --git a/src/types/LocalUserView.ts b/src/types/LocalUserView.ts index ea6f87e..2dd2381 100644 --- a/src/types/LocalUserView.ts +++ b/src/types/LocalUserView.ts @@ -1,10 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LocalUser } from "./LocalUser"; +import type { LocalUserVoteDisplayMode } from "./LocalUserVoteDisplayMode"; import type { Person } from "./Person"; import type { PersonAggregates } from "./PersonAggregates"; export interface LocalUserView { local_user: LocalUser; + local_user_vote_display_mode: LocalUserVoteDisplayMode; person: Person; counts: PersonAggregates; } diff --git a/src/types/LocalImage.ts b/src/types/LocalUserVoteDisplayMode.ts similarity index 58% rename from src/types/LocalImage.ts rename to src/types/LocalUserVoteDisplayMode.ts index 3b51683..141c02a 100644 --- a/src/types/LocalImage.ts +++ b/src/types/LocalUserVoteDisplayMode.ts @@ -1,9 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LocalUserId } from "./LocalUserId"; -export interface LocalImage { +export interface LocalUserVoteDisplayMode { local_user_id: LocalUserId; - pictrs_alias: string; - pictrs_delete_token: string; - published: string; + score: boolean; + upvotes: boolean; + downvotes: boolean; + upvote_percentage: boolean; } diff --git a/src/types/PostReportView.ts b/src/types/PostReportView.ts index 0c48f17..64845fe 100644 --- a/src/types/PostReportView.ts +++ b/src/types/PostReportView.ts @@ -4,6 +4,7 @@ import type { Person } from "./Person"; import type { Post } from "./Post"; import type { PostAggregates } from "./PostAggregates"; import type { PostReport } from "./PostReport"; +import type { SubscribedType } from "./SubscribedType"; export interface PostReportView { post_report: PostReport; @@ -12,7 +13,15 @@ export interface PostReportView { creator: Person; post_creator: Person; creator_banned_from_community: boolean; + creator_is_moderator: boolean; + creator_is_admin: boolean; + subscribed: SubscribedType; + saved: boolean; + read: boolean; + hidden: boolean; + creator_blocked: boolean; my_vote?: number; + unread_comments: /* integer */ number; counts: PostAggregates; resolver?: Person; } diff --git a/src/types/SaveUserSettings.ts b/src/types/SaveUserSettings.ts index f4f0375..c9c15fd 100644 --- a/src/types/SaveUserSettings.ts +++ b/src/types/SaveUserSettings.ts @@ -8,7 +8,6 @@ export interface SaveUserSettings { show_nsfw?: boolean; blur_nsfw?: boolean; auto_expand?: boolean; - show_scores?: boolean; theme?: string; default_sort_type?: SortType; default_listing_type?: ListingType; @@ -31,4 +30,8 @@ export interface SaveUserSettings { enable_keyboard_navigation?: boolean; enable_animated_images?: boolean; collapse_bot_comments?: boolean; + show_scores?: boolean; + show_upvotes?: boolean; + show_downvotes?: boolean; + show_upvote_percentage?: boolean; } diff --git a/src/types/Site.ts b/src/types/Site.ts index 1ed7ce6..071a21c 100644 --- a/src/types/Site.ts +++ b/src/types/Site.ts @@ -14,8 +14,6 @@ export interface Site { actor_id: string; last_refreshed_at: string; inbox_url: string; - private_key?: string; - public_key: string; instance_id: InstanceId; content_warning?: string; }