diff --git a/src/index.ts b/src/index.ts index 1f7e62c..6edddaa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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"; diff --git a/src/types/AdminAllowInstance.ts b/src/types/AdminAllowInstance.ts index 9f1dc9f..2a1a873 100644 --- a/src/types/AdminAllowInstance.ts +++ b/src/types/AdminAllowInstance.ts @@ -9,5 +9,5 @@ export type AdminAllowInstance = { admin_person_id: PersonId; allowed: boolean; reason?: string; - when_: string; + published: string; }; diff --git a/src/types/AdminBlockInstance.ts b/src/types/AdminBlockInstance.ts index 54b74a9..e8189ee 100644 --- a/src/types/AdminBlockInstance.ts +++ b/src/types/AdminBlockInstance.ts @@ -10,5 +10,5 @@ export type AdminBlockInstance = { blocked: boolean; reason?: string; expires?: string; - when_: string; + published: string; }; diff --git a/src/types/AdminPurgeComment.ts b/src/types/AdminPurgeComment.ts index b85b6b1..57a9eef 100644 --- a/src/types/AdminPurgeComment.ts +++ b/src/types/AdminPurgeComment.ts @@ -11,5 +11,5 @@ export type AdminPurgeComment = { admin_person_id: PersonId; post_id: PostId; reason?: string; - when_: string; + published: string; }; diff --git a/src/types/AdminPurgeCommunity.ts b/src/types/AdminPurgeCommunity.ts index c202eb1..dbaf744 100644 --- a/src/types/AdminPurgeCommunity.ts +++ b/src/types/AdminPurgeCommunity.ts @@ -9,5 +9,5 @@ export type AdminPurgeCommunity = { id: AdminPurgeCommunityId; admin_person_id: PersonId; reason?: string; - when_: string; + published: string; }; diff --git a/src/types/AdminPurgePerson.ts b/src/types/AdminPurgePerson.ts index 1ef7341..bde8904 100644 --- a/src/types/AdminPurgePerson.ts +++ b/src/types/AdminPurgePerson.ts @@ -9,5 +9,5 @@ export type AdminPurgePerson = { id: AdminPurgePersonId; admin_person_id: PersonId; reason?: string; - when_: string; + published: string; }; diff --git a/src/types/AdminPurgePost.ts b/src/types/AdminPurgePost.ts index 5cd11a0..1bf8b88 100644 --- a/src/types/AdminPurgePost.ts +++ b/src/types/AdminPurgePost.ts @@ -11,5 +11,5 @@ export type AdminPurgePost = { admin_person_id: PersonId; community_id: CommunityId; reason?: string; - when_: string; + published: string; }; diff --git a/src/types/CommunityAggregates.ts b/src/types/CommunityAggregates.ts index ece11e3..b546c18 100644 --- a/src/types/CommunityAggregates.ts +++ b/src/types/CommunityAggregates.ts @@ -27,4 +27,6 @@ export type CommunityAggregates = { */ users_active_half_year: number; subscribers_local: number; + report_count: number; + unresolved_report_count: number; }; diff --git a/src/types/CommunityReport.ts b/src/types/CommunityReport.ts new file mode 100644 index 0000000..30bf72b --- /dev/null +++ b/src/types/CommunityReport.ts @@ -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; +}; diff --git a/src/types/CommunityReportId.ts b/src/types/CommunityReportId.ts new file mode 100644 index 0000000..7874305 --- /dev/null +++ b/src/types/CommunityReportId.ts @@ -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; diff --git a/src/types/CommunityReportView.ts b/src/types/CommunityReportView.ts new file mode 100644 index 0000000..dd43d39 --- /dev/null +++ b/src/types/CommunityReportView.ts @@ -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; +}; diff --git a/src/types/CreateSite.ts b/src/types/CreateSite.ts index a7c9de6..966a739 100644 --- a/src/types/CreateSite.ts +++ b/src/types/CreateSite.ts @@ -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; diff --git a/src/types/EditSite.ts b/src/types/EditSite.ts index 75b4fb1..85fecac 100644 --- a/src/types/EditSite.ts +++ b/src/types/EditSite.ts @@ -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. */ diff --git a/src/types/FederationError.ts b/src/types/FederationError.ts index 9574192..1e209f5 100644 --- a/src/types/FederationError.ts +++ b/src/types/FederationError.ts @@ -4,7 +4,6 @@ * Federation related errors, these dont need to be translated. */ export type FederationError = - | "CouldntFindActivity" | "InvalidCommunity" | "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" | "CannotReceivePage" diff --git a/src/types/GetModlog.ts b/src/types/GetModlog.ts index 0542b6b..e4a650a 100644 --- a/src/types/GetModlog.ts +++ b/src/types/GetModlog.ts @@ -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; diff --git a/src/types/ModAdd.ts b/src/types/ModAdd.ts index 37f910c..5ce1119 100644 --- a/src/types/ModAdd.ts +++ b/src/types/ModAdd.ts @@ -10,5 +10,5 @@ export type ModAdd = { mod_person_id: PersonId; other_person_id: PersonId; removed: boolean; - when_: string; + published: string; }; diff --git a/src/types/ModAddCommunity.ts b/src/types/ModAddCommunity.ts index 9a637fa..089b9aa 100644 --- a/src/types/ModAddCommunity.ts +++ b/src/types/ModAddCommunity.ts @@ -12,5 +12,5 @@ export type ModAddCommunity = { other_person_id: PersonId; community_id: CommunityId; removed: boolean; - when_: string; + published: string; }; diff --git a/src/types/ModAddCommunityView.ts b/src/types/ModAddCommunityView.ts index 7d2860a..5ddd5c1 100644 --- a/src/types/ModAddCommunityView.ts +++ b/src/types/ModAddCommunityView.ts @@ -10,5 +10,5 @@ export type ModAddCommunityView = { mod_add_community: ModAddCommunity; moderator?: Person; community: Community; - modded_person: Person; + other_person: Person; }; diff --git a/src/types/ModAddView.ts b/src/types/ModAddView.ts index 83253f6..c3ba691 100644 --- a/src/types/ModAddView.ts +++ b/src/types/ModAddView.ts @@ -8,5 +8,5 @@ import type { Person } from "./Person"; export type ModAddView = { mod_add: ModAdd; moderator?: Person; - modded_person: Person; + other_person: Person; }; diff --git a/src/types/ModBan.ts b/src/types/ModBan.ts index eadb07c..6fe2dad 100644 --- a/src/types/ModBan.ts +++ b/src/types/ModBan.ts @@ -12,5 +12,5 @@ export type ModBan = { reason?: string; banned: boolean; expires?: string; - when_: string; + published: string; }; diff --git a/src/types/ModBanFromCommunity.ts b/src/types/ModBanFromCommunity.ts index 836d2e9..009ffdc 100644 --- a/src/types/ModBanFromCommunity.ts +++ b/src/types/ModBanFromCommunity.ts @@ -14,5 +14,5 @@ export type ModBanFromCommunity = { reason?: string; banned: boolean; expires?: string; - when_: string; + published: string; }; diff --git a/src/types/ModBanFromCommunityView.ts b/src/types/ModBanFromCommunityView.ts index 99255cb..8b7204d 100644 --- a/src/types/ModBanFromCommunityView.ts +++ b/src/types/ModBanFromCommunityView.ts @@ -10,5 +10,5 @@ export type ModBanFromCommunityView = { mod_ban_from_community: ModBanFromCommunity; moderator?: Person; community: Community; - modded_person: Person; + other_person: Person; }; diff --git a/src/types/ModBanView.ts b/src/types/ModBanView.ts index 14ff18a..62edf0f 100644 --- a/src/types/ModBanView.ts +++ b/src/types/ModBanView.ts @@ -8,5 +8,5 @@ import type { Person } from "./Person"; export type ModBanView = { mod_ban: ModBan; moderator?: Person; - modded_person: Person; + other_person: Person; }; diff --git a/src/types/ModFeaturePost.ts b/src/types/ModFeaturePost.ts index e3d4735..ff9550c 100644 --- a/src/types/ModFeaturePost.ts +++ b/src/types/ModFeaturePost.ts @@ -11,6 +11,6 @@ export type ModFeaturePost = { mod_person_id: PersonId; post_id: PostId; featured: boolean; - when_: string; + published: string; is_featured_community: boolean; }; diff --git a/src/types/ModFeaturePostView.ts b/src/types/ModFeaturePostView.ts index c535339..10e13af 100644 --- a/src/types/ModFeaturePostView.ts +++ b/src/types/ModFeaturePostView.ts @@ -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; }; diff --git a/src/types/ModHideCommunity.ts b/src/types/ModHideCommunity.ts index 0dd76a0..d40cc37 100644 --- a/src/types/ModHideCommunity.ts +++ b/src/types/ModHideCommunity.ts @@ -10,7 +10,7 @@ export type ModHideCommunity = { id: ModHideCommunityId; community_id: CommunityId; mod_person_id: PersonId; - when_: string; + published: string; reason?: string; hidden: boolean; }; diff --git a/src/types/ModLockPost.ts b/src/types/ModLockPost.ts index 346d186..13c7e3c 100644 --- a/src/types/ModLockPost.ts +++ b/src/types/ModLockPost.ts @@ -11,5 +11,5 @@ export type ModLockPost = { mod_person_id: PersonId; post_id: PostId; locked: boolean; - when_: string; + published: string; }; diff --git a/src/types/ModLockPostView.ts b/src/types/ModLockPostView.ts index 31c3482..a4b0ba9 100644 --- a/src/types/ModLockPostView.ts +++ b/src/types/ModLockPostView.ts @@ -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; }; diff --git a/src/types/ModRemoveComment.ts b/src/types/ModRemoveComment.ts index 2a8b84c..aaa09f4 100644 --- a/src/types/ModRemoveComment.ts +++ b/src/types/ModRemoveComment.ts @@ -12,5 +12,5 @@ export type ModRemoveComment = { comment_id: CommentId; reason?: string; removed: boolean; - when_: string; + published: string; }; diff --git a/src/types/ModRemoveCommentView.ts b/src/types/ModRemoveCommentView.ts index 8fc88de..fa5014b 100644 --- a/src/types/ModRemoveCommentView.ts +++ b/src/types/ModRemoveCommentView.ts @@ -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; diff --git a/src/types/ModRemoveCommunity.ts b/src/types/ModRemoveCommunity.ts index a47c1c4..728bcbd 100644 --- a/src/types/ModRemoveCommunity.ts +++ b/src/types/ModRemoveCommunity.ts @@ -12,5 +12,5 @@ export type ModRemoveCommunity = { community_id: CommunityId; reason?: string; removed: boolean; - when_: string; + published: string; }; diff --git a/src/types/ModRemovePost.ts b/src/types/ModRemovePost.ts index 82ac2b6..be475e1 100644 --- a/src/types/ModRemovePost.ts +++ b/src/types/ModRemovePost.ts @@ -12,5 +12,5 @@ export type ModRemovePost = { post_id: PostId; reason?: string; removed: boolean; - when_: string; + published: string; }; diff --git a/src/types/ModRemovePostView.ts b/src/types/ModRemovePostView.ts index 6881828..c0ed552 100644 --- a/src/types/ModRemovePostView.ts +++ b/src/types/ModRemovePostView.ts @@ -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; }; diff --git a/src/types/ModTransferCommunity.ts b/src/types/ModTransferCommunity.ts index 505c1bf..eccc9fa 100644 --- a/src/types/ModTransferCommunity.ts +++ b/src/types/ModTransferCommunity.ts @@ -11,5 +11,5 @@ export type ModTransferCommunity = { mod_person_id: PersonId; other_person_id: PersonId; community_id: CommunityId; - when_: string; + published: string; }; diff --git a/src/types/ModTransferCommunityView.ts b/src/types/ModTransferCommunityView.ts index 2be8158..d0338d3 100644 --- a/src/types/ModTransferCommunityView.ts +++ b/src/types/ModTransferCommunityView.ts @@ -10,5 +10,5 @@ export type ModTransferCommunityView = { mod_transfer_community: ModTransferCommunity; moderator?: Person; community: Community; - modded_person: Person; + other_person: Person; }; diff --git a/src/types/ReportCombinedView.ts b/src/types/ReportCombinedView.ts index b8d4420..a209c86 100644 --- a/src/types/ReportCombinedView.ts +++ b/src/types/ReportCombinedView.ts @@ -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);