]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/typings/models/video/video-change-ownership.ts
Type toFormattedJSON
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-change-ownership.ts
index 0410115c6b22189c630964fece6f930bbfab76a2..72634cdb2a38ac579e7646c87b708317262a67ef 100644 (file)
@@ -1,6 +1,6 @@
 import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
 import { PickWith } from '@server/typings/utils'
-import { MAccountDefault, MVideoWithFileThumbnail } from '@server/typings/models'
+import { MAccountDefault, MAccountFormattable, MVideo, MVideoWithFileThumbnail } from '@server/typings/models'
 
 type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
 
@@ -12,3 +12,12 @@ export type MVideoChangeOwnershipFull = MVideoChangeOwnership &
   Use<'Initiator', MAccountDefault> &
   Use<'NextOwner', MAccountDefault> &
   Use<'Video', MVideoWithFileThumbnail>
+
+// ############################################################################
+
+// Format for API or AP object
+
+export type MVideoChangeOwnershipFormattable = Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
+  Use<'Initiator', MAccountFormattable> &
+  Use<'NextOwner', MAccountFormattable> &
+  Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>>