-import { ActorModel } from '../../../models/activitypub/actor'
+
import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils'
-import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account'
+import { ActorModel } from '../../../models/activitypub/actor'
import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server'
-import { MAvatar, MAvatarFormattable } from './avatar'
import { MChannel, MChannelAccountActor, MChannelAccountDefault, MChannelId, MChannelIdActor } from '../video'
+import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account'
+import { MActorImage, MActorImageFormattable } from './actor-image'
type Use<K extends keyof ActorModel, M> = PickWith<ActorModel, K, M>
+type UseOpt<K extends keyof ActorModel, M> = PickWithOpt<ActorModel, K, M>
// ############################################################################
-export type MActor = Omit<ActorModel, 'Account' | 'VideoChannel' | 'ActorFollowing' | 'Avatar' | 'ActorFollowers' | 'Server'>
+export type MActor = Omit<ActorModel, 'Account' | 'VideoChannel' | 'ActorFollowing' | 'Avatar' | 'ActorFollowers' | 'Server' | 'Banner'>
// ############################################################################
export type MActorDefaultLight =
MActorLight &
Use<'Server', MServerHost> &
- Use<'Avatar', MAvatar>
+ Use<'Avatar', MActorImage>
export type MActorAccountId =
MActor &
// Complex actor associations
+export type MActorImages =
+ MActor &
+ Use<'Avatar', MActorImage> &
+ UseOpt<'Banner', MActorImage>
+
export type MActorDefault =
MActor &
Use<'Server', MServer> &
- Use<'Avatar', MAvatar>
+ Use<'Avatar', MActorImage>
+
+export type MActorDefaultChannelId =
+ MActorDefault &
+ Use<'VideoChannel', MChannelId>
+
+export type MActorDefaultBanner =
+ MActor &
+ Use<'Server', MServer> &
+ Use<'Avatar', MActorImage> &
+ Use<'Banner', MActorImage>
// Actor with channel that is associated to an account and its actor
// Actor -> VideoChannel -> Account -> Actor
export type MActorFull =
MActor &
Use<'Server', MServer> &
- Use<'Avatar', MAvatar> &
+ Use<'Avatar', MActorImage> &
+ Use<'Banner', MActorImage> &
Use<'Account', MAccount> &
Use<'VideoChannel', MChannelAccountActor>
export type MActorFullActor =
MActor &
Use<'Server', MServer> &
- Use<'Avatar', MAvatar> &
+ Use<'Avatar', MActorImage> &
+ Use<'Banner', MActorImage> &
Use<'Account', MAccountDefault> &
Use<'VideoChannel', MChannelAccountDefault>
FunctionProperties<MActor> &
Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> &
Use<'Server', MServerHost> &
- Use<'Avatar', MAvatar>
+ Use<'Avatar', MActorImage>
export type MActorSummaryBlocks =
MActorSummary &
FunctionProperties<MActor> &
Pick<MActor, 'url' | 'preferredUsername'> &
Use<'Server', MServerHost> &
- Use<'Avatar', MAvatarFormattable>
+ Use<'Avatar', MActorImageFormattable>
export type MActorFormattable =
MActorSummaryFormattable &
- Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt'> &
- Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>>
+ Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt' | 'remoteCreatedAt' | 'bannerId' | 'avatarId'> &
+ Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>> &
+ UseOpt<'Banner', MActorImageFormattable>
-export type MActorAP =
+type MActorAPBase =
MActor &
- Use<'Avatar', MAvatar>
+ Use<'Avatar', MActorImage>
+
+export type MActorAPAccount =
+ MActorAPBase
+
+export type MActorAPChannel =
+ MActorAPBase &
+ Use<'Banner', MActorImage>