]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/user/user-interface.ts
Upgrade express validator to v4
[github/Chocobozzz/PeerTube.git] / server / models / user / user-interface.ts
index 9bd3d2ebb24e2d67ded2d3319f8cac5cefab5dc3..8974a9a97f32b6f82493aa72c1cc193cb227fdfe 100644 (file)
@@ -2,15 +2,16 @@ import * as Sequelize from 'sequelize'
 import * as Promise from 'bluebird'
 
 // Don't use barrel, import just what we need
-import { User as FormatedUser } from '../../../shared/models/users/user.model'
+import { User as FormattedUser } from '../../../shared/models/users/user.model'
 import { UserRole } from '../../../shared/models/users/user-role.type'
 import { ResultList } from '../../../shared/models/result-list.model'
 
 export namespace UserMethods {
   export type IsPasswordMatch = (this: UserInstance, password: string) => Promise<boolean>
 
-  export type ToFormatedJSON = (this: UserInstance) => FormatedUser
+  export type ToFormattedJSON = (this: UserInstance) => FormattedUser
   export type IsAdmin = (this: UserInstance) => boolean
+  export type IsAbleToUploadVideo = (this: UserInstance, videoFile: Express.Multer.File) => Promise<boolean>
 
   export type CountTotal = () => Promise<number>
 
@@ -29,8 +30,9 @@ export namespace UserMethods {
 
 export interface UserClass {
   isPasswordMatch: UserMethods.IsPasswordMatch,
-  toFormatedJSON: UserMethods.ToFormatedJSON,
+  toFormattedJSON: UserMethods.ToFormattedJSON,
   isAdmin: UserMethods.IsAdmin,
+  isAbleToUploadVideo: UserMethods.IsAbleToUploadVideo,
 
   countTotal: UserMethods.CountTotal,
   getByUsername: UserMethods.GetByUsername,
@@ -42,11 +44,13 @@ export interface UserClass {
 }
 
 export interface UserAttributes {
+  id?: number
   password: string
   username: string
   email: string
   displayNSFW?: boolean
   role: UserRole
+  videoQuota: number
 }
 
 export interface UserInstance extends UserClass, UserAttributes, Sequelize.Instance<UserAttributes> {
@@ -55,7 +59,7 @@ export interface UserInstance extends UserClass, UserAttributes, Sequelize.Insta
   updatedAt: Date
 
   isPasswordMatch: UserMethods.IsPasswordMatch
-  toFormatedJSON: UserMethods.ToFormatedJSON
+  toFormattedJSON: UserMethods.ToFormattedJSON
   isAdmin: UserMethods.IsAdmin
 }