PeerTube/server/models/request/request-video-qadu-interfac...

49 lines
1.6 KiB
TypeScript
Raw Normal View History

2017-05-22 20:58:25 +02:00
import * as Sequelize from 'sequelize'
import * as Promise from 'bluebird'
2017-05-22 20:58:25 +02:00
import { AbstractRequestClass, AbstractRequestToPodClass } from './abstract-request-interface'
2017-06-16 09:45:46 +02:00
import { VideoInstance } from '../video'
import { PodInstance } from '../pod'
2017-06-10 22:15:25 +02:00
2017-06-16 10:36:18 +02:00
import { RequestVideoQaduType } from '../../../shared/models/request-scheduler.model'
2017-06-10 22:15:25 +02:00
export type RequestsVideoQaduGrouped = {
[ podId: number ]: {
request: RequestVideoQaduInstance
video: VideoInstance
pod: PodInstance
}
}
2017-05-22 20:58:25 +02:00
export namespace RequestVideoQaduMethods {
export type CountTotalRequests = () => Promise<number>
2017-06-10 22:15:25 +02:00
export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number) => Promise<RequestsVideoQaduGrouped>
2017-06-10 22:15:25 +02:00
export type RemoveByRequestIdsAndPod = (ids: number[], podId: number) => Promise<number>
2017-06-10 22:15:25 +02:00
export type RemoveAll = () => Promise<void>
2017-05-22 20:58:25 +02:00
}
export interface RequestVideoQaduClass extends AbstractRequestClass<RequestsVideoQaduGrouped>, AbstractRequestToPodClass {
2017-05-22 20:58:25 +02:00
countTotalRequests: RequestVideoQaduMethods.CountTotalRequests
listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom
removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod
removeAll: RequestVideoQaduMethods.RemoveAll
}
export interface RequestVideoQaduAttributes {
2017-06-16 10:36:18 +02:00
type: RequestVideoQaduType
2017-05-22 20:58:25 +02:00
}
export interface RequestVideoQaduInstance
extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> {
2017-05-22 20:58:25 +02:00
id: number
2017-06-10 22:15:25 +02:00
Pod: PodInstance
Video: VideoInstance
2017-05-22 20:58:25 +02:00
}
export interface RequestVideoQaduModel
extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {}