diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:05:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:23:10 +0200 |
commit | 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch) | |
tree | 27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/typings/models/video/video-channels.ts | |
parent | 0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff) | |
download | PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.gz PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.zst PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.zip |
Type toFormattedJSON
Diffstat (limited to 'server/typings/models/video/video-channels.ts')
-rw-r--r-- | server/typings/models/video/video-channels.ts | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/server/typings/models/video/video-channels.ts b/server/typings/models/video/video-channels.ts index b6506ed9f..2be7dd7ed 100644 --- a/server/typings/models/video/video-channels.ts +++ b/server/typings/models/video/video-channels.ts | |||
@@ -1,19 +1,23 @@ | |||
1 | import { PickWith } from '../../utils' | 1 | import { FunctionProperties, PickWith, PickWithOpt } from '../../utils' |
2 | import { VideoChannelModel } from '../../../models/video/video-channel' | 2 | import { VideoChannelModel } from '../../../models/video/video-channel' |
3 | import { | 3 | import { |
4 | MAccountActor, | 4 | MAccountActor, |
5 | MAccountAPI, | 5 | MAccountAPI, |
6 | MAccountDefault, | 6 | MAccountDefault, |
7 | MAccountFormattable, | ||
7 | MAccountLight, | 8 | MAccountLight, |
8 | MAccountSummaryBlocks, | 9 | MAccountSummaryBlocks, |
10 | MAccountSummaryFormattable, | ||
9 | MAccountUserId, | 11 | MAccountUserId, |
10 | MActor, | 12 | MActor, |
11 | MActorAccountChannelId, | 13 | MActorAccountChannelId, |
12 | MActorAPI, | 14 | MActorAPI, |
13 | MActorDefault, | 15 | MActorDefault, |
14 | MActorDefaultLight, | 16 | MActorDefaultLight, |
17 | MActorFormattable, | ||
15 | MActorLight, | 18 | MActorLight, |
16 | MActorSummary | 19 | MActorSummary, |
20 | MActorSummaryFormattable | ||
17 | } from '../account' | 21 | } from '../account' |
18 | import { MVideo } from './video' | 22 | import { MVideo } from './video' |
19 | 23 | ||
@@ -86,7 +90,8 @@ export type MChannelActorAccountDefaultVideos = MChannel & | |||
86 | 90 | ||
87 | // For API | 91 | // For API |
88 | 92 | ||
89 | export type MChannelSummary = Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> & | 93 | export type MChannelSummary = FunctionProperties<MChannel> & |
94 | Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> & | ||
90 | Use<'Actor', MActorSummary> | 95 | Use<'Actor', MActorSummary> |
91 | 96 | ||
92 | export type MChannelSummaryAccount = MChannelSummary & | 97 | export type MChannelSummaryAccount = MChannelSummary & |
@@ -95,3 +100,19 @@ export type MChannelSummaryAccount = MChannelSummary & | |||
95 | export type MChannelAPI = MChannel & | 100 | export type MChannelAPI = MChannel & |
96 | Use<'Actor', MActorAPI> & | 101 | Use<'Actor', MActorAPI> & |
97 | Use<'Account', MAccountAPI> | 102 | Use<'Account', MAccountAPI> |
103 | |||
104 | // ############################################################################ | ||
105 | |||
106 | // Format for API or AP object | ||
107 | |||
108 | export type MChannelSummaryFormattable = FunctionProperties<MChannel> & | ||
109 | Pick<MChannel, 'id' | 'name'> & | ||
110 | Use<'Actor', MActorSummaryFormattable> | ||
111 | |||
112 | export type MChannelAccountSummaryFormattable = MChannelSummaryFormattable & | ||
113 | Use<'Account', MAccountSummaryFormattable> | ||
114 | |||
115 | export type MChannelFormattable = FunctionProperties<MChannel> & | ||
116 | Pick<MChannel, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'support'> & | ||
117 | Use<'Actor', MActorFormattable> & | ||
118 | PickWithOpt<VideoChannelModel, 'Account', MAccountFormattable> | ||