attlaz-client 1.8.17 → 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.
|
@@ -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
|
+
}
|
|
@@ -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.
|
|
1
|
+
export declare const VERSION = "1.8.18";
|
package/dist/version.js
CHANGED