attlaz-client 1.8.6 → 1.8.9
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/Project/Project.d.ts +4 -1
- package/dist/Model/Project/Project.js +8 -2
- package/dist/Model/Project/ProjectEnvironment.d.ts +2 -1
- package/dist/Model/Project/ProjectEnvironment.js +13 -3
- package/dist/Model/Result/DataResult.js +17 -8
- package/dist/Model/Task.d.ts +2 -2
- package/dist/Model/Task.js +13 -3
- package/dist/Model/TaskExecution.d.ts +4 -4
- package/dist/Model/TaskExecution.js +15 -4
- 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/TaskEndpoint.js +1 -1
- 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
|
@@ -4,11 +4,14 @@ export declare class Project implements StateAware {
|
|
|
4
4
|
id: string;
|
|
5
5
|
key: string;
|
|
6
6
|
name: string;
|
|
7
|
-
|
|
7
|
+
teamId: string;
|
|
8
8
|
default: boolean;
|
|
9
9
|
defaultEnvironmentId: string;
|
|
10
|
+
/** @deprecated **/
|
|
10
11
|
source_account: number;
|
|
12
|
+
/** @deprecated **/
|
|
11
13
|
source_repository: string;
|
|
14
|
+
/** @deprecated **/
|
|
12
15
|
language: number;
|
|
13
16
|
state: State;
|
|
14
17
|
constructor(id: string, key: string, name: string);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Project = void 0;
|
|
4
4
|
const State_1 = require("../State");
|
|
5
|
+
const Utils_1 = require("../../Utils");
|
|
5
6
|
class Project {
|
|
6
7
|
constructor(id, key, name) {
|
|
7
8
|
this.default = false;
|
|
@@ -12,9 +13,14 @@ class Project {
|
|
|
12
13
|
}
|
|
13
14
|
static parse(rawProject) {
|
|
14
15
|
let project = new Project(rawProject.id, rawProject.key, rawProject.name);
|
|
15
|
-
|
|
16
|
+
if (rawProject.team !== undefined) {
|
|
17
|
+
project.teamId = rawProject.team;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
project.teamId = rawProject.teamId;
|
|
21
|
+
}
|
|
16
22
|
if (rawProject.default !== null && rawProject.default !== undefined) {
|
|
17
|
-
project.default = (rawProject.default
|
|
23
|
+
project.default = Utils_1.Utils.isTrue(rawProject.default);
|
|
18
24
|
}
|
|
19
25
|
project.defaultEnvironmentId = rawProject.defaultEnvironmentId;
|
|
20
26
|
project.source_account = rawProject.source_account;
|
|
@@ -5,8 +5,9 @@ export declare class ProjectEnvironment implements StateAware {
|
|
|
5
5
|
key: string;
|
|
6
6
|
projectId: string;
|
|
7
7
|
name: string;
|
|
8
|
+
/** @deprecated **/
|
|
8
9
|
sourceBranch: string;
|
|
9
|
-
|
|
10
|
+
parentId: string | null;
|
|
10
11
|
isLocal: boolean;
|
|
11
12
|
state: State;
|
|
12
13
|
static parse(rawProjectEnvironment: any): ProjectEnvironment;
|
|
@@ -5,7 +5,7 @@ const State_1 = require("../State");
|
|
|
5
5
|
const Utils_1 = require("../../Utils");
|
|
6
6
|
class ProjectEnvironment {
|
|
7
7
|
constructor() {
|
|
8
|
-
this.
|
|
8
|
+
this.parentId = null;
|
|
9
9
|
this.isLocal = false;
|
|
10
10
|
this.state = State_1.State.Active;
|
|
11
11
|
}
|
|
@@ -13,10 +13,20 @@ class ProjectEnvironment {
|
|
|
13
13
|
const projectEnvironment = new ProjectEnvironment();
|
|
14
14
|
projectEnvironment.id = rawProjectEnvironment.id;
|
|
15
15
|
projectEnvironment.key = rawProjectEnvironment.key;
|
|
16
|
-
|
|
16
|
+
if (rawProjectEnvironment.project !== undefined) {
|
|
17
|
+
projectEnvironment.projectId = rawProjectEnvironment.project;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
projectEnvironment.projectId = rawProjectEnvironment.projectId;
|
|
21
|
+
}
|
|
17
22
|
projectEnvironment.name = rawProjectEnvironment.name;
|
|
18
23
|
projectEnvironment.sourceBranch = rawProjectEnvironment.source_branch;
|
|
19
|
-
|
|
24
|
+
if (rawProjectEnvironment.parent !== undefined) {
|
|
25
|
+
projectEnvironment.parentId = rawProjectEnvironment.parent;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
projectEnvironment.parentId = rawProjectEnvironment.parentId;
|
|
29
|
+
}
|
|
20
30
|
projectEnvironment.isLocal = Utils_1.Utils.isTrue(rawProjectEnvironment.is_local);
|
|
21
31
|
projectEnvironment.state = State_1.State.fromString(rawProjectEnvironment.state);
|
|
22
32
|
return projectEnvironment;
|
|
@@ -11,14 +11,17 @@ class DataResult {
|
|
|
11
11
|
if (raw === null || raw === undefined) {
|
|
12
12
|
throw new Error('Unable to parse DataResult: result: empty');
|
|
13
13
|
}
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
if (raw.hasOwnProperty('errors')) {
|
|
15
|
+
if (raw.errors === undefined || raw.errors === null) {
|
|
16
|
+
console.error('Unable to parse DataResult: errors defined but invalid value', raw);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const errors = raw.errors;
|
|
20
|
+
for (const error of errors) {
|
|
21
|
+
result.addError(error);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
22
25
|
}
|
|
23
26
|
else {
|
|
24
27
|
const errors = raw.errors;
|
|
@@ -26,6 +29,12 @@ class DataResult {
|
|
|
26
29
|
result.addError(error);
|
|
27
30
|
}
|
|
28
31
|
}
|
|
32
|
+
if (!raw.hasOwnProperty('data') || raw.data === undefined) {
|
|
33
|
+
throw new Error('Unable to parse DataResult: data is not defined');
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
result.setData(raw.data);
|
|
37
|
+
}
|
|
29
38
|
return result;
|
|
30
39
|
}
|
|
31
40
|
setData(data) {
|
package/dist/Model/Task.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare class Task implements StateAware {
|
|
|
5
5
|
key: string;
|
|
6
6
|
name: string;
|
|
7
7
|
description: string;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
projectId: string;
|
|
9
|
+
isDirect: boolean;
|
|
10
10
|
state: State;
|
|
11
11
|
/** The maximum number of tasks to run at any time (0 = no limit) **/
|
|
12
12
|
parallelLimit: number;
|
package/dist/Model/Task.js
CHANGED
|
@@ -5,7 +5,7 @@ const State_1 = require("./State");
|
|
|
5
5
|
const Utils_1 = require("../Utils");
|
|
6
6
|
class Task {
|
|
7
7
|
constructor() {
|
|
8
|
-
this.
|
|
8
|
+
this.isDirect = false;
|
|
9
9
|
this.state = State_1.State.Active;
|
|
10
10
|
/** The maximum number of tasks to run at any time (0 = no limit) **/
|
|
11
11
|
this.parallelLimit = 0;
|
|
@@ -14,10 +14,20 @@ class Task {
|
|
|
14
14
|
const task = new Task();
|
|
15
15
|
task.id = rawTask.id;
|
|
16
16
|
task.key = rawTask.key;
|
|
17
|
-
|
|
17
|
+
if (rawTask.project !== undefined) {
|
|
18
|
+
task.projectId = rawTask.project;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
task.projectId = rawTask.projectId;
|
|
22
|
+
}
|
|
18
23
|
task.name = rawTask.name;
|
|
19
24
|
task.description = rawTask.description;
|
|
20
|
-
|
|
25
|
+
if (rawTask.direct !== undefined) {
|
|
26
|
+
task.isDirect = Utils_1.Utils.isTrue(rawTask.direct);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
task.isDirect = rawTask.isDirect;
|
|
30
|
+
}
|
|
21
31
|
task.state = State_1.State.fromString(rawTask.state);
|
|
22
32
|
task.parallelLimit = 0;
|
|
23
33
|
if (rawTask.parallelLimit !== null && rawTask.parallelLimit !== undefined) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { LogLevel } from './Log/LogLevel';
|
|
2
2
|
export declare class TaskExecution {
|
|
3
3
|
id: string;
|
|
4
|
-
code: string;
|
|
5
|
-
name: string;
|
|
6
4
|
taskId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
parentId: string | null;
|
|
7
7
|
arguments: any;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
projectEnvironmentId: string;
|
|
9
|
+
triggerId: string;
|
|
10
10
|
deployId: number;
|
|
11
11
|
logLevelCount: Map<LogLevel, number>;
|
|
12
12
|
logsPurged: boolean;
|
|
@@ -3,22 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TaskExecution = void 0;
|
|
4
4
|
class TaskExecution {
|
|
5
5
|
constructor() {
|
|
6
|
+
this.parentId = null;
|
|
6
7
|
this.logsPurged = false;
|
|
7
8
|
}
|
|
8
9
|
static parse(rawTaskExecution) {
|
|
9
10
|
let taskExecution = new TaskExecution();
|
|
10
11
|
taskExecution.id = rawTaskExecution.id;
|
|
11
|
-
taskExecution.code = rawTaskExecution.code;
|
|
12
|
+
// taskExecution.code = rawTaskExecution.code;
|
|
12
13
|
taskExecution.name = rawTaskExecution.name;
|
|
13
|
-
if (rawTaskExecution.task
|
|
14
|
+
if (rawTaskExecution.task !== undefined) {
|
|
14
15
|
taskExecution.taskId = rawTaskExecution.task;
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
18
|
taskExecution.taskId = rawTaskExecution.taskId;
|
|
18
19
|
}
|
|
19
20
|
taskExecution.arguments = rawTaskExecution.arguments;
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
if (rawTaskExecution.projectEnvironment !== undefined) {
|
|
22
|
+
taskExecution.projectEnvironmentId = rawTaskExecution.projectEnvironment;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
taskExecution.projectEnvironmentId = rawTaskExecution.projectEnvironmentId;
|
|
26
|
+
}
|
|
27
|
+
if (rawTaskExecution.trigger !== undefined) {
|
|
28
|
+
taskExecution.triggerId = rawTaskExecution.trigger;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
taskExecution.triggerId = rawTaskExecution.triggerId;
|
|
32
|
+
}
|
|
22
33
|
taskExecution.deployId = rawTaskExecution.deployId;
|
|
23
34
|
taskExecution.logLevelCount = rawTaskExecution.logLevelCount;
|
|
24
35
|
taskExecution.logsPurged = rawTaskExecution.logsPurged;
|
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) {
|
|
@@ -78,7 +78,7 @@ class TaskEndpoint extends Endpoint_1.Endpoint {
|
|
|
78
78
|
}
|
|
79
79
|
save(task) {
|
|
80
80
|
return new Promise((resolve, reject) => {
|
|
81
|
-
let url = '/projects/' + task.
|
|
81
|
+
let url = '/projects/' + task.projectId + '/tasks';
|
|
82
82
|
this.httpClient.request(url, task, 'POST').then((result) => {
|
|
83
83
|
resolve(Task_1.Task.parse(result));
|
|
84
84
|
}).catch((reason) => {
|
|
@@ -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.9";
|
package/dist/version.js
CHANGED