]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/typings/models/video/video-change-ownership.ts
Add ability to disable webtorrent
[github/Chocobozzz/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 = MVideoChangeOwnership &
13 Use<'Initiator', MAccountDefault> &
14 Use<'NextOwner', MAccountDefault> &
15 Use<'Video', MVideoWithAllFiles>
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'>>