PeerTube/server/core/types/models/video/video-change-ownership.ts

27 lines
1.1 KiB
TypeScript
Raw Normal View History

import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership.js'
import { PickWith } from '@peertube/peertube-typescript-utils'
import { MAccountDefault, MAccountFormattable } from '../account/account.js'
import { MVideoFormattable, MVideoWithAllFiles } from './video.js'
2019-08-15 11:53:26 +02:00
2019-08-20 13:52:49 +02:00
type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
// ############################################################################
2019-08-15 11:53:26 +02:00
export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
2020-01-31 16:56:52 +01:00
export type MVideoChangeOwnershipFull =
MVideoChangeOwnership &
2019-08-20 13:52:49 +02:00
Use<'Initiator', MAccountDefault> &
Use<'NextOwner', MAccountDefault> &
Use<'Video', MVideoWithAllFiles>
2019-08-20 19:05:31 +02:00
// ############################################################################
// Format for API or AP object
2020-01-31 16:56:52 +01:00
export type MVideoChangeOwnershipFormattable =
Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
2019-08-20 19:05:31 +02:00
Use<'Initiator', MAccountFormattable> &
Use<'NextOwner', MAccountFormattable> &
2020-06-28 22:45:25 +02:00
Use<'Video', MVideoFormattable>