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.
- package/dist/Model/Project/Project.d.ts +1 -2
- package/dist/Model/Project/Project.js +5 -12
- package/dist/Model/User/UserAction.d.ts +1 -1
- package/dist/Model/Workspace/Workspace.d.ts +1 -1
- package/dist/Model/Workspace/Workspace.js +6 -6
- package/dist/Model/Workspace/WorkspaceMemberInvite.d.ts +1 -1
- package/dist/Model/Workspace/WorkspaceMemberInvite2.d.ts +3 -3
- package/dist/Model/Workspace/WorkspaceMemberInvite2.js +3 -3
- package/dist/Model/Workspace/WorkspaceMemberInviteState.js +1 -1
- package/dist/Service/ChannelEndpoint.js +1 -1
- package/dist/Service/HealthAlertEndpoint.d.ts +2 -1
- package/dist/Service/HealthAlertEndpoint.js +2 -12
- package/dist/Service/ProjectEndpoint.d.ts +1 -1
- package/dist/Service/ProjectEndpoint.js +2 -2
- package/dist/Service/WorkspaceMemberEndpoint.d.ts +2 -2
- package/dist/Service/WorkspaceMemberEndpoint.js +6 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
}
|
|
@@ -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(
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return
|
|
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;
|
|
@@ -2,9 +2,9 @@ import { WorkspaceMemberInviteState } from './WorkspaceMemberInviteState';
|
|
|
2
2
|
export declare class WorkspaceMemberInvite2 {
|
|
3
3
|
code: string;
|
|
4
4
|
email: string | null;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
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
|
|
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.
|
|
11
|
-
|
|
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
|
-
|
|
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
|
|
21
|
+
async getByWorkspace(workspaceId) {
|
|
22
22
|
try {
|
|
23
|
-
const result = await this.requestCollection('
|
|
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(
|
|
10
|
+
invite(workspaceId: string, invites: WorkspaceMemberInvite[]): Promise<DataResult<void>>;
|
|
11
11
|
getWorkspaceInviteByCode(inviteCode: string): Promise<WorkspaceMemberInvite2 | null>;
|
|
12
|
-
|
|
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(
|
|
38
|
-
let cmd = '/workspaces/' +
|
|
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
|
|
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
|
|
65
|
+
async getWorkspaceMemberEvents(workspaceId, memberId) {
|
|
66
66
|
try {
|
|
67
|
-
const url = '/
|
|
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.
|
|
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.
|
|
1
|
+
export declare const VERSION = "1.9.3";
|
package/dist/version.js
CHANGED