-
Notifications
You must be signed in to change notification settings - Fork 3
/
tfsApi.ts
45 lines (40 loc) · 1.14 KB
/
tfsApi.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class TfsApi
{
tfsUrl = localStorage.getItem("tfsUrl")
getTfsProjects()
{
return fetch(this.tfsUrl + "/_apis/projects",
{
method: "GET",
credentials: "include"
});
}
getQueuedBuildFromProject(project: string, definitionId: string)
{
return fetch(
this.tfsUrl + "/"+ project + "/_apis/build/builds?$top=1&statusFilter=41&definitions=" + definitionId,
{
method: "GET",
credentials: "include"
});
}
getLatestBuildFromProject(project: string, definitionId: string)
{
return fetch(
this.tfsUrl + "/"+ project + "/_apis/build/builds?$top=1&statusFilter=2&definitions=" + definitionId,
{
method: "GET",
credentials: "include"
});
}
getBuildDefinitionsForProject(project: string)
{
return fetch(
this.tfsUrl + "/"+ project + "/_apis/build/definitions",
{
method: "GET",
credentials: "include"
});
}
};
export default new TfsApi();