fix(api): send correct staff emails and allow suppressing them (#3048)

This commit is contained in:
Hampus
2026-09-29 23:55:54 +02:00
committed by GitHub
parent f0b3c82cfd
commit 39f9beda5a
113 changed files with 2496 additions and 206 deletions
@@ -227,6 +227,7 @@ export type ListReportsQuery = z.infer<typeof ListReportsQuery>;
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'),
});
export type UpdateReportRequest = z.infer<typeof UpdateReportRequest>;
@@ -318,7 +318,11 @@ export const TempBanUserRequest = z.object({
.min(0)
.max(8760)
.describe('Duration of the ban in hours. Use 0 for a permanent ban (until manually unbanned).'),
reason: createStringType(0, 512).optional().describe('Reason for the temporary ban'),
reason: createStringType(0, 512).optional().describe('Reason shown to the user in the ban email'),
notify_user: z
.boolean()
.default(true)
.describe('Whether to email the user about a temporary ban. Permanent bans (duration_hours 0) are never emailed'),
});
export type TempBanUserRequest = z.infer<typeof TempBanUserRequest>;
@@ -346,6 +350,7 @@ export const ScheduleAccountDeletionRequest = z.object({
.describe(
'pending_deletion_at of the deletion this request replaces. Required when a deletion is already scheduled for the account',
),
notify_user: z.boolean().default(true).describe('Whether to email the user about the scheduled deletion'),
});
export type ScheduleAccountDeletionRequest = z.infer<typeof ScheduleAccountDeletionRequest>;
@@ -400,6 +405,7 @@ export const DisableForSuspiciousActivityRequest = z.object({
'Bitmask of suspicious activity flags that triggered the disable',
'SuspiciousActivityFlags',
),
notify_user: z.boolean().default(true).describe('Whether to email the user that the account was disabled'),
});
export type DisableForSuspiciousActivityRequest = z.infer<typeof DisableForSuspiciousActivityRequest>;
@@ -653,6 +659,15 @@ export const AdminUserDeletionCancelRequest = z.object({
export type AdminUserDeletionCancelRequest = z.infer<typeof AdminUserDeletionCancelRequest>;
export const AdminUserUnbanRequest = z.object({
notify_user: z.boolean().default(true).describe('Whether to email the user that the suspension was lifted'),
public_reason: createStringType(0, 512)
.optional()
.describe('Reason shown to the user in the unban email. The audit log reason is never emailed'),
});
export type AdminUserUnbanRequest = z.infer<typeof AdminUserUnbanRequest>;
export const AdminUserBanNoteRequest = z.object({
ban_audit_log_id: SnowflakeType.describe('Audit log entry of the current ban that the note refers to'),
note: createStringType(1, 512).describe('Note to append to the ban. Recorded as the reason of a new audit log entry'),