aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request-video-event-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/request-video-event-interface.ts')
-rw-r--r--server/models/request-video-event-interface.ts32
1 files changed, 27 insertions, 5 deletions
diff --git a/server/models/request-video-event-interface.ts b/server/models/request-video-event-interface.ts
index a31c7108f..ad576a2b1 100644
--- a/server/models/request-video-event-interface.ts
+++ b/server/models/request-video-event-interface.ts
@@ -1,10 +1,30 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2 2
3import { VideoInstance } from './video-interface'
4import { PodInstance } from './pod-interface'
5
6export type RequestsVideoEventGrouped = {
7 [ podId: number ]: {
8 id: number
9 type: string
10 count: number
11 video: VideoInstance
12 pod: PodInstance
13 }[]
14}
15
3export namespace RequestVideoEventMethods { 16export namespace RequestVideoEventMethods {
4 export type CountTotalRequests = (callback) => void 17 export type CountTotalRequestsCallback = (err: Error, total: number) => void
5 export type ListWithLimitAndRandom = (limitPods, limitRequestsPerPod, callback) => void 18 export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void
6 export type RemoveByRequestIdsAndPod = (ids, podId, callback) => void 19
7 export type RemoveAll = (callback) => void 20 export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoEventGrouped) => void
21 export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void
22
23 export type RemoveByRequestIdsAndPodCallback = () => void
24 export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void
25
26 export type RemoveAllCallback = () => void
27 export type RemoveAll = (callback: RemoveAllCallback) => void
8} 28}
9 29
10export interface RequestVideoEventClass { 30export interface RequestVideoEventClass {
@@ -19,8 +39,10 @@ export interface RequestVideoEventAttributes {
19 count: number 39 count: number
20} 40}
21 41
22export interface RequestVideoEventInstance extends Sequelize.Instance<RequestVideoEventAttributes> { 42export interface RequestVideoEventInstance extends RequestVideoEventClass, RequestVideoEventAttributes, Sequelize.Instance<RequestVideoEventAttributes> {
23 id: number 43 id: number
44
45 Video: VideoInstance
24} 46}
25 47
26export interface RequestVideoEventModel extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {} 48export interface RequestVideoEventModel extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {}