]>
Commit | Line | Data |
---|---|---|
e02643f3 C |
1 | import * as Sequelize from 'sequelize' |
2 | ||
69818c93 C |
3 | import { VideoInstance } from './video-interface' |
4 | import { PodInstance } from './pod-interface' | |
5 | ||
6 | export type RequestsVideoEventGrouped = { | |
7 | [ podId: number ]: { | |
8 | id: number | |
9 | type: string | |
10 | count: number | |
11 | video: VideoInstance | |
12 | pod: PodInstance | |
13 | }[] | |
14 | } | |
15 | ||
e02643f3 | 16 | export namespace RequestVideoEventMethods { |
69818c93 C |
17 | export type CountTotalRequestsCallback = (err: Error, total: number) => void |
18 | export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void | |
19 | ||
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 | |
e02643f3 C |
28 | } |
29 | ||
30 | export interface RequestVideoEventClass { | |
31 | countTotalRequests: RequestVideoEventMethods.CountTotalRequests | |
32 | listWithLimitAndRandom: RequestVideoEventMethods.ListWithLimitAndRandom | |
33 | removeByRequestIdsAndPod: RequestVideoEventMethods.RemoveByRequestIdsAndPod | |
34 | removeAll: RequestVideoEventMethods.RemoveAll | |
35 | } | |
36 | ||
37 | export interface RequestVideoEventAttributes { | |
38 | type: string | |
39 | count: number | |
40 | } | |
41 | ||
69818c93 | 42 | export interface RequestVideoEventInstance extends RequestVideoEventClass, RequestVideoEventAttributes, Sequelize.Instance<RequestVideoEventAttributes> { |
e02643f3 | 43 | id: number |
69818c93 C |
44 | |
45 | Video: VideoInstance | |
e02643f3 C |
46 | } |
47 | ||
48 | export interface RequestVideoEventModel extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {} |