diff options
Diffstat (limited to 'server/typings/models/account/actor.ts')
-rw-r--r-- | server/typings/models/account/actor.ts | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/server/typings/models/account/actor.ts b/server/typings/models/account/actor.ts index ee4ece755..1160e84cb 100644 --- a/server/typings/models/account/actor.ts +++ b/server/typings/models/account/actor.ts | |||
@@ -31,18 +31,23 @@ export type MActorLight = Omit<MActor, 'privateKey' | 'privateKey'> | |||
31 | export type MActorHost = Use<'Server', MServerHost> | 31 | export type MActorHost = Use<'Server', MServerHost> |
32 | export type MActorRedundancyAllowedOpt = PickWithOpt<ActorModel, 'Server', MServerRedundancyAllowed> | 32 | export type MActorRedundancyAllowedOpt = PickWithOpt<ActorModel, 'Server', MServerRedundancyAllowed> |
33 | 33 | ||
34 | export type MActorDefaultLight = MActorLight & | 34 | export type MActorDefaultLight = |
35 | MActorLight & | ||
35 | Use<'Server', MServerHost> & | 36 | Use<'Server', MServerHost> & |
36 | Use<'Avatar', MAvatar> | 37 | Use<'Avatar', MAvatar> |
37 | 38 | ||
38 | export type MActorAccountId = MActor & | 39 | export type MActorAccountId = |
40 | MActor & | ||
39 | Use<'Account', MAccountId> | 41 | Use<'Account', MAccountId> |
40 | export type MActorAccountIdActor = MActor & | 42 | export type MActorAccountIdActor = |
43 | MActor & | ||
41 | Use<'Account', MAccountIdActor> | 44 | Use<'Account', MAccountIdActor> |
42 | 45 | ||
43 | export type MActorChannelId = MActor & | 46 | export type MActorChannelId = |
47 | MActor & | ||
44 | Use<'VideoChannel', MChannelId> | 48 | Use<'VideoChannel', MChannelId> |
45 | export type MActorChannelIdActor = MActor & | 49 | export type MActorChannelIdActor = |
50 | MActor & | ||
46 | Use<'VideoChannel', MChannelIdActor> | 51 | Use<'VideoChannel', MChannelIdActor> |
47 | 52 | ||
48 | export type MActorAccountChannelId = MActorAccountId & MActorChannelId | 53 | export type MActorAccountChannelId = MActorAccountId & MActorChannelId |
@@ -52,38 +57,45 @@ export type MActorAccountChannelIdActor = MActorAccountIdActor & MActorChannelId | |||
52 | 57 | ||
53 | // Include raw account/channel/server | 58 | // Include raw account/channel/server |
54 | 59 | ||
55 | export type MActorAccount = MActor & | 60 | export type MActorAccount = |
61 | MActor & | ||
56 | Use<'Account', MAccount> | 62 | Use<'Account', MAccount> |
57 | 63 | ||
58 | export type MActorChannel = MActor & | 64 | export type MActorChannel = |
65 | MActor & | ||
59 | Use<'VideoChannel', MChannel> | 66 | Use<'VideoChannel', MChannel> |
60 | 67 | ||
61 | export type MActorDefaultAccountChannel = MActorDefault & MActorAccount & MActorChannel | 68 | export type MActorDefaultAccountChannel = MActorDefault & MActorAccount & MActorChannel |
62 | 69 | ||
63 | export type MActorServer = MActor & | 70 | export type MActorServer = |
71 | MActor & | ||
64 | Use<'Server', MServer> | 72 | Use<'Server', MServer> |
65 | 73 | ||
66 | // ############################################################################ | 74 | // ############################################################################ |
67 | 75 | ||
68 | // Complex actor associations | 76 | // Complex actor associations |
69 | 77 | ||
70 | export type MActorDefault = MActor & | 78 | export type MActorDefault = |
79 | MActor & | ||
71 | Use<'Server', MServer> & | 80 | Use<'Server', MServer> & |
72 | Use<'Avatar', MAvatar> | 81 | Use<'Avatar', MAvatar> |
73 | 82 | ||
74 | // Actor with channel that is associated to an account and its actor | 83 | // Actor with channel that is associated to an account and its actor |
75 | // Actor -> VideoChannel -> Account -> Actor | 84 | // Actor -> VideoChannel -> Account -> Actor |
76 | export type MActorChannelAccountActor = MActor & | 85 | export type MActorChannelAccountActor = |
86 | MActor & | ||
77 | Use<'VideoChannel', MChannelAccountActor> | 87 | Use<'VideoChannel', MChannelAccountActor> |
78 | 88 | ||
79 | export type MActorFull = MActor & | 89 | export type MActorFull = |
90 | MActor & | ||
80 | Use<'Server', MServer> & | 91 | Use<'Server', MServer> & |
81 | Use<'Avatar', MAvatar> & | 92 | Use<'Avatar', MAvatar> & |
82 | Use<'Account', MAccount> & | 93 | Use<'Account', MAccount> & |
83 | Use<'VideoChannel', MChannelAccountActor> | 94 | Use<'VideoChannel', MChannelAccountActor> |
84 | 95 | ||
85 | // Same than ActorFull, but the account and the channel have their actor | 96 | // Same than ActorFull, but the account and the channel have their actor |
86 | export type MActorFullActor = MActor & | 97 | export type MActorFullActor = |
98 | MActor & | ||
87 | Use<'Server', MServer> & | 99 | Use<'Server', MServer> & |
88 | Use<'Avatar', MAvatar> & | 100 | Use<'Avatar', MAvatar> & |
89 | Use<'Account', MAccountDefault> & | 101 | Use<'Account', MAccountDefault> & |
@@ -93,29 +105,35 @@ export type MActorFullActor = MActor & | |||
93 | 105 | ||
94 | // API | 106 | // API |
95 | 107 | ||
96 | export type MActorSummary = FunctionProperties<MActor> & | 108 | export type MActorSummary = |
109 | FunctionProperties<MActor> & | ||
97 | Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> & | 110 | Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> & |
98 | Use<'Server', MServerHost> & | 111 | Use<'Server', MServerHost> & |
99 | Use<'Avatar', MAvatar> | 112 | Use<'Avatar', MAvatar> |
100 | 113 | ||
101 | export type MActorSummaryBlocks = MActorSummary & | 114 | export type MActorSummaryBlocks = |
115 | MActorSummary & | ||
102 | Use<'Server', MServerHostBlocks> | 116 | Use<'Server', MServerHostBlocks> |
103 | 117 | ||
104 | export type MActorAPI = Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' | | 118 | export type MActorAPI = |
119 | Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' | | ||
105 | 'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'> | 120 | 'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'> |
106 | 121 | ||
107 | // ############################################################################ | 122 | // ############################################################################ |
108 | 123 | ||
109 | // Format for API or AP object | 124 | // Format for API or AP object |
110 | 125 | ||
111 | export type MActorSummaryFormattable = FunctionProperties<MActor> & | 126 | export type MActorSummaryFormattable = |
127 | FunctionProperties<MActor> & | ||
112 | Pick<MActor, 'url' | 'preferredUsername'> & | 128 | Pick<MActor, 'url' | 'preferredUsername'> & |
113 | Use<'Server', MServerHost> & | 129 | Use<'Server', MServerHost> & |
114 | Use<'Avatar', MAvatarFormattable> | 130 | Use<'Avatar', MAvatarFormattable> |
115 | 131 | ||
116 | export type MActorFormattable = MActorSummaryFormattable & | 132 | export type MActorFormattable = |
133 | MActorSummaryFormattable & | ||
117 | Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt'> & | 134 | Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt'> & |
118 | Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>> | 135 | Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>> |
119 | 136 | ||
120 | export type MActorAP = MActor & | 137 | export type MActorAP = |
138 | MActor & | ||
121 | Use<'Avatar', MAvatar> | 139 | Use<'Avatar', MAvatar> |