attlaz-client 1.7.8 → 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.
package/README.md CHANGED
@@ -1,2 +1,27 @@
1
- #To enable strict typescript:
2
- https://github.com/ReactiveX/rxjs/issues/3031
1
+ Attlaz Javascript/Node client
2
+ ==========
3
+
4
+ [Attlaz](https://attlaz.com) is a cloud-based iPaas (Integration Platform as a Service), automation and data management platform.
5
+
6
+ Getting Started
7
+ ---------------
8
+
9
+ Install Attlaz using `yarn`:
10
+
11
+ ```bash
12
+ yarn add attlaz-client
13
+ ```
14
+
15
+ Or npm, if you wish:
16
+
17
+ ```bash
18
+ npm install attlaz-client
19
+ ```
20
+
21
+ Getting Help
22
+ ------------
23
+
24
+ Check the [Attlaz Documentation](https://attlaz.com/docs).
25
+
26
+ Please ask usage and debugging questions on [StackOverflow](http://stackoverflow.com/questions/tagged/attlaz) (use the ["attlaz"](http://stackoverflow.com/questions/ask?tags=attlaz) tag).
27
+ (Please do not ask support questions here on Bitbucket.)
@@ -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>;
@@ -6,6 +6,8 @@ const TaskExecution_1 = require("../Model/TaskExecution");
6
6
  const Utils_1 = require("../Utils");
7
7
  const TaskExecutionSummary_1 = require("../Model/TaskExecutionSummary");
8
8
  const TaskExecutionHistory_1 = require("../Model/TaskExecutionHistory");
9
+ const ClientError_1 = require("../Model/Error/ClientError");
10
+ const HttpClient_1 = require("../Http/HttpClient");
9
11
  class TaskExecutionEndpoint extends Endpoint_1.Endpoint {
10
12
  getTaskExecutions(taskId) {
11
13
  return new Promise((resolve, reject) => {
@@ -23,7 +25,7 @@ class TaskExecutionEndpoint extends Endpoint_1.Endpoint {
23
25
  });
24
26
  });
25
27
  }
26
- async getTaskExecutionSummaries(taskId, from = null, to = null, projectEnvironmentId = null) {
28
+ async getTaskExecutionSummaries(taskId, from = null, to = null, taskExecutionStatuses = null, projectEnvironmentId = null) {
27
29
  try {
28
30
  let params = null;
29
31
  if (from !== null && from !== undefined) {
@@ -44,6 +46,12 @@ class TaskExecutionEndpoint extends Endpoint_1.Endpoint {
44
46
  }
45
47
  params.environment = projectEnvironmentId;
46
48
  }
49
+ if (taskExecutionStatuses !== null && taskExecutionStatuses.length > 0) {
50
+ if (params === null || params === undefined) {
51
+ params = {};
52
+ }
53
+ params.statuses = taskExecutionStatuses.length;
54
+ }
47
55
  const rawTaskExecutions = await this.httpClient.request('/tasks/' + taskId + '/executionsummaries', params);
48
56
  let taskExecutions = [];
49
57
  for (let rawTaskExecution of rawTaskExecutions) {
@@ -66,11 +74,14 @@ class TaskExecutionEndpoint extends Endpoint_1.Endpoint {
66
74
  }
67
75
  return TaskExecutionSummary_1.TaskExecutionSummary.parse(rawTaskExecution);
68
76
  }
69
- catch (e) {
77
+ catch (error) {
78
+ if (error instanceof ClientError_1.ClientError && error.code === HttpClient_1.HttpClient.HTTP_NOTFOUND) {
79
+ return null;
80
+ }
70
81
  if (this.httpClient.isDebugEnabled()) {
71
- console.error('Failed to load tasks executions: ' + e);
82
+ console.error('Failed to load tasks executions: ' + error);
72
83
  }
73
- throw e;
84
+ throw error;
74
85
  }
75
86
  }
76
87
  getTaskExecutionHistory(taskExecutionId) {
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.8";
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.8";
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.8",
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",
@@ -8,6 +8,7 @@
8
8
  "type": "git",
9
9
  "url": "git+https://bitbucket.org/attlaz/javascript-client.git"
10
10
  },
11
+ "homepage": "https://attlaz.com",
11
12
  "files": [
12
13
  "dist/*"
13
14
  ],
@@ -33,13 +34,13 @@
33
34
  "@types/node": "^17.0.21",
34
35
  "jest": "^27.5.1",
35
36
  "rimraf": "^3.0.2",
36
- "ts-jest": "^27.1.3",
37
- "typescript": "^4.6.2",
38
37
  "rollup-plugin-commonjs": "^10.1.0",
39
38
  "rollup-plugin-node-resolve": "^5.2.0",
40
- "rollup-plugin-typescript": "^1.0.1"
39
+ "rollup-plugin-typescript": "^1.0.1",
40
+ "ts-jest": "^27.1.3",
41
+ "typescript": "^4.6.2",
42
+ "dotenv": "^16.0.0"
41
43
  },
42
- "homepage": "https://bitbucket.org/attlaz/javascript-client#readme",
43
44
  "directories": {
44
45
  "test": "test"
45
46
  }