Updating types

This commit is contained in:
Dessalines 2025-01-13 23:55:03 -05:00
parent e01302659e
commit f8ac266052
36 changed files with 83 additions and 39 deletions

View file

@ -59,6 +59,9 @@ export { CommunityFollowerState } from "./types/CommunityFollowerState";
export { CommunityFollowerView } from "./types/CommunityFollowerView";
export { CommunityId } from "./types/CommunityId";
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 { CommunitySortType } from "./types/CommunitySortType";
export { CommunityView } from "./types/CommunityView";

View file

@ -9,5 +9,5 @@ export type AdminAllowInstance = {
admin_person_id: PersonId;
allowed: boolean;
reason?: string;
when_: string;
published: string;
};

View file

@ -10,5 +10,5 @@ export type AdminBlockInstance = {
blocked: boolean;
reason?: string;
expires?: string;
when_: string;
published: string;
};

View file

@ -11,5 +11,5 @@ export type AdminPurgeComment = {
admin_person_id: PersonId;
post_id: PostId;
reason?: string;
when_: string;
published: string;
};

View file

@ -9,5 +9,5 @@ export type AdminPurgeCommunity = {
id: AdminPurgeCommunityId;
admin_person_id: PersonId;
reason?: string;
when_: string;
published: string;
};

View file

@ -9,5 +9,5 @@ export type AdminPurgePerson = {
id: AdminPurgePersonId;
admin_person_id: PersonId;
reason?: string;
when_: string;
published: string;
};

View file

@ -11,5 +11,5 @@ export type AdminPurgePost = {
admin_person_id: PersonId;
community_id: CommunityId;
reason?: string;
when_: string;
published: string;
};

View file

@ -27,4 +27,6 @@ export type CommunityAggregates = {
*/
users_active_half_year: 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

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

View file

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

View file

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

View file

@ -13,7 +13,7 @@ export type GetModlog = {
mod_person_id?: PersonId;
community_id?: CommunityId;
type_?: ModlogActionType;
modded_person_id?: PersonId;
other_person_id?: PersonId;
post_id?: PostId;
comment_id?: CommentId;
page_cursor?: ModlogCombinedPaginationCursor;

View file

@ -10,5 +10,5 @@ export type ModAdd = {
mod_person_id: PersonId;
other_person_id: PersonId;
removed: boolean;
when_: string;
published: string;
};

View file

@ -12,5 +12,5 @@ export type ModAddCommunity = {
other_person_id: PersonId;
community_id: CommunityId;
removed: boolean;
when_: string;
published: string;
};

View file

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

View file

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

View file

@ -12,5 +12,5 @@ export type ModBan = {
reason?: string;
banned: boolean;
expires?: string;
when_: string;
published: string;
};

View file

@ -14,5 +14,5 @@ export type ModBanFromCommunity = {
reason?: string;
banned: boolean;
expires?: string;
when_: string;
published: string;
};

View file

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

View file

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

View file

@ -11,6 +11,6 @@ export type ModFeaturePost = {
mod_person_id: PersonId;
post_id: PostId;
featured: boolean;
when_: string;
published: string;
is_featured_community: boolean;
};

View file

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

View file

@ -10,7 +10,7 @@ export type ModHideCommunity = {
id: ModHideCommunityId;
community_id: CommunityId;
mod_person_id: PersonId;
when_: string;
published: string;
reason?: string;
hidden: boolean;
};

View file

@ -11,5 +11,5 @@ export type ModLockPost = {
mod_person_id: PersonId;
post_id: PostId;
locked: boolean;
when_: string;
published: string;
};

View file

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

View file

@ -12,5 +12,5 @@ export type ModRemoveComment = {
comment_id: CommentId;
reason?: string;
removed: boolean;
when_: string;
published: string;
};

View file

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

View file

@ -12,5 +12,5 @@ export type ModRemoveCommunity = {
community_id: CommunityId;
reason?: string;
removed: boolean;
when_: string;
published: string;
};

View file

@ -12,5 +12,5 @@ export type ModRemovePost = {
post_id: PostId;
reason?: string;
removed: boolean;
when_: string;
published: string;
};

View file

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

View file

@ -11,5 +11,5 @@ export type ModTransferCommunity = {
mod_person_id: PersonId;
other_person_id: PersonId;
community_id: CommunityId;
when_: string;
published: string;
};

View file

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

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