Adding listMedia, and a few more additions from main.

This commit is contained in:
Dessalines 2024-03-05 12:55:51 -05:00
parent 97a3b59e8a
commit b7e4cabd26
9 changed files with 51 additions and 0 deletions

View file

@ -139,6 +139,8 @@ import { ListPostLikesResponse } from "./types/ListPostLikesResponse";
import { ListCommentLikes } from "./types/ListCommentLikes"; import { ListCommentLikes } from "./types/ListCommentLikes";
import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse"; import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
import { HidePost } from "./types/HidePost"; import { HidePost } from "./types/HidePost";
import { ListMedia } from "./types/ListMedia";
import { ListMediaResponse } from "./types/ListMediaResponse";
enum HttpType { enum HttpType {
Get = "GET", 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<ListMedia, ListMediaResponse>(
HttpType.Get,
"/user/list_media",
form,
);
}
/** /**
* Enable / Disable TOTP / two-factor authentication. * Enable / Disable TOTP / two-factor authentication.
* *

View file

@ -125,6 +125,8 @@ export { ListCommentReports } from "./types/ListCommentReports";
export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse"; export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
export { ListCommunities } from "./types/ListCommunities"; export { ListCommunities } from "./types/ListCommunities";
export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse"; export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
export { ListMedia } from "./types/ListMedia";
export { ListMediaResponse } from "./types/ListMediaResponse";
export { ListPostLikes } from "./types/ListPostLikes"; export { ListPostLikes } from "./types/ListPostLikes";
export { ListPostLikesResponse } from "./types/ListPostLikesResponse"; export { ListPostLikesResponse } from "./types/ListPostLikesResponse";
export { ListPostReports } from "./types/ListPostReports"; export { ListPostReports } from "./types/ListPostReports";
@ -134,6 +136,7 @@ export { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageRep
export { ListRegistrationApplications } from "./types/ListRegistrationApplications"; export { ListRegistrationApplications } from "./types/ListRegistrationApplications";
export { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse"; export { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
export { ListingType } from "./types/ListingType"; export { ListingType } from "./types/ListingType";
export { LocalImage } from "./types/LocalImage";
export { LocalSite } from "./types/LocalSite"; export { LocalSite } from "./types/LocalSite";
export { LocalSiteId } from "./types/LocalSiteId"; export { LocalSiteId } from "./types/LocalSiteId";
export { LocalSiteRateLimit } from "./types/LocalSiteRateLimit"; export { LocalSiteRateLimit } from "./types/LocalSiteRateLimit";

View file

@ -1,7 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // 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 { CommunityId } from "./CommunityId";
import type { ModlogActionType } from "./ModlogActionType"; import type { ModlogActionType } from "./ModlogActionType";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId";
export interface GetModlog { export interface GetModlog {
mod_person_id?: PersonId; mod_person_id?: PersonId;
@ -10,4 +12,6 @@ export interface GetModlog {
limit?: /* integer */ number; limit?: /* integer */ number;
type_?: ModlogActionType; type_?: ModlogActionType;
other_person_id?: PersonId; other_person_id?: PersonId;
post_id?: PostId;
comment_id?: CommentId;
} }

View file

@ -1,7 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // 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 { CommunityId } from "./CommunityId";
export interface ListCommentReports { export interface ListCommentReports {
comment_id?: CommentId;
page?: /* integer */ number; page?: /* integer */ number;
limit?: /* integer */ number; limit?: /* integer */ number;
unresolved_only?: boolean; unresolved_only?: boolean;

6
src/types/ListMedia.ts Normal file
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.
export interface ListMedia {
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 { LocalImage } from "./LocalImage";
export interface ListMediaResponse {
images: Array<LocalImage>;
}

View file

@ -1,9 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // 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 { CommunityId } from "./CommunityId";
import type { PostId } from "./PostId";
export interface ListPostReports { export interface ListPostReports {
page?: /* integer */ number; page?: /* integer */ number;
limit?: /* integer */ number; limit?: /* integer */ number;
unresolved_only?: boolean; unresolved_only?: boolean;
community_id?: CommunityId; community_id?: CommunityId;
post_id?: PostId;
} }

9
src/types/LocalImage.ts Normal file
View file

@ -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;
}

View file

@ -1,11 +1,15 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // 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 { CommunityId } from "./CommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId";
export interface ModlogListParams { export interface ModlogListParams {
community_id?: CommunityId; community_id?: CommunityId;
mod_person_id?: PersonId; mod_person_id?: PersonId;
other_person_id?: PersonId; other_person_id?: PersonId;
post_id?: PostId;
comment_id?: CommentId;
page?: /* integer */ number; page?: /* integer */ number;
limit?: /* integer */ number; limit?: /* integer */ number;
hide_modlog_names: boolean; hide_modlog_names: boolean;