Files
Compass/common/src/user.ts
2025-10-20 16:35:59 +02:00

58 lines
1.3 KiB
TypeScript

import { Socials } from './socials'
import { notification_preferences } from './user-notification-preferences'
export type User = {
id: string
createdTime: number
name: string
username: string
avatarUrl: string
// For their user page
bio?: string
// Social links
link: Socials
// Legacy fields (deprecated)
/** @deprecated Use link.site instead */
website?: string
/** @deprecated Use link.x instead */
twitterHandle?: string
/** @deprecated Use link.discord instead */
discordHandle?: string
/** @deprecated Use link.manifold instead */
manifoldHandle?: string
isBannedFromPosting?: boolean
userDeleted?: boolean
sweestakesVerified?: boolean
verifiedPhone?: boolean
idVerified?: boolean
}
export type PrivateUser = {
id: string // same as User.id
email?: string
initialDeviceToken?: string
initialIpAddress?: string
notificationPreferences: notification_preferences
blockedUserIds: string[]
blockedByUserIds: string[]
}
export type UserActivity = {
user_id: string // same as User.id
last_online_time: string
}
export type UserAndPrivateUser = { user: User; privateUser: PrivateUser }
export function getCurrentUtcTime(): Date {
const currentDate = new Date()
const utcDate = currentDate.toISOString()
return new Date(utcDate)
}