Private community

This commit is contained in:
Felix Ableitner 2024-10-08 11:03:54 +02:00
parent e80951df44
commit ebf8eb20c0
3 changed files with 36 additions and 1 deletions

View file

@ -154,6 +154,12 @@ import { ListTaglinesResponse } from "./types/ListTaglinesResponse";
import { ListCustomEmojis } from "./types/ListCustomEmojis"; import { ListCustomEmojis } from "./types/ListCustomEmojis";
import { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse"; import { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
import { GetRandomCommunity } from "./types/GetRandomCommunity"; import { GetRandomCommunity } from "./types/GetRandomCommunity";
import { ApproveCommunityPendingFollows } from "./types/ApproveCommunityPendingFollows";
import { GetCommunityPendingFollowsCount } from "./types/GetCommunityPendingFollowsCount";
import { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPendingFollowsCountResponse";
import { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
import { CommunityId } from "./types/CommunityId";
enum HttpType { enum HttpType {
Get = "GET", Get = "GET",
@ -448,6 +454,29 @@ export class LemmyHttp {
); );
} }
getCommunityPendingFollowsCount(community_id: CommunityId) {
const form: GetCommunityPendingFollowsCount = { community_id };
return this.#wrapper<
GetCommunityPendingFollowsCount,
GetCommunityPendingFollowsCountResponse
>(HttpType.Get, "/community/pending_follows/count", form);
}
listCommunityPendingFollows(form: ListCommunityPendingFollows) {
return this.#wrapper<
ListCommunityPendingFollows,
ListCommunityPendingFollowsResponse
>(HttpType.Get, "/community/pending_follows/list", form);
}
approveCommunityPendingFollow(form: ApproveCommunityPendingFollows) {
return this.#wrapper<ApproveCommunityPendingFollows, SuccessResponse>(
HttpType.Post,
"/community/pending_follows/approve",
form,
);
}
/** /**
* Block a community. * Block a community.
* *

View file

@ -18,6 +18,7 @@ export { AdminPurgePerson } from "./types/AdminPurgePerson";
export { AdminPurgePersonView } from "./types/AdminPurgePersonView"; export { AdminPurgePersonView } from "./types/AdminPurgePersonView";
export { AdminPurgePost } from "./types/AdminPurgePost"; export { AdminPurgePost } from "./types/AdminPurgePost";
export { AdminPurgePostView } from "./types/AdminPurgePostView"; export { AdminPurgePostView } from "./types/AdminPurgePostView";
export { ApproveCommunityPendingFollows } from "./types/ApproveCommunityPendingFollows";
export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication"; export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth"; export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
export { BanFromCommunity } from "./types/BanFromCommunity"; export { BanFromCommunity } from "./types/BanFromCommunity";
@ -49,6 +50,7 @@ export { CommentSortType } from "./types/CommentSortType";
export { CommentView } from "./types/CommentView"; export { CommentView } from "./types/CommentView";
export { Community } from "./types/Community"; export { Community } from "./types/Community";
export { CommunityAggregates } from "./types/CommunityAggregates"; export { CommunityAggregates } from "./types/CommunityAggregates";
export { CommunityFollowerState } from "./types/CommunityFollowerState";
export { CommunityFollowerView } from "./types/CommunityFollowerView"; export { CommunityFollowerView } from "./types/CommunityFollowerView";
export { CommunityId } from "./types/CommunityId"; export { CommunityId } from "./types/CommunityId";
export { CommunityModeratorView } from "./types/CommunityModeratorView"; export { CommunityModeratorView } from "./types/CommunityModeratorView";
@ -99,6 +101,8 @@ export { GetComment } from "./types/GetComment";
export { GetComments } from "./types/GetComments"; export { GetComments } from "./types/GetComments";
export { GetCommentsResponse } from "./types/GetCommentsResponse"; export { GetCommentsResponse } from "./types/GetCommentsResponse";
export { GetCommunity } from "./types/GetCommunity"; export { GetCommunity } from "./types/GetCommunity";
export { GetCommunityPendingFollowsCount } from "./types/GetCommunityPendingFollowsCount";
export { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPendingFollowsCountResponse";
export { GetCommunityResponse } from "./types/GetCommunityResponse"; export { GetCommunityResponse } from "./types/GetCommunityResponse";
export { GetFederatedInstancesResponse } from "./types/GetFederatedInstancesResponse"; export { GetFederatedInstancesResponse } from "./types/GetFederatedInstancesResponse";
export { GetModlog } from "./types/GetModlog"; export { GetModlog } from "./types/GetModlog";
@ -139,6 +143,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 { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
export { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
export { ListCustomEmojis } from "./types/ListCustomEmojis"; export { ListCustomEmojis } from "./types/ListCustomEmojis";
export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse"; export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
export { ListLoginsResponse } from "./types/ListLoginsResponse"; export { ListLoginsResponse } from "./types/ListLoginsResponse";

View file

@ -1,3 +1,3 @@
// 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.
export type CommunityVisibility = "Public" | "LocalOnly"; export type CommunityVisibility = "Public" | "LocalOnly" | "Private";