attlaz-client 1.7.10 → 1.8.0

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.
@@ -8,5 +8,7 @@ export declare class Task implements StateAware {
8
8
  project: string;
9
9
  direct: boolean;
10
10
  state: State;
11
+ /** The maximum number of tasks to run at any time (0 = no limit) **/
12
+ parallelLimit: number;
11
13
  static parse(rawTask: any): Task;
12
14
  }
@@ -2,10 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Task = void 0;
4
4
  const State_1 = require("./State");
5
+ const Utils_1 = require("../Utils");
5
6
  class Task {
6
7
  constructor() {
7
8
  this.direct = false;
8
9
  this.state = State_1.State.Active;
10
+ /** The maximum number of tasks to run at any time (0 = no limit) **/
11
+ this.parallelLimit = 0;
9
12
  }
10
13
  static parse(rawTask) {
11
14
  const task = new Task();
@@ -16,6 +19,7 @@ class Task {
16
19
  task.description = rawTask.description;
17
20
  task.direct = rawTask.direct;
18
21
  task.state = State_1.State.fromString(rawTask.state);
22
+ task.parallelLimit = Utils_1.Utils.parseInt(rawTask.parallel_limit);
19
23
  return task;
20
24
  }
21
25
  }
@@ -5,7 +5,7 @@ import { TaskExecutionHistory } from '../Model/TaskExecutionHistory';
5
5
  import { TaskExecutionStatus } from '../Model/TaskExecutionStatus';
6
6
  export declare class TaskExecutionEndpoint extends Endpoint {
7
7
  getTaskExecutions(taskId: string): Promise<TaskExecution[]>;
8
- getTaskExecutionSummaries(taskId: string, from?: Date | null, to?: Date | null, projectEnvironmentId?: string | null): Promise<TaskExecutionSummary[]>;
8
+ getTaskExecutionSummaries(taskId: string, from?: Date | null, to?: Date | null, taskExecutionStatuses?: TaskExecutionStatus[] | null, projectEnvironmentId?: string | null): Promise<TaskExecutionSummary[]>;
9
9
  getTaskExecutionSummary(taskExecutionId: string): Promise<TaskExecutionSummary | null>;
10
10
  getTaskExecutionHistory(taskExecutionId: string): Promise<TaskExecutionHistory[]>;
11
11
  updateTaskExecution(taskExecutionId: string, status: TaskExecutionStatus, time?: Date | null): Promise<TaskExecution>;
@@ -25,7 +25,7 @@ class TaskExecutionEndpoint extends Endpoint_1.Endpoint {
25
25
  });
26
26
  });
27
27
  }
28
- async getTaskExecutionSummaries(taskId, from = null, to = null, projectEnvironmentId = null) {
28
+ async getTaskExecutionSummaries(taskId, from = null, to = null, taskExecutionStatuses = null, projectEnvironmentId = null) {
29
29
  try {
30
30
  let params = null;
31
31
  if (from !== null && from !== undefined) {
@@ -46,6 +46,12 @@ class TaskExecutionEndpoint extends Endpoint_1.Endpoint {
46
46
  }
47
47
  params.environment = projectEnvironmentId;
48
48
  }
49
+ if (taskExecutionStatuses !== null && taskExecutionStatuses.length > 0) {
50
+ if (params === null || params === undefined) {
51
+ params = {};
52
+ }
53
+ params.statuses = taskExecutionStatuses.length;
54
+ }
49
55
  const rawTaskExecutions = await this.httpClient.request('/tasks/' + taskId + '/executionsummaries', params);
50
56
  let taskExecutions = [];
51
57
  for (let rawTaskExecution of rawTaskExecutions) {
package/dist/Utils.d.ts CHANGED
@@ -3,6 +3,7 @@ export declare class Utils {
3
3
  static isTrue(input: string | number | boolean | null | undefined): boolean;
4
4
  static parseRawDate(input: Date): Date;
5
5
  static parseEnum<T>(input: string, Enum: any): T | null;
6
+ static parseInt(input: string | number | boolean): number;
6
7
  static base64encode(input: string): string;
7
8
  static base64decode(encodedString: string): string;
8
9
  static isIterable(variable: any): boolean;
package/dist/Utils.js CHANGED
@@ -38,6 +38,9 @@ class Utils {
38
38
  }
39
39
  return null;
40
40
  }
41
+ static parseInt(input) {
42
+ return parseInt(input.toString(), undefined);
43
+ }
41
44
  static base64encode(input) {
42
45
  if (input === null || input === undefined || input === '') {
43
46
  return '';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.7.10";
1
+ export declare const VERSION = "1.8.0";
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.7.10";
4
+ exports.VERSION = "1.8.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.7.10",
3
+ "version": "1.8.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",