aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/user/user-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/user/user-interface.ts')
-rw-r--r--server/models/user/user-interface.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/models/user/user-interface.ts b/server/models/user/user-interface.ts
index 8974a9a97..1b5233eaf 100644
--- a/server/models/user/user-interface.ts
+++ b/server/models/user/user-interface.ts
@@ -5,6 +5,7 @@ import * as Promise from 'bluebird'
5import { User as FormattedUser } from '../../../shared/models/users/user.model' 5import { User as FormattedUser } from '../../../shared/models/users/user.model'
6import { UserRole } from '../../../shared/models/users/user-role.type' 6import { UserRole } from '../../../shared/models/users/user-role.type'
7import { ResultList } from '../../../shared/models/result-list.model' 7import { ResultList } from '../../../shared/models/result-list.model'
8import { AuthorInstance } from '../video/author-interface'
8 9
9export namespace UserMethods { 10export namespace UserMethods {
10 export type IsPasswordMatch = (this: UserInstance, password: string) => Promise<boolean> 11 export type IsPasswordMatch = (this: UserInstance, password: string) => Promise<boolean>
@@ -17,13 +18,12 @@ export namespace UserMethods {
17 18
18 export type GetByUsername = (username: string) => Promise<UserInstance> 19 export type GetByUsername = (username: string) => Promise<UserInstance>
19 20
20 export type List = () => Promise<UserInstance[]>
21
22 export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<UserInstance> > 21 export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<UserInstance> >
23 22
24 export type LoadById = (id: number) => Promise<UserInstance> 23 export type LoadById = (id: number) => Promise<UserInstance>
25 24
26 export type LoadByUsername = (username: string) => Promise<UserInstance> 25 export type LoadByUsername = (username: string) => Promise<UserInstance>
26 export type LoadByUsernameAndPopulateChannels = (username: string) => Promise<UserInstance>
27 27
28 export type LoadByUsernameOrEmail = (username: string, email: string) => Promise<UserInstance> 28 export type LoadByUsernameOrEmail = (username: string, email: string) => Promise<UserInstance>
29} 29}
@@ -36,10 +36,10 @@ export interface UserClass {
36 36
37 countTotal: UserMethods.CountTotal, 37 countTotal: UserMethods.CountTotal,
38 getByUsername: UserMethods.GetByUsername, 38 getByUsername: UserMethods.GetByUsername,
39 list: UserMethods.List,
40 listForApi: UserMethods.ListForApi, 39 listForApi: UserMethods.ListForApi,
41 loadById: UserMethods.LoadById, 40 loadById: UserMethods.LoadById,
42 loadByUsername: UserMethods.LoadByUsername, 41 loadByUsername: UserMethods.LoadByUsername,
42 loadByUsernameAndPopulateChannels: UserMethods.LoadByUsernameAndPopulateChannels,
43 loadByUsernameOrEmail: UserMethods.LoadByUsernameOrEmail 43 loadByUsernameOrEmail: UserMethods.LoadByUsernameOrEmail
44} 44}
45 45
@@ -51,6 +51,8 @@ export interface UserAttributes {
51 displayNSFW?: boolean 51 displayNSFW?: boolean
52 role: UserRole 52 role: UserRole
53 videoQuota: number 53 videoQuota: number
54
55 Author?: AuthorInstance
54} 56}
55 57
56export interface UserInstance extends UserClass, UserAttributes, Sequelize.Instance<UserAttributes> { 58export interface UserInstance extends UserClass, UserAttributes, Sequelize.Instance<UserAttributes> {