1 import { AccountModel } from '../../../models/account/account'
4 MActorAccountChannelId,
14 import { PickWith } from '../../utils'
15 import { MAccountBlocklistId } from './account-blocklist'
16 import { MChannelDefault } from '@server/typings/models'
18 type Use<K extends keyof AccountModel, M> = PickWith<AccountModel, K, M>
20 // ############################################################################
22 export type MAccount = Omit<AccountModel, 'Actor' | 'User' | 'Application' | 'VideoChannels' | 'VideoPlaylists' |
23 'VideoComments' | 'BlockedAccounts'>
25 // ############################################################################
27 // Only some attributes
28 export type MAccountId = Pick<MAccount, 'id'>
29 export type MAccountUserId = Pick<MAccount, 'userId'>
31 // Only some Actor attributes
32 export type MAccountUrl = Use<'Actor', MActorUrl>
33 export type MAccountAudience = Use<'Actor', MActorAudience>
35 export type MAccountIdActor = MAccountId &
36 Use<'Actor', MActorAccountChannelId>
38 export type MAccountIdActorId = MAccountId &
39 Use<'Actor', MActorId>
41 // ############################################################################
44 export type MAccountDefault = MAccount &
45 Use<'Actor', MActorDefault>
47 // Default with default association scopes
48 export type MAccountDefaultChannelDefault = MAccount &
49 Use<'Actor', MActorDefault> &
50 Use<'VideoChannels', MChannelDefault[]>
52 // We don't need some actors attributes
53 export type MAccountLight = MAccount &
54 Use<'Actor', MActorDefaultLight>
56 // ############################################################################
59 export type MAccountActor = MAccount &
62 // Full actor with server
63 export type MAccountServer = MAccount &
64 Use<'Actor', MActorServer>
66 // ############################################################################
70 export type MAccountSummary = Pick<MAccount, 'id' | 'name'> &
71 Use<'Actor', MActorSummary>
73 export type MAccountSummaryBlocks = MAccountSummary &
74 Use<'BlockedAccounts', MAccountBlocklistId[]>
76 export type MAccountAPI = MAccount &
77 Use<'Actor', MActorAPI>