diff options
Diffstat (limited to 'server/models/request/request-interface.ts')
-rw-r--r-- | server/models/request/request-interface.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/server/models/request/request-interface.ts b/server/models/request/request-interface.ts index 483850633..7b0ee4df9 100644 --- a/server/models/request/request-interface.ts +++ b/server/models/request/request-interface.ts | |||
@@ -1,5 +1,7 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import * as Promise from 'bluebird' | ||
2 | 3 | ||
4 | import { AbstractRequestClass } from './abstract-request-interface' | ||
3 | import { PodInstance, PodAttributes } from '../pod' | 5 | import { PodInstance, PodAttributes } from '../pod' |
4 | import { RequestEndpoint } from '../../../shared/models/request-scheduler.model' | 6 | import { RequestEndpoint } from '../../../shared/models/request-scheduler.model' |
5 | 7 | ||
@@ -11,20 +13,16 @@ export type RequestsGrouped = { | |||
11 | } | 13 | } |
12 | 14 | ||
13 | export namespace RequestMethods { | 15 | export namespace RequestMethods { |
14 | export type CountTotalRequestsCallback = (err: Error, total: number) => void | 16 | export type CountTotalRequests = () => Promise<number> |
15 | export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void | ||
16 | 17 | ||
17 | export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsGrouped) => void | 18 | export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number) => Promise<RequestsGrouped> |
18 | export type ListWithLimitAndRandom = (limitPods, limitRequestsPerPod, callback: ListWithLimitAndRandomCallback) => void | ||
19 | 19 | ||
20 | export type RemoveWithEmptyToCallback = (err: Error) => void | 20 | export type RemoveWithEmptyTo = () => Promise<number> |
21 | export type RemoveWithEmptyTo = (callback: RemoveWithEmptyToCallback) => void | ||
22 | 21 | ||
23 | export type RemoveAllCallback = (err: Error) => void | 22 | export type RemoveAll = () => Promise<void> |
24 | export type RemoveAll = (callback: RemoveAllCallback) => void | ||
25 | } | 23 | } |
26 | 24 | ||
27 | export interface RequestClass { | 25 | export interface RequestClass extends AbstractRequestClass<RequestsGrouped> { |
28 | countTotalRequests: RequestMethods.CountTotalRequests | 26 | countTotalRequests: RequestMethods.CountTotalRequests |
29 | listWithLimitAndRandom: RequestMethods.ListWithLimitAndRandom | 27 | listWithLimitAndRandom: RequestMethods.ListWithLimitAndRandom |
30 | removeWithEmptyTo: RequestMethods.RemoveWithEmptyTo | 28 | removeWithEmptyTo: RequestMethods.RemoveWithEmptyTo |