/** * Mock data for testing. Realistic AT Protocol forum data * matching barazo-api response schemas. */ import type { AuthSession, AuthUser, AuthorProfile, CategoryTreeNode, CategoryWithTopicCount, CommunityProfile, Topic, Reply, Notification, SearchResult, ModerationReport, FirstPostQueueItem, ModerationLogEntry, ModerationThresholds, ReportedUser, AdminUser, CommunitySettings, CommunityStats, Plugin, PublicSettings, UserPreferences, UserProfile, OnboardingField, MyReport, PageTreeNode, SybilCluster, SybilClusterDetail, TrustSeed, PdsTrustFactor, TrustGraphStatus, BehavioralFlag, } from '@/lib/api/types' const COMMUNITY_DID = 'did:plc:test-community-123' const NOW = '2026-02-14T12:00:00.000Z' const YESTERDAY = '2026-02-13T12:00:00.000Z' const TWO_DAYS_AGO = '2026-02-12T12:00:00.000Z' const LAST_WEEK = '2026-02-07T12:00:00.000Z' // --- Users --- export const mockUsers = [ { did: 'did:plc:user-jay-001', handle: 'jay.bsky.team' }, { did: 'did:plc:user-alex-002', handle: 'alex.bsky.team' }, { did: 'did:plc:user-sam-003', handle: 'sam.example.com' }, { did: 'did:plc:user-robin-004', handle: 'robin.bsky.team' }, { did: 'did:plc:user-morgan-005', handle: 'morgan.forum.example' }, ] as const // --- Author Profiles (for enriched Topic/Reply responses) --- export const mockAuthorProfiles: AuthorProfile[] = [ { did: mockUsers[0]!.did, handle: mockUsers[0]!.handle, displayName: 'Jay', avatarUrl: 'https://cdn.bsky.social/avatar/jay.jpg', }, { did: mockUsers[1]!.did, handle: mockUsers[1]!.handle, displayName: 'Alex', avatarUrl: null }, { did: mockUsers[2]!.did, handle: mockUsers[2]!.handle, displayName: 'Sam', avatarUrl: null }, { did: mockUsers[3]!.did, handle: mockUsers[3]!.handle, displayName: 'Robin', avatarUrl: null }, { did: mockUsers[4]!.did, handle: mockUsers[4]!.handle, displayName: 'Morgan', avatarUrl: null }, ] // --- Auth --- export const mockAuthSession: AuthSession = { accessToken: 'mock-access-token-xyz', expiresAt: '2026-02-15T13:00:00.000Z', did: 'did:plc:user-jay-001', handle: 'jay.bsky.team', displayName: 'Jay', avatarUrl: 'https://cdn.bsky.social/avatar/jay.jpg', role: 'user', } export const mockAuthUser: AuthUser = { did: 'did:plc:user-jay-001', handle: 'jay.bsky.team', displayName: 'Jay', avatarUrl: 'https://cdn.bsky.social/avatar/jay.jpg', role: 'user', } // --- Categories --- export const mockCategories: CategoryTreeNode[] = [ { id: 'cat-general', slug: 'general', name: 'General Discussion', description: 'Talk about anything related to the community', parentId: null, sortOrder: 0, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, { id: 'cat-dev', slug: 'development', name: 'Development', description: 'Technical discussions, code, and project updates', parentId: null, sortOrder: 1, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [ { id: 'cat-frontend', slug: 'frontend', name: 'Frontend', description: 'UI, UX, and frontend frameworks', parentId: 'cat-dev', sortOrder: 0, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, { id: 'cat-backend', slug: 'backend', name: 'Backend', description: 'APIs, databases, and server infrastructure', parentId: 'cat-dev', sortOrder: 1, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, ], }, { id: 'cat-feedback', slug: 'feedback', name: 'Feedback & Ideas', description: 'Suggestions and feature requests', parentId: null, sortOrder: 2, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [ { id: 'cat-fb-features', slug: 'feature-requests', name: 'Feature Requests', description: 'Suggest new features and improvements', parentId: 'cat-feedback', sortOrder: 0, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, { id: 'cat-fb-bugs', slug: 'bug-reports', name: 'Bug Reports', description: 'Report bugs and unexpected behavior', parentId: 'cat-feedback', sortOrder: 1, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, ], }, { id: 'cat-atproto', slug: 'atproto', name: 'AT Protocol', description: 'AT Protocol ecosystem, standards, and tooling', parentId: null, sortOrder: 3, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [ { id: 'cat-atp-lexicons', slug: 'lexicons', name: 'Lexicons', description: 'Schema definitions and data model discussions', parentId: 'cat-atproto', sortOrder: 0, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, { id: 'cat-atp-identity', slug: 'identity', name: 'Identity', description: 'DIDs, handles, and portable identity', parentId: 'cat-atproto', sortOrder: 1, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, ], }, { id: 'cat-meta', slug: 'meta', name: 'Meta', description: 'About this community', parentId: null, sortOrder: 4, communityDid: COMMUNITY_DID, maturityRating: 'safe', createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, ] export const mockCategoryWithTopicCount: CategoryWithTopicCount = { ...mockCategories[0]!, topicCount: 12, } // --- Topics --- export const mockTopics: Topic[] = [ { uri: `at://${mockUsers[0]!.did}/forum.barazo.topic.post/3kf1abc`, rkey: '3kf1abc', authorDid: mockUsers[0]!.did, author: mockAuthorProfiles[0]!, title: 'Welcome to Barazo Forums', content: 'This is the first topic on our new federated forum platform.', category: 'general', site: null, tags: ['welcome', 'introduction'], communityDid: COMMUNITY_DID, cid: 'bafyreib1', replyCount: 5, reactionCount: 12, isAuthorDeleted: false, isModDeleted: false, isPinned: false, isLocked: false, pinnedScope: null, pinnedAt: null, categoryMaturityRating: 'safe', lastActivityAt: NOW, publishedAt: TWO_DAYS_AGO, indexedAt: TWO_DAYS_AGO, }, { uri: `at://${mockUsers[1]!.did}/forum.barazo.topic.post/3kf2def`, rkey: '3kf2def', authorDid: mockUsers[1]!.did, author: mockAuthorProfiles[1]!, title: 'Building with the AT Protocol', content: 'A deep dive into building applications on the AT Protocol.', category: 'development', site: null, tags: ['atproto', 'tutorial'], communityDid: COMMUNITY_DID, cid: 'bafyreib2', replyCount: 8, reactionCount: 23, isAuthorDeleted: false, isModDeleted: false, isPinned: false, isLocked: false, pinnedScope: null, pinnedAt: null, categoryMaturityRating: 'safe', lastActivityAt: YESTERDAY, publishedAt: TWO_DAYS_AGO, indexedAt: TWO_DAYS_AGO, }, { uri: `at://${mockUsers[2]!.did}/forum.barazo.topic.post/3kf3ghi`, rkey: '3kf3ghi', authorDid: mockUsers[2]!.did, author: mockAuthorProfiles[2]!, title: 'Feature Request: Dark Mode Improvements', content: 'I would love to see more theme customization options.', category: 'feedback', site: null, tags: ['feature-request', 'ui'], communityDid: COMMUNITY_DID, cid: 'bafyreib3', replyCount: 3, reactionCount: 7, isAuthorDeleted: false, isModDeleted: false, isPinned: false, isLocked: false, pinnedScope: null, pinnedAt: null, categoryMaturityRating: 'safe', lastActivityAt: YESTERDAY, publishedAt: YESTERDAY, indexedAt: YESTERDAY, }, { uri: `at://${mockUsers[3]!.did}/forum.barazo.topic.post/3kf4jkl`, rkey: '3kf4jkl', authorDid: mockUsers[3]!.did, author: mockAuthorProfiles[3]!, title: 'Understanding Portable Identity', content: 'How does identity work across federated services?', category: 'general', site: null, tags: ['identity', 'federation'], communityDid: COMMUNITY_DID, cid: 'bafyreib4', replyCount: 15, reactionCount: 31, isAuthorDeleted: false, isModDeleted: false, isPinned: false, isLocked: false, pinnedScope: null, pinnedAt: null, categoryMaturityRating: 'safe', lastActivityAt: NOW, publishedAt: YESTERDAY, indexedAt: YESTERDAY, }, { uri: `at://${mockUsers[4]!.did}/forum.barazo.topic.post/3kf5mno`, rkey: '3kf5mno', authorDid: mockUsers[4]!.did, author: mockAuthorProfiles[4]!, title: 'Self-Hosting Guide', content: 'Step-by-step guide to running your own Barazo instance.', category: 'meta', site: null, tags: ['self-hosting', 'guide'], communityDid: COMMUNITY_DID, cid: 'bafyreib5', replyCount: 2, reactionCount: 9, isAuthorDeleted: false, isModDeleted: false, isPinned: false, isLocked: false, pinnedScope: null, pinnedAt: null, categoryMaturityRating: 'safe', lastActivityAt: NOW, publishedAt: NOW, indexedAt: NOW, }, ] // --- Tombstone Topics (deleted) --- export const mockAuthorDeletedTopic: Topic = { uri: `at://${mockUsers[2]!.did}/forum.barazo.topic.post/3kf6del`, rkey: '3kf6del', authorDid: mockUsers[2]!.did, title: '[Deleted by author]', content: '', category: 'general', site: null, tags: null, communityDid: COMMUNITY_DID, cid: 'bafyreib6', replyCount: 0, reactionCount: 0, isAuthorDeleted: true, isModDeleted: false, isPinned: false, isLocked: false, pinnedScope: null, pinnedAt: null, categoryMaturityRating: 'safe', lastActivityAt: YESTERDAY, publishedAt: YESTERDAY, indexedAt: YESTERDAY, } export const mockModDeletedTopic: Topic = { uri: `at://${mockUsers[3]!.did}/forum.barazo.topic.post/3kf7del`, rkey: '3kf7del', authorDid: mockUsers[3]!.did, title: '[Removed by moderator]', content: '', category: 'general', site: null, tags: null, communityDid: COMMUNITY_DID, cid: 'bafyreib7', replyCount: 0, reactionCount: 0, isAuthorDeleted: false, isModDeleted: true, isPinned: false, isLocked: false, pinnedScope: null, pinnedAt: null, categoryMaturityRating: 'safe', lastActivityAt: NOW, publishedAt: NOW, indexedAt: NOW, } // --- Replies --- const TOPIC_URI = mockTopics[0]!.uri const TOPIC_CID = mockTopics[0]!.cid // --- Search Results --- export const mockSearchResults: SearchResult[] = [ { type: 'topic', uri: mockTopics[0]!.uri, rkey: mockTopics[0]!.rkey, authorDid: mockTopics[0]!.authorDid, authorHandle: mockUsers[0]!.handle, title: 'Welcome to Barazo Forums', content: 'This is the first topic on our new federated forum platform.', category: 'general', communityDid: COMMUNITY_DID, replyCount: 5, reactionCount: 12, publishedAt: TWO_DAYS_AGO, rank: 0.95, rootUri: null, rootTitle: null, }, { type: 'topic', uri: mockTopics[1]!.uri, rkey: mockTopics[1]!.rkey, authorDid: mockTopics[1]!.authorDid, authorHandle: mockUsers[1]!.handle, title: 'Building with the AT Protocol', content: 'A deep dive into building applications on the AT Protocol.', category: 'development', communityDid: COMMUNITY_DID, replyCount: 8, reactionCount: 23, publishedAt: TWO_DAYS_AGO, rank: 0.82, rootUri: null, rootTitle: null, }, { type: 'reply', uri: `at://${mockUsers[1]!.did}/forum.barazo.reply.post/3kf6aaa`, rkey: '3kf6aaa', authorDid: mockUsers[1]!.did, authorHandle: mockUsers[1]!.handle, title: null, content: 'Welcome! Excited to see this forum take shape.', category: null, communityDid: COMMUNITY_DID, replyCount: null, reactionCount: 4, publishedAt: TWO_DAYS_AGO, rank: 0.71, rootUri: mockTopics[0]!.uri, rootTitle: 'Welcome to Barazo Forums', }, ] // --- Notifications --- export const mockNotifications: Notification[] = [ { id: 'notif-1', type: 'reply', userDid: mockUsers[0]!.did, actorDid: mockUsers[1]!.did, actorHandle: mockUsers[1]!.handle, subjectUri: mockTopics[0]!.uri, subjectTitle: 'Welcome to Barazo Forums', subjectAuthorDid: mockUsers[0]!.did, subjectAuthorHandle: mockUsers[0]!.handle, message: 'alex.bsky.team replied to your topic', read: false, createdAt: NOW, }, { id: 'notif-2', type: 'reaction', userDid: mockUsers[0]!.did, actorDid: mockUsers[2]!.did, actorHandle: mockUsers[2]!.handle, subjectUri: mockTopics[0]!.uri, subjectTitle: 'Welcome to Barazo Forums', subjectAuthorDid: mockUsers[0]!.did, subjectAuthorHandle: mockUsers[0]!.handle, message: 'sam.example.com reacted to your topic', read: false, createdAt: YESTERDAY, }, { id: 'notif-3', type: 'mention', userDid: mockUsers[0]!.did, actorDid: mockUsers[3]!.did, actorHandle: mockUsers[3]!.handle, subjectUri: `at://${mockUsers[3]!.did}/forum.barazo.reply.post/3kf6ddd`, subjectTitle: null, subjectAuthorDid: mockUsers[3]!.did, subjectAuthorHandle: mockUsers[3]!.handle, message: 'robin.bsky.team mentioned you in a reply', read: true, createdAt: YESTERDAY, }, { id: 'notif-4', type: 'moderation', userDid: mockUsers[0]!.did, actorDid: mockUsers[4]!.did, actorHandle: mockUsers[4]!.handle, subjectUri: mockTopics[0]!.uri, subjectTitle: 'Welcome to Barazo Forums', subjectAuthorDid: mockUsers[0]!.did, subjectAuthorHandle: mockUsers[0]!.handle, message: 'Your topic was pinned by a moderator', read: true, createdAt: TWO_DAYS_AGO, }, ] // --- Replies --- export const mockReplies: Reply[] = [ { uri: `at://${mockUsers[1]!.did}/forum.barazo.reply.post/3kf6aaa`, rkey: '3kf6aaa', authorDid: mockUsers[1]!.did, author: mockAuthorProfiles[1]!, content: 'Welcome! Excited to see this forum take shape.', rootUri: TOPIC_URI, rootCid: TOPIC_CID, parentUri: TOPIC_URI, parentCid: TOPIC_CID, communityDid: COMMUNITY_DID, cid: 'bafyreir1', depth: 1, reactionCount: 4, isAuthorDeleted: false, isModDeleted: false, createdAt: TWO_DAYS_AGO, indexedAt: TWO_DAYS_AGO, }, { uri: `at://${mockUsers[2]!.did}/forum.barazo.reply.post/3kf6bbb`, rkey: '3kf6bbb', authorDid: mockUsers[2]!.did, author: mockAuthorProfiles[2]!, content: 'Thanks for starting this community! The AT Protocol integration is really interesting.', rootUri: TOPIC_URI, rootCid: TOPIC_CID, parentUri: `at://${mockUsers[1]!.did}/forum.barazo.reply.post/3kf6aaa`, parentCid: 'bafyreir1', communityDid: COMMUNITY_DID, cid: 'bafyreir2', depth: 2, reactionCount: 2, isAuthorDeleted: false, isModDeleted: false, createdAt: YESTERDAY, indexedAt: YESTERDAY, }, { uri: `at://${mockUsers[0]!.did}/forum.barazo.reply.post/3kf6ccc`, rkey: '3kf6ccc', authorDid: mockUsers[0]!.did, author: mockAuthorProfiles[0]!, content: 'Agreed! Portable identity changes everything.', rootUri: TOPIC_URI, rootCid: TOPIC_CID, parentUri: `at://${mockUsers[2]!.did}/forum.barazo.reply.post/3kf6bbb`, parentCid: 'bafyreir2', communityDid: COMMUNITY_DID, cid: 'bafyreir3', depth: 3, reactionCount: 1, isAuthorDeleted: false, isModDeleted: false, createdAt: YESTERDAY, indexedAt: YESTERDAY, }, { uri: `at://${mockUsers[3]!.did}/forum.barazo.reply.post/3kf6ddd`, rkey: '3kf6ddd', authorDid: mockUsers[3]!.did, author: mockAuthorProfiles[3]!, content: 'One question: how does content moderation work across federated instances?', rootUri: TOPIC_URI, rootCid: TOPIC_CID, parentUri: TOPIC_URI, parentCid: TOPIC_CID, communityDid: COMMUNITY_DID, cid: 'bafyreir4', depth: 1, reactionCount: 6, isAuthorDeleted: false, isModDeleted: false, createdAt: NOW, indexedAt: NOW, }, { uri: `at://${mockUsers[4]!.did}/forum.barazo.reply.post/3kf6eee`, rkey: '3kf6eee', authorDid: mockUsers[4]!.did, author: mockAuthorProfiles[4]!, content: 'Great question! Each community has its own moderation policies, but the AT Protocol labeling system allows cross-community signals.', rootUri: TOPIC_URI, rootCid: TOPIC_CID, parentUri: `at://${mockUsers[3]!.did}/forum.barazo.reply.post/3kf6ddd`, parentCid: 'bafyreir4', communityDid: COMMUNITY_DID, cid: 'bafyreir5', depth: 2, reactionCount: 8, isAuthorDeleted: false, isModDeleted: false, createdAt: NOW, indexedAt: NOW, }, ] // --- Tombstone Replies (deleted) --- export const mockAuthorDeletedReply: Reply = { uri: `at://${mockUsers[2]!.did}/forum.barazo.reply.post/3kf6fff`, rkey: '3kf6fff', authorDid: mockUsers[2]!.did, content: '', rootUri: TOPIC_URI, rootCid: TOPIC_CID, parentUri: TOPIC_URI, parentCid: TOPIC_CID, communityDid: COMMUNITY_DID, cid: 'bafyreir6', depth: 1, reactionCount: 0, isAuthorDeleted: true, isModDeleted: false, createdAt: YESTERDAY, indexedAt: YESTERDAY, } export const mockModDeletedReply: Reply = { uri: `at://${mockUsers[3]!.did}/forum.barazo.reply.post/3kf6ggg`, rkey: '3kf6ggg', authorDid: mockUsers[3]!.did, content: '[Removed by moderator]', rootUri: TOPIC_URI, rootCid: TOPIC_CID, parentUri: TOPIC_URI, parentCid: TOPIC_CID, communityDid: COMMUNITY_DID, cid: 'bafyreir7', depth: 1, reactionCount: 0, isAuthorDeleted: false, isModDeleted: true, createdAt: NOW, indexedAt: NOW, } // --- Deep Thread Replies (15 levels deep, for testing nested threading on mobile) --- const DEEP_TOPIC_URI = `at://${mockUsers[0]!.did}/forum.barazo.topic.post/3kf1abc` const DEEP_TOPIC_CID = 'bafyreit1' const deepThreadContent: string[] = [ 'Has anyone tried running Barazo on a Raspberry Pi?', 'I actually have it running on a Pi 4 with 8GB RAM. Works surprisingly well.', 'What about the database? PostgreSQL on a Pi seems heavy.', 'SQLite would be lighter but you lose concurrent writes. PostgreSQL is fine with proper tuning.', 'What pg settings did you change? I keep running out of shared memory.', 'Set shared_buffers to 256MB and work_mem to 16MB. Also reduce max_connections to 20.', 'That helped a lot, thanks! But now the firehose consumer is lagging behind.', 'The firehose needs dedicated resources. Consider running it as a separate service.', 'Separate service means another container though. The Pi is already running 4.', 'You could use a lightweight process manager instead of Docker for some services.', 'PM2 or systemd? I tried PM2 but it added 100MB of memory overhead.', 'systemd is the way to go. Zero overhead and it handles restarts natively.', 'Good call. One more question -- how do you handle SSL termination?', 'Caddy is perfect for this. Auto-HTTPS with minimal config and low resource usage.', 'This whole thread is gold. Someone should turn this into a self-hosting guide.', ] /** * A deeply nested reply thread (15 levels) for testing deep threading behavior, * especially on mobile viewports where indentation becomes a concern. * Each reply is a child of the previous one, forming a single chain. * Uses the same topic as mockReplies (mockTopics[0]). */ export const mockDeepReplies: Reply[] = deepThreadContent.map((content, i) => { const depth = i + 1 const userIndex = i % mockUsers.length const rkey = `3kf7${String(i + 1).padStart(3, '0')}` const prevRkey = i > 0 ? `3kf7${String(i).padStart(3, '0')}` : null const prevUserIndex = i > 0 ? (i - 1) % mockUsers.length : null const parentUri = i === 0 ? DEEP_TOPIC_URI : `at://${mockUsers[prevUserIndex!]!.did}/forum.barazo.reply.post/${prevRkey}` const parentCid = i === 0 ? DEEP_TOPIC_CID : `bafydeep${i}` return { uri: `at://${mockUsers[userIndex]!.did}/forum.barazo.reply.post/${rkey}`, rkey, authorDid: mockUsers[userIndex]!.did, author: mockAuthorProfiles[userIndex]!, content, rootUri: DEEP_TOPIC_URI, rootCid: DEEP_TOPIC_CID, parentUri, parentCid, communityDid: COMMUNITY_DID, cid: `bafydeep${depth}`, depth, reactionCount: Math.max(0, 15 - depth), isAuthorDeleted: false, isModDeleted: false, createdAt: new Date(Date.parse(TWO_DAYS_AGO) + i * 3600000).toISOString(), indexedAt: new Date(Date.parse(TWO_DAYS_AGO) + i * 3600000).toISOString(), } }) // --- Community Settings --- export const mockCommunitySettings: CommunitySettings = { id: 'community-1', initialized: true, communityDid: COMMUNITY_DID, adminDid: mockUsers[0]!.did, communityName: 'Barazo Test Community', maturityRating: 'safe', reactionSet: ['like', 'love', 'laugh', 'surprise', 'sad'], communityDescription: 'A test community for development', communityLogoUrl: null, faviconUrl: null, headerLogoUrl: null, showCommunityName: true, primaryColor: '#31748f', accentColor: '#c4a7e7', jurisdictionCountry: null, ageThreshold: 16, maxReplyDepth: 9999, requireLoginForMature: true, createdAt: TWO_DAYS_AGO, updatedAt: NOW, } // --- Community Stats --- export const mockCommunityStats: CommunityStats = { topicCount: 42, replyCount: 187, userCount: 156, categoryCount: 6, reportCount: 3, recentTopics: 8, recentReplies: 23, recentUsers: 5, } // --- Moderation Reports --- export const mockReports: ModerationReport[] = [ { id: 'report-1', reporterDid: mockUsers[2]!.did, reporterHandle: mockUsers[2]!.handle, targetUri: mockTopics[2]!.uri, targetAuthorDid: mockUsers[3]!.did, targetAuthorHandle: mockUsers[3]!.handle, targetContent: 'This content contains misleading information about the protocol.', targetTitle: 'Feature Request: Dark Mode Improvements', reasonType: 'misleading', reason: 'This post contains inaccurate technical claims', potentiallyIllegal: false, status: 'pending', resolution: null, resolvedAt: null, resolvedByDid: null, communityDid: COMMUNITY_DID, createdAt: NOW, }, { id: 'report-2', reporterDid: mockUsers[4]!.did, reporterHandle: mockUsers[4]!.handle, targetUri: `at://${mockUsers[1]!.did}/forum.barazo.reply.post/3kf6spam`, targetAuthorDid: mockUsers[1]!.did, targetAuthorHandle: mockUsers[1]!.handle, targetContent: 'Buy cheap products at example.com! Best deals ever!', targetTitle: null, reasonType: 'spam', reason: 'Obvious spam with commercial links', potentiallyIllegal: false, status: 'pending', resolution: null, resolvedAt: null, resolvedByDid: null, communityDid: COMMUNITY_DID, createdAt: YESTERDAY, }, { id: 'report-3', reporterDid: mockUsers[0]!.did, reporterHandle: mockUsers[0]!.handle, targetUri: `at://${mockUsers[3]!.did}/forum.barazo.reply.post/3kf6ill`, targetAuthorDid: mockUsers[3]!.did, targetAuthorHandle: mockUsers[3]!.handle, targetContent: 'Content that may violate local laws regarding hate speech.', targetTitle: null, reasonType: 'harassment', reason: 'Potentially illegal hate speech content', potentiallyIllegal: true, status: 'pending', resolution: null, resolvedAt: null, resolvedByDid: null, communityDid: COMMUNITY_DID, createdAt: NOW, }, ] // --- First Post Queue --- export const mockFirstPostQueue: FirstPostQueueItem[] = [ { id: 'fpq-1', authorDid: 'did:plc:new-user-001', authorHandle: 'newbie.bsky.social', contentUri: 'at://did:plc:new-user-001/forum.barazo.reply.post/3kf7aaa', contentType: 'reply', title: null, content: 'Hello everyone! I am new here and excited to join this community.', accountAge: '2 days', crossCommunityCount: 0, bannedFromOtherCommunities: 1, status: 'pending', communityDid: COMMUNITY_DID, createdAt: NOW, }, { id: 'fpq-2', authorDid: 'did:plc:new-user-002', authorHandle: 'newcomer.example.com', contentUri: 'at://did:plc:new-user-002/forum.barazo.topic.post/3kf7bbb', contentType: 'topic', title: 'Introduction: Newcomer here!', content: 'Hi, I found this forum through Bluesky and wanted to introduce myself.', accountAge: '5 days', crossCommunityCount: 3, bannedFromOtherCommunities: 0, status: 'pending', communityDid: COMMUNITY_DID, createdAt: YESTERDAY, }, ] // --- Moderation Log --- export const mockModerationLog: ModerationLogEntry[] = [ { id: 'log-1', actionType: 'pin', moderatorDid: mockUsers[0]!.did, moderatorHandle: mockUsers[0]!.handle, targetUri: mockTopics[0]!.uri, targetDid: null, targetHandle: null, reason: 'Welcome topic should be visible', communityDid: COMMUNITY_DID, createdAt: NOW, }, { id: 'log-2', actionType: 'warn', moderatorDid: mockUsers[0]!.did, moderatorHandle: mockUsers[0]!.handle, targetUri: null, targetDid: mockUsers[3]!.did, targetHandle: mockUsers[3]!.handle, reason: 'Repeated off-topic posting', communityDid: COMMUNITY_DID, createdAt: YESTERDAY, }, { id: 'log-3', actionType: 'delete', moderatorDid: mockUsers[4]!.did, moderatorHandle: mockUsers[4]!.handle, targetUri: `at://${mockUsers[1]!.did}/forum.barazo.reply.post/3kf6spam`, targetDid: mockUsers[1]!.did, targetHandle: mockUsers[1]!.handle, reason: 'Spam content', communityDid: COMMUNITY_DID, createdAt: TWO_DAYS_AGO, }, ] // --- Moderation Thresholds --- export const mockModerationThresholds: ModerationThresholds = { autoBlockReportCount: 5, warnThreshold: 3, firstPostQueueCount: 3, newAccountRateLimit: 3, linkPostingHold: true, topicCreationDelay: true, burstDetectionPostCount: 5, burstDetectionMinutes: 10, } // --- Reported Users --- export const mockReportedUsers: ReportedUser[] = [ { did: mockUsers[3]!.did, handle: mockUsers[3]!.handle, reportCount: 4, latestReportAt: NOW, bannedFromOtherCommunities: 2, }, { did: mockUsers[1]!.did, handle: mockUsers[1]!.handle, reportCount: 2, latestReportAt: YESTERDAY, bannedFromOtherCommunities: 0, }, ] // --- Admin Users --- export const mockAdminUsers: AdminUser[] = [ { did: mockUsers[0]!.did, handle: mockUsers[0]!.handle, displayName: 'Jay Admin', avatarUrl: null, role: 'admin', isBanned: false, bannedAt: null, banReason: null, bannedFromOtherCommunities: 0, topicCount: 15, replyCount: 42, reportCount: 0, firstSeenAt: TWO_DAYS_AGO, lastActiveAt: NOW, }, { did: mockUsers[1]!.did, handle: mockUsers[1]!.handle, displayName: 'Alex Moderator', avatarUrl: null, role: 'moderator', isBanned: false, bannedAt: null, banReason: null, bannedFromOtherCommunities: 0, topicCount: 8, replyCount: 31, reportCount: 2, firstSeenAt: TWO_DAYS_AGO, lastActiveAt: YESTERDAY, }, { did: mockUsers[2]!.did, handle: mockUsers[2]!.handle, displayName: 'Sam Member', avatarUrl: null, role: 'member', isBanned: false, bannedAt: null, banReason: null, bannedFromOtherCommunities: 0, topicCount: 3, replyCount: 12, reportCount: 0, firstSeenAt: YESTERDAY, lastActiveAt: NOW, }, { did: mockUsers[3]!.did, handle: mockUsers[3]!.handle, displayName: 'Robin Troublemaker', avatarUrl: null, role: 'member', isBanned: false, bannedAt: null, banReason: null, bannedFromOtherCommunities: 2, topicCount: 5, replyCount: 18, reportCount: 4, firstSeenAt: TWO_DAYS_AGO, lastActiveAt: NOW, }, { did: mockUsers[4]!.did, handle: mockUsers[4]!.handle, displayName: 'Morgan Banned', avatarUrl: null, role: 'member', isBanned: true, bannedAt: YESTERDAY, banReason: 'Repeated spam violations', bannedFromOtherCommunities: 3, topicCount: 1, replyCount: 2, reportCount: 5, firstSeenAt: TWO_DAYS_AGO, lastActiveAt: YESTERDAY, }, ] // --- Plugins --- export const mockPlugins: Plugin[] = [ { id: 'barazo-plugin-search', name: 'barazo-plugin-search', displayName: 'Full-Text Search', version: '1.0.0', description: 'Full-text search for topics and replies with optional semantic search.', source: 'core', enabled: true, category: 'search', dependencies: [], dependents: [], settingsSchema: { enableSemanticSearch: { type: 'boolean', label: 'Enable semantic search', description: 'Use embeddings for semantic search alongside full-text.', default: false, }, embeddingProvider: { type: 'select', label: 'Embedding provider', description: 'Provider for generating embeddings.', default: '', options: ['', 'openai', 'ollama', 'openrouter'], }, }, settings: { enableSemanticSearch: false, embeddingProvider: '' }, installedAt: LAST_WEEK, }, { id: 'barazo-plugin-markdown', name: 'barazo-plugin-markdown', displayName: 'Markdown Editor', version: '1.2.0', description: 'Rich text editor with Markdown support, code highlighting, and preview.', source: 'core', enabled: true, category: 'editor', dependencies: [], dependents: ['barazo-plugin-code-highlight'], settingsSchema: { enablePreview: { type: 'boolean', label: 'Enable live preview', default: true, }, }, settings: { enablePreview: true }, installedAt: LAST_WEEK, }, { id: 'barazo-plugin-code-highlight', name: 'barazo-plugin-code-highlight', displayName: 'Code Highlighting', version: '0.9.1', description: 'Syntax highlighting for code blocks using Shiki.', source: 'official', enabled: true, category: 'editor', dependencies: ['barazo-plugin-markdown'], dependents: [], settingsSchema: { theme: { type: 'select', label: 'Code theme', default: 'flexoki', options: ['flexoki', 'github-dark', 'github-light', 'one-dark-pro'], }, }, settings: { theme: 'flexoki' }, installedAt: LAST_WEEK, }, { id: 'barazo-plugin-analytics', name: 'barazo-plugin-analytics', displayName: 'Community Analytics', version: '0.5.0', description: 'Topic trends, user engagement metrics, and growth analytics.', source: 'community', enabled: false, category: 'analytics', dependencies: [], dependents: [], settingsSchema: { trackingInterval: { type: 'number', label: 'Tracking interval (minutes)', description: 'How often to aggregate analytics data.', default: 60, }, }, settings: { trackingInterval: 60 }, installedAt: YESTERDAY, }, { id: 'barazo-plugin-webhooks', name: 'barazo-plugin-webhooks', displayName: 'Webhook Notifications', version: '0.2.0-beta', description: 'Send webhook notifications on new topics, replies, and moderation actions.', source: 'experimental', enabled: false, category: 'integrations', dependencies: [], dependents: [], settingsSchema: { webhookUrl: { type: 'string', label: 'Webhook URL', description: 'URL to send webhook payloads to.', default: '', }, }, settings: { webhookUrl: '' }, installedAt: YESTERDAY, }, ] // --- User Preferences --- export const mockUserPreferences: UserPreferences = { maturityLevel: 'sfw', declaredAge: null, mutedWords: ['spam', 'offensive'], blockedDids: [], blockedProfiles: [], mutedDids: [], crossPostBluesky: true, crossPostFrontpage: false, updatedAt: NOW, } // --- Onboarding Fields --- export const mockOnboardingFields: OnboardingField[] = [ { id: 'field-tos', communityDid: COMMUNITY_DID, fieldType: 'tos_acceptance', label: 'Terms of Service', description: 'You must accept our community rules to participate.', isMandatory: true, sortOrder: 0, source: 'admin', config: { tosUrl: 'https://example.com/tos' }, createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, }, { id: 'field-intro', communityDid: COMMUNITY_DID, fieldType: 'custom_text', label: 'Introduce yourself', description: 'Tell us a bit about yourself and why you joined.', isMandatory: false, sortOrder: 1, source: 'admin', config: null, createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, }, { id: 'platform:age_confirmation', communityDid: COMMUNITY_DID, fieldType: 'age_confirmation', label: 'Age Declaration', description: 'Please select your age bracket. This determines which content is available to you.', isMandatory: true, sortOrder: -1, source: 'platform', config: null, createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, }, ] // --- My Reports (user's own reports) --- export const mockMyReports: MyReport[] = [ { id: 1, reporterDid: 'did:plc:user-jay-001', targetUri: 'at://did:plc:user-alex-002/forum.barazo.topic.post/abc123', targetDid: 'did:plc:user-alex-002', reasonType: 'spam', description: 'This is spam content', status: 'pending', resolutionType: null, resolvedBy: null, resolvedAt: null, appealReason: null, appealedAt: null, appealStatus: 'none', createdAt: NOW, }, { id: 2, reporterDid: 'did:plc:user-jay-001', targetUri: 'at://did:plc:user-sam-003/forum.barazo.topic.post/def456', targetDid: 'did:plc:user-sam-003', reasonType: 'harassment', description: 'Targeted harassment', status: 'resolved', resolutionType: 'warned', resolvedBy: 'did:plc:mod-001', resolvedAt: YESTERDAY, appealReason: null, appealedAt: null, appealStatus: 'none', createdAt: TWO_DAYS_AGO, }, { id: 3, reporterDid: 'did:plc:user-jay-001', targetUri: 'at://did:plc:user-robin-004/forum.barazo.topic.reply/ghi789', targetDid: 'did:plc:user-robin-004', reasonType: 'misleading', description: 'Misleading information', status: 'resolved', resolutionType: 'dismissed', resolvedBy: 'did:plc:mod-001', resolvedAt: YESTERDAY, appealReason: null, appealedAt: null, appealStatus: 'none', createdAt: LAST_WEEK, }, { id: 4, reporterDid: 'did:plc:user-jay-001', targetUri: 'at://did:plc:user-morgan-005/forum.barazo.topic.post/jkl012', targetDid: 'did:plc:user-morgan-005', reasonType: 'violation', description: 'Rule violation', status: 'pending', resolutionType: null, resolvedBy: null, resolvedAt: null, appealReason: 'I believe this was wrongly dismissed', appealedAt: YESTERDAY, appealStatus: 'pending', createdAt: LAST_WEEK, }, ] // --- User Profiles (public, keyed by handle) --- export const mockUserProfiles: Record = { 'jay.bsky.team': { did: 'did:plc:user-jay-001', handle: 'jay.bsky.team', displayName: 'Jay', avatarUrl: 'https://cdn.bsky.social/avatar/jay.jpg', bannerUrl: null, bio: 'Community admin and AT Protocol enthusiast.', role: 'admin', firstSeenAt: TWO_DAYS_AGO, lastActiveAt: NOW, accountCreatedAt: TWO_DAYS_AGO, followersCount: 150, followsCount: 75, atprotoPostsCount: 230, hasBlueskyProfile: true, communityCount: 2, labels: [{ val: 'adult-content', src: 'did:plc:user-jay-001', isSelfLabel: true }], activity: { topicCount: 15, replyCount: 42, reactionsReceived: 89, votesReceived: 34, }, globalActivity: { topicCount: 25, replyCount: 60, reactionsReceived: 120, votesReceived: 55, }, }, 'alex.bsky.team': { did: 'did:plc:user-alex-002', handle: 'alex.bsky.team', displayName: 'Alex', avatarUrl: null, bannerUrl: null, bio: null, role: 'moderator', firstSeenAt: TWO_DAYS_AGO, lastActiveAt: YESTERDAY, accountCreatedAt: TWO_DAYS_AGO, followersCount: 30, followsCount: 20, atprotoPostsCount: 45, hasBlueskyProfile: true, communityCount: 1, labels: [], activity: { topicCount: 8, replyCount: 31, reactionsReceived: 45, votesReceived: 12, }, }, } // --- Public Settings --- export const mockPublicSettings: PublicSettings = { communityDid: COMMUNITY_DID, communityName: 'Barazo Test Community', maturityRating: 'safe', maxReplyDepth: 9999, communityDescription: 'A test community for development', communityLogoUrl: null, faviconUrl: null, headerLogoUrl: null, showCommunityName: true, } // --- Community Profile (own profile in a community) --- export const mockCommunityProfile: CommunityProfile = { did: 'did:plc:user-jay-001', handle: 'jay.bsky.team', displayName: 'Jay', avatarUrl: 'https://cdn.bsky.social/avatar/jay.jpg', bannerUrl: null, bio: 'Community admin and AT Protocol enthusiast.', communityDid: COMMUNITY_DID, hasOverride: false, source: { displayName: 'Jay', avatarUrl: 'https://cdn.bsky.social/avatar/jay.jpg', bannerUrl: null, bio: 'Community admin and AT Protocol enthusiast.', }, } // --- Pages --- export const mockPages: PageTreeNode[] = [ { id: 'page-about', slug: 'about', title: 'About This Community', content: '# About\n\nWelcome to our community forum.', status: 'published', metaDescription: 'Learn about our community forum.', parentId: null, sortOrder: 0, communityDid: COMMUNITY_DID, createdAt: TWO_DAYS_AGO, updatedAt: YESTERDAY, children: [], }, { id: 'page-privacy', slug: 'privacy-policy', title: 'Privacy Policy', content: '# Privacy Policy\n\nYour privacy matters to us.', status: 'published', metaDescription: 'How we handle your data.', parentId: null, sortOrder: 1, communityDid: COMMUNITY_DID, createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, { id: 'page-terms', slug: 'terms-of-service', title: 'Terms of Service', content: '# Terms of Service\n\nBy using this forum, you agree to these terms.', status: 'published', metaDescription: 'Terms and conditions for using this forum.', parentId: null, sortOrder: 2, communityDid: COMMUNITY_DID, createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, { id: 'page-cookie', slug: 'cookie-policy', title: 'Cookie Policy', content: '## Overview\n\nBarazo uses a minimal number of cookies...', status: 'published', metaDescription: 'How Barazo uses cookies.', parentId: null, sortOrder: 3, communityDid: COMMUNITY_DID, createdAt: TWO_DAYS_AGO, updatedAt: TWO_DAYS_AGO, children: [], }, { id: 'page-draft', slug: 'upcoming-features', title: 'Upcoming Features', content: '# Coming Soon\n\nStay tuned for new features.', status: 'draft', metaDescription: null, parentId: null, sortOrder: 4, communityDid: COMMUNITY_DID, createdAt: YESTERDAY, updatedAt: YESTERDAY, children: [], }, ] // --- Sybil Detection --- const TWO_HOURS_AGO = '2026-02-14T10:00:00.000Z' export const mockSybilClusters: SybilCluster[] = [ { id: 1, clusterHash: 'abc123def456', memberCount: 8, internalEdgeCount: 24, externalEdgeCount: 3, suspicionRatio: 0.89, status: 'flagged', detectedAt: TWO_HOURS_AGO, reviewedBy: null, reviewedAt: null, }, { id: 2, clusterHash: 'ghi789jkl012', memberCount: 5, internalEdgeCount: 12, externalEdgeCount: 7, suspicionRatio: 0.62, status: 'monitoring', detectedAt: YESTERDAY, reviewedBy: 'did:plc:user-jay-001', reviewedAt: NOW, }, { id: 3, clusterHash: 'mno345pqr678', memberCount: 3, internalEdgeCount: 4, externalEdgeCount: 8, suspicionRatio: 0.33, status: 'dismissed', detectedAt: LAST_WEEK, reviewedBy: 'did:plc:user-jay-001', reviewedAt: YESTERDAY, }, ] export const mockSybilClusterDetail: SybilClusterDetail = { ...mockSybilClusters[0]!, members: [ { did: 'did:plc:sybil-001', handle: 'sybil1.bsky.social', displayName: 'Sybil Account 1', roleInCluster: 'core', trustScore: 0.12, reputationScore: 0.15, accountAge: '3 days', communitiesActiveIn: 1, }, { did: 'did:plc:sybil-002', handle: 'sybil2.bsky.social', displayName: 'Sybil Account 2', roleInCluster: 'core', trustScore: 0.14, reputationScore: 0.18, accountAge: '3 days', communitiesActiveIn: 1, }, { did: 'did:plc:sybil-003', handle: 'sybil3.example.com', displayName: 'Sybil Account 3', roleInCluster: 'peripheral', trustScore: 0.31, reputationScore: 0.28, accountAge: '7 days', communitiesActiveIn: 2, }, { did: 'did:plc:sybil-004', handle: 'sybil4.bsky.social', displayName: 'Sybil Account 4', roleInCluster: 'core', trustScore: 0.1, reputationScore: 0.12, accountAge: '2 days', communitiesActiveIn: 1, }, { did: 'did:plc:sybil-005', handle: 'sybil5.bsky.social', displayName: 'Sybil Account 5', roleInCluster: 'peripheral', trustScore: 0.25, reputationScore: 0.22, accountAge: '5 days', communitiesActiveIn: 1, }, { did: 'did:plc:sybil-006', handle: 'sybil6.example.com', displayName: 'Sybil Account 6', roleInCluster: 'core', trustScore: 0.11, reputationScore: 0.14, accountAge: '3 days', communitiesActiveIn: 1, }, { did: 'did:plc:sybil-007', handle: 'sybil7.bsky.social', displayName: 'Sybil Account 7', roleInCluster: 'peripheral', trustScore: 0.29, reputationScore: 0.26, accountAge: '6 days', communitiesActiveIn: 2, }, { did: 'did:plc:sybil-008', handle: 'sybil8.bsky.social', displayName: 'Sybil Account 8', roleInCluster: 'core', trustScore: 0.13, reputationScore: 0.16, accountAge: '3 days', communitiesActiveIn: 1, }, ], } export const mockTrustSeeds: TrustSeed[] = [ { id: 1, did: 'did:plc:seed-001', handle: 'trusted-mod.bsky.social', displayName: 'Trusted Moderator', communityId: null, reason: 'Founding community moderator', implicit: false, createdAt: LAST_WEEK, }, { id: 2, did: 'did:plc:seed-002', handle: 'verified-expert.bsky.social', displayName: 'Verified Expert', communityId: COMMUNITY_DID, reason: 'Subject matter expert with verified credentials', implicit: false, createdAt: TWO_DAYS_AGO, }, { id: 3, did: 'did:plc:user-jay-001', handle: 'jay.bsky.team', displayName: 'Jay', communityId: null, reason: null, implicit: true, createdAt: LAST_WEEK, }, { id: 4, did: 'did:plc:user-alex-002', handle: 'alex.bsky.team', displayName: 'Alex', communityId: null, reason: null, implicit: true, createdAt: LAST_WEEK, }, { id: 5, did: 'did:plc:user-sam-003', handle: 'sam.example.com', displayName: 'Sam', communityId: COMMUNITY_DID, reason: null, implicit: true, createdAt: TWO_DAYS_AGO, }, ] export const mockPdsTrustFactors: PdsTrustFactor[] = [ { pdsHost: 'bsky.social', trustFactor: 1.0, isDefault: true, updatedAt: LAST_WEEK, }, { pdsHost: 'northsky.app', trustFactor: 1.0, isDefault: true, updatedAt: LAST_WEEK, }, { pdsHost: 'custom-pds.example', trustFactor: 0.7, isDefault: false, updatedAt: TWO_DAYS_AGO, }, ] export const mockTrustGraphStatus: TrustGraphStatus = { lastComputedAt: TWO_HOURS_AGO, totalNodes: 1500, totalEdges: 4200, computationDurationMs: 3200, clustersFlagged: 2, nextScheduledAt: '2026-02-14T16:00:00.000Z', } export const mockBehavioralFlags: BehavioralFlag[] = [ { id: 1, flagType: 'burst_voting', affectedDids: ['did:plc:sybil-001', 'did:plc:sybil-002', 'did:plc:sybil-004'], details: '3 accounts cast 47 votes within a 2-minute window on the same set of 5 topics.', detectedAt: TWO_HOURS_AGO, status: 'pending', }, { id: 2, flagType: 'content_similarity', affectedDids: ['did:plc:sybil-005', 'did:plc:sybil-006'], details: '2 accounts posted near-identical replies across 3 different topics with 94% text similarity.', detectedAt: YESTERDAY, status: 'pending', }, ]