summary refs log tree commit diff
path: root/src/schemas/responses/AccountStandingResponse.ts
blob: c1f603bdfb9176066bcbc046871a03fed5fab1c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
	Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
	Copyright (C) 2025 Spacebar and Spacebar Contributors
	
	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Affero General Public License as published
	by the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Affero General Public License for more details.
	
	You should have received a copy of the GNU Affero General Public License
	along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

import { PublicAttachment } from "../api/messages/Attachments";

export enum AccountStandingState {
    ALL_GOOD = 100,
    LIMITED = 200,
    VERY_LIMITED = 300,
    AT_RISK = 400,
    SUSPENDED = 500,
}

export enum AppealEligibility {
    DSA_ELIGIBLE = 1,
    IN_APP_ELIGIBLE = 2,
    AGE_VERIFY_ELIGIBLE = 3,
}

export enum ClassificationType {
    UNKNOWN = 1,
    UNSOLICITED_PORNOGRAPHY = 100,
    NONCONSENSUAL_PORNOGRAPHY = 200,
    GLORIFYING_VIOLENCE = 210,
    HATE_SPEECH = 220,
    CRACKED_ACCOUNTS = 230,
    ILLICIT_GOODS = 240,
    SOCIAL_ENGINEERING = 250,
    CHILD_SAFETY = 280,
    HARRASMENT_AND_BULLYING = 290,
    HARRASMENT_AND_BULLYING_2 = 310,
    HATEFUL_CONDUCT = 320,
    HARRASMENT_AND_BULLYING_3 = 390,
    CHILD_SAFETY_2 = 600,
    CHILD_SAFETY_3 = 650,
    IMPERSONATION = 711,
    BAN_EVASION = 720,
    MALICIOUS_CONDUCT = 3010,
    SPAM = 3030,
    NONCONSENSUAL_ADULT_CONTENT = 4000,
    FRAUD = 4010,
    DOXXING_GUILD_OWNER = 4130,
    COPYRIGHT_INFRINGEMENT_GUILD_OWNER = 4140,
    CHILD_SAFETY_4 = 5010,
    CHILD_SELF_ENDANGERMENT = 5090,
    DOXXING_GUILD_MEMBER = 5305,
    UNDERAGE = 5411,
    COPYRIGHT_INFRINGEMENT_GUILD_MEMBER = 5440,
    COPYRIGHT_INFRINGEMENT_3 = 5485,
}

export enum AppealIngestionType {
    WEBFORM = 0,
    AGE_VERIFY = 1,
    IN_APP = 2,
}

export enum ClassificationActionType {
    BAN = 0,
    TEMP_BAN = 1,
    GLOBAL_QUARANTINE = 2,
    REQUIRE_VERIFICATION = 3,
    USER_WARNING = 4,
    USER_SPAMMER = 5,
    CHANNEL_SPAM = 6,
    MESSAGE_SPAM = 7,
    DISABLE_SUSPICIOUS_ACTIVITY = 8,
    LIMITED_ACCESS = 9,
    CHANNEL_SCHEDULE_DELETE = 10,
    MESSAGE_CONTENT_REMOVAL = 11,
    GUILD_DISABLE_INVITE = 12,
    USER_CONTENT_REMOVAL = 13,
    USER_USERNAME_MANGLED = 14,
    GUILD_LIMITED_ACCESS = 15,
    USER_MESSAGE_REMOVAL = 16,
    GUILD_DELETE = 20,
    USER_PROFILE_MANGLED = 22,
}

export interface ClassificationAction {
    id: string;
    action_type: ClassificationActionType;
    descriptions: string[];
}

export enum AppealStatusValue {
    REVIEW_PENDING = 1,
    CLASSIFICATION_UPHELD = 2,
    CLASSIFICATION_INVALIDATED = 3,
}

export interface AppealStatus {
    status: AppealStatusValue;
}

// why is this just a reduced message?
export interface FlaggedContent {
    type: "message";
    id: string;
    content: string;
    attachments: PublicAttachment[];
}

export interface Classification {
    id: string;
    classification_type: ClassificationType;
    description: string;
    explainer_link: string;
    actions: ClassificationAction[];
    max_expiration_time: string; // ISO 8601 timestamp
    flagged_content: unknown[]; // TODO
    appeal_status: AppealStatus;
    is_coppa: boolean;
    is_spam: boolean;
    appeal_ingestion_type: AppealIngestionType;
}

export enum GuildMemberType {
    OWNER = 1,
    MEMBER = 2,
}

export interface GuildMetadata {
    name: string;
    icon?: string;
    member_type: GuildMemberType;
}

export interface GuildClassification extends Classification {
    guild_metadata: GuildMetadata;
}

export interface AccountStandingResponse {
    classifications: Classification[];
    guild_classifications: GuildClassification[];
    account_standing: {
        state: AccountStandingState;
    };
    is_dsa_eligible: boolean;
    username: string;
    discriminator: string; // Not sure if this is even valid, we don't have any examples of pre-pomelo users
    is_appeal_eligible: boolean;
    appeal_eligibility: AppealEligibility[];
}