attlaz-client 1.8.8 → 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.
@@ -13,7 +13,12 @@ class ProjectEnvironment {
13
13
  const projectEnvironment = new ProjectEnvironment();
14
14
  projectEnvironment.id = rawProjectEnvironment.id;
15
15
  projectEnvironment.key = rawProjectEnvironment.key;
16
- projectEnvironment.projectId = rawProjectEnvironment.project;
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) {
@@ -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 (!raw.hasOwnProperty('data') || raw.data === undefined) {
15
- throw new Error('Unable to parse DataResult: data is not defined');
16
- }
17
- else {
18
- result.setData(raw.data);
19
- }
20
- if (!raw.hasOwnProperty('errors') || raw.errors === undefined || raw.errors === null) {
21
- console.error('Unable to parse DataResult (ignore for now, not setting any errors): errors is not defined');
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/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.8.8";
1
+ export declare const VERSION = "1.8.9";
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.8";
4
+ exports.VERSION = "1.8.9";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.8.8",
3
+ "version": "1.8.9",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",