aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/pod/pod-interface.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-19 09:43:01 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-19 09:43:01 +0200
commit8a02bd0433b7101c5ea36e87a4edb63204d2adec (patch)
treed7ab4b6164aef752c216bd2f22f8b3b270a724b8 /server/models/pod/pod-interface.ts
parent9fd540562c356cb54b98861d2d9e7d4fbfcd00e0 (diff)
downloadPeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.tar.gz
PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.tar.zst
PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.zip
Add pod list endpoint with pagination, sort...
Diffstat (limited to 'server/models/pod/pod-interface.ts')
-rw-r--r--server/models/pod/pod-interface.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/models/pod/pod-interface.ts b/server/models/pod/pod-interface.ts
index fc763acac..7e095d424 100644
--- a/server/models/pod/pod-interface.ts
+++ b/server/models/pod/pod-interface.ts
@@ -3,6 +3,7 @@ import * as Promise from 'bluebird'
3 3
4// Don't use barrel, import just what we need 4// Don't use barrel, import just what we need
5import { Pod as FormattedPod } from '../../../shared/models/pods/pod.model' 5import { Pod as FormattedPod } from '../../../shared/models/pods/pod.model'
6import { ResultList } from '../../../shared/models/result-list.model'
6 7
7export namespace PodMethods { 8export namespace PodMethods {
8 export type ToFormattedJSON = (this: PodInstance) => FormattedPod 9 export type ToFormattedJSON = (this: PodInstance) => FormattedPod
@@ -13,6 +14,8 @@ export namespace PodMethods {
13 14
14 export type List = () => Promise<PodInstance[]> 15 export type List = () => Promise<PodInstance[]>
15 16
17 export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<PodInstance> >
18
16 export type ListAllIds = (transaction: Sequelize.Transaction) => Promise<number[]> 19 export type ListAllIds = (transaction: Sequelize.Transaction) => Promise<number[]>
17 20
18 export type ListRandomPodIdsWithRequest = (limit: number, tableWithPods: string, tableWithPodsJoins: string) => Promise<number[]> 21 export type ListRandomPodIdsWithRequest = (limit: number, tableWithPods: string, tableWithPodsJoins: string) => Promise<number[]>
@@ -32,6 +35,7 @@ export interface PodClass {
32 countAll: PodMethods.CountAll 35 countAll: PodMethods.CountAll
33 incrementScores: PodMethods.IncrementScores 36 incrementScores: PodMethods.IncrementScores
34 list: PodMethods.List 37 list: PodMethods.List
38 listForApi: PodMethods.ListForApi
35 listAllIds: PodMethods.ListAllIds 39 listAllIds: PodMethods.ListAllIds
36 listRandomPodIdsWithRequest: PodMethods.ListRandomPodIdsWithRequest 40 listRandomPodIdsWithRequest: PodMethods.ListRandomPodIdsWithRequest
37 listBadPods: PodMethods.ListBadPods 41 listBadPods: PodMethods.ListBadPods