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/account/account.ts | |
parent | 0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff) | |
download | PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.gz PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.zst PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.zip |
Type toFormattedJSON
Diffstat (limited to 'server/typings/models/account/account.ts')
-rw-r--r-- | server/typings/models/account/account.ts | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/server/typings/models/account/account.ts b/server/typings/models/account/account.ts index 9a8784e6b..33940517e 100644 --- a/server/typings/models/account/account.ts +++ b/server/typings/models/account/account.ts | |||
@@ -9,9 +9,11 @@ import { | |||
9 | MActorId, | 9 | MActorId, |
10 | MActorServer, | 10 | MActorServer, |
11 | MActorSummary, | 11 | MActorSummary, |
12 | MActorUrl | 12 | MActorSummaryFormattable, |
13 | MActorUrl, | ||
14 | MActorFormattable | ||
13 | } from './actor' | 15 | } from './actor' |
14 | import { PickWith } from '../../utils' | 16 | import { FunctionProperties, PickWith } from '../../utils' |
15 | import { MAccountBlocklistId } from './account-blocklist' | 17 | import { MAccountBlocklistId } from './account-blocklist' |
16 | import { MChannelDefault } from '@server/typings/models' | 18 | import { MChannelDefault } from '@server/typings/models' |
17 | 19 | ||
@@ -67,7 +69,8 @@ export type MAccountServer = MAccount & | |||
67 | 69 | ||
68 | // For API | 70 | // For API |
69 | 71 | ||
70 | export type MAccountSummary = Pick<MAccount, 'id' | 'name'> & | 72 | export type MAccountSummary = FunctionProperties<MAccount> & |
73 | Pick<MAccount, 'id' | 'name'> & | ||
71 | Use<'Actor', MActorSummary> | 74 | Use<'Actor', MActorSummary> |
72 | 75 | ||
73 | export type MAccountSummaryBlocks = MAccountSummary & | 76 | export type MAccountSummaryBlocks = MAccountSummary & |
@@ -75,3 +78,15 @@ export type MAccountSummaryBlocks = MAccountSummary & | |||
75 | 78 | ||
76 | export type MAccountAPI = MAccount & | 79 | export type MAccountAPI = MAccount & |
77 | Use<'Actor', MActorAPI> | 80 | Use<'Actor', MActorAPI> |
81 | |||
82 | // ############################################################################ | ||
83 | |||
84 | // Format for API or AP object | ||
85 | |||
86 | export type MAccountSummaryFormattable = FunctionProperties<MAccount> & | ||
87 | Pick<MAccount, 'id' | 'name'> & | ||
88 | Use<'Actor', MActorSummaryFormattable> | ||
89 | |||
90 | export type MAccountFormattable = FunctionProperties<MAccount> & | ||
91 | Pick<MAccount, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'userId'> & | ||
92 | Use<'Actor', MActorFormattable> | ||