aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request/request-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/request/request-interface.ts')
-rw-r--r--server/models/request/request-interface.ts16
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 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import * as Promise from 'bluebird'
2 3
4import { AbstractRequestClass } from './abstract-request-interface'
3import { PodInstance, PodAttributes } from '../pod' 5import { PodInstance, PodAttributes } from '../pod'
4import { RequestEndpoint } from '../../../shared/models/request-scheduler.model' 6import { RequestEndpoint } from '../../../shared/models/request-scheduler.model'
5 7
@@ -11,20 +13,16 @@ export type RequestsGrouped = {
11} 13}
12 14
13export namespace RequestMethods { 15export 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
27export interface RequestClass { 25export 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