mockData.ts (8775B)
1 export const EBanTypes = { 2 User: "user", 3 Server: "server", 4 Room: "room", 5 } as const; 6 type BanTypes = typeof EBanTypes[keyof typeof EBanTypes]; 7 8 export interface PolicyList { 9 id: string; 10 name: string; 11 description: string; 12 readOnly: boolean; 13 teamId: string; 14 entries: { 15 id: string, 16 target: string, 17 reason: string, 18 timestamp: string, 19 type: BanTypes; 20 }[]; 21 }; 22 23 export interface Report { 24 id: string; 25 type: string; 26 status: string; 27 priority: string; 28 timestamp: string; 29 reporter: string; 30 room: string; 31 teamId: string; 32 subject: { 33 type: string; 34 id?: string; 35 sender: string; 36 content?: { 37 msgtype: string; 38 body: string; 39 url?: string; 40 info?: { 41 mimetype: string; 42 w: number; 43 h: number; 44 size: number; 45 }; 46 }; 47 target?: string; 48 timestamp: string; 49 }; 50 reason: string; 51 }; 52 53 // Mock data for policy lists - filtered by team 54 export const mockPolicyLists: PolicyList[] = [ 55 { 56 id: "global", 57 name: "Global Ban List", 58 description: "Shared ban list for all Matrix communities", 59 readOnly: true, 60 teamId: "team1", 61 entries: [ 62 { 63 id: "ban_1", 64 target: "@spammer:badserver.org", 65 reason: "Spam across multiple rooms", 66 timestamp: "2025-04-20T10:30:00Z", 67 type: EBanTypes.User, 68 }, 69 { 70 id: "ban_2", 71 target: "@troll:badserver.org", 72 reason: "Harassment and inappropriate content", 73 timestamp: "2025-04-19T15:45:00Z", 74 type: EBanTypes.User, 75 }, 76 { 77 id: "ban_3", 78 target: "@phisher:scam.org", 79 reason: "Phishing attempts", 80 timestamp: "2025-04-18T09:20:00Z", 81 type: EBanTypes.User, 82 }, 83 ], 84 }, 85 { 86 id: "community", 87 name: "Community Ban List", 88 description: "Ban list for our community rooms", 89 readOnly: false, 90 teamId: "team1", 91 entries: [ 92 { 93 id: "ban_4", 94 target: "@disruptor:matrix.org", 95 reason: "Disruptive behavior in #general", 96 timestamp: "2025-04-21T08:15:00Z", 97 type: EBanTypes.User, 98 }, 99 { 100 id: "ban_5", 101 target: "@bot123:unknown.org", 102 reason: "Automated spam", 103 timestamp: "2025-04-20T14:30:00Z", 104 type: EBanTypes.User, 105 }, 106 // Server ban 107 { 108 id: "ban_6", 109 target: "badserver.org", 110 reason: "Known spam server", 111 timestamp: "2025-04-19T11:00:00Z", 112 type: EBanTypes.Server, 113 }, 114 ], 115 }, 116 { 117 id: "support", 118 name: "Support Rooms Ban List", 119 description: "Ban list specific to support rooms", 120 readOnly: false, 121 teamId: "team1", 122 entries: [ 123 { 124 id: "ban_6", 125 target: "@angryuser:matrix.org", 126 reason: "Abusive language to support staff", 127 timestamp: "2025-04-21T11:45:00Z", 128 type: EBanTypes.User, 129 }, 130 ], 131 }, 132 { 133 id: "dev", 134 name: "Development Ban List", 135 description: "Ban list for development rooms", 136 readOnly: false, 137 teamId: "team2", 138 entries: [ 139 { 140 id: "ban_7", 141 target: "@spambot:matrix.org", 142 reason: "Code spam in development channels", 143 timestamp: "2025-04-19T09:30:00Z", 144 type: EBanTypes.User, 145 }, 146 ], 147 }, 148 ] 149 150 // Mock data for reports - filtered by team 151 export const mockReports: Report[] = [ 152 { 153 id: "rep_1", 154 type: "message", 155 status: "open", 156 priority: "high", 157 timestamp: "2025-04-21T14:32:00Z", 158 reporter: "@moderator:matrix.org", 159 room: "#general:matrix.org", 160 teamId: "team1", 161 subject: { 162 type: "message", 163 id: "$1234567890abcdefghij:matrix.org", 164 sender: "@spammer:badserver.org", 165 content: { 166 msgtype: "m.text", 167 body: "Hey everyone! Check out this amazing investment opportunity at scam-crypto-site.com - 1000% returns guaranteed!", 168 }, 169 timestamp: "2025-04-21T14:30:00Z", 170 }, 171 reason: "Spam/scam content", 172 }, 173 { 174 id: "rep_2", 175 type: "invite", 176 status: "open", 177 priority: "medium", 178 timestamp: "2025-04-21T13:15:00Z", 179 reporter: "@user:matrix.org", 180 room: "#general:matrix.org", 181 teamId: "team1", 182 subject: { 183 type: "invite", 184 sender: "@spambot:badserver.org", 185 target: "@user:matrix.org", 186 timestamp: "2025-04-21T13:10:00Z", 187 }, 188 reason: "Unsolicited invite from unknown user", 189 }, 190 { 191 id: "rep_3", 192 type: "message", 193 status: "open", 194 priority: "high", 195 timestamp: "2025-04-21T12:05:00Z", 196 reporter: "@admin:matrix.org", 197 room: "#support:matrix.org", 198 teamId: "team1", 199 subject: { 200 type: "message", 201 id: "$abcdefghij1234567890:matrix.org", 202 sender: "@troll:badserver.org", 203 content: { 204 msgtype: "m.image", 205 body: "image.jpg", 206 url: "mxc://matrix.org/abcdefghijklmnopqrstuvwxyz", 207 info: { 208 mimetype: "image/jpeg", 209 w: 800, 210 h: 600, 211 size: 95431, 212 }, 213 }, 214 timestamp: "2025-04-21T12:00:00Z", 215 }, 216 reason: "Inappropriate image", 217 }, 218 { 219 id: "rep_4", 220 type: "message", 221 status: "open", 222 priority: "medium", 223 timestamp: "2025-04-21T11:45:00Z", 224 reporter: "@dev1:matrix.org", 225 room: "#development:matrix.org", 226 teamId: "team2", 227 subject: { 228 type: "message", 229 id: "$devmessage123456789:matrix.org", 230 sender: "@newuser:matrix.org", 231 content: { 232 msgtype: "m.text", 233 body: "Can someone help me with this code? It's not working: <script>alert('hack');</script>", 234 }, 235 timestamp: "2025-04-21T11:40:00Z", 236 }, 237 reason: "Potential code injection attempt", 238 }, 239 ] 240 241 242 export interface Team { 243 id: string; 244 name: string; 245 owner: string; 246 created: string; 247 members: { 248 id: string; 249 name: string; 250 role: "owner" | "moderator"; 251 avatar?: string; 252 joined: string; 253 }[]; 254 rooms: string[]; 255 } 256 257 // Mock data for teams/bots 258 export const mockTeams: Team[] = [ 259 { 260 id: "team1", 261 name: "Main Community Bot", 262 owner: "@admin:matrix.org", 263 created: "2025-01-15T10:00:00Z", 264 members: [ 265 { 266 id: "user1", 267 name: "@admin:matrix.org", 268 role: "owner", 269 avatar: undefined, 270 joined: "2025-01-15T10:00:00Z", 271 }, 272 { 273 id: "user2", 274 name: "@mod1:matrix.org", 275 role: "moderator", 276 avatar: undefined, 277 joined: "2025-01-16T14:30:00Z", 278 }, 279 { 280 id: "user3", 281 name: "@mod2:matrix.org", 282 role: "moderator", 283 avatar: undefined, 284 joined: "2025-02-01T09:15:00Z", 285 }, 286 ], 287 rooms: ["#general:matrix.org", "#support:matrix.org", "#community:matrix.org"], 288 }, 289 { 290 id: "team2", 291 name: "Development Team Bot", 292 owner: "@admin:matrix.org", 293 created: "2025-02-10T11:30:00Z", 294 members: [ 295 { 296 id: "user1", 297 name: "@admin:matrix.org", 298 role: "owner", 299 avatar: undefined, 300 joined: "2025-02-10T11:30:00Z", 301 }, 302 { 303 id: "user4", 304 name: "@dev1:matrix.org", 305 role: "moderator", 306 avatar: undefined, 307 joined: "2025-02-11T13:45:00Z", 308 }, 309 ], 310 rooms: ["#development:matrix.org", "#coding:matrix.org"], 311 }, 312 ]