aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/pod-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/pod-interface.ts')
-rw-r--r--server/models/pod-interface.ts41
1 files changed, 31 insertions, 10 deletions
diff --git a/server/models/pod-interface.ts b/server/models/pod-interface.ts
index 14c88bec6..8f362bd5c 100644
--- a/server/models/pod-interface.ts
+++ b/server/models/pod-interface.ts
@@ -1,18 +1,39 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2 2
3// Don't use barrel, import just what we need
4import { Pod as FormatedPod } from '../../shared/models/pod.model'
5
3export namespace PodMethods { 6export namespace PodMethods {
4 export type ToFormatedJSON = () => void 7 export type ToFormatedJSON = () => FormatedPod
5 8
9 export type CountAllCallback = (err: Error, total: number) => void
6 export type CountAll = (callback) => void 10 export type CountAll = (callback) => void
7 export type IncrementScores = (ids, value, callback) => void 11
8 export type List = (callback) => void 12 export type IncrementScoresCallback = (err: Error) => void
9 export type ListAllIds = (transaction, callback) => void 13 export type IncrementScores = (ids: number[], value: number, callback?: IncrementScoresCallback) => void
10 export type ListRandomPodIdsWithRequest = (limit, tableWithPods, tableWithPodsJoins, callback) => void 14
11 export type ListBadPods = (callback) => void 15 export type ListCallback = (err: Error, podInstances?: PodInstance[]) => void
12 export type Load = (id, callback) => void 16 export type List = (callback: ListCallback) => void
13 export type LoadByHost = (host, callback) => void 17
14 export type RemoveAll = (callback) => void 18 export type ListAllIdsCallback = (err: Error, ids?: number[]) => void
15 export type UpdatePodsScore = (goodPods, badPods) => void 19 export type ListAllIds = (transaction: Sequelize.Transaction, callback: ListAllIdsCallback) => void
20
21 export type ListRandomPodIdsWithRequestCallback = (err: Error, podInstanceIds?: number[]) => void
22 export type ListRandomPodIdsWithRequest = (limit: number, tableWithPods: string, tableWithPodsJoins: string, callback: ListRandomPodIdsWithRequestCallback) => void
23
24 export type ListBadPodsCallback = (err: Error, podInstances?: PodInstance[]) => void
25 export type ListBadPods = (callback: ListBadPodsCallback) => void
26
27 export type LoadCallback = (err: Error, podInstance: PodInstance) => void
28 export type Load = (id: number, callback: LoadCallback) => void
29
30 export type LoadByHostCallback = (err: Error, podInstance: PodInstance) => void
31 export type LoadByHost = (host: string, callback: LoadByHostCallback) => void
32
33 export type RemoveAllCallback = (err: Error) => void
34 export type RemoveAll = (callback: RemoveAllCallback) => void
35
36 export type UpdatePodsScore = (goodPods: number[], badPods: number[]) => void
16} 37}
17 38
18export interface PodClass { 39export interface PodClass {