aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/types/models/video/video-abuse.ts
blob: 279a87cf3ac189971731982a07f4c21e57b8bc6a (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                   
                                             
                                                                     
                                                                 
 



                                                                               

                                                                                            

                                                                               

                                                       

                              
                                                
                      
 

                                     
                                                
                                                     
                                 




                                                                               

                                    
                                       

                                                                                                 
import { VideoAbuseModel } from '../../../models/video/video-abuse'
import { PickWith } from '@shared/core-utils'
import { MVideoAccountLightBlacklistAllFiles, MVideo } from './video'
import { MAccountDefault, MAccountFormattable } from '../account'

type Use<K extends keyof VideoAbuseModel, M> = PickWith<VideoAbuseModel, K, M>

// ############################################################################

export type MVideoAbuse = Omit<VideoAbuseModel, 'Account' | 'Video' | 'toActivityPubObject'>

// ############################################################################

export type MVideoAbuseId = Pick<VideoAbuseModel, 'id'>

export type MVideoAbuseVideo =
  MVideoAbuse &
  Pick<VideoAbuseModel, 'toActivityPubObject'> &
  Use<'Video', MVideo>

export type MVideoAbuseAccountVideo =
  MVideoAbuse &
  Pick<VideoAbuseModel, 'toActivityPubObject'> &
  Use<'Video', MVideoAccountLightBlacklistAllFiles> &
  Use<'Account', MAccountDefault>

// ############################################################################

// Format for API or AP object

export type MVideoAbuseFormattable =
  MVideoAbuse &
  Use<'Account', MAccountFormattable> &
  Use<'Video', Pick<MVideoAccountLightBlacklistAllFiles,
  'id' | 'uuid' | 'name' | 'nsfw' | 'getMiniatureStaticPath' | 'isBlacklisted' | 'VideoChannel'>>