2019-08-15 04:53:26 -05:00
|
|
|
import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
|
|
|
|
import { PickWith } from '@server/typings/utils'
|
2019-11-15 08:06:03 -06:00
|
|
|
import { MAccountDefault, MAccountFormattable } from '../account/account'
|
|
|
|
import { MVideo, MVideoWithAllFiles } from './video'
|
2019-08-15 04:53:26 -05:00
|
|
|
|
2019-08-20 06:52:49 -05:00
|
|
|
type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 04:53:26 -05:00
|
|
|
export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
|
|
|
|
|
2020-01-31 09:56:52 -06:00
|
|
|
export type MVideoChangeOwnershipFull =
|
|
|
|
MVideoChangeOwnership &
|
2019-08-20 06:52:49 -05:00
|
|
|
Use<'Initiator', MAccountDefault> &
|
|
|
|
Use<'NextOwner', MAccountDefault> &
|
2019-11-15 08:06:03 -06:00
|
|
|
Use<'Video', MVideoWithAllFiles>
|
2019-08-20 12:05:31 -05:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// Format for API or AP object
|
|
|
|
|
2020-01-31 09:56:52 -06:00
|
|
|
export type MVideoChangeOwnershipFormattable =
|
|
|
|
Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
|
2019-08-20 12:05:31 -05:00
|
|
|
Use<'Initiator', MAccountFormattable> &
|
|
|
|
Use<'NextOwner', MAccountFormattable> &
|
|
|
|
Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>>
|