mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
feat(api): add moderation events and visibility actions (#3219)
This commit is contained in:
@@ -57,6 +57,7 @@ export const UserFlags = {
|
||||
FRIENDLY_BOT: 1n << 4n,
|
||||
FRIENDLY_BOT_MANUAL_APPROVAL: 1n << 5n,
|
||||
SPAMMER: 1n << 6n,
|
||||
PROFILE_HIDDEN: 1n << 7n,
|
||||
DELETED: 1n << 34n,
|
||||
SELF_DELETED: 1n << 36n,
|
||||
DISABLED: 1n << 38n,
|
||||
@@ -79,6 +80,7 @@ export const UserFlagsDescriptions: Record<keyof typeof UserFlags, string> = {
|
||||
FRIENDLY_BOT: 'Bot accepts friend requests from users',
|
||||
FRIENDLY_BOT_MANUAL_APPROVAL: 'Bot requires manual approval for friend requests',
|
||||
SPAMMER: 'User is flagged as a spammer',
|
||||
PROFILE_HIDDEN: 'User profile details are hidden from other users',
|
||||
DELETED: 'User account has been deleted',
|
||||
SELF_DELETED: 'User account was self-deleted',
|
||||
DISABLED: 'User account is disabled',
|
||||
@@ -153,6 +155,8 @@ export const DELETED_USER_USERNAME = 'DeletedUser';
|
||||
export const DELETED_USER_GLOBAL_NAME = 'Deleted User';
|
||||
export const DELETED_USER_DISCRIMINATOR = 0;
|
||||
export const DELETED_USER_ID = 1n;
|
||||
export const HIDDEN_USER_USERNAME = 'HiddenUser';
|
||||
export const HIDDEN_USER_DISCRIMINATOR = 0;
|
||||
export const PublicUserFlags = {
|
||||
STAFF: Number(UserFlags.STAFF),
|
||||
PARTNER: Number(UserFlags.PARTNER),
|
||||
@@ -160,6 +164,7 @@ export const PublicUserFlags = {
|
||||
FRIENDLY_BOT: Number(UserFlags.FRIENDLY_BOT),
|
||||
FRIENDLY_BOT_MANUAL_APPROVAL: Number(UserFlags.FRIENDLY_BOT_MANUAL_APPROVAL),
|
||||
SPAMMER: Number(UserFlags.SPAMMER),
|
||||
PROFILE_HIDDEN: Number(UserFlags.PROFILE_HIDDEN),
|
||||
} as const;
|
||||
export const PublicUserFlagsDescriptions: Record<keyof typeof PublicUserFlags, string> = {
|
||||
STAFF: 'User is a staff member',
|
||||
@@ -168,6 +173,7 @@ export const PublicUserFlagsDescriptions: Record<keyof typeof PublicUserFlags, s
|
||||
FRIENDLY_BOT: 'Bot accepts friend requests from users',
|
||||
FRIENDLY_BOT_MANUAL_APPROVAL: 'Bot requires manual approval for friend requests',
|
||||
SPAMMER: 'User is flagged as a spammer',
|
||||
PROFILE_HIDDEN: 'User profile details are hidden',
|
||||
};
|
||||
export const ThemeTypes = {
|
||||
DARK: 'dark',
|
||||
|
||||
@@ -228,10 +228,20 @@ export const ListReportsQuery = z.object({
|
||||
|
||||
export type ListReportsQuery = z.infer<typeof ListReportsQuery>;
|
||||
|
||||
const ReportResolutionEnum = createNamedStringLiteralUnion(
|
||||
[
|
||||
['actioned', 'actioned', 'The report was valid and action was taken'],
|
||||
['no_violation', 'no_violation', 'The report was reviewed and no violation was found'],
|
||||
['duplicate', 'duplicate', 'The report repeats one that was already handled'],
|
||||
],
|
||||
'How the report was resolved',
|
||||
);
|
||||
|
||||
export const UpdateReportRequest = z.object({
|
||||
status: z.literal('resolved').describe('The status to move the report to'),
|
||||
public_comment: createStringType(0, 512).optional().describe('Public comment to include with the resolution'),
|
||||
notify_reporter: z.boolean().default(true).describe('Whether to notify the reporter by system DM and email'),
|
||||
resolution: ReportResolutionEnum.optional().describe('How the report was resolved'),
|
||||
});
|
||||
|
||||
export type UpdateReportRequest = z.infer<typeof UpdateReportRequest>;
|
||||
|
||||
Reference in New Issue
Block a user