]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/types/models/video/video-change-ownership.ts
Merge branch 'release/4.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / types / models / video / video-change-ownership.ts
1 import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
2 import { PickWith } from '@shared/typescript-utils'
3 import { MAccountDefault, MAccountFormattable } from '../account/account'
4 import { MVideoFormattable, 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', MVideoFormattable>