aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/account/actor.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/typings/models/account/actor.ts')
-rw-r--r--server/typings/models/account/actor.ts23
1 files changed, 19 insertions, 4 deletions
diff --git a/server/typings/models/account/actor.ts b/server/typings/models/account/actor.ts
index 7d99a433b..14ab2cd5b 100644
--- a/server/typings/models/account/actor.ts
+++ b/server/typings/models/account/actor.ts
@@ -1,8 +1,8 @@
1import { ActorModel } from '../../../models/activitypub/actor' 1import { ActorModel } from '../../../models/activitypub/actor'
2import { PickWith } from '../../utils' 2import { FunctionProperties, PickWith } from '../../utils'
3import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account' 3import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account'
4import { MServer, MServerHost, MServerHostBlocks } from '../server' 4import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server'
5import { MAvatar } from './avatar' 5import { MAvatar, MAvatarFormattable } from './avatar'
6import { MChannel, MChannelAccountActor, MChannelAccountDefault, MChannelId, MChannelIdActor } from '../video' 6import { MChannel, MChannelAccountActor, MChannelAccountDefault, MChannelId, MChannelIdActor } from '../video'
7 7
8type Use<K extends keyof ActorModel, M> = PickWith<ActorModel, K, M> 8type Use<K extends keyof ActorModel, M> = PickWith<ActorModel, K, M>
@@ -29,6 +29,7 @@ export type MActorLight = Omit<MActor, 'privateKey' | 'privateKey'>
29// Some association attributes 29// Some association attributes
30 30
31export type MActorHost = Use<'Server', MServerHost> 31export type MActorHost = Use<'Server', MServerHost>
32export type MActorRedundancyAllowed = Use<'Server', MServerRedundancyAllowed>
32 33
33export type MActorDefaultLight = MActorLight & 34export type MActorDefaultLight = MActorLight &
34 Use<'Server', MServerHost> & 35 Use<'Server', MServerHost> &
@@ -92,7 +93,8 @@ export type MActorFullActor = MActor &
92 93
93// API 94// API
94 95
95export type MActorSummary = Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> & 96export type MActorSummary = FunctionProperties<MActor> &
97 Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> &
96 Use<'Server', MServerHost> & 98 Use<'Server', MServerHost> &
97 Use<'Avatar', MAvatar> 99 Use<'Avatar', MAvatar>
98 100
@@ -101,3 +103,16 @@ export type MActorSummaryBlocks = MActorSummary &
101 103
102export type MActorAPI = Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' | 104export type MActorAPI = Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' |
103 'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'> 105 'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'>
106
107// ############################################################################
108
109// Format for API or AP object
110
111export type MActorSummaryFormattable = FunctionProperties<MActor> &
112 Pick<MActor, 'url' | 'preferredUsername'> &
113 Use<'Server', MServerHost> &
114 Use<'Avatar', MAvatarFormattable>
115
116export type MActorFormattable = MActorSummaryFormattable &
117 Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt'> &
118 Use<'Server', MServer>