diff options
Diffstat (limited to 'server/typings/models/account/account.ts')
-rw-r--r-- | server/typings/models/account/account.ts | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/server/typings/models/account/account.ts b/server/typings/models/account/account.ts index adb1f3689..7b826ee04 100644 --- a/server/typings/models/account/account.ts +++ b/server/typings/models/account/account.ts | |||
@@ -21,7 +21,8 @@ type Use<K extends keyof AccountModel, M> = PickWith<AccountModel, K, M> | |||
21 | 21 | ||
22 | // ############################################################################ | 22 | // ############################################################################ |
23 | 23 | ||
24 | export type MAccount = Omit<AccountModel, 'Actor' | 'User' | 'Application' | 'VideoChannels' | 'VideoPlaylists' | | 24 | export type MAccount = |
25 | Omit<AccountModel, 'Actor' | 'User' | 'Application' | 'VideoChannels' | 'VideoPlaylists' | | ||
25 | 'VideoComments' | 'BlockedAccounts'> | 26 | 'VideoComments' | 'BlockedAccounts'> |
26 | 27 | ||
27 | // ############################################################################ | 28 | // ############################################################################ |
@@ -34,62 +35,75 @@ export type MAccountUserId = Pick<MAccount, 'userId'> | |||
34 | export type MAccountUrl = Use<'Actor', MActorUrl> | 35 | export type MAccountUrl = Use<'Actor', MActorUrl> |
35 | export type MAccountAudience = Use<'Actor', MActorAudience> | 36 | export type MAccountAudience = Use<'Actor', MActorAudience> |
36 | 37 | ||
37 | export type MAccountIdActor = MAccountId & | 38 | export type MAccountIdActor = |
39 | MAccountId & | ||
38 | Use<'Actor', MActor> | 40 | Use<'Actor', MActor> |
39 | 41 | ||
40 | export type MAccountIdActorId = MAccountId & | 42 | export type MAccountIdActorId = |
43 | MAccountId & | ||
41 | Use<'Actor', MActorId> | 44 | Use<'Actor', MActorId> |
42 | 45 | ||
43 | // ############################################################################ | 46 | // ############################################################################ |
44 | 47 | ||
45 | // Default scope | 48 | // Default scope |
46 | export type MAccountDefault = MAccount & | 49 | export type MAccountDefault = |
50 | MAccount & | ||
47 | Use<'Actor', MActorDefault> | 51 | Use<'Actor', MActorDefault> |
48 | 52 | ||
49 | // Default with default association scopes | 53 | // Default with default association scopes |
50 | export type MAccountDefaultChannelDefault = MAccount & | 54 | export type MAccountDefaultChannelDefault = |
55 | MAccount & | ||
51 | Use<'Actor', MActorDefault> & | 56 | Use<'Actor', MActorDefault> & |
52 | Use<'VideoChannels', MChannelDefault[]> | 57 | Use<'VideoChannels', MChannelDefault[]> |
53 | 58 | ||
54 | // We don't need some actors attributes | 59 | // We don't need some actors attributes |
55 | export type MAccountLight = MAccount & | 60 | export type MAccountLight = |
61 | MAccount & | ||
56 | Use<'Actor', MActorDefaultLight> | 62 | Use<'Actor', MActorDefaultLight> |
57 | 63 | ||
58 | // ############################################################################ | 64 | // ############################################################################ |
59 | 65 | ||
60 | // Full actor | 66 | // Full actor |
61 | export type MAccountActor = MAccount & | 67 | export type MAccountActor = |
68 | MAccount & | ||
62 | Use<'Actor', MActor> | 69 | Use<'Actor', MActor> |
63 | 70 | ||
64 | // Full actor with server | 71 | // Full actor with server |
65 | export type MAccountServer = MAccount & | 72 | export type MAccountServer = |
73 | MAccount & | ||
66 | Use<'Actor', MActorServer> | 74 | Use<'Actor', MActorServer> |
67 | 75 | ||
68 | // ############################################################################ | 76 | // ############################################################################ |
69 | 77 | ||
70 | // For API | 78 | // For API |
71 | 79 | ||
72 | export type MAccountSummary = FunctionProperties<MAccount> & | 80 | export type MAccountSummary = |
81 | FunctionProperties<MAccount> & | ||
73 | Pick<MAccount, 'id' | 'name'> & | 82 | Pick<MAccount, 'id' | 'name'> & |
74 | Use<'Actor', MActorSummary> | 83 | Use<'Actor', MActorSummary> |
75 | 84 | ||
76 | export type MAccountSummaryBlocks = MAccountSummary & | 85 | export type MAccountSummaryBlocks = |
86 | MAccountSummary & | ||
77 | Use<'BlockedAccounts', MAccountBlocklistId[]> | 87 | Use<'BlockedAccounts', MAccountBlocklistId[]> |
78 | 88 | ||
79 | export type MAccountAPI = MAccount & | 89 | export type MAccountAPI = |
90 | MAccount & | ||
80 | Use<'Actor', MActorAPI> | 91 | Use<'Actor', MActorAPI> |
81 | 92 | ||
82 | // ############################################################################ | 93 | // ############################################################################ |
83 | 94 | ||
84 | // Format for API or AP object | 95 | // Format for API or AP object |
85 | 96 | ||
86 | export type MAccountSummaryFormattable = FunctionProperties<MAccount> & | 97 | export type MAccountSummaryFormattable = |
98 | FunctionProperties<MAccount> & | ||
87 | Pick<MAccount, 'id' | 'name'> & | 99 | Pick<MAccount, 'id' | 'name'> & |
88 | Use<'Actor', MActorSummaryFormattable> | 100 | Use<'Actor', MActorSummaryFormattable> |
89 | 101 | ||
90 | export type MAccountFormattable = FunctionProperties<MAccount> & | 102 | export type MAccountFormattable = |
103 | FunctionProperties<MAccount> & | ||
91 | Pick<MAccount, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'userId'> & | 104 | Pick<MAccount, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'userId'> & |
92 | Use<'Actor', MActorFormattable> | 105 | Use<'Actor', MActorFormattable> |
93 | 106 | ||
94 | export type MAccountAP = Pick<MAccount, 'name' | 'description'> & | 107 | export type MAccountAP = |
108 | Pick<MAccount, 'name' | 'description'> & | ||
95 | Use<'Actor', MActorAP> | 109 | Use<'Actor', MActorAP> |