From e4f97babf701481b55cc10fb3448feab5f97c867 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 9 Nov 2017 17:51:58 +0100 Subject: Begin activitypub --- server/models/user/user-interface.ts | 69 ------------------------------------ 1 file changed, 69 deletions(-) delete mode 100644 server/models/user/user-interface.ts (limited to 'server/models/user/user-interface.ts') diff --git a/server/models/user/user-interface.ts b/server/models/user/user-interface.ts deleted file mode 100644 index 49c75aa3b..000000000 --- a/server/models/user/user-interface.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as Sequelize from 'sequelize' -import * as Promise from 'bluebird' - -// Don't use barrel, import just what we need -import { User as FormattedUser } from '../../../shared/models/users/user.model' -import { ResultList } from '../../../shared/models/result-list.model' -import { AuthorInstance } from '../video/author-interface' -import { UserRight } from '../../../shared/models/users/user-right.enum' -import { UserRole } from '../../../shared/models/users/user-role' - -export namespace UserMethods { - export type HasRight = (this: UserInstance, right: UserRight) => boolean - export type IsPasswordMatch = (this: UserInstance, password: string) => Promise - - export type ToFormattedJSON = (this: UserInstance) => FormattedUser - export type IsAbleToUploadVideo = (this: UserInstance, videoFile: Express.Multer.File) => Promise - - export type CountTotal = () => Promise - - export type GetByUsername = (username: string) => Promise - - export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList > - - export type LoadById = (id: number) => Promise - - export type LoadByUsername = (username: string) => Promise - export type LoadByUsernameAndPopulateChannels = (username: string) => Promise - - export type LoadByUsernameOrEmail = (username: string, email: string) => Promise -} - -export interface UserClass { - isPasswordMatch: UserMethods.IsPasswordMatch, - toFormattedJSON: UserMethods.ToFormattedJSON, - hasRight: UserMethods.HasRight, - isAbleToUploadVideo: UserMethods.IsAbleToUploadVideo, - - countTotal: UserMethods.CountTotal, - getByUsername: UserMethods.GetByUsername, - listForApi: UserMethods.ListForApi, - loadById: UserMethods.LoadById, - loadByUsername: UserMethods.LoadByUsername, - loadByUsernameAndPopulateChannels: UserMethods.LoadByUsernameAndPopulateChannels, - loadByUsernameOrEmail: UserMethods.LoadByUsernameOrEmail -} - -export interface UserAttributes { - id?: number - password: string - username: string - email: string - displayNSFW?: boolean - role: UserRole - videoQuota: number - - Author?: AuthorInstance -} - -export interface UserInstance extends UserClass, UserAttributes, Sequelize.Instance { - id: number - createdAt: Date - updatedAt: Date - - isPasswordMatch: UserMethods.IsPasswordMatch - toFormattedJSON: UserMethods.ToFormattedJSON - hasRight: UserMethods.HasRight -} - -export interface UserModel extends UserClass, Sequelize.Model {} -- cgit v1.2.3