diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-22 20:58:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-25 17:32:16 +0200 |
commit | e02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch) | |
tree | b7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/models/request-interface.ts | |
parent | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff) | |
download | PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip |
Type models
Diffstat (limited to 'server/models/request-interface.ts')
-rw-r--r-- | server/models/request-interface.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/server/models/request-interface.ts b/server/models/request-interface.ts new file mode 100644 index 000000000..2bba8ce7f --- /dev/null +++ b/server/models/request-interface.ts | |||
@@ -0,0 +1,32 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | import { PodAttributes } from './pod-interface' | ||
4 | |||
5 | export namespace RequestMethods { | ||
6 | export type CountTotalRequests = (callback) => void | ||
7 | export type ListWithLimitAndRandom = (limitPods, limitRequestsPerPod, callback) => void | ||
8 | export type RemoveWithEmptyTo = (callback) => void | ||
9 | export type RemoveAll = (callback) => void | ||
10 | } | ||
11 | |||
12 | export interface RequestClass { | ||
13 | countTotalRequests: RequestMethods.CountTotalRequests | ||
14 | listWithLimitAndRandom: RequestMethods.ListWithLimitAndRandom | ||
15 | removeWithEmptyTo: RequestMethods.RemoveWithEmptyTo | ||
16 | removeAll: RequestMethods.RemoveAll | ||
17 | } | ||
18 | |||
19 | export interface RequestAttributes { | ||
20 | request: object | ||
21 | endpoint: string | ||
22 | } | ||
23 | |||
24 | export interface RequestInstance extends Sequelize.Instance<RequestAttributes> { | ||
25 | id: number | ||
26 | createdAt: Date | ||
27 | updatedAt: Date | ||
28 | |||
29 | setPods: Sequelize.HasManySetAssociationsMixin<PodAttributes, number> | ||
30 | } | ||
31 | |||
32 | export interface RequestModel extends RequestClass, Sequelize.Model<RequestInstance, RequestAttributes> {} | ||