video-change-ownership.ts 1.1 KB

123456789101112131415161718192021222324
  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. type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
  6. // ############################################################################
  7. export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
  8. export type MVideoChangeOwnershipFull = MVideoChangeOwnership &
  9. Use<'Initiator', MAccountDefault> &
  10. Use<'NextOwner', MAccountDefault> &
  11. Use<'Video', MVideoWithAllFiles>
  12. // ############################################################################
  13. // Format for API or AP object
  14. export type MVideoChangeOwnershipFormattable = Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
  15. Use<'Initiator', MAccountFormattable> &
  16. Use<'NextOwner', MAccountFormattable> &
  17. Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>>