]>
Commit | Line | Data |
---|---|---|
453e83ea C |
1 | import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' |
2 | import { PickWith } from '@server/typings/utils' | |
d7a25329 C |
3 | import { MAccountDefault, MAccountFormattable } from '../account/account' |
4 | import { MVideo, MVideoWithAllFiles } from './video' | |
453e83ea | 5 | |
0283eaac C |
6 | type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M> |
7 | ||
8 | // ############################################################################ | |
9 | ||
453e83ea C |
10 | export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'> |
11 | ||
12 | export type MVideoChangeOwnershipFull = MVideoChangeOwnership & | |
0283eaac C |
13 | Use<'Initiator', MAccountDefault> & |
14 | Use<'NextOwner', MAccountDefault> & | |
d7a25329 | 15 | Use<'Video', MVideoWithAllFiles> |
1ca9f7c3 C |
16 | |
17 | // ############################################################################ | |
18 | ||
19 | // Format for API or AP object | |
20 | ||
21 | export type MVideoChangeOwnershipFormattable = Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> & | |
22 | Use<'Initiator', MAccountFormattable> & | |
23 | Use<'NextOwner', MAccountFormattable> & | |
24 | Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>> |