attlaz-client 1.9.2 → 1.9.3

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,8 +4,7 @@ export declare class Project implements StateAware {
4
4
  id: string;
5
5
  key: string;
6
6
  name: string;
7
- teamId: string;
8
- default: boolean;
7
+ workspaceId: string;
9
8
  defaultEnvironmentId: string;
10
9
  state: State;
11
10
  constructor(id: string, key: string, name: string);
@@ -2,10 +2,8 @@
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");
6
5
  class Project {
7
6
  constructor(id, key, name) {
8
- this.default = false;
9
7
  this.state = State_1.State.Active;
10
8
  this.id = id;
11
9
  this.key = key;
@@ -13,16 +11,11 @@ class Project {
13
11
  }
14
12
  static parse(rawProject) {
15
13
  let project = new Project(rawProject.id, rawProject.key, rawProject.name);
16
- if (rawProject.team !== undefined) {
17
- project.teamId = rawProject.team;
18
- }
19
- else {
20
- project.teamId = rawProject.teamId;
21
- }
22
- if (rawProject.default !== null && rawProject.default !== undefined) {
23
- project.default = Utils_1.Utils.isTrue(rawProject.default);
24
- }
25
- project.defaultEnvironmentId = rawProject.defaultEnvironmentId;
14
+ project.workspaceId = rawProject.workspace;
15
+ // if (rawProject.default !== null && rawProject.default !== undefined) {
16
+ // project.default = Utils.isTrue(rawProject.default);
17
+ // }
18
+ project.defaultEnvironmentId = rawProject.default_environment;
26
19
  project.state = State_1.State.fromString(rawProject.state);
27
20
  return project;
28
21
  }
@@ -2,7 +2,7 @@ import { DataValueCollection } from '../DataValueCollection';
2
2
  export declare class UserAction {
3
3
  id: string;
4
4
  userId: string;
5
- teamId: string;
5
+ workspaceId: string;
6
6
  action: string;
7
7
  resourceId: string;
8
8
  resourceType: string;
@@ -4,5 +4,5 @@ export declare class Workspace implements StateAware {
4
4
  id: string;
5
5
  name: string;
6
6
  state: State;
7
- static parse(rawTeam: any): Workspace;
7
+ static parse(raw: any): Workspace;
8
8
  }
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Workspace = void 0;
4
4
  const State_1 = require("../State");
5
5
  class Workspace {
6
- static parse(rawTeam) {
7
- const team = new Workspace();
8
- team.id = rawTeam.id;
9
- team.name = rawTeam.name;
10
- team.state = State_1.State.fromString(rawTeam.state);
11
- return team;
6
+ static parse(raw) {
7
+ const workspace = new Workspace();
8
+ workspace.id = raw.id;
9
+ workspace.name = raw.name;
10
+ workspace.state = State_1.State.fromString(raw.state);
11
+ return workspace;
12
12
  }
13
13
  }
14
14
  exports.Workspace = Workspace;
@@ -3,7 +3,7 @@ import { WorkspaceMemberInviteState } from './WorkspaceMemberInviteState';
3
3
  export declare class WorkspaceMemberInvite {
4
4
  id: string;
5
5
  code: string;
6
- teamId: string;
6
+ workspaceId: string;
7
7
  email: string;
8
8
  role: WorkspaceMemberRole;
9
9
  date: Date;
@@ -2,9 +2,9 @@ import { WorkspaceMemberInviteState } from './WorkspaceMemberInviteState';
2
2
  export declare class WorkspaceMemberInvite2 {
3
3
  code: string;
4
4
  email: string | null;
5
- inviter_name: string | null;
6
- inviter_email: string | null;
7
- team_name: string | null;
5
+ inviterName: string | null;
6
+ inviterEmail: string | null;
7
+ workspaceName: string | null;
8
8
  state: WorkspaceMemberInviteState;
9
9
  static parse(rawInvite: any): WorkspaceMemberInvite2;
10
10
  }
@@ -7,9 +7,9 @@ class WorkspaceMemberInvite2 {
7
7
  return {
8
8
  code: rawInvite.code,
9
9
  email: rawInvite.email,
10
- inviter_name: rawInvite.inviter_name,
11
- inviter_email: rawInvite.inviter_email,
12
- team_name: rawInvite.team_name,
10
+ inviterName: rawInvite.inviter_name,
11
+ inviterEmail: rawInvite.inviter_email,
12
+ workspaceName: rawInvite.workspace_name,
13
13
  state: WorkspaceMemberInviteState_1.WorkspaceMemberInviteState.fromString(rawInvite.state)
14
14
  };
15
15
  }
@@ -15,7 +15,7 @@ var WorkspaceMemberInviteState;
15
15
  function fromString(input) {
16
16
  const result = Utils_1.Utils.parseEnum(input, WorkspaceMemberInviteState);
17
17
  if (result === null) {
18
- throw new Error('Unable to parse WorkspaceMemberInviteState from string: Unknown TeamMemberInviteState "' + input + '"');
18
+ throw new Error('Unable to parse WorkspaceMemberInviteState from string: Unknown WorkspaceMemberInviteState "' + input + '"');
19
19
  }
20
20
  return result;
21
21
  }
@@ -29,7 +29,7 @@ class ChannelEndpoint extends Endpoint_1.Endpoint {
29
29
  }
30
30
  catch (ex) {
31
31
  if (this.httpClient.isDebugEnabled()) {
32
- console.error('Failed to load channels for team "' + workspaceId + '": ', ex);
32
+ console.error('Failed to load channels for workspace "' + workspaceId + '": ', ex);
33
33
  }
34
34
  throw ex;
35
35
  }
@@ -1,5 +1,6 @@
1
1
  import { Endpoint } from './Endpoint';
2
2
  import { HealthAlert } from '../Model/HealthAlert/HealthAlert';
3
+ import { CollectionResult } from '../Model/Result/CollectionResult';
3
4
  export declare class HealthAlertEndpoint extends Endpoint {
4
- getLatestByProjectEnvironment(projectEnvironmentId: string): Promise<HealthAlert[]>;
5
+ getLatestByProjectEnvironment(projectEnvironmentId: string): Promise<CollectionResult<HealthAlert>>;
5
6
  }
@@ -7,18 +7,8 @@ class HealthAlertEndpoint extends Endpoint_1.Endpoint {
7
7
  async getLatestByProjectEnvironment(projectEnvironmentId) {
8
8
  try {
9
9
  let url = '/projectenvironments/' + projectEnvironmentId + '/health';
10
- const result = await this.request(url);
11
- // if (Utils.isNullOrUndefined(result)) {
12
- // return null;
13
- // }
14
- let alerts = [];
15
- const resultData = result.getData();
16
- if (resultData !== null) {
17
- for (let raw of resultData) {
18
- alerts.push(HealthAlert_1.HealthAlert.parse(raw));
19
- }
20
- }
21
- return alerts;
10
+ const result = await this.requestCollection(url, null, HealthAlert_1.HealthAlert.parse);
11
+ return result;
22
12
  }
23
13
  catch (error) {
24
14
  if (this.httpClient.isDebugEnabled()) {
@@ -3,7 +3,7 @@ import { Project } from '../Model/Project/Project';
3
3
  import { CollectionResult } from '../Model/Result/CollectionResult';
4
4
  export declare class ProjectEndpoint extends Endpoint {
5
5
  getAll(): Promise<CollectionResult<Project>>;
6
- getByTeam(teamId: string): Promise<CollectionResult<Project>>;
6
+ getByWorkspace(workspaceId: string): Promise<CollectionResult<Project>>;
7
7
  getById(projectId: string): Promise<Project | null>;
8
8
  save(project: Project): Promise<Project>;
9
9
  }
@@ -18,9 +18,9 @@ class ProjectEndpoint extends Endpoint_1.Endpoint {
18
18
  throw e;
19
19
  }
20
20
  }
21
- async getByTeam(teamId) {
21
+ async getByWorkspace(workspaceId) {
22
22
  try {
23
- const result = await this.requestCollection('teams/' + teamId + '/projects', null, Project_1.Project.parse);
23
+ const result = await this.requestCollection('workspaces/' + workspaceId + '/projects', null, Project_1.Project.parse);
24
24
  return result;
25
25
  }
26
26
  catch (e) {
@@ -7,8 +7,8 @@ import { WorkspaceMemberInvite2 } from '../Model/Workspace/WorkspaceMemberInvite
7
7
  import { CollectionResult } from '../Model/Result/CollectionResult';
8
8
  export declare class WorkspaceMemberEndpoint extends Endpoint {
9
9
  getByWorkspace(workspaceId: string): Promise<CollectionResult<WorkspaceMember>>;
10
- invite(teamId: string, invites: WorkspaceMemberInvite[]): Promise<DataResult<void>>;
10
+ invite(workspaceId: string, invites: WorkspaceMemberInvite[]): Promise<DataResult<void>>;
11
11
  getWorkspaceInviteByCode(inviteCode: string): Promise<WorkspaceMemberInvite2 | null>;
12
- getTeamMemberEvents(teamId: string, memberId: string): Promise<CollectionResult<UserAction>>;
12
+ getWorkspaceMemberEvents(workspaceId: string, memberId: string): Promise<CollectionResult<UserAction>>;
13
13
  private static parse;
14
14
  }
@@ -34,8 +34,8 @@ class WorkspaceMemberEndpoint extends Endpoint_1.Endpoint {
34
34
  const result = await this.requestCollection(cmd, null, parser);
35
35
  return result;
36
36
  }
37
- async invite(teamId, invites) {
38
- let cmd = '/workspaces/' + teamId + '/invites';
37
+ async invite(workspaceId, invites) {
38
+ let cmd = '/workspaces/' + workspaceId + '/invites';
39
39
  const rawInvites = [];
40
40
  for (let invite of invites) {
41
41
  rawInvites.push({ email: invite.email, role: invite.role.toString() });
@@ -49,7 +49,7 @@ class WorkspaceMemberEndpoint extends Endpoint_1.Endpoint {
49
49
  }
50
50
  catch (ex) {
51
51
  if (this.httpClient.isDebugEnabled()) {
52
- console.error('Failed to invite members to team "' + teamId + '": ', ex);
52
+ console.error('Failed to invite members to workspace "' + workspaceId + '": ', ex);
53
53
  }
54
54
  throw ex;
55
55
  }
@@ -62,9 +62,9 @@ class WorkspaceMemberEndpoint extends Endpoint_1.Endpoint {
62
62
  }
63
63
  return null;
64
64
  }
65
- async getTeamMemberEvents(teamId, memberId) {
65
+ async getWorkspaceMemberEvents(workspaceId, memberId) {
66
66
  try {
67
- const url = '/teams/' + teamId + '/members/' + memberId + '/events';
67
+ const url = '/workspaces/' + workspaceId + '/members/' + memberId + '/events';
68
68
  const result = await this.requestCollection(url, null, WorkspaceMemberEndpoint.parse, 'GET');
69
69
  return result;
70
70
  }
@@ -79,7 +79,7 @@ class WorkspaceMemberEndpoint extends Endpoint_1.Endpoint {
79
79
  const userAction = new UserAction_1.UserAction();
80
80
  userAction.id = rawUserEvent.id;
81
81
  userAction.userId = rawUserEvent.user;
82
- userAction.teamId = rawUserEvent.team;
82
+ userAction.workspaceId = rawUserEvent.workspace;
83
83
  userAction.action = rawUserEvent.action;
84
84
  userAction.resourceId = rawUserEvent.resource_id;
85
85
  userAction.resourceType = rawUserEvent.resource_type;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.9.2";
1
+ export declare const VERSION = "1.9.3";
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.9.2";
4
+ exports.VERSION = "1.9.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",