diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:45:46 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:45:46 +0200 |
commit | 74889a71fe687dda74f2a687653122327807af36 (patch) | |
tree | e938e8b6401b74fbec80513a877d9967f2c0dbcd /server/models/request/request-video-qadu-interface.ts | |
parent | 15a302943d84bc0978b84fe33110c4daa451d311 (diff) | |
download | PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.gz PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.zst PeerTube-74889a71fe687dda74f2a687653122327807af36.zip |
Reorganize model files
Diffstat (limited to 'server/models/request/request-video-qadu-interface.ts')
-rw-r--r-- | server/models/request/request-video-qadu-interface.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/server/models/request/request-video-qadu-interface.ts b/server/models/request/request-video-qadu-interface.ts new file mode 100644 index 000000000..625b063dc --- /dev/null +++ b/server/models/request/request-video-qadu-interface.ts | |||
@@ -0,0 +1,46 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | import { VideoInstance } from '../video' | ||
4 | import { PodInstance } from '../pod' | ||
5 | |||
6 | export type RequestsVideoQaduGrouped = { | ||
7 | [ podId: number ]: { | ||
8 | request: RequestVideoQaduInstance | ||
9 | video: VideoInstance | ||
10 | pod: PodInstance | ||
11 | } | ||
12 | } | ||
13 | |||
14 | export namespace RequestVideoQaduMethods { | ||
15 | export type CountTotalRequestsCallback = (err: Error, total: number) => void | ||
16 | export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void | ||
17 | |||
18 | export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoQaduGrouped) => void | ||
19 | export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void | ||
20 | |||
21 | export type RemoveByRequestIdsAndPodCallback = () => void | ||
22 | export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void | ||
23 | |||
24 | export type RemoveAllCallback = () => void | ||
25 | export type RemoveAll = (callback: RemoveAllCallback) => void | ||
26 | } | ||
27 | |||
28 | export interface RequestVideoQaduClass { | ||
29 | countTotalRequests: RequestVideoQaduMethods.CountTotalRequests | ||
30 | listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom | ||
31 | removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod | ||
32 | removeAll: RequestVideoQaduMethods.RemoveAll | ||
33 | } | ||
34 | |||
35 | export interface RequestVideoQaduAttributes { | ||
36 | type: string | ||
37 | } | ||
38 | |||
39 | export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> { | ||
40 | id: number | ||
41 | |||
42 | Pod: PodInstance | ||
43 | Video: VideoInstance | ||
44 | } | ||
45 | |||
46 | export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} | ||