2025-11-21 08:31:02 +01:00
import { z } from "zod" ;
2025-02-12 23:04:44 +01:00
import { Account } from "./account.ts" ;
import { Appeal } from "./appeal.ts" ;
import { Id } from "./common.ts" ;
export const AccountWarning = z
. object ( {
2025-07-07 03:42:35 +02:00
id : Id.meta ( {
2025-02-12 23:04:44 +01:00
description : "The ID of the account warning in the database." ,
example : "0968680e-fd64-4525-b818-6e1c46fbdb28" ,
} ) ,
action : z
. enum ( [
"none" ,
"disable" ,
"mark_statuses_as_sensitive" ,
"delete_statuses" ,
"sensitive" ,
"silence" ,
"suspend" ,
] )
2025-07-07 03:42:35 +02:00
. meta ( {
2025-02-12 23:04:44 +01:00
description :
"Action taken against the account. 'none' = No action was taken, this is a simple warning; 'disable' = The account has been disabled; 'mark_statuses_as_sensitive' = Specific posts from the target account have been marked as sensitive; 'delete_statuses' = Specific statuses from the target account have been deleted; 'sensitive' = All posts from the target account are marked as sensitive; 'silence' = The target account has been limited; 'suspend' = The target account has been suspended." ,
example : "none" ,
} ) ,
2025-07-07 03:42:35 +02:00
text : z.string ( ) . meta ( {
2025-02-12 23:04:44 +01:00
description : "Message from the moderator to the target account." ,
example : "Please adhere to our community guidelines." ,
} ) ,
status_ids : z
. array ( Id )
. nullable ( )
2025-07-07 03:42:35 +02:00
. meta ( {
2025-02-12 23:04:44 +01:00
description :
"List of status IDs that are relevant to the warning. When action is mark_statuses_as_sensitive or delete_statuses, those are the affected statuses." ,
example : [ "5ee59275-c308-4173-bb1f-58646204579b" ] ,
} ) ,
2025-07-07 03:42:35 +02:00
target_account : Account.meta ( {
2025-02-12 23:04:44 +01:00
description :
"Account against which a moderation decision has been taken." ,
} ) ,
2025-07-07 03:42:35 +02:00
appeal : Appeal.nullable ( ) . meta ( {
2025-02-12 23:04:44 +01:00
description : "Appeal submitted by the target account, if any." ,
example : null ,
} ) ,
2025-07-07 03:42:35 +02:00
created_at : z.iso.datetime ( ) . meta ( {
2025-02-12 23:04:44 +01:00
description : "When the event took place." ,
example : "2025-01-04T14:11:00Z" ,
} ) ,
} )
2025-07-07 03:42:35 +02:00
. meta ( {
2025-02-12 23:04:44 +01:00
description : "Moderation warning against a particular account." ,
externalDocs : {
url : "https://docs.joinmastodon.org/entities/AccountWarning" ,
} ,
2025-07-07 03:42:35 +02:00
id : "AccountWarning" ,
2025-02-12 23:04:44 +01:00
} ) ;