attlaz-client 1.66.0 → 1.68.0
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/User/UserActionFilter.d.ts +10 -0
- package/dist/Model/User/UserActionFilter.js +1 -0
- package/dist/Model/User/UserSummary.d.ts +13 -0
- package/dist/Model/User/UserSummary.js +11 -0
- package/dist/Service/UserActionEndpoint.d.ts +6 -1
- package/dist/Service/UserActionEndpoint.js +31 -1
- package/dist/Service/UserEndpoint.d.ts +8 -0
- package/dist/Service/UserEndpoint.js +23 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filters for the audit-log list. userIds is multi-value; entityId is a single prefixed entity id;
|
|
3
|
+
* timeFrom/timeTo bound the action time (inclusive). All optional.
|
|
4
|
+
*/
|
|
5
|
+
export interface UserActionFilter {
|
|
6
|
+
userIds?: string[];
|
|
7
|
+
entityId?: string;
|
|
8
|
+
timeFrom?: Date;
|
|
9
|
+
timeTo?: Date;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { State } from '../State.js';
|
|
2
|
+
export type UserSummaryType = 'user' | 'system';
|
|
3
|
+
/**
|
|
4
|
+
* Display-safe view of a user (no email/PII). Resolved via UserEndpoint.getSummaries().
|
|
5
|
+
* `state` drives the badge (reuses the global State enum); `null` = not resolvable for this caller.
|
|
6
|
+
* `displayName` is always safe to show ("System", "Removed user", "Unknown user" for the edge cases).
|
|
7
|
+
*/
|
|
8
|
+
export declare class UserSummary {
|
|
9
|
+
id: string;
|
|
10
|
+
type: UserSummaryType;
|
|
11
|
+
state: State | null;
|
|
12
|
+
displayName: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display-safe view of a user (no email/PII). Resolved via UserEndpoint.getSummaries().
|
|
3
|
+
* `state` drives the badge (reuses the global State enum); `null` = not resolvable for this caller.
|
|
4
|
+
* `displayName` is always safe to show ("System", "Removed user", "Unknown user" for the edge cases).
|
|
5
|
+
*/
|
|
6
|
+
export class UserSummary {
|
|
7
|
+
id;
|
|
8
|
+
type;
|
|
9
|
+
state;
|
|
10
|
+
displayName;
|
|
11
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { UserAction } from '../Model/User/UserAction.js';
|
|
2
|
+
import { UserActionFilter } from '../Model/User/UserActionFilter.js';
|
|
3
|
+
import { UserSummary } from '../Model/User/UserSummary.js';
|
|
2
4
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
3
5
|
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
4
6
|
import { Endpoint } from './Endpoint.js';
|
|
@@ -6,6 +8,9 @@ export declare class UserActionEndpoint extends Endpoint {
|
|
|
6
8
|
getWorkspaceMemberActions(workspaceId: string, memberId: string, pagination?: CursorPagination | null): Promise<CollectionResult<UserAction>>;
|
|
7
9
|
getUserActions(userId: string, pagination?: CursorPagination | null): Promise<CollectionResult<UserAction>>;
|
|
8
10
|
getByResource(resourceId: string, resourceType: string, pagination?: CursorPagination | null): Promise<CollectionResult<UserAction>>;
|
|
9
|
-
getAll(pagination?: CursorPagination | null): Promise<CollectionResult<UserAction>>;
|
|
11
|
+
getAll(pagination?: CursorPagination | null, filter?: UserActionFilter | null): Promise<CollectionResult<UserAction>>;
|
|
12
|
+
/** Distinct users that appear in the audit log, resolved to display-safe summaries (for the user filter). */
|
|
13
|
+
getDistinctUsers(): Promise<UserSummary[]>;
|
|
14
|
+
private static parseSummary;
|
|
10
15
|
private static parse;
|
|
11
16
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Utils } from '../Utils.js';
|
|
2
2
|
import { UserAction } from '../Model/User/UserAction.js';
|
|
3
|
+
import { UserSummary } from '../Model/User/UserSummary.js';
|
|
4
|
+
import { State } from '../Model/State.js';
|
|
3
5
|
import { DataValueCollection } from '../Model/DataValueCollection.js';
|
|
4
6
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
5
7
|
import { Endpoint } from './Endpoint.js';
|
|
@@ -43,11 +45,39 @@ export class UserActionEndpoint extends Endpoint {
|
|
|
43
45
|
throw error;
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
|
-
async getAll(pagination = null) {
|
|
48
|
+
async getAll(pagination = null, filter = null) {
|
|
47
49
|
const queryString = new QueryString('/audit-logs');
|
|
48
50
|
queryString.addPagination(pagination);
|
|
51
|
+
if (filter !== null) {
|
|
52
|
+
if (filter.userIds !== undefined && filter.userIds.length > 0) {
|
|
53
|
+
queryString.set('user', filter.userIds);
|
|
54
|
+
}
|
|
55
|
+
if (filter.entityId !== undefined) {
|
|
56
|
+
queryString.set('entity', filter.entityId);
|
|
57
|
+
}
|
|
58
|
+
if (filter.timeFrom !== undefined) {
|
|
59
|
+
queryString.set('time_from', filter.timeFrom.toISOString());
|
|
60
|
+
}
|
|
61
|
+
if (filter.timeTo !== undefined) {
|
|
62
|
+
queryString.set('time_to', filter.timeTo.toISOString());
|
|
63
|
+
}
|
|
64
|
+
}
|
|
49
65
|
return await this.requestCollection(queryString, UserActionEndpoint.parse, null, 'GET');
|
|
50
66
|
}
|
|
67
|
+
/** Distinct users that appear in the audit log, resolved to display-safe summaries (for the user filter). */
|
|
68
|
+
async getDistinctUsers() {
|
|
69
|
+
const queryString = new QueryString('/audit-logs/users');
|
|
70
|
+
const result = await this.requestCollection(queryString, UserActionEndpoint.parseSummary, null, 'GET');
|
|
71
|
+
return result.getData();
|
|
72
|
+
}
|
|
73
|
+
static parseSummary(raw) {
|
|
74
|
+
const summary = new UserSummary();
|
|
75
|
+
summary.id = raw.id;
|
|
76
|
+
summary.type = raw.type;
|
|
77
|
+
summary.state = (raw.state === null || raw.state === undefined) ? null : State.fromString(raw.state);
|
|
78
|
+
summary.displayName = raw.display_name;
|
|
79
|
+
return summary;
|
|
80
|
+
}
|
|
51
81
|
static parse(rawUserEvent) {
|
|
52
82
|
const userAction = new UserAction();
|
|
53
83
|
userAction.id = rawUserEvent.id;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UserAuthProvider } from '../Model/User/UserAuthProvider.js';
|
|
2
2
|
import { User } from '../Model/User/User.js';
|
|
3
|
+
import { UserSummary } from '../Model/User/UserSummary.js';
|
|
3
4
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
5
|
import { Endpoint } from './Endpoint.js';
|
|
5
6
|
import { UserNotificationSession } from '../Model/User/UserNotificationSession.js';
|
|
@@ -7,6 +8,13 @@ import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
|
7
8
|
export declare class UserEndpoint extends Endpoint {
|
|
8
9
|
getUser(): Promise<User | null>;
|
|
9
10
|
removeAuthProvider(providerId: string): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve display-safe summaries for a set of user ids (e.g. to show "Requested by" names in a
|
|
13
|
+
* list). The server applies visibility rules and returns tombstones ("Unknown user" / "Removed
|
|
14
|
+
* user") rather than leaking anything the caller isn't allowed to see.
|
|
15
|
+
*/
|
|
16
|
+
getSummaries(userIds: string[]): Promise<UserSummary[]>;
|
|
17
|
+
private static parseSummary;
|
|
10
18
|
getAuthProviders(): Promise<CollectionResult<UserAuthProvider>>;
|
|
11
19
|
getPermissions(): Promise<CollectionResult<{
|
|
12
20
|
key: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UserAuthProvider } from '../Model/User/UserAuthProvider.js';
|
|
2
2
|
import { User } from '../Model/User/User.js';
|
|
3
|
+
import { UserSummary } from '../Model/User/UserSummary.js';
|
|
3
4
|
import { Endpoint } from './Endpoint.js';
|
|
4
5
|
import { UserNotificationSession } from '../Model/User/UserNotificationSession.js';
|
|
5
6
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
@@ -27,6 +28,28 @@ export class UserEndpoint extends Endpoint {
|
|
|
27
28
|
throw e;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolve display-safe summaries for a set of user ids (e.g. to show "Requested by" names in a
|
|
33
|
+
* list). The server applies visibility rules and returns tombstones ("Unknown user" / "Removed
|
|
34
|
+
* user") rather than leaking anything the caller isn't allowed to see.
|
|
35
|
+
*/
|
|
36
|
+
async getSummaries(userIds) {
|
|
37
|
+
if (userIds.length === 0) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const queryString = new QueryString('/users/summaries');
|
|
41
|
+
queryString.set('id', userIds);
|
|
42
|
+
const result = await this.requestCollection(queryString, UserEndpoint.parseSummary, null, 'GET');
|
|
43
|
+
return result.getData();
|
|
44
|
+
}
|
|
45
|
+
static parseSummary(raw) {
|
|
46
|
+
const summary = new UserSummary();
|
|
47
|
+
summary.id = raw.id;
|
|
48
|
+
summary.type = raw.type;
|
|
49
|
+
summary.state = (raw.state === null || raw.state === undefined) ? null : State.fromString(raw.state);
|
|
50
|
+
summary.displayName = raw.display_name;
|
|
51
|
+
return summary;
|
|
52
|
+
}
|
|
30
53
|
async getAuthProviders() {
|
|
31
54
|
const cmd = '/users/auth/providers';
|
|
32
55
|
const rawAuthProviders = await this.requestCollection(cmd, UserAuthProvider.parse);
|
package/dist/index.d.ts
CHANGED
|
@@ -129,6 +129,9 @@ export { FlowTemplate } from './Model/Flow/FlowTemplate.js';
|
|
|
129
129
|
export { User } from './Model/User/User.js';
|
|
130
130
|
export { UserAuthProvider } from './Model/User/UserAuthProvider.js';
|
|
131
131
|
export { UserAction } from './Model/User/UserAction.js';
|
|
132
|
+
export type { UserActionFilter } from './Model/User/UserActionFilter.js';
|
|
133
|
+
export { UserSummary } from './Model/User/UserSummary.js';
|
|
134
|
+
export type { UserSummaryType } from './Model/User/UserSummary.js';
|
|
132
135
|
export { RunnerImage } from './Model/Runner/RunnerImage.js';
|
|
133
136
|
export { CommandExecutionHistory } from './Model/Command/CommandExecutionHistory.js';
|
|
134
137
|
export { CommandExecutionStatus } from './Model/Command/CommandExecutionStatus.js';
|
package/dist/index.js
CHANGED
|
@@ -117,6 +117,7 @@ export { FlowTemplate } from './Model/Flow/FlowTemplate.js';
|
|
|
117
117
|
export { User } from './Model/User/User.js';
|
|
118
118
|
export { UserAuthProvider } from './Model/User/UserAuthProvider.js';
|
|
119
119
|
export { UserAction } from './Model/User/UserAction.js';
|
|
120
|
+
export { UserSummary } from './Model/User/UserSummary.js';
|
|
120
121
|
export { RunnerImage } from './Model/Runner/RunnerImage.js';
|
|
121
122
|
export { CommandExecutionHistory } from './Model/Command/CommandExecutionHistory.js';
|
|
122
123
|
export { CommandExecutionStatus } from './Model/Command/CommandExecutionStatus.js';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.67.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.67.0";
|