]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/types/models/video/video-change-ownership.ts
Move typescript utils in its own directory
[github/Chocobozzz/PeerTube.git] / server / types / models / video / video-change-ownership.ts
CommitLineData
453e83ea 1import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
6b5f72be 2import { PickWith } from '@shared/typescript-utils'
d7a25329 3import { MAccountDefault, MAccountFormattable } from '../account/account'
6b5f72be 4import { MVideoFormattable, MVideoWithAllFiles } from './video'
453e83ea 5
0283eaac
C
6type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
7
8// ############################################################################
9
453e83ea
C
10export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
11
a1587156
C
12export type MVideoChangeOwnershipFull =
13 MVideoChangeOwnership &
0283eaac
C
14 Use<'Initiator', MAccountDefault> &
15 Use<'NextOwner', MAccountDefault> &
d7a25329 16 Use<'Video', MVideoWithAllFiles>
1ca9f7c3
C
17
18// ############################################################################
19
20// Format for API or AP object
21
a1587156
C
22export type MVideoChangeOwnershipFormattable =
23 Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
1ca9f7c3
C
24 Use<'Initiator', MAccountFormattable> &
25 Use<'NextOwner', MAccountFormattable> &
b8b3abac 26 Use<'Video', MVideoFormattable>