Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list media #244

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lemmy-js-client",
"description": "A javascript / typescript client for Lemmy",
"version": "0.19.4-alpha.6",
"version": "0.19.4-alpha.7",
"author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0",
"main": "./dist/index.js",
Expand Down
15 changes: 15 additions & 0 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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.
*
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down
4 changes: 4 additions & 0 deletions src/types/GetModlog.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -10,4 +12,6 @@ export interface GetModlog {
limit?: /* integer */ number;
type_?: ModlogActionType;
other_person_id?: PersonId;
post_id?: PostId;
comment_id?: CommentId;
}
2 changes: 2 additions & 0 deletions src/types/ListCommentReports.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/types/ListMedia.ts
Original file line number Diff line number Diff line change
@@ -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;
}
6 changes: 6 additions & 0 deletions src/types/ListMediaResponse.ts
Original file line number Diff line number Diff line change
@@ -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>;
}
2 changes: 2 additions & 0 deletions src/types/ListPostReports.ts
Original file line number Diff line number Diff line change
@@ -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;
}
9 changes: 9 additions & 0 deletions src/types/LocalImage.ts
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 4 additions & 0 deletions src/types/ModlogListParams.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down