]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/models/video/video.ts
Fix tests
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video.ts
CommitLineData
453e83ea
C
1import { VideoModel } from '../../../models/video/video'
2import { PickWith, PickWithOpt } from '../../utils'
3import { MChannelAccountLight, MChannelActor, MChannelActorAccountDefault, MChannelUserId } from './video-channels'
4import { MTag } from './tag'
5import { MVideoCaptionLanguage } from './video-caption'
6import { MStreamingPlaylist, MStreamingPlaylistRedundancies } from './video-streaming-playlist'
7import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file'
8import { MThumbnail } from './thumbnail'
9import { MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist'
10import { MScheduleVideoUpdate } from './schedule-video-update'
11import { MUserVideoHistoryTime } from '../user/user-video-history'
12
13export type MVideo = Omit<VideoModel, 'VideoChannel' | 'Tags' | 'Thumbnails' | 'VideoPlaylistElements' | 'VideoAbuses' |
14 'VideoFiles' | 'VideoStreamingPlaylists' | 'VideoShares' | 'AccountVideoRates' | 'VideoComments' | 'VideoViews' | 'UserVideoHistories' |
15 'ScheduleVideoUpdate' | 'VideoBlacklist' | 'VideoImport' | 'VideoCaptions'>
16
17export type MVideoId = Pick<MVideo, 'id'>
18export type MVideoUrl = Pick<MVideo, 'url'>
19export type MVideoUUID = Pick<MVideo, 'uuid'>
20
21export type MVideoIdUrl = MVideoId & MVideoUrl
22export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'>
23
24export type MVideoWithFile = MVideo &
25 PickWith<VideoModel, 'VideoFiles', MVideoFile[]>
26
27export type MVideoThumbnail = MVideo &
28 PickWith<VideoModel, 'Thumbnails', MThumbnail[]>
29export type MVideoIdThumbnail = MVideoThumbnail & MVideoId
30
31export type MVideoTag = MVideo &
32 PickWith<VideoModel, 'Tags', MTag[]>
33
34export type MVideoWithSchedule = MVideo &
35 PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate>
36
37export type MVideoWithFileThumbnail = MVideoWithFile & MVideoThumbnail
38
39export type MVideoUser = MVideo &
40 PickWith<VideoModel, 'VideoChannel', MChannelUserId>
41
42export type MVideoWithCaptions = MVideo &
43 PickWith<VideoModel, 'VideoCaptions', MVideoCaptionLanguage[]>
44
45export type MVideoWithBlacklistLight = MVideo &
46 PickWith<VideoModel, 'VideoBlacklist', MVideoBlacklistLight>
47
48export type MVideoAccountLight = MVideo &
49 PickWith<VideoModel, 'VideoChannel', MChannelAccountLight>
50
51export type MVideoWithRights = MVideoWithBlacklistLight & MVideoThumbnail & MVideoUser
52
53export type MVideoWithStreamingPlaylist = MVideo &
54 PickWith<VideoModel, 'VideoStreamingPlaylists', MStreamingPlaylist[]>
55
56export type MVideoWithAllFiles = MVideoWithFileThumbnail & MVideoWithStreamingPlaylist
57
58export type MVideoAccountAllFiles = MVideoWithAllFiles & MVideoAccountLight & MVideoWithBlacklistLight
59export type MVideoAccountAllFilesCaptions = MVideoAccountAllFiles & MVideoWithCaptions
60
61export type MVideoUserHistory = MVideo &
62 PickWith<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]>
63
64export type MVideoWithBlacklistThumbnailScheduled = MVideoWithSchedule & MVideoWithBlacklistLight & MVideoWithFileThumbnail
65
66export type MVideoAccountDefault = MVideo &
67 PickWith<VideoModel, 'VideoChannel', MChannelActorAccountDefault>
68
69export type MVideoThumbnailAccountDefault = MVideoThumbnail &
70 PickWith<VideoModel, 'VideoChannel', MChannelActorAccountDefault>
71
72export type MVideoWithChannelActor = MVideo &
73 PickWith<VideoModel, 'VideoChannel', MChannelActor>
74
75export type MVideoFullLight = MVideoThumbnail &
76 MVideoWithBlacklistLight &
77 MVideoTag &
78 MVideoAccountLight &
79 MVideoUserHistory &
80 MVideoWithFile &
81 MVideoWithSchedule &
82 MVideoWithStreamingPlaylist &
83 MVideoUserHistory
84
85export type MVideoAP = MVideo &
86 MVideoTag &
87 MVideoAccountLight &
88 MVideoWithStreamingPlaylist &
89 MVideoWithCaptions &
90 PickWith<VideoModel, 'VideoBlacklist', MVideoBlacklistUnfederated> &
91 PickWith<VideoModel, 'VideoFiles', MVideoFileRedundanciesOpt[]>
92
93export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'>
94
95export type MVideoDetails = MVideo &
96 MVideoWithBlacklistLight &
97 MVideoTag &
98 MVideoAccountLight &
99 MVideoWithSchedule &
100 MVideoThumbnail &
101 MVideoUserHistory &
102 PickWith<VideoModel, 'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> &
103 PickWith<VideoModel, 'VideoFiles', MVideoFileRedundanciesOpt[]>