attlaz-client 1.8.7 → 1.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Model/Team/Team.d.ts +1 -0
- package/dist/Model/Team/Team.js +8 -0
- package/dist/Service/ProjectEndpoint.js +24 -30
- package/dist/Service/ProjectEnvironmentEndpoint.js +6 -9
- package/dist/Service/TeamsEndpoint.js +3 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/Model/Team/Team.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Team = void 0;
|
|
4
|
+
const State_1 = require("../State");
|
|
4
5
|
class Team {
|
|
6
|
+
static parse(rawTeam) {
|
|
7
|
+
const team = new Team();
|
|
8
|
+
team.id = rawTeam.id;
|
|
9
|
+
team.name = rawTeam.name;
|
|
10
|
+
team.state = State_1.State.fromString(rawTeam.state);
|
|
11
|
+
return team;
|
|
12
|
+
}
|
|
5
13
|
}
|
|
6
14
|
exports.Team = Team;
|
|
@@ -5,37 +5,31 @@ const Endpoint_1 = require("./Endpoint");
|
|
|
5
5
|
const Project_1 = require("../Model/Project/Project");
|
|
6
6
|
const Utils_1 = require("../Utils");
|
|
7
7
|
class ProjectEndpoint extends Endpoint_1.Endpoint {
|
|
8
|
-
getAll() {
|
|
9
|
-
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
reject(reason);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
8
|
+
async getAll() {
|
|
9
|
+
try {
|
|
10
|
+
const result = await this.request('/projects');
|
|
11
|
+
result.setData(this.parseCollection(result, Project_1.Project.parse));
|
|
12
|
+
return result.getData();
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
16
|
+
console.error('Failed to load projects: ' + e);
|
|
17
|
+
}
|
|
18
|
+
throw e;
|
|
19
|
+
}
|
|
23
20
|
}
|
|
24
|
-
getByTeam(teamId) {
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
reject(reason);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
21
|
+
async getByTeam(teamId) {
|
|
22
|
+
try {
|
|
23
|
+
const result = await this.request('teams/' + teamId + '/projects');
|
|
24
|
+
result.setData(this.parseCollection(result, Project_1.Project.parse));
|
|
25
|
+
return result.getData();
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
29
|
+
console.error('Failed to load projects: ' + e);
|
|
30
|
+
}
|
|
31
|
+
throw e;
|
|
32
|
+
}
|
|
39
33
|
}
|
|
40
34
|
async getById(projectId) {
|
|
41
35
|
try {
|
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProjectEnvironmentEndpoint = void 0;
|
|
4
4
|
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const ProjectEnvironment_1 = require("../Model/Project/ProjectEnvironment");
|
|
5
6
|
class ProjectEnvironmentEndpoint extends Endpoint_1.Endpoint {
|
|
6
7
|
async getByProject(id) {
|
|
7
8
|
try {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//TODO: add parsing
|
|
12
|
-
projectEnvironment.push(rawProjectEnvironment);
|
|
13
|
-
}
|
|
14
|
-
return projectEnvironment;
|
|
9
|
+
const result = await this.request('/projects/' + id + '/environments');
|
|
10
|
+
result.setData(this.parseCollection(result, ProjectEnvironment_1.ProjectEnvironment.parse));
|
|
11
|
+
return result.getData();
|
|
15
12
|
}
|
|
16
13
|
catch (error) {
|
|
17
14
|
if (this.httpClient.isDebugEnabled()) {
|
|
@@ -23,7 +20,7 @@ class ProjectEnvironmentEndpoint extends Endpoint_1.Endpoint {
|
|
|
23
20
|
async getById(id) {
|
|
24
21
|
try {
|
|
25
22
|
const rawProjectEnvironment = await this.httpClient.request('/projectenvironments/' + id + '');
|
|
26
|
-
const projectEnvironment = rawProjectEnvironment;
|
|
23
|
+
const projectEnvironment = ProjectEnvironment_1.ProjectEnvironment.parse(rawProjectEnvironment);
|
|
27
24
|
return projectEnvironment;
|
|
28
25
|
}
|
|
29
26
|
catch (error) {
|
|
@@ -37,7 +34,7 @@ class ProjectEnvironmentEndpoint extends Endpoint_1.Endpoint {
|
|
|
37
34
|
try {
|
|
38
35
|
const rawProjectEnvironment = await this.httpClient.request('projectenvironments/', projectEnvironment, 'POST');
|
|
39
36
|
// TODO: parse result
|
|
40
|
-
const savedProjectEnvironment = rawProjectEnvironment;
|
|
37
|
+
const savedProjectEnvironment = ProjectEnvironment_1.ProjectEnvironment.parse(rawProjectEnvironment);
|
|
41
38
|
return savedProjectEnvironment;
|
|
42
39
|
}
|
|
43
40
|
catch (error) {
|
|
@@ -3,20 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TeamsEndpoint = void 0;
|
|
4
4
|
const Endpoint_1 = require("./Endpoint");
|
|
5
5
|
const Team_1 = require("../Model/Team/Team");
|
|
6
|
-
const State_1 = require("../Model/State");
|
|
7
6
|
class TeamsEndpoint extends Endpoint_1.Endpoint {
|
|
8
7
|
async getAll() {
|
|
9
8
|
try {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let team = new Team_1.Team();
|
|
14
|
-
team.id = rawTeam.id;
|
|
15
|
-
team.name = rawTeam.name;
|
|
16
|
-
team.state = State_1.State.fromString(rawTeam.state);
|
|
17
|
-
teams.push(team);
|
|
18
|
-
}
|
|
19
|
-
return teams;
|
|
9
|
+
const result = await this.request('/teams');
|
|
10
|
+
result.setData(this.parseCollection(result, Team_1.Team.parse));
|
|
11
|
+
return result.getData();
|
|
20
12
|
}
|
|
21
13
|
catch (e) {
|
|
22
14
|
if (this.httpClient.isDebugEnabled()) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.8.
|
|
1
|
+
export declare const VERSION = "1.8.8";
|
package/dist/version.js
CHANGED