From b7e4cabd26d3269d41e9ad97ab3820f54f63aba0 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 5 Mar 2024 12:55:51 -0500 Subject: [PATCH] Adding listMedia, and a few more additions from main. --- src/http.ts | 15 +++++++++++++++ src/index.ts | 3 +++ src/types/GetModlog.ts | 4 ++++ src/types/ListCommentReports.ts | 2 ++ src/types/ListMedia.ts | 6 ++++++ src/types/ListMediaResponse.ts | 6 ++++++ src/types/ListPostReports.ts | 2 ++ src/types/LocalImage.ts | 9 +++++++++ src/types/ModlogListParams.ts | 4 ++++ 9 files changed, 51 insertions(+) create mode 100644 src/types/ListMedia.ts create mode 100644 src/types/ListMediaResponse.ts create mode 100644 src/types/LocalImage.ts diff --git a/src/http.ts b/src/http.ts index 337399f..6b1eb80 100644 --- a/src/http.ts +++ b/src/http.ts @@ -139,6 +139,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", @@ -290,6 +292,19 @@ 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 e1191c3..695fa45 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/GetModlog.ts b/src/types/GetModlog.ts index 75baaa0..449a303 100644 --- a/src/types/GetModlog.ts +++ b/src/types/GetModlog.ts @@ -1,7 +1,9 @@ // 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"; import type { CommunityId } from "./CommunityId"; import type { ModlogActionType } from "./ModlogActionType"; import type { PersonId } from "./PersonId"; +import type { PostId } from "./PostId"; export interface GetModlog { mod_person_id?: PersonId; @@ -10,4 +12,6 @@ export interface GetModlog { limit?: /* integer */ number; type_?: ModlogActionType; other_person_id?: PersonId; + post_id?: PostId; + comment_id?: CommentId; } diff --git a/src/types/ListCommentReports.ts b/src/types/ListCommentReports.ts index 7a700ad..e291323 100644 --- a/src/types/ListCommentReports.ts +++ b/src/types/ListCommentReports.ts @@ -1,7 +1,9 @@ // 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"; import type { CommunityId } from "./CommunityId"; export interface ListCommentReports { + comment_id?: CommentId; page?: /* integer */ number; limit?: /* integer */ number; unresolved_only?: boolean; 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/ListPostReports.ts b/src/types/ListPostReports.ts index 598a986..951d974 100644 --- a/src/types/ListPostReports.ts +++ b/src/types/ListPostReports.ts @@ -1,9 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommunityId } from "./CommunityId"; +import type { PostId } from "./PostId"; export interface ListPostReports { page?: /* integer */ number; limit?: /* integer */ number; unresolved_only?: boolean; community_id?: CommunityId; + post_id?: PostId; } diff --git a/src/types/LocalImage.ts b/src/types/LocalImage.ts new file mode 100644 index 0000000..3b51683 --- /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/ModlogListParams.ts b/src/types/ModlogListParams.ts index 577c558..85e8673 100644 --- a/src/types/ModlogListParams.ts +++ b/src/types/ModlogListParams.ts @@ -1,11 +1,15 @@ // 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"; import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; +import type { PostId } from "./PostId"; export interface ModlogListParams { community_id?: CommunityId; mod_person_id?: PersonId; other_person_id?: PersonId; + post_id?: PostId; + comment_id?: CommentId; page?: /* integer */ number; limit?: /* integer */ number; hide_modlog_names: boolean;