]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - 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
... / ...
CommitLineData
1import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
2import { PickWith } from '@shared/typescript-utils'
3import { MAccountDefault, MAccountFormattable } from '../account/account'
4import { MVideoFormattable, MVideoWithAllFiles } from './video'
5
6type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
7
8// ############################################################################
9
10export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
11
12export 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
22export type MVideoChangeOwnershipFormattable =
23 Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
24 Use<'Initiator', MAccountFormattable> &
25 Use<'NextOwner', MAccountFormattable> &
26 Use<'Video', MVideoFormattable>