Merge branch 'main' into pictrs-delete-token

This commit is contained in:
Felix Ableitner 2025-01-15 10:25:10 +01:00
commit d8d28bc4dd
81 changed files with 398 additions and 153 deletions

View file

@ -154,6 +154,10 @@ import { MyUserInfo } from "./types/MyUserInfo";
import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams"; import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams"; import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams"; import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
import { ListPersonContent } from "./types/ListPersonContent";
import { ListPersonContentResponse } from "./types/ListPersonContentResponse";
import { ListPersonSaved } from "./types/ListPersonSaved";
import { ListPersonSavedResponse } from "./types/ListPersonSavedResponse";
import { DeleteImageParams } from "./types/DeleteImageParams"; import { DeleteImageParams } from "./types/DeleteImageParams";
import { UploadImageResponse } from "./types/UploadImageResponse"; import { UploadImageResponse } from "./types/UploadImageResponse";
@ -1224,6 +1228,20 @@ export class LemmyHttp {
); );
} }
/**
* List the content for a person.
*
* `HTTP.GET /person/content`
*/
listPersonContent(form: ListPersonContent = {}, options?: RequestOptions) {
return this.#wrapper<ListPersonContent, ListPersonContentResponse>(
HttpType.Get,
"/person/content",
form,
options,
);
}
/** /**
* Get mentions for your user. * Get mentions for your user.
* *
@ -1468,6 +1486,20 @@ export class LemmyHttp {
); );
} }
/**
* List your saved content.
*
* `HTTP.GET /account/auth/saved`
*/
listPersonSaved(form: ListPersonSaved, options?: RequestOptions) {
return this.#wrapper<ListPersonSaved, ListPersonSavedResponse>(
HttpType.Post,
"/account/auth/saved",
form,
options,
);
}
/** /**
* Add an admin to your site. * Add an admin to your site.
* *

View file

@ -6,18 +6,24 @@ export { AddAdminResponse } from "./types/AddAdminResponse";
export { AddModToCommunity } from "./types/AddModToCommunity"; export { AddModToCommunity } from "./types/AddModToCommunity";
export { AddModToCommunityResponse } from "./types/AddModToCommunityResponse"; export { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
export { AdminAllowInstance } from "./types/AdminAllowInstance"; export { AdminAllowInstance } from "./types/AdminAllowInstance";
export { AdminAllowInstanceId } from "./types/AdminAllowInstanceId";
export { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams"; export { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
export { AdminAllowInstanceView } from "./types/AdminAllowInstanceView"; export { AdminAllowInstanceView } from "./types/AdminAllowInstanceView";
export { AdminBlockInstance } from "./types/AdminBlockInstance"; export { AdminBlockInstance } from "./types/AdminBlockInstance";
export { AdminBlockInstanceId } from "./types/AdminBlockInstanceId";
export { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams"; export { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
export { AdminBlockInstanceView } from "./types/AdminBlockInstanceView"; export { AdminBlockInstanceView } from "./types/AdminBlockInstanceView";
export { AdminPurgeComment } from "./types/AdminPurgeComment"; export { AdminPurgeComment } from "./types/AdminPurgeComment";
export { AdminPurgeCommentId } from "./types/AdminPurgeCommentId";
export { AdminPurgeCommentView } from "./types/AdminPurgeCommentView"; export { AdminPurgeCommentView } from "./types/AdminPurgeCommentView";
export { AdminPurgeCommunity } from "./types/AdminPurgeCommunity"; export { AdminPurgeCommunity } from "./types/AdminPurgeCommunity";
export { AdminPurgeCommunityId } from "./types/AdminPurgeCommunityId";
export { AdminPurgeCommunityView } from "./types/AdminPurgeCommunityView"; export { AdminPurgeCommunityView } from "./types/AdminPurgeCommunityView";
export { AdminPurgePerson } from "./types/AdminPurgePerson"; export { AdminPurgePerson } from "./types/AdminPurgePerson";
export { AdminPurgePersonId } from "./types/AdminPurgePersonId";
export { AdminPurgePersonView } from "./types/AdminPurgePersonView"; export { AdminPurgePersonView } from "./types/AdminPurgePersonView";
export { AdminPurgePost } from "./types/AdminPurgePost"; export { AdminPurgePost } from "./types/AdminPurgePost";
export { AdminPurgePostId } from "./types/AdminPurgePostId";
export { AdminPurgePostView } from "./types/AdminPurgePostView"; export { AdminPurgePostView } from "./types/AdminPurgePostView";
export { ApproveCommunityPendingFollower } from "./types/ApproveCommunityPendingFollower"; export { ApproveCommunityPendingFollower } from "./types/ApproveCommunityPendingFollower";
export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication"; export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
@ -53,6 +59,9 @@ 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";
export { CommunityReport } from "./types/CommunityReport";
export { CommunityReportId } from "./types/CommunityReportId";
export { CommunityReportView } from "./types/CommunityReportView";
export { CommunityResponse } from "./types/CommunityResponse"; export { CommunityResponse } from "./types/CommunityResponse";
export { CommunitySortType } from "./types/CommunitySortType"; export { CommunitySortType } from "./types/CommunitySortType";
export { CommunityView } from "./types/CommunityView"; export { CommunityView } from "./types/CommunityView";
@ -154,6 +163,10 @@ export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
export { ListLoginsResponse } from "./types/ListLoginsResponse"; export { ListLoginsResponse } from "./types/ListLoginsResponse";
export { ListMedia } from "./types/ListMedia"; export { ListMedia } from "./types/ListMedia";
export { ListMediaResponse } from "./types/ListMediaResponse"; export { ListMediaResponse } from "./types/ListMediaResponse";
export { ListPersonContent } from "./types/ListPersonContent";
export { ListPersonContentResponse } from "./types/ListPersonContentResponse";
export { ListPersonSaved } from "./types/ListPersonSaved";
export { ListPersonSavedResponse } from "./types/ListPersonSavedResponse";
export { ListPostLikes } from "./types/ListPostLikes"; export { ListPostLikes } from "./types/ListPostLikes";
export { ListPostLikesResponse } from "./types/ListPostLikesResponse"; export { ListPostLikesResponse } from "./types/ListPostLikesResponse";
export { ListRegistrationApplications } from "./types/ListRegistrationApplications"; export { ListRegistrationApplications } from "./types/ListRegistrationApplications";
@ -184,28 +197,40 @@ export { MarkPostAsRead } from "./types/MarkPostAsRead";
export { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead"; export { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
export { ModAdd } from "./types/ModAdd"; export { ModAdd } from "./types/ModAdd";
export { ModAddCommunity } from "./types/ModAddCommunity"; export { ModAddCommunity } from "./types/ModAddCommunity";
export { ModAddCommunityId } from "./types/ModAddCommunityId";
export { ModAddCommunityView } from "./types/ModAddCommunityView"; export { ModAddCommunityView } from "./types/ModAddCommunityView";
export { ModAddId } from "./types/ModAddId";
export { ModAddView } from "./types/ModAddView"; export { ModAddView } from "./types/ModAddView";
export { ModBan } from "./types/ModBan"; export { ModBan } from "./types/ModBan";
export { ModBanFromCommunity } from "./types/ModBanFromCommunity"; export { ModBanFromCommunity } from "./types/ModBanFromCommunity";
export { ModBanFromCommunityId } from "./types/ModBanFromCommunityId";
export { ModBanFromCommunityView } from "./types/ModBanFromCommunityView"; export { ModBanFromCommunityView } from "./types/ModBanFromCommunityView";
export { ModBanId } from "./types/ModBanId";
export { ModBanView } from "./types/ModBanView"; export { ModBanView } from "./types/ModBanView";
export { ModFeaturePost } from "./types/ModFeaturePost"; export { ModFeaturePost } from "./types/ModFeaturePost";
export { ModFeaturePostId } from "./types/ModFeaturePostId";
export { ModFeaturePostView } from "./types/ModFeaturePostView"; export { ModFeaturePostView } from "./types/ModFeaturePostView";
export { ModHideCommunity } from "./types/ModHideCommunity"; export { ModHideCommunity } from "./types/ModHideCommunity";
export { ModHideCommunityId } from "./types/ModHideCommunityId";
export { ModHideCommunityView } from "./types/ModHideCommunityView"; export { ModHideCommunityView } from "./types/ModHideCommunityView";
export { ModLockPost } from "./types/ModLockPost"; export { ModLockPost } from "./types/ModLockPost";
export { ModLockPostId } from "./types/ModLockPostId";
export { ModLockPostView } from "./types/ModLockPostView"; export { ModLockPostView } from "./types/ModLockPostView";
export { ModRemoveComment } from "./types/ModRemoveComment"; export { ModRemoveComment } from "./types/ModRemoveComment";
export { ModRemoveCommentId } from "./types/ModRemoveCommentId";
export { ModRemoveCommentView } from "./types/ModRemoveCommentView"; export { ModRemoveCommentView } from "./types/ModRemoveCommentView";
export { ModRemoveCommunity } from "./types/ModRemoveCommunity"; export { ModRemoveCommunity } from "./types/ModRemoveCommunity";
export { ModRemoveCommunityId } from "./types/ModRemoveCommunityId";
export { ModRemoveCommunityView } from "./types/ModRemoveCommunityView"; export { ModRemoveCommunityView } from "./types/ModRemoveCommunityView";
export { ModRemovePost } from "./types/ModRemovePost"; export { ModRemovePost } from "./types/ModRemovePost";
export { ModRemovePostId } from "./types/ModRemovePostId";
export { ModRemovePostView } from "./types/ModRemovePostView"; export { ModRemovePostView } from "./types/ModRemovePostView";
export { ModTransferCommunity } from "./types/ModTransferCommunity"; export { ModTransferCommunity } from "./types/ModTransferCommunity";
export { ModTransferCommunityId } from "./types/ModTransferCommunityId";
export { ModTransferCommunityView } from "./types/ModTransferCommunityView"; export { ModTransferCommunityView } from "./types/ModTransferCommunityView";
export { ModlogActionType } from "./types/ModlogActionType"; export { ModlogActionType } from "./types/ModlogActionType";
export { ModlogListParams } from "./types/ModlogListParams"; export { ModlogCombinedPaginationCursor } from "./types/ModlogCombinedPaginationCursor";
export { ModlogCombinedView } from "./types/ModlogCombinedView";
export { MyUserInfo } from "./types/MyUserInfo"; export { MyUserInfo } from "./types/MyUserInfo";
export { OAuthAccount } from "./types/OAuthAccount"; export { OAuthAccount } from "./types/OAuthAccount";
export { OAuthProvider } from "./types/OAuthProvider"; export { OAuthProvider } from "./types/OAuthProvider";
@ -217,11 +242,15 @@ export { PasswordReset } from "./types/PasswordReset";
export { PendingFollow } from "./types/PendingFollow"; export { PendingFollow } from "./types/PendingFollow";
export { Person } from "./types/Person"; export { Person } from "./types/Person";
export { PersonAggregates } from "./types/PersonAggregates"; export { PersonAggregates } from "./types/PersonAggregates";
export { PersonContentCombinedPaginationCursor } from "./types/PersonContentCombinedPaginationCursor";
export { PersonContentCombinedView } from "./types/PersonContentCombinedView";
export { PersonContentType } from "./types/PersonContentType";
export { PersonId } from "./types/PersonId"; export { PersonId } from "./types/PersonId";
export { PersonMention } from "./types/PersonMention"; export { PersonMention } from "./types/PersonMention";
export { PersonMentionId } from "./types/PersonMentionId"; export { PersonMentionId } from "./types/PersonMentionId";
export { PersonMentionResponse } from "./types/PersonMentionResponse"; export { PersonMentionResponse } from "./types/PersonMentionResponse";
export { PersonMentionView } from "./types/PersonMentionView"; export { PersonMentionView } from "./types/PersonMentionView";
export { PersonSavedCombinedPaginationCursor } from "./types/PersonSavedCombinedPaginationCursor";
export { PersonView } from "./types/PersonView"; export { PersonView } from "./types/PersonView";
export { Post } from "./types/Post"; export { Post } from "./types/Post";
export { PostAggregates } from "./types/PostAggregates"; export { PostAggregates } from "./types/PostAggregates";
@ -234,6 +263,7 @@ export { PostReportResponse } from "./types/PostReportResponse";
export { PostReportView } from "./types/PostReportView"; export { PostReportView } from "./types/PostReportView";
export { PostResponse } from "./types/PostResponse"; export { PostResponse } from "./types/PostResponse";
export { PostSortType } from "./types/PostSortType"; export { PostSortType } from "./types/PostSortType";
export { PostTags } from "./types/PostTags";
export { PostView } from "./types/PostView"; export { PostView } from "./types/PostView";
export { PrivateMessage } from "./types/PrivateMessage"; export { PrivateMessage } from "./types/PrivateMessage";
export { PrivateMessageId } from "./types/PrivateMessageId"; export { PrivateMessageId } from "./types/PrivateMessageId";
@ -259,8 +289,6 @@ export { RegistrationMode } from "./types/RegistrationMode";
export { RemoveComment } from "./types/RemoveComment"; export { RemoveComment } from "./types/RemoveComment";
export { RemoveCommunity } from "./types/RemoveCommunity"; export { RemoveCommunity } from "./types/RemoveCommunity";
export { RemovePost } from "./types/RemovePost"; export { RemovePost } from "./types/RemovePost";
export { ReportCombined } from "./types/ReportCombined";
export { ReportCombinedId } from "./types/ReportCombinedId";
export { ReportCombinedPaginationCursor } from "./types/ReportCombinedPaginationCursor"; export { ReportCombinedPaginationCursor } from "./types/ReportCombinedPaginationCursor";
export { ReportCombinedView } from "./types/ReportCombinedView"; export { ReportCombinedView } from "./types/ReportCombinedView";
export { ResolveCommentReport } from "./types/ResolveCommentReport"; export { ResolveCommentReport } from "./types/ResolveCommentReport";
@ -282,6 +310,8 @@ export { SiteResponse } from "./types/SiteResponse";
export { SiteView } from "./types/SiteView"; export { SiteView } from "./types/SiteView";
export { SubscribedType } from "./types/SubscribedType"; export { SubscribedType } from "./types/SubscribedType";
export { SuccessResponse } from "./types/SuccessResponse"; export { SuccessResponse } from "./types/SuccessResponse";
export { Tag } from "./types/Tag";
export { TagId } from "./types/TagId";
export { Tagline } from "./types/Tagline"; export { Tagline } from "./types/Tagline";
export { TaglineId } from "./types/TaglineId"; export { TaglineId } from "./types/TaglineId";
export { TaglineResponse } from "./types/TaglineResponse"; export { TaglineResponse } from "./types/TaglineResponse";

View file

@ -1,12 +1,13 @@
// 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 { AdminAllowInstanceId } from "./AdminAllowInstanceId";
import type { InstanceId } from "./InstanceId"; import type { InstanceId } from "./InstanceId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export type AdminAllowInstance = { export type AdminAllowInstance = {
id: number; id: AdminAllowInstanceId;
instance_id: InstanceId; instance_id: InstanceId;
admin_person_id: PersonId; admin_person_id: PersonId;
allowed: boolean; allowed: boolean;
reason?: string; reason?: string;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AdminAllowInstanceId = number;

View file

@ -7,7 +7,7 @@ import type { Person } from "./Person";
* When an admin purges a post. * When an admin purges a post.
*/ */
export type AdminAllowInstanceView = { export type AdminAllowInstanceView = {
admin_block_instance: AdminAllowInstance; admin_allow_instance: AdminAllowInstance;
instance: Instance; instance: Instance;
admin?: Person; admin?: Person;
}; };

View file

@ -1,13 +1,14 @@
// 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 { AdminBlockInstanceId } from "./AdminBlockInstanceId";
import type { InstanceId } from "./InstanceId"; import type { InstanceId } from "./InstanceId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export type AdminBlockInstance = { export type AdminBlockInstance = {
id: number; id: AdminBlockInstanceId;
instance_id: InstanceId; instance_id: InstanceId;
admin_person_id: PersonId; admin_person_id: PersonId;
blocked: boolean; blocked: boolean;
reason?: string; reason?: string;
expires?: string; expires?: string;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AdminBlockInstanceId = number;

View file

@ -1,4 +1,5 @@
// 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 { AdminPurgeCommentId } from "./AdminPurgeCommentId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
@ -6,9 +7,9 @@ import type { PostId } from "./PostId";
* When an admin purges a comment. * When an admin purges a comment.
*/ */
export type AdminPurgeComment = { export type AdminPurgeComment = {
id: number; id: AdminPurgeCommentId;
admin_person_id: PersonId; admin_person_id: PersonId;
post_id: PostId; post_id: PostId;
reason?: string; reason?: string;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AdminPurgeCommentId = number;

View file

@ -1,12 +1,13 @@
// 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 { AdminPurgeCommunityId } from "./AdminPurgeCommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When an admin purges a community. * When an admin purges a community.
*/ */
export type AdminPurgeCommunity = { export type AdminPurgeCommunity = {
id: number; id: AdminPurgeCommunityId;
admin_person_id: PersonId; admin_person_id: PersonId;
reason?: string; reason?: string;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AdminPurgeCommunityId = number;

View file

@ -1,12 +1,13 @@
// 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 { AdminPurgePersonId } from "./AdminPurgePersonId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When an admin purges a person. * When an admin purges a person.
*/ */
export type AdminPurgePerson = { export type AdminPurgePerson = {
id: number; id: AdminPurgePersonId;
admin_person_id: PersonId; admin_person_id: PersonId;
reason?: string; reason?: string;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AdminPurgePersonId = number;

View file

@ -1,4 +1,5 @@
// 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 { AdminPurgePostId } from "./AdminPurgePostId";
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
@ -6,9 +7,9 @@ import type { PersonId } from "./PersonId";
* When an admin purges a post. * When an admin purges a post.
*/ */
export type AdminPurgePost = { export type AdminPurgePost = {
id: number; id: AdminPurgePostId;
admin_person_id: PersonId; admin_person_id: PersonId;
community_id: CommunityId; community_id: CommunityId;
reason?: string; reason?: string;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AdminPurgePostId = number;

View file

@ -27,4 +27,6 @@ export type CommunityAggregates = {
*/ */
users_active_half_year: number; users_active_half_year: number;
subscribers_local: number; subscribers_local: number;
report_count: number;
unresolved_report_count: number;
}; };

View file

@ -0,0 +1,24 @@
// 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 { CommunityReportId } from "./CommunityReportId";
import type { PersonId } from "./PersonId";
/**
* A comment report.
*/
export type CommunityReport = {
id: CommunityReportId;
creator_id: PersonId;
community_id: CommunityId;
original_community_name: string;
original_community_title: string;
original_community_description?: string;
original_community_sidebar?: string;
original_community_icon?: string;
original_community_banner?: string;
reason: string;
resolved: boolean;
resolver_id?: PersonId;
published: string;
updated?: string;
};

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.
/**
* The community report id.
*/
export type CommunityReportId = number;

View file

@ -0,0 +1,18 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Community } from "./Community";
import type { CommunityAggregates } from "./CommunityAggregates";
import type { CommunityReport } from "./CommunityReport";
import type { Person } from "./Person";
import type { SubscribedType } from "./SubscribedType";
/**
* A community report view.
*/
export type CommunityReportView = {
community_report: CommunityReport;
community: Community;
creator: Person;
counts: CommunityAggregates;
subscribed: SubscribedType;
resolver?: Person;
};

View file

@ -1,6 +1,7 @@
// 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 { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
import type { TagId } from "./TagId";
/** /**
* Create a post. * Create a post.
@ -27,6 +28,7 @@ export type CreatePost = {
* Instead of fetching a thumbnail, use a custom one. * Instead of fetching a thumbnail, use a custom one.
*/ */
custom_thumbnail?: string; custom_thumbnail?: string;
tags?: Array<TagId>;
/** /**
* Time when this post should be scheduled. Null means publish immediately. * Time when this post should be scheduled. Null means publish immediately.
*/ */

View file

@ -14,7 +14,6 @@ export type CreateSite = {
name: string; name: string;
sidebar?: string; sidebar?: string;
description?: string; description?: string;
enable_nsfw?: boolean;
community_creation_admin_only?: boolean; community_creation_admin_only?: boolean;
require_email_verification?: boolean; require_email_verification?: boolean;
application_question?: string; application_question?: string;
@ -43,7 +42,6 @@ export type CreateSite = {
rate_limit_search?: number; rate_limit_search?: number;
rate_limit_search_per_second?: number; rate_limit_search_per_second?: number;
federation_enabled?: boolean; federation_enabled?: boolean;
federation_debug?: boolean;
captcha_enabled?: boolean; captcha_enabled?: boolean;
captcha_difficulty?: string; captcha_difficulty?: string;
registration_mode?: RegistrationMode; registration_mode?: RegistrationMode;

View file

@ -1,6 +1,7 @@
// 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 { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
import type { TagId } from "./TagId";
/** /**
* Edit a post. * Edit a post.
@ -23,6 +24,7 @@ export type EditPost = {
* Instead of fetching a thumbnail, use a custom one. * Instead of fetching a thumbnail, use a custom one.
*/ */
custom_thumbnail?: string; custom_thumbnail?: string;
tags?: Array<TagId>;
/** /**
* Time when this post should be scheduled. Null means publish immediately. * Time when this post should be scheduled. Null means publish immediately.
*/ */

View file

@ -20,10 +20,6 @@ export type EditSite = {
* A shorter, one line description of your site. * A shorter, one line description of your site.
*/ */
description?: string; description?: string;
/**
* Whether to enable NSFW.
*/
enable_nsfw?: boolean;
/** /**
* Limits community creation to admins only. * Limits community creation to admins only.
*/ */
@ -118,10 +114,6 @@ export type EditSite = {
* Whether to enable federation. * Whether to enable federation.
*/ */
federation_enabled?: boolean; federation_enabled?: boolean;
/**
* Enables federation debugging.
*/
federation_debug?: boolean;
/** /**
* Whether to enable captchas for signups. * Whether to enable captchas for signups.
*/ */

View file

@ -4,7 +4,6 @@
* Federation related errors, these dont need to be translated. * Federation related errors, these dont need to be translated.
*/ */
export type FederationError = export type FederationError =
| "CouldntFindActivity"
| "InvalidCommunity" | "InvalidCommunity"
| "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" | "CannotCreatePostOrCommentInDeletedOrRemovedCommunity"
| "CannotReceivePage" | "CannotReceivePage"

View file

@ -18,7 +18,6 @@ export type GetComments = {
community_name?: string; community_name?: string;
post_id?: PostId; post_id?: PostId;
parent_id?: CommentId; parent_id?: CommentId;
saved_only?: boolean;
liked_only?: boolean; liked_only?: boolean;
disliked_only?: boolean; disliked_only?: boolean;
}; };

View file

@ -2,6 +2,7 @@
import type { CommentId } from "./CommentId"; 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 { ModlogCombinedPaginationCursor } from "./ModlogCombinedPaginationCursor";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
@ -11,10 +12,10 @@ import type { PostId } from "./PostId";
export type GetModlog = { export type GetModlog = {
mod_person_id?: PersonId; mod_person_id?: PersonId;
community_id?: CommunityId; community_id?: CommunityId;
page?: number;
limit?: number;
type_?: ModlogActionType; type_?: ModlogActionType;
other_person_id?: PersonId; other_person_id?: PersonId;
post_id?: PostId; post_id?: PostId;
comment_id?: CommentId; comment_id?: CommentId;
page_cursor?: ModlogCombinedPaginationCursor;
page_back?: boolean;
}; };

View file

@ -1,41 +1,7 @@
// 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 { AdminAllowInstanceView } from "./AdminAllowInstanceView"; import type { ModlogCombinedView } from "./ModlogCombinedView";
import type { AdminBlockInstanceView } from "./AdminBlockInstanceView";
import type { AdminPurgeCommentView } from "./AdminPurgeCommentView";
import type { AdminPurgeCommunityView } from "./AdminPurgeCommunityView";
import type { AdminPurgePersonView } from "./AdminPurgePersonView";
import type { AdminPurgePostView } from "./AdminPurgePostView";
import type { ModAddCommunityView } from "./ModAddCommunityView";
import type { ModAddView } from "./ModAddView";
import type { ModBanFromCommunityView } from "./ModBanFromCommunityView";
import type { ModBanView } from "./ModBanView";
import type { ModFeaturePostView } from "./ModFeaturePostView";
import type { ModHideCommunityView } from "./ModHideCommunityView";
import type { ModLockPostView } from "./ModLockPostView";
import type { ModRemoveCommentView } from "./ModRemoveCommentView";
import type { ModRemoveCommunityView } from "./ModRemoveCommunityView";
import type { ModRemovePostView } from "./ModRemovePostView";
import type { ModTransferCommunityView } from "./ModTransferCommunityView";
/** /**
* The modlog fetch response. * The modlog fetch response.
*/ */
export type GetModlogResponse = { export type GetModlogResponse = { modlog: Array<ModlogCombinedView> };
removed_posts: Array<ModRemovePostView>;
locked_posts: Array<ModLockPostView>;
featured_posts: Array<ModFeaturePostView>;
removed_comments: Array<ModRemoveCommentView>;
removed_communities: Array<ModRemoveCommunityView>;
banned_from_community: Array<ModBanFromCommunityView>;
banned: Array<ModBanView>;
added_to_community: Array<ModAddCommunityView>;
transferred_to_community: Array<ModTransferCommunityView>;
added: Array<ModAddView>;
admin_purged_persons: Array<AdminPurgePersonView>;
admin_purged_communities: Array<AdminPurgeCommunityView>;
admin_purged_posts: Array<AdminPurgePostView>;
admin_purged_comments: Array<AdminPurgeCommentView>;
hidden_communities: Array<ModHideCommunityView>;
admin_block_instance: Array<AdminBlockInstanceView>;
admin_allow_instance: Array<AdminAllowInstanceView>;
};

View file

@ -1,7 +1,5 @@
// 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 { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostSortType } from "./PostSortType";
/** /**
* Gets a person's details. * Gets a person's details.
@ -14,9 +12,4 @@ export type GetPersonDetails = {
* Example: dessalines , or dessalines@xyz.tld * Example: dessalines , or dessalines@xyz.tld
*/ */
username?: string; username?: string;
sort?: PostSortType;
page?: number;
limit?: number;
community_id?: CommunityId;
saved_only?: boolean;
}; };

View file

@ -1,8 +1,6 @@
// 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 { CommentView } from "./CommentView";
import type { CommunityModeratorView } from "./CommunityModeratorView"; import type { CommunityModeratorView } from "./CommunityModeratorView";
import type { PersonView } from "./PersonView"; import type { PersonView } from "./PersonView";
import type { PostView } from "./PostView";
import type { Site } from "./Site"; import type { Site } from "./Site";
/** /**
@ -11,7 +9,5 @@ import type { Site } from "./Site";
export type GetPersonDetailsResponse = { export type GetPersonDetailsResponse = {
person_view: PersonView; person_view: PersonView;
site?: Site; site?: Site;
comments: Array<CommentView>;
posts: Array<PostView>;
moderates: Array<CommunityModeratorView>; moderates: Array<CommunityModeratorView>;
}; };

View file

@ -18,6 +18,7 @@ export type GetPosts = {
community_id?: CommunityId; community_id?: CommunityId;
community_name?: string; community_name?: string;
saved_only?: boolean; saved_only?: boolean;
read_only?: boolean;
liked_only?: boolean; liked_only?: boolean;
disliked_only?: boolean; disliked_only?: boolean;
show_hidden?: boolean; show_hidden?: boolean;

View file

@ -17,14 +17,6 @@ export type GetSiteResponse = {
version: string; version: string;
all_languages: Array<Language>; all_languages: Array<Language>;
discussion_languages: Array<LanguageId>; discussion_languages: Array<LanguageId>;
/**
* deprecated, use field `tagline` or /api/v3/tagline/list
*/
taglines: Array<null>;
/**
* deprecated, use /api/v3/custom_emoji/list
*/
custom_emojis: Array<null>;
/** /**
* If the site has any taglines, a random one is included here for displaying * If the site has any taglines, a random one is included here for displaying
*/ */

View file

@ -105,7 +105,6 @@ export type LemmyErrorType =
| { error: "system_err_login" } | { error: "system_err_login" }
| { error: "couldnt_set_all_registrations_accepted" } | { error: "couldnt_set_all_registrations_accepted" }
| { error: "couldnt_set_all_email_verified" } | { error: "couldnt_set_all_email_verified" }
| { error: "banned" }
| { error: "blocked_url" } | { error: "blocked_url" }
| { error: "couldnt_get_comments" } | { error: "couldnt_get_comments" }
| { error: "couldnt_get_posts" } | { error: "couldnt_get_posts" }

View file

@ -0,0 +1,20 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonContentCombinedPaginationCursor } from "./PersonContentCombinedPaginationCursor";
import type { PersonContentType } from "./PersonContentType";
import type { PersonId } from "./PersonId";
/**
* Gets a person's content (posts and comments)
*
* Either person_id, or username are required.
*/
export type ListPersonContent = {
type_?: PersonContentType;
person_id?: PersonId;
/**
* Example: dessalines , or dessalines@xyz.tld
*/
username?: string;
page_cursor?: PersonContentCombinedPaginationCursor;
page_back?: boolean;
};

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 { PersonContentCombinedView } from "./PersonContentCombinedView";
/**
* A person's content response.
*/
export type ListPersonContentResponse = {
content: Array<PersonContentCombinedView>;
};

View file

@ -0,0 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonContentType } from "./PersonContentType";
import type { PersonSavedCombinedPaginationCursor } from "./PersonSavedCombinedPaginationCursor";
/**
* Gets your saved posts and comments
*/
export type ListPersonSaved = {
type_?: PersonContentType;
page_cursor?: PersonSavedCombinedPaginationCursor;
page_back?: boolean;
};

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 { PersonContentCombinedView } from "./PersonContentCombinedView";
/**
* A person's saved content response.
*/
export type ListPersonSavedResponse = {
saved: Array<PersonContentCombinedView>;
};

View file

@ -1,13 +1,14 @@
// 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 { ModAddId } from "./ModAddId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When someone is added as a site moderator. * When someone is added as a site moderator.
*/ */
export type ModAdd = { export type ModAdd = {
id: number; id: ModAddId;
mod_person_id: PersonId; mod_person_id: PersonId;
other_person_id: PersonId; other_person_id: PersonId;
removed: boolean; removed: boolean;
when_: string; published: string;
}; };

View file

@ -1,15 +1,16 @@
// 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 { ModAddCommunityId } from "./ModAddCommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When someone is added as a community moderator. * When someone is added as a community moderator.
*/ */
export type ModAddCommunity = { export type ModAddCommunity = {
id: number; id: ModAddCommunityId;
mod_person_id: PersonId; mod_person_id: PersonId;
other_person_id: PersonId; other_person_id: PersonId;
community_id: CommunityId; community_id: CommunityId;
removed: boolean; removed: boolean;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModAddCommunityId = number;

View file

@ -10,5 +10,5 @@ export type ModAddCommunityView = {
mod_add_community: ModAddCommunity; mod_add_community: ModAddCommunity;
moderator?: Person; moderator?: Person;
community: Community; community: Community;
modded_person: Person; other_person: Person;
}; };

3
src/types/ModAddId.ts Normal file
View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModAddId = number;

View file

@ -8,5 +8,5 @@ import type { Person } from "./Person";
export type ModAddView = { export type ModAddView = {
mod_add: ModAdd; mod_add: ModAdd;
moderator?: Person; moderator?: Person;
modded_person: Person; other_person: Person;
}; };

View file

@ -1,15 +1,16 @@
// 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 { ModBanId } from "./ModBanId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When someone is banned from the site. * When someone is banned from the site.
*/ */
export type ModBan = { export type ModBan = {
id: number; id: ModBanId;
mod_person_id: PersonId; mod_person_id: PersonId;
other_person_id: PersonId; other_person_id: PersonId;
reason?: string; reason?: string;
banned: boolean; banned: boolean;
expires?: string; expires?: string;
when_: string; published: string;
}; };

View file

@ -1,17 +1,18 @@
// 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 { ModBanFromCommunityId } from "./ModBanFromCommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When someone is banned from a community. * When someone is banned from a community.
*/ */
export type ModBanFromCommunity = { export type ModBanFromCommunity = {
id: number; id: ModBanFromCommunityId;
mod_person_id: PersonId; mod_person_id: PersonId;
other_person_id: PersonId; other_person_id: PersonId;
community_id: CommunityId; community_id: CommunityId;
reason?: string; reason?: string;
banned: boolean; banned: boolean;
expires?: string; expires?: string;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModBanFromCommunityId = number;

View file

@ -10,5 +10,5 @@ export type ModBanFromCommunityView = {
mod_ban_from_community: ModBanFromCommunity; mod_ban_from_community: ModBanFromCommunity;
moderator?: Person; moderator?: Person;
community: Community; community: Community;
banned_person: Person; other_person: Person;
}; };

3
src/types/ModBanId.ts Normal file
View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModBanId = number;

View file

@ -8,5 +8,5 @@ import type { Person } from "./Person";
export type ModBanView = { export type ModBanView = {
mod_ban: ModBan; mod_ban: ModBan;
moderator?: Person; moderator?: Person;
banned_person: Person; other_person: Person;
}; };

View file

@ -1,4 +1,5 @@
// 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 { ModFeaturePostId } from "./ModFeaturePostId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
@ -6,10 +7,10 @@ import type { PostId } from "./PostId";
* When a moderator features a post on a community (pins it to the top). * When a moderator features a post on a community (pins it to the top).
*/ */
export type ModFeaturePost = { export type ModFeaturePost = {
id: number; id: ModFeaturePostId;
mod_person_id: PersonId; mod_person_id: PersonId;
post_id: PostId; post_id: PostId;
featured: boolean; featured: boolean;
when_: string; published: string;
is_featured_community: boolean; is_featured_community: boolean;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModFeaturePostId = number;

View file

@ -10,6 +10,7 @@ import type { Post } from "./Post";
export type ModFeaturePostView = { export type ModFeaturePostView = {
mod_feature_post: ModFeaturePost; mod_feature_post: ModFeaturePost;
moderator?: Person; moderator?: Person;
other_person: Person;
post: Post; post: Post;
community: Community; community: Community;
}; };

View file

@ -1,15 +1,16 @@
// 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 { ModHideCommunityId } from "./ModHideCommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When a community is hidden from public view. * When a community is hidden from public view.
*/ */
export type ModHideCommunity = { export type ModHideCommunity = {
id: number; id: ModHideCommunityId;
community_id: CommunityId; community_id: CommunityId;
mod_person_id: PersonId; mod_person_id: PersonId;
when_: string; published: string;
reason?: string; reason?: string;
hidden: boolean; hidden: boolean;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModHideCommunityId = number;

View file

@ -1,4 +1,5 @@
// 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 { ModLockPostId } from "./ModLockPostId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
@ -6,9 +7,9 @@ import type { PostId } from "./PostId";
* When a moderator locks a post (prevents new comments being made). * When a moderator locks a post (prevents new comments being made).
*/ */
export type ModLockPost = { export type ModLockPost = {
id: number; id: ModLockPostId;
mod_person_id: PersonId; mod_person_id: PersonId;
post_id: PostId; post_id: PostId;
locked: boolean; locked: boolean;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModLockPostId = number;

View file

@ -10,6 +10,7 @@ import type { Post } from "./Post";
export type ModLockPostView = { export type ModLockPostView = {
mod_lock_post: ModLockPost; mod_lock_post: ModLockPost;
moderator?: Person; moderator?: Person;
other_person: Person;
post: Post; post: Post;
community: Community; community: Community;
}; };

View file

@ -1,15 +1,16 @@
// 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 { CommentId } from "./CommentId";
import type { ModRemoveCommentId } from "./ModRemoveCommentId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When a moderator removes a comment. * When a moderator removes a comment.
*/ */
export type ModRemoveComment = { export type ModRemoveComment = {
id: number; id: ModRemoveCommentId;
mod_person_id: PersonId; mod_person_id: PersonId;
comment_id: CommentId; comment_id: CommentId;
reason?: string; reason?: string;
removed: boolean; removed: boolean;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModRemoveCommentId = number;

View file

@ -11,8 +11,8 @@ import type { Post } from "./Post";
export type ModRemoveCommentView = { export type ModRemoveCommentView = {
mod_remove_comment: ModRemoveComment; mod_remove_comment: ModRemoveComment;
moderator?: Person; moderator?: Person;
other_person: Person;
comment: Comment; comment: Comment;
commenter: Person;
post: Post; post: Post;
community: Community; community: Community;
}; };

View file

@ -1,15 +1,16 @@
// 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 { ModRemoveCommunityId } from "./ModRemoveCommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When a moderator removes a community. * When a moderator removes a community.
*/ */
export type ModRemoveCommunity = { export type ModRemoveCommunity = {
id: number; id: ModRemoveCommunityId;
mod_person_id: PersonId; mod_person_id: PersonId;
community_id: CommunityId; community_id: CommunityId;
reason?: string; reason?: string;
removed: boolean; removed: boolean;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModRemoveCommunityId = number;

View file

@ -1,4 +1,5 @@
// 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 { ModRemovePostId } from "./ModRemovePostId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
@ -6,10 +7,10 @@ import type { PostId } from "./PostId";
* When a moderator removes a post. * When a moderator removes a post.
*/ */
export type ModRemovePost = { export type ModRemovePost = {
id: number; id: ModRemovePostId;
mod_person_id: PersonId; mod_person_id: PersonId;
post_id: PostId; post_id: PostId;
reason?: string; reason?: string;
removed: boolean; removed: boolean;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModRemovePostId = number;

View file

@ -10,6 +10,7 @@ import type { Post } from "./Post";
export type ModRemovePostView = { export type ModRemovePostView = {
mod_remove_post: ModRemovePost; mod_remove_post: ModRemovePost;
moderator?: Person; moderator?: Person;
other_person: Person;
post: Post; post: Post;
community: Community; community: Community;
}; };

View file

@ -1,14 +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 { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
import type { ModTransferCommunityId } from "./ModTransferCommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
/** /**
* When a moderator transfers a community to a new owner. * When a moderator transfers a community to a new owner.
*/ */
export type ModTransferCommunity = { export type ModTransferCommunity = {
id: number; id: ModTransferCommunityId;
mod_person_id: PersonId; mod_person_id: PersonId;
other_person_id: PersonId; other_person_id: PersonId;
community_id: CommunityId; community_id: CommunityId;
when_: string; published: string;
}; };

View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ModTransferCommunityId = number;

View file

@ -10,5 +10,5 @@ export type ModTransferCommunityView = {
mod_transfer_community: ModTransferCommunity; mod_transfer_community: ModTransferCommunity;
moderator?: Person; moderator?: Person;
community: Community; community: Community;
modded_person: Person; other_person: Person;
}; };

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.
/**
* like PaginationCursor but for the modlog_combined
*/
export type ModlogCombinedPaginationCursor = string;

View file

@ -0,0 +1,37 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AdminAllowInstanceView } from "./AdminAllowInstanceView";
import type { AdminBlockInstanceView } from "./AdminBlockInstanceView";
import type { AdminPurgeCommentView } from "./AdminPurgeCommentView";
import type { AdminPurgeCommunityView } from "./AdminPurgeCommunityView";
import type { AdminPurgePersonView } from "./AdminPurgePersonView";
import type { AdminPurgePostView } from "./AdminPurgePostView";
import type { ModAddCommunityView } from "./ModAddCommunityView";
import type { ModAddView } from "./ModAddView";
import type { ModBanFromCommunityView } from "./ModBanFromCommunityView";
import type { ModBanView } from "./ModBanView";
import type { ModFeaturePostView } from "./ModFeaturePostView";
import type { ModHideCommunityView } from "./ModHideCommunityView";
import type { ModLockPostView } from "./ModLockPostView";
import type { ModRemoveCommentView } from "./ModRemoveCommentView";
import type { ModRemoveCommunityView } from "./ModRemoveCommunityView";
import type { ModRemovePostView } from "./ModRemovePostView";
import type { ModTransferCommunityView } from "./ModTransferCommunityView";
export type ModlogCombinedView =
| ({ type_: "AdminAllowInstance" } & AdminAllowInstanceView)
| ({ type_: "AdminBlockInstance" } & AdminBlockInstanceView)
| ({ type_: "AdminPurgeComment" } & AdminPurgeCommentView)
| ({ type_: "AdminPurgeCommunity" } & AdminPurgeCommunityView)
| ({ type_: "AdminPurgePerson" } & AdminPurgePersonView)
| ({ type_: "AdminPurgePost" } & AdminPurgePostView)
| ({ type_: "ModAdd" } & ModAddView)
| ({ type_: "ModAddCommunity" } & ModAddCommunityView)
| ({ type_: "ModBan" } & ModBanView)
| ({ type_: "ModBanFromCommunity" } & ModBanFromCommunityView)
| ({ type_: "ModFeaturePost" } & ModFeaturePostView)
| ({ type_: "ModHideCommunity" } & ModHideCommunityView)
| ({ type_: "ModLockPost" } & ModLockPostView)
| ({ type_: "ModRemoveComment" } & ModRemoveCommentView)
| ({ type_: "ModRemoveCommunity" } & ModRemoveCommunityView)
| ({ type_: "ModRemovePost" } & ModRemovePostView)
| ({ type_: "ModTransferCommunity" } & ModTransferCommunityView);

View file

@ -1,19 +0,0 @@
// 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";
/**
* Querying / filtering the modlog.
*/
export type ModlogListParams = {
community_id?: CommunityId;
mod_person_id?: PersonId;
other_person_id?: PersonId;
post_id?: PostId;
comment_id?: CommentId;
page?: number;
limit?: number;
hide_modlog_names: boolean;
};

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.
/**
* like PaginationCursor but for the person_content_combined table
*/
export type PersonContentCombinedPaginationCursor = string;

View file

@ -0,0 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentView } from "./CommentView";
import type { PostView } from "./PostView";
export type PersonContentCombinedView =
| ({ type_: "Post" } & PostView)
| ({ type_: "Comment" } & CommentView);

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.
/**
* A list of possible types for the various modlog actions.
*/
export type PersonContentType = "All" | "Comments" | "Posts";

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.
/**
* like PaginationCursor but for the person_saved_combined table
*/
export type PersonSavedCombinedPaginationCursor = string;

7
src/types/PostTags.ts Normal file
View file

@ -0,0 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Tag } from "./Tag";
/**
* we wrap this in a struct so we can implement FromSqlRow<Json> for it
*/
export type PostTags = { tags: Array<Tag> };

View file

@ -4,6 +4,7 @@ import type { ImageDetails } from "./ImageDetails";
import type { Person } from "./Person"; import type { Person } from "./Person";
import type { Post } from "./Post"; import type { Post } from "./Post";
import type { PostAggregates } from "./PostAggregates"; import type { PostAggregates } from "./PostAggregates";
import type { PostTags } from "./PostTags";
import type { SubscribedType } from "./SubscribedType"; import type { SubscribedType } from "./SubscribedType";
/** /**
@ -26,4 +27,5 @@ export type PostView = {
creator_blocked: boolean; creator_blocked: boolean;
my_vote?: number; my_vote?: number;
unread_comments: number; unread_comments: number;
tags: PostTags;
}; };

View file

@ -1,16 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentReportId } from "./CommentReportId";
import type { PostReportId } from "./PostReportId";
import type { PrivateMessageReportId } from "./PrivateMessageReportId";
import type { ReportCombinedId } from "./ReportCombinedId";
/**
* A combined reports table.
*/
export type ReportCombined = {
id: ReportCombinedId;
published: string;
post_report_id?: PostReportId;
comment_report_id?: CommentReportId;
private_message_report_id?: PrivateMessageReportId;
};

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 { CommentReportView } from "./CommentReportView"; import type { CommentReportView } from "./CommentReportView";
import type { CommunityReportView } from "./CommunityReportView";
import type { PostReportView } from "./PostReportView"; import type { PostReportView } from "./PostReportView";
import type { PrivateMessageReportView } from "./PrivateMessageReportView"; import type { PrivateMessageReportView } from "./PrivateMessageReportView";
export type ReportCombinedView = export type ReportCombinedView =
| ({ type_: "Post" } & PostReportView) | ({ type_: "Post" } & PostReportView)
| ({ type_: "Comment" } & CommentReportView) | ({ type_: "Comment" } & CommentReportView)
| ({ type_: "PrivateMessage" } & PrivateMessageReportView); | ({ type_: "PrivateMessage" } & PrivateMessageReportView)
| ({ type_: "Community" } & CommunityReportView);

View file

@ -20,7 +20,6 @@ export type Search = {
limit?: number; limit?: number;
title_only?: boolean; title_only?: boolean;
post_url_only?: boolean; post_url_only?: boolean;
saved_only?: boolean;
liked_only?: boolean; liked_only?: boolean;
disliked_only?: boolean; disliked_only?: boolean;
}; };

29
src/types/Tag.ts Normal file
View file

@ -0,0 +1,29 @@
// 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 { DbUrl } from "./DbUrl";
import type { TagId } from "./TagId";
/**
* A tag that can be assigned to a post within a community.
* The tag object is created by the community moderators.
* The assignment happens by the post creator and can be updated by the community moderators.
*
* A tag is a federatable object that gives additional context to another object, which can be
* displayed and filtered on currently, we only have community post tags, which is a tag that is
* created by post authors as well as mods of a community, to categorize a post. in the future we
* may add more tag types, depending on the requirements, this will lead to either expansion of
* this table (community_id optional, addition of tag_type enum) or split of this table / creation
* of new tables.
*/
export type Tag = {
id: TagId;
ap_id: DbUrl;
name: string;
/**
* the community that owns this tag
*/
community_id: CommunityId;
published: string;
updated?: string;
deleted: boolean;
};

View file

@ -1,6 +1,6 @@
// 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.
/** /**
* The report combined id * The internal tag id.
*/ */
export type ReportCombinedId = number; export type TagId = number;