2019-08-15 11:53:26 +02:00
|
|
|
import { ServerBlocklistModel } from '@server/models/server/server-blocklist'
|
|
|
|
import { PickWith } from '@server/typings/utils'
|
2019-11-15 15:06:03 +01:00
|
|
|
import { MAccountDefault, MAccountFormattable } from '../account/account'
|
|
|
|
import { MServer, MServerFormattable } from './server'
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
type Use<K extends keyof ServerBlocklistModel, M> = PickWith<ServerBlocklistModel, K, M>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 11:53:26 +02:00
|
|
|
export type MServerBlocklist = Omit<ServerBlocklistModel, 'ByAccount' | 'BlockedServer'>
|
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 11:53:26 +02:00
|
|
|
export type MServerBlocklistAccountServer = MServerBlocklist &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'ByAccount', MAccountDefault> &
|
|
|
|
Use<'BlockedServer', MServer>
|
2019-08-20 19:05:31 +02:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// Format for API or AP object
|
|
|
|
|
|
|
|
export type MServerBlocklistFormattable = Pick<MServerBlocklist, 'createdAt'> &
|
|
|
|
Use<'ByAccount', MAccountFormattable> &
|
|
|
|
Use<'BlockedServer', MServerFormattable>
|