aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types/models/server/server.ts
blob: 0b16186cd67aabb6d61cb191b48468277a25e1da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { FunctionProperties, PickWith } from '@shared/typescript-utils'
import { ServerModel } from '../../../models/server/server'
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 &
  Use<'BlockedBy', MAccountBlocklistId[]>

// ############################################################################

// Format for API or AP object

export type MServerFormattable =
  FunctionProperties<MServer> &
  Pick<MServer, 'host'>