]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/typings/models/server/server.ts
Merge branch 'release/1.4.0' into develop
[github/Chocobozzz/PeerTube.git] / server / typings / models / server / server.ts
index 6be7bf9bb5344a8c2458f29258136013169ec242..190cc0c289082cec5b76a33033c928b1a9b39151 100644 (file)
@@ -1,10 +1,24 @@
 import { ServerModel } from '../../../models/server/server'
-import { PickWith } from '../../utils'
+import { FunctionProperties, PickWith } from '../../utils'
 import { MAccountBlocklistId } from '../account'
 
+type Use<K extends keyof ServerModel, M> = PickWith<ServerModel, K, M>
+
+// ############################################################################
+
 export type MServer = Omit<ServerModel, 'Actors' | 'BlockedByAccounts'>
 
+// ############################################################################
+
 export type MServerHost = Pick<MServer, 'host'>
+export type MServerRedundancyAllowed = Pick<MServer, 'redundancyAllowed'>
 
 export type MServerHostBlocks = MServerHost &
-  PickWith<ServerModel, 'BlockedByAccounts', MAccountBlocklistId[]>
+  Use<'BlockedByAccounts', MAccountBlocklistId[]>
+
+// ############################################################################
+
+// Format for API or AP object
+
+export type MServerFormattable = FunctionProperties<MServer> &
+  Pick<MServer, 'host'>