// User roles export const UserRole = { ADMIN: 'admin', USER: 'user' } as const; export type UserRole = (typeof UserRole)[keyof typeof UserRole]; // Authentication modes export const AuthMode = { LOCAL: 'local', OAUTH: 'oauth', BOTH: 'both' } as const; export type AuthMode = (typeof AuthMode)[keyof typeof AuthMode]; // Auth providers export const AuthProvider = { LOCAL: 'local', OAUTH: 'oauth' } as const; export type AuthProvider = (typeof AuthProvider)[keyof typeof AuthProvider]; // App status values export const AppStatusValue = { ONLINE: 'online', OFFLINE: 'offline', DEGRADED: 'degraded', UNKNOWN: 'unknown' } as const; export type AppStatusValue = (typeof AppStatusValue)[keyof typeof AppStatusValue]; // Widget types export const WidgetType = { APP: 'app', BOOKMARK: 'bookmark', NOTE: 'note', EMBED: 'embed', STATUS: 'status', CLOCK: 'clock', SYSTEM_STATS: 'system_stats', RSS: 'rss', CALENDAR: 'calendar', MARKDOWN: 'markdown', METRIC: 'metric', LINK_GROUP: 'link_group', CAMERA: 'camera' } as const; export type WidgetType = (typeof WidgetType)[keyof typeof WidgetType]; // Icon types export const IconType = { LUCIDE: 'lucide', SIMPLE: 'simple', URL: 'url', EMOJI: 'emoji' } as const; export type IconType = (typeof IconType)[keyof typeof IconType]; // Permission levels (ordered by privilege) export const PermissionLevel = { VIEW: 'view', EDIT: 'edit', ADMIN: 'admin' } as const; export type PermissionLevel = (typeof PermissionLevel)[keyof typeof PermissionLevel]; // Permission hierarchy for comparison export const PERMISSION_HIERARCHY: Record = { [PermissionLevel.VIEW]: 1, [PermissionLevel.EDIT]: 2, [PermissionLevel.ADMIN]: 3 }; // Entity types for permissions export const EntityType = { BOARD: 'board', APP: 'app' } as const; export type EntityType = (typeof EntityType)[keyof typeof EntityType]; // Target types for permissions export const TargetType = { USER: 'user', GROUP: 'group' } as const; export type TargetType = (typeof TargetType)[keyof typeof TargetType]; // Healthcheck method export const HealthcheckMethod = { GET: 'GET', HEAD: 'HEAD' } as const; export type HealthcheckMethod = (typeof HealthcheckMethod)[keyof typeof HealthcheckMethod]; // Card sizes export const CardSize = { COMPACT: 'compact', MEDIUM: 'medium', LARGE: 'large' } as const; export type CardSize = (typeof CardSize)[keyof typeof CardSize]; // Notification channel types export const NotificationType = { DISCORD: 'discord', SLACK: 'slack', TELEGRAM: 'telegram', HTTP: 'http' } as const; export type NotificationType = (typeof NotificationType)[keyof typeof NotificationType]; // Notification events export const NotificationEvent = { APP_ONLINE: 'app_online', APP_OFFLINE: 'app_offline', APP_DEGRADED: 'app_degraded' } as const; export type NotificationEvent = (typeof NotificationEvent)[keyof typeof NotificationEvent]; // API token scopes export const ApiTokenScope = { READ: 'read', WRITE: 'write', ADMIN: 'admin' } as const; export type ApiTokenScope = (typeof ApiTokenScope)[keyof typeof ApiTokenScope]; // Audit log actions export const AuditAction = { USER_CREATED: 'user_created', USER_DELETED: 'user_deleted', USER_UPDATED: 'user_updated', BOARD_CREATED: 'board_created', BOARD_DELETED: 'board_deleted', APP_CREATED: 'app_created', APP_DELETED: 'app_deleted', SETTINGS_UPDATED: 'settings_updated', IMPORT: 'import', EXPORT: 'export' } as const; export type AuditAction = (typeof AuditAction)[keyof typeof AuditAction]; // Background types for board wallpapers export const BackgroundType = { NONE: 'none', COLOR: 'color', WALLPAPER: 'wallpaper' } as const; export type BackgroundType = (typeof BackgroundType)[keyof typeof BackgroundType]; // Defaults export const DEFAULTS = { HEALTHCHECK_INTERVAL: 300, HEALTHCHECK_TIMEOUT: 5000, HEALTHCHECK_EXPECTED_STATUS: 200, HEALTHCHECK_METHOD: 'GET', JWT_EXPIRY: '15m', REFRESH_TOKEN_EXPIRY_DAYS: 7, DEFAULT_THEME: 'dark', DEFAULT_PRIMARY_COLOR: '#6366f1', SYSTEM_SETTINGS_ID: 'singleton' } as const;