2019-08-15 04:53:26 -05:00
|
|
|
import { VideoImportModel } from '@server/models/video/video-import'
|
2019-08-20 12:05:31 -05:00
|
|
|
import { PickWith, PickWithOpt } from '@server/typings/utils'
|
|
|
|
import { MUser, MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from '@server/typings/models'
|
2019-08-15 04:53:26 -05:00
|
|
|
|
2019-08-20 06:52:49 -05:00
|
|
|
type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M>
|
2019-08-15 04:53:26 -05:00
|
|
|
|
2019-08-20 06:52:49 -05:00
|
|
|
// ############################################################################
|
2019-08-15 04:53:26 -05:00
|
|
|
|
2019-08-20 06:52:49 -05:00
|
|
|
export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'>
|
2019-08-15 04:53:26 -05:00
|
|
|
|
|
|
|
export type MVideoImportVideo = MVideoImport &
|
2019-08-20 06:52:49 -05:00
|
|
|
Use<'Video', MVideo>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnail
|
|
|
|
|
|
|
|
export type MVideoImportDefault = MVideoImport &
|
|
|
|
Use<'User', MUser> &
|
|
|
|
Use<'Video', VideoAssociation>
|
|
|
|
|
|
|
|
export type MVideoImportDefaultFiles = MVideoImport &
|
|
|
|
Use<'User', MUser> &
|
|
|
|
Use<'Video', VideoAssociation & MVideoWithFile>
|
2019-08-20 12:05:31 -05:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// Format for API or AP object
|
|
|
|
|
|
|
|
export type MVideoImportFormattable = MVideoImport &
|
|
|
|
PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag>
|