e38c3f58600585e7af33d7a363d42101e313e6e4
[oweals/peertube.git] / server / typings / models / video / video-abuse.ts
1 import { VideoAbuseModel } from '../../../models/video/video-abuse'
2 import { PickWith } from '../../utils'
3 import { MVideo } from './video'
4 import { MAccountDefault, MAccountFormattable } from '../account'
5
6 type Use<K extends keyof VideoAbuseModel, M> = PickWith<VideoAbuseModel, K, M>
7
8 // ############################################################################
9
10 export type MVideoAbuse = Omit<VideoAbuseModel, 'Account' | 'Video' | 'toActivityPubObject'>
11
12 // ############################################################################
13
14 export type MVideoAbuseId = Pick<VideoAbuseModel, 'id'>
15
16 export type MVideoAbuseVideo = MVideoAbuse &
17   Pick<VideoAbuseModel, 'toActivityPubObject'> &
18   Use<'Video', MVideo>
19
20 export type MVideoAbuseAccountVideo = MVideoAbuse &
21   Pick<VideoAbuseModel, 'toActivityPubObject'> &
22   Use<'Video', MVideo> &
23   Use<'Account', MAccountDefault>
24
25 // ############################################################################
26
27 // Format for API or AP object
28
29 export type MVideoAbuseFormattable = MVideoAbuse &
30   Use<'Account', MAccountFormattable> &
31   Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'name'>>