aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-abuse.ts
blob: e38c3f58600585e7af33d7a363d42101e313e6e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { VideoAbuseModel } from '../../../models/video/video-abuse'
import { PickWith } from '../../utils'
import { 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', MVideo> &
  Use<'Account', MAccountDefault>

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

// Format for API or AP object

export type MVideoAbuseFormattable = MVideoAbuse &
  Use<'Account', MAccountFormattable> &
  Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'name'>>