diff --git a/src/http.ts b/src/http.ts index 73f8cc1..2d0e23f 100644 --- a/src/http.ts +++ b/src/http.ts @@ -137,6 +137,8 @@ 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", @@ -288,6 +290,32 @@ export class LemmyHttp { ); } + /** + * List all the media for your user + * + * `HTTP.GET /account/list_media` + */ + listMedia(form: ListMedia = {}) { + return this.#wrapper( + HttpType.Get, + "/account/list_media", + form, + ); + } + + /** + * List all the media known to your instance. + * + * `HTTP.GET /admin/list_all_media` + */ + listAllMedia(form: ListMedia = {}) { + return this.#wrapper( + HttpType.Get, + "/admin/list_all_media", + form, + ); + } + /** * Enable / Disable TOTP / two-factor authentication. * diff --git a/src/index.ts b/src/index.ts index 515a96f..e338a3f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -125,6 +125,8 @@ 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"; @@ -134,6 +136,7 @@ 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"; diff --git a/src/types/CommentReplyView.ts b/src/types/CommentReplyView.ts index 7b2e5db..b7348b4 100644 --- a/src/types/CommentReplyView.ts +++ b/src/types/CommentReplyView.ts @@ -16,6 +16,7 @@ export interface CommentReplyView { recipient: Person; counts: CommentAggregates; creator_banned_from_community: boolean; + banned_from_community: boolean; creator_is_moderator: boolean; creator_is_admin: boolean; subscribed: SubscribedType; diff --git a/src/types/ListMedia.ts b/src/types/ListMedia.ts new file mode 100644 index 0000000..618716f --- /dev/null +++ b/src/types/ListMedia.ts @@ -0,0 +1,6 @@ +// 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 new file mode 100644 index 0000000..ed042ff --- /dev/null +++ b/src/types/ListMediaResponse.ts @@ -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 { LocalImage } from "./LocalImage"; + +export interface ListMediaResponse { + images: Array; +} diff --git a/src/types/LocalImage.ts b/src/types/LocalImage.ts new file mode 100644 index 0000000..e0f5c4a --- /dev/null +++ b/src/types/LocalImage.ts @@ -0,0 +1,9 @@ +// 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 { + local_user_id?: LocalUserId; + pictrs_alias: string; + pictrs_delete_token: string; + published: string; +} diff --git a/src/types/PersonMentionView.ts b/src/types/PersonMentionView.ts index 7367a50..ecd7877 100644 --- a/src/types/PersonMentionView.ts +++ b/src/types/PersonMentionView.ts @@ -16,6 +16,7 @@ export interface PersonMentionView { recipient: Person; counts: CommentAggregates; creator_banned_from_community: boolean; + banned_from_community: boolean; creator_is_moderator: boolean; creator_is_admin: boolean; subscribed: SubscribedType; diff --git a/src/types/VoteView.ts b/src/types/VoteView.ts index d42272a..22d8ac8 100644 --- a/src/types/VoteView.ts +++ b/src/types/VoteView.ts @@ -3,5 +3,6 @@ import type { Person } from "./Person"; export interface VoteView { creator: Person; + creator_banned_from_community: boolean; score: number; }