diff options
Diffstat (limited to 'server/types')
-rw-r--r-- | server/types/models/account/actor-image.ts | 12 | ||||
-rw-r--r-- | server/types/models/account/actor.ts | 22 | ||||
-rw-r--r-- | server/types/models/account/avatar.ts | 12 | ||||
-rw-r--r-- | server/types/models/account/index.ts | 4 | ||||
-rw-r--r-- | server/types/models/user/user-notification.ts | 6 |
5 files changed, 28 insertions, 28 deletions
diff --git a/server/types/models/account/actor-image.ts b/server/types/models/account/actor-image.ts new file mode 100644 index 000000000..e59f8b141 --- /dev/null +++ b/server/types/models/account/actor-image.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | import { ActorImageModel } from '../../../models/account/actor-image' | ||
2 | import { FunctionProperties } from '@shared/core-utils' | ||
3 | |||
4 | export type MActorImage = ActorImageModel | ||
5 | |||
6 | // ############################################################################ | ||
7 | |||
8 | // Format for API or AP object | ||
9 | |||
10 | export type MActorImageFormattable = | ||
11 | FunctionProperties<MActorImage> & | ||
12 | Pick<MActorImage, 'filename' | 'createdAt' | 'updatedAt'> | ||
diff --git a/server/types/models/account/actor.ts b/server/types/models/account/actor.ts index ee0d05f4e..8af19c4da 100644 --- a/server/types/models/account/actor.ts +++ b/server/types/models/account/actor.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | import { ActorModel } from '../../../models/activitypub/actor' | ||
2 | import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils' | 1 | import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account' | 2 | import { ActorModel } from '../../../models/activitypub/actor' |
4 | import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server' | 3 | import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server' |
5 | import { MAvatar, MAvatarFormattable } from './avatar' | ||
6 | import { MChannel, MChannelAccountActor, MChannelAccountDefault, MChannelId, MChannelIdActor } from '../video' | 4 | import { MChannel, MChannelAccountActor, MChannelAccountDefault, MChannelId, MChannelIdActor } from '../video' |
5 | import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account' | ||
6 | import { MActorImage, MActorImageFormattable } from './actor-image' | ||
7 | 7 | ||
8 | type Use<K extends keyof ActorModel, M> = PickWith<ActorModel, K, M> | 8 | type Use<K extends keyof ActorModel, M> = PickWith<ActorModel, K, M> |
9 | 9 | ||
10 | // ############################################################################ | 10 | // ############################################################################ |
11 | 11 | ||
12 | export type MActor = Omit<ActorModel, 'Account' | 'VideoChannel' | 'ActorFollowing' | 'Avatar' | 'ActorFollowers' | 'Server'> | 12 | export type MActor = Omit<ActorModel, 'Account' | 'VideoChannel' | 'ActorFollowing' | 'Avatar' | 'ActorFollowers' | 'Server' | 'Banner'> |
13 | 13 | ||
14 | // ############################################################################ | 14 | // ############################################################################ |
15 | 15 | ||
@@ -34,7 +34,7 @@ export type MActorRedundancyAllowedOpt = PickWithOpt<ActorModel, 'Server', MServ | |||
34 | export type MActorDefaultLight = | 34 | export type MActorDefaultLight = |
35 | MActorLight & | 35 | MActorLight & |
36 | Use<'Server', MServerHost> & | 36 | Use<'Server', MServerHost> & |
37 | Use<'Avatar', MAvatar> | 37 | Use<'Avatar', MActorImage> |
38 | 38 | ||
39 | export type MActorAccountId = | 39 | export type MActorAccountId = |
40 | MActor & | 40 | MActor & |
@@ -78,7 +78,7 @@ export type MActorServer = | |||
78 | export type MActorDefault = | 78 | export type MActorDefault = |
79 | MActor & | 79 | MActor & |
80 | Use<'Server', MServer> & | 80 | Use<'Server', MServer> & |
81 | Use<'Avatar', MAvatar> | 81 | Use<'Avatar', MActorImage> |
82 | 82 | ||
83 | // 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 |
84 | // Actor -> VideoChannel -> Account -> Actor | 84 | // Actor -> VideoChannel -> Account -> Actor |
@@ -89,7 +89,7 @@ export type MActorChannelAccountActor = | |||
89 | export type MActorFull = | 89 | export type MActorFull = |
90 | MActor & | 90 | MActor & |
91 | Use<'Server', MServer> & | 91 | Use<'Server', MServer> & |
92 | Use<'Avatar', MAvatar> & | 92 | Use<'Avatar', MActorImage> & |
93 | Use<'Account', MAccount> & | 93 | Use<'Account', MAccount> & |
94 | Use<'VideoChannel', MChannelAccountActor> | 94 | Use<'VideoChannel', MChannelAccountActor> |
95 | 95 | ||
@@ -97,7 +97,7 @@ export type MActorFull = | |||
97 | export type MActorFullActor = | 97 | export type MActorFullActor = |
98 | MActor & | 98 | MActor & |
99 | Use<'Server', MServer> & | 99 | Use<'Server', MServer> & |
100 | Use<'Avatar', MAvatar> & | 100 | Use<'Avatar', MActorImage> & |
101 | Use<'Account', MAccountDefault> & | 101 | Use<'Account', MAccountDefault> & |
102 | Use<'VideoChannel', MChannelAccountDefault> | 102 | Use<'VideoChannel', MChannelAccountDefault> |
103 | 103 | ||
@@ -109,7 +109,7 @@ export type MActorSummary = | |||
109 | FunctionProperties<MActor> & | 109 | FunctionProperties<MActor> & |
110 | Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> & | 110 | Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> & |
111 | Use<'Server', MServerHost> & | 111 | Use<'Server', MServerHost> & |
112 | Use<'Avatar', MAvatar> | 112 | Use<'Avatar', MActorImage> |
113 | 113 | ||
114 | export type MActorSummaryBlocks = | 114 | export type MActorSummaryBlocks = |
115 | MActorSummary & | 115 | MActorSummary & |
@@ -127,7 +127,7 @@ export type MActorSummaryFormattable = | |||
127 | FunctionProperties<MActor> & | 127 | FunctionProperties<MActor> & |
128 | Pick<MActor, 'url' | 'preferredUsername'> & | 128 | Pick<MActor, 'url' | 'preferredUsername'> & |
129 | Use<'Server', MServerHost> & | 129 | Use<'Server', MServerHost> & |
130 | Use<'Avatar', MAvatarFormattable> | 130 | Use<'Avatar', MActorImageFormattable> |
131 | 131 | ||
132 | export type MActorFormattable = | 132 | export type MActorFormattable = |
133 | MActorSummaryFormattable & | 133 | MActorSummaryFormattable & |
@@ -136,4 +136,4 @@ export type MActorFormattable = | |||
136 | 136 | ||
137 | export type MActorAP = | 137 | export type MActorAP = |
138 | MActor & | 138 | MActor & |
139 | Use<'Avatar', MAvatar> | 139 | Use<'Avatar', MActorImage> |
diff --git a/server/types/models/account/avatar.ts b/server/types/models/account/avatar.ts deleted file mode 100644 index 0489a8599..000000000 --- a/server/types/models/account/avatar.ts +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | import { AvatarModel } from '../../../models/avatar/avatar' | ||
2 | import { FunctionProperties } from '@shared/core-utils' | ||
3 | |||
4 | export type MAvatar = AvatarModel | ||
5 | |||
6 | // ############################################################################ | ||
7 | |||
8 | // Format for API or AP object | ||
9 | |||
10 | export type MAvatarFormattable = | ||
11 | FunctionProperties<MAvatar> & | ||
12 | Pick<MAvatar, 'filename' | 'createdAt' | 'updatedAt'> | ||
diff --git a/server/types/models/account/index.ts b/server/types/models/account/index.ts index 513c09c40..e3fc00f94 100644 --- a/server/types/models/account/index.ts +++ b/server/types/models/account/index.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | export * from './account' | 1 | export * from './account' |
2 | export * from './account-blocklist' | 2 | export * from './account-blocklist' |
3 | export * from './actor' | ||
4 | export * from './actor-follow' | 3 | export * from './actor-follow' |
5 | export * from './avatar' | 4 | export * from './actor-image' |
5 | export * from './actor' | ||
diff --git a/server/types/models/user/user-notification.ts b/server/types/models/user/user-notification.ts index 6988086f1..7ebb0485d 100644 --- a/server/types/models/user/user-notification.ts +++ b/server/types/models/user/user-notification.ts | |||
@@ -5,10 +5,10 @@ import { PluginModel } from '@server/models/server/plugin' | |||
5 | import { PickWith, PickWithOpt } from '@shared/core-utils' | 5 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
6 | import { AbuseModel } from '../../../models/abuse/abuse' | 6 | import { AbuseModel } from '../../../models/abuse/abuse' |
7 | import { AccountModel } from '../../../models/account/account' | 7 | import { AccountModel } from '../../../models/account/account' |
8 | import { ActorImageModel } from '../../../models/account/actor-image' | ||
8 | import { UserNotificationModel } from '../../../models/account/user-notification' | 9 | import { UserNotificationModel } from '../../../models/account/user-notification' |
9 | import { ActorModel } from '../../../models/activitypub/actor' | 10 | import { ActorModel } from '../../../models/activitypub/actor' |
10 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | 11 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
11 | import { AvatarModel } from '../../../models/avatar/avatar' | ||
12 | import { ServerModel } from '../../../models/server/server' | 12 | import { ServerModel } from '../../../models/server/server' |
13 | import { VideoModel } from '../../../models/video/video' | 13 | import { VideoModel } from '../../../models/video/video' |
14 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' | 14 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' |
@@ -29,7 +29,7 @@ export module UserNotificationIncludes { | |||
29 | 29 | ||
30 | export type ActorInclude = | 30 | export type ActorInclude = |
31 | Pick<ActorModel, 'preferredUsername' | 'getHost'> & | 31 | Pick<ActorModel, 'preferredUsername' | 'getHost'> & |
32 | PickWith<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> & | 32 | PickWith<ActorModel, 'Avatar', Pick<ActorImageModel, 'filename' | 'getStaticPath'>> & |
33 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> | 33 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> |
34 | 34 | ||
35 | export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'> | 35 | export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'> |
@@ -75,7 +75,7 @@ export module UserNotificationIncludes { | |||
75 | Pick<ActorModel, 'preferredUsername' | 'getHost'> & | 75 | Pick<ActorModel, 'preferredUsername' | 'getHost'> & |
76 | PickWith<ActorModel, 'Account', AccountInclude> & | 76 | PickWith<ActorModel, 'Account', AccountInclude> & |
77 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> & | 77 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> & |
78 | PickWithOpt<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> | 78 | PickWithOpt<ActorModel, 'Avatar', Pick<ActorImageModel, 'filename' | 'getStaticPath'>> |
79 | 79 | ||
80 | export type ActorFollowing = | 80 | export type ActorFollowing = |
81 | Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> & | 81 | Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> & |