]> 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 0b97a8f6d1e86fdb6e74416a903ae56a113075df..8974a9a97f32b6f82493aa72c1cc193cb227fdfe 100644 (file)
@@ -11,6 +11,7 @@ export namespace UserMethods {
 
   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>
 
@@ -31,6 +32,7 @@ export interface UserClass {
   isPasswordMatch: UserMethods.IsPasswordMatch,
   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> {