aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/models/users/user.model.ts
blob: 63c5c8a92f961e36da3e9b4e40e064e27cb713e4 (plain) (tree)
1
2
3
4
5
6
7
8
                                   
                                                                    
                                      
                                                           
                                                                           
                                                 
                                                                                
 



                       
                             
 
                        
                            
 

                            
                        
                            
                                    

                                        
                            

                     
                               
                          
 
                

                   
                    
                         

                              
 
                      




                              
                             


               
                  
                                                
                                


                        
 

                                       
                                     

                 

                           

                            
 
 





                                        
                                      
                                           
 
import { Account } from '../actors'
import { VideoChannel } from '../videos/channel/video-channel.model'
import { UserRole } from './user-role'
import { NSFWPolicyType } from '../videos/nsfw-policy.type'
import { UserNotificationSetting } from './user-notification-setting.model'
import { UserAdminFlag } from './user-flag.model'
import { VideoPlaylistType } from '../videos/playlist/video-playlist-type.model'

export interface User {
  id: number
  username: string
  email: string
  pendingEmail: string | null

  emailVerified: boolean
  nsfwPolicy: NSFWPolicyType

  adminFlags?: UserAdminFlag

  autoPlayVideo: boolean
  autoPlayNextVideo: boolean
  autoPlayNextVideoPlaylist: boolean

  // @deprecated in favour of p2pEnabled
  webTorrentEnabled: boolean
  p2pEnabled: boolean

  videosHistoryEnabled: boolean
  videoLanguages: string[]

  role: UserRole
  roleLabel: string

  videoQuota: number
  videoQuotaDaily: number
  videoQuotaUsed?: number
  videoQuotaUsedDaily?: number

  videosCount?: number

  abusesCount?: number
  abusesAcceptedCount?: number
  abusesCreatedCount?: number

  videoCommentsCount?: number

  theme: string

  account: Account
  notificationSettings?: UserNotificationSetting
  videoChannels?: VideoChannel[]

  blocked: boolean
  blockedReason?: string

  noInstanceConfigWarningModal: boolean
  noWelcomeModal: boolean
  noAccountSetupWarningModal: boolean

  createdAt: Date

  pluginAuth: string | null

  lastLoginDate: Date | null
}

export interface MyUserSpecialPlaylist {
  id: number
  name: string
  type: VideoPlaylistType
}

export interface MyUser extends User {
  specialPlaylists: MyUserSpecialPlaylist[]
}