-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtfsApi.js
34 lines (34 loc) · 1.14 KB
/
tfsApi.js
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
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class TfsApi {
constructor() {
this.tfsUrl = localStorage.getItem("tfsUrl");
}
getTfsProjects() {
return fetch(this.tfsUrl + "/_apis/projects", {
method: "GET",
credentials: "include"
});
}
getQueuedBuildFromProject(project, definitionId) {
return fetch(this.tfsUrl + "/" + project + "/_apis/build/builds?$top=1&statusFilter=41&definitions=" + definitionId, {
method: "GET",
credentials: "include"
});
}
getLatestBuildFromProject(project, definitionId) {
return fetch(this.tfsUrl + "/" + project + "/_apis/build/builds?$top=1&statusFilter=2&definitions=" + definitionId, {
method: "GET",
credentials: "include"
});
}
getBuildDefinitionsForProject(project) {
return fetch(this.tfsUrl + "/" + project + "/_apis/build/definitions", {
method: "GET",
credentials: "include"
});
}
}
;
exports.default = new TfsApi();
//# sourceMappingURL=tfsApi.js.map