Remove uneccessary details to link titles
[oweals/peertube.git] / server / typings / models / video / video-change-ownership.ts
1 import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
2 import { PickWith } from '@server/typings/utils'
3 import { MAccountDefault, MAccountFormattable } from '../account/account'
4 import { MVideo, MVideoWithAllFiles } from './video'
5
6 type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
7
8 // ############################################################################
9
10 export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
11
12 export type MVideoChangeOwnershipFull =
13   MVideoChangeOwnership &
14   Use<'Initiator', MAccountDefault> &
15   Use<'NextOwner', MAccountDefault> &
16   Use<'Video', MVideoWithAllFiles>
17
18 // ############################################################################
19
20 // Format for API or AP object
21
22 export type MVideoChangeOwnershipFormattable =
23   Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
24   Use<'Initiator', MAccountFormattable> &
25   Use<'NextOwner', MAccountFormattable> &
26   Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>>