attlaz-client 1.8.16 → 1.8.18

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.
@@ -10,6 +10,7 @@ export declare class HttpClient {
10
10
  static HTTP_INTERNAL_SERVER_ERROR: number;
11
11
  static HTTP_BAD_GATEWAY: number;
12
12
  static HTTP_UNAVAILABLE: number;
13
+ static HTTP_TIMEOUT: number;
13
14
  static request2(request: HttpClientRequest): Promise<HttpClientResponse>;
14
15
  private static getContentType;
15
16
  private static formatContentType;
@@ -88,3 +88,4 @@ HttpClient.HTTP_UNPROCESSABLE_ENTITY = 422;
88
88
  HttpClient.HTTP_INTERNAL_SERVER_ERROR = 500;
89
89
  HttpClient.HTTP_BAD_GATEWAY = 502;
90
90
  HttpClient.HTTP_UNAVAILABLE = 503;
91
+ HttpClient.HTTP_TIMEOUT = 504;
@@ -80,6 +80,9 @@ class ClientError {
80
80
  case 503:
81
81
  return new ClientError('Service not available', HttpClient_1.HttpClient.HTTP_UNAVAILABLE);
82
82
  break;
83
+ case 504:
84
+ return new ClientError('Gateway Time-out', HttpClient_1.HttpClient.HTTP_TIMEOUT);
85
+ break;
83
86
  default:
84
87
  console.error('Unknown status code "' + statusCode + '"', { code: statusCode, text: statusText });
85
88
  return new ClientError('Status code ' + statusCode + ': ' + statusText, statusCode);
@@ -20,7 +20,12 @@ class ProjectEnvironment {
20
20
  projectEnvironment.projectId = rawProjectEnvironment.projectId;
21
21
  }
22
22
  projectEnvironment.name = rawProjectEnvironment.name;
23
- projectEnvironment.sourceBranch = rawProjectEnvironment.source_branch;
23
+ if (rawProjectEnvironment.sourceBranch !== undefined) {
24
+ projectEnvironment.sourceBranch = rawProjectEnvironment.sourceBranch;
25
+ }
26
+ else {
27
+ projectEnvironment.sourceBranch = rawProjectEnvironment.source_branch;
28
+ }
24
29
  if (rawProjectEnvironment.parent !== undefined) {
25
30
  projectEnvironment.parentId = rawProjectEnvironment.parent;
26
31
  }
@@ -0,0 +1,14 @@
1
+ import { DataValueCollection } from '../DataValueCollection';
2
+ export declare class UserAction {
3
+ id: string;
4
+ userId: string;
5
+ teamId: string;
6
+ action: string;
7
+ resourceId: string;
8
+ resourceType: string;
9
+ description: string;
10
+ ip: string;
11
+ time: Date;
12
+ result: string;
13
+ data: DataValueCollection;
14
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserAction = void 0;
4
+ class UserAction {
5
+ }
6
+ exports.UserAction = UserAction;
@@ -49,12 +49,10 @@ class StorageEndpoint extends Endpoint_1.Endpoint {
49
49
  let cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + poolKey + '/items/' + storageItemKey;
50
50
  try {
51
51
  const result = await this.request(cmd, null, 'GET');
52
- if (result.getData() === null) {
52
+ if (!result.hasData()) {
53
53
  return null;
54
54
  }
55
- else {
56
- return StorageItem_1.StorageItem.parse(result.getData());
57
- }
55
+ return StorageItem_1.StorageItem.parse(result.getData());
58
56
  }
59
57
  catch (ex) {
60
58
  if (this.httpClient.isDebugEnabled()) {
@@ -3,8 +3,11 @@ import { TeamMemberInvite2 } from '../Model/Team/TeamMemberInvite2';
3
3
  import { TeamMember } from '../Model/Team/TeamMember';
4
4
  import { TeamMemberInvite } from '../Model/Team/TeamMemberInvite';
5
5
  import { DataResult } from '../Model/Result/DataResult';
6
+ import { UserAction } from '../Model/User/UserAction';
6
7
  export declare class TeamMemberEndpoint extends Endpoint {
7
8
  getByTeam(teamId: string): Promise<TeamMember[]>;
8
9
  invite(teamId: string, invites: TeamMemberInvite[]): Promise<DataResult<void>>;
9
10
  getTeamInviteByCode(inviteCode: string): Promise<TeamMemberInvite2 | null>;
11
+ getTeamMemberEvents(teamId: string, memberId: string): Promise<DataResult<UserAction[]>>;
12
+ private static parse;
10
13
  }
@@ -7,6 +7,8 @@ const Utils_1 = require("../Utils");
7
7
  const TeamMemberRole_1 = require("../Model/Team/TeamMemberRole");
8
8
  const TeamMemberInviteState_1 = require("../Model/Team/TeamMemberInviteState");
9
9
  const State_1 = require("../Model/State");
10
+ const UserAction_1 = require("../Model/User/UserAction");
11
+ const DataValueCollection_1 = require("../Model/DataValueCollection");
10
12
  class TeamMemberEndpoint extends Endpoint_1.Endpoint {
11
13
  async getByTeam(teamId) {
12
14
  let cmd = '/teams/' + teamId + '/members';
@@ -68,5 +70,34 @@ class TeamMemberEndpoint extends Endpoint_1.Endpoint {
68
70
  }
69
71
  return null;
70
72
  }
73
+ async getTeamMemberEvents(teamId, memberId) {
74
+ try {
75
+ const url = '/teams/' + teamId + '/members/' + memberId + '/events';
76
+ const result = await this.request(url, null, 'GET');
77
+ result.setData(this.parseCollection(result, TeamMemberEndpoint.parse));
78
+ return result;
79
+ }
80
+ catch (error) {
81
+ if (this.httpClient.isDebugEnabled()) {
82
+ console.error('Failed to load adapter configuration: ', error);
83
+ }
84
+ throw error;
85
+ }
86
+ }
87
+ static parse(rawUserEvent) {
88
+ const userAction = new UserAction_1.UserAction();
89
+ userAction.id = rawUserEvent.id;
90
+ userAction.userId = rawUserEvent.user;
91
+ userAction.teamId = rawUserEvent.team;
92
+ userAction.action = rawUserEvent.action;
93
+ userAction.resourceId = rawUserEvent.resource_id;
94
+ userAction.resourceType = rawUserEvent.resource_type;
95
+ userAction.description = rawUserEvent.description;
96
+ userAction.ip = rawUserEvent.ip;
97
+ userAction.time = new Date(rawUserEvent.time);
98
+ userAction.result = rawUserEvent.result;
99
+ userAction.data = DataValueCollection_1.DataValueCollection.fromObject(rawUserEvent.data);
100
+ return userAction;
101
+ }
71
102
  }
72
103
  exports.TeamMemberEndpoint = TeamMemberEndpoint;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.8.16";
1
+ export declare const VERSION = "1.8.18";
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.16";
4
+ exports.VERSION = "1.8.18";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.8.16",
3
+ "version": "1.8.18",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",