attlaz-client 1.8.4 → 1.8.7

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.
@@ -4,11 +4,14 @@ export declare class Project implements StateAware {
4
4
  id: string;
5
5
  key: string;
6
6
  name: string;
7
- team: string;
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
- project.team = rawProject.team;
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.toString() === '1');
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
- parent: string | null;
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.parent = null;
8
+ this.parentId = null;
9
9
  this.isLocal = false;
10
10
  this.state = State_1.State.Active;
11
11
  }
@@ -16,7 +16,12 @@ class ProjectEnvironment {
16
16
  projectEnvironment.projectId = rawProjectEnvironment.project;
17
17
  projectEnvironment.name = rawProjectEnvironment.name;
18
18
  projectEnvironment.sourceBranch = rawProjectEnvironment.source_branch;
19
- projectEnvironment.parent = rawProjectEnvironment.parent;
19
+ if (rawProjectEnvironment.parent !== undefined) {
20
+ projectEnvironment.parentId = rawProjectEnvironment.parent;
21
+ }
22
+ else {
23
+ projectEnvironment.parentId = rawProjectEnvironment.parentId;
24
+ }
20
25
  projectEnvironment.isLocal = Utils_1.Utils.isTrue(rawProjectEnvironment.is_local);
21
26
  projectEnvironment.state = State_1.State.fromString(rawProjectEnvironment.state);
22
27
  return projectEnvironment;
@@ -5,8 +5,8 @@ export declare class Task implements StateAware {
5
5
  key: string;
6
6
  name: string;
7
7
  description: string;
8
- project: string;
9
- direct: boolean;
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;
@@ -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.direct = false;
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
- task.project = rawTask.project;
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
- task.direct = rawTask.direct;
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,11 +1,12 @@
1
1
  import { LogLevel } from './Log/LogLevel';
2
2
  export declare class TaskExecution {
3
3
  id: string;
4
- code: string;
4
+ taskId: string;
5
5
  name: string;
6
+ parentId: string | null;
6
7
  arguments: any;
7
- projectEnvironment: string;
8
- trigger: string;
8
+ projectEnvironmentId: string;
9
+ triggerId: string;
9
10
  deployId: number;
10
11
  logLevelCount: Map<LogLevel, number>;
11
12
  logsPurged: boolean;
@@ -3,16 +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;
14
+ if (rawTaskExecution.task !== undefined) {
15
+ taskExecution.taskId = rawTaskExecution.task;
16
+ }
17
+ else {
18
+ taskExecution.taskId = rawTaskExecution.taskId;
19
+ }
13
20
  taskExecution.arguments = rawTaskExecution.arguments;
14
- taskExecution.projectEnvironment = rawTaskExecution.projectEnvironment;
15
- taskExecution.trigger = rawTaskExecution.trigger;
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
+ }
16
33
  taskExecution.deployId = rawTaskExecution.deployId;
17
34
  taskExecution.logLevelCount = rawTaskExecution.logLevelCount;
18
35
  taskExecution.logsPurged = rawTaskExecution.logsPurged;
@@ -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.project + '/tasks';
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) => {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.8.4";
1
+ export declare const VERSION = "1.8.7";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "1.8.4";
4
+ exports.VERSION = "1.8.7";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.8.4",
3
+ "version": "1.8.7",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",