attlaz-client 1.67.0 → 1.69.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/Command/CommandExecutionFilter.d.ts +1 -1
- package/dist/Model/User/UserActionFilter.d.ts +10 -0
- package/dist/Model/User/UserActionFilter.js +1 -0
- package/dist/Service/CommandExecutionEndpoint.d.ts +4 -0
- package/dist/Service/CommandExecutionEndpoint.js +17 -1
- package/dist/Service/StorageEndpoint.d.ts +6 -2
- package/dist/Service/StorageEndpoint.js +12 -4
- package/dist/Service/UserActionEndpoint.d.ts +6 -1
- package/dist/Service/UserActionEndpoint.js +31 -1
- package/dist/index.d.ts +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 {};
|
|
@@ -2,9 +2,13 @@ import { CommandExecutionFilter } from '../Model/Command/CommandExecutionFilter.
|
|
|
2
2
|
import { CommandExecutionHistory } from '../Model/Command/CommandExecutionHistory.js';
|
|
3
3
|
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
4
4
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
5
|
+
import { UserSummary } from '../Model/User/UserSummary.js';
|
|
5
6
|
import { Endpoint } from './Endpoint.js';
|
|
6
7
|
export declare class CommandExecutionEndpoint extends Endpoint {
|
|
7
8
|
getAll(pagination?: CursorPagination | null, filter?: CommandExecutionFilter | null): Promise<CollectionResult<CommandExecutionHistory>>;
|
|
8
9
|
getById(id: string): Promise<CommandExecutionHistory | null>;
|
|
10
|
+
/** Distinct users that requested commands, resolved to display-safe summaries (for the requester filter). */
|
|
11
|
+
getDistinctRequesters(): Promise<UserSummary[]>;
|
|
12
|
+
private static parseSummary;
|
|
9
13
|
private static parse;
|
|
10
14
|
}
|
|
@@ -2,6 +2,8 @@ import { QueryString } from '../Http/Data/QueryString.js';
|
|
|
2
2
|
import { CommandExecutionHistory } from '../Model/Command/CommandExecutionHistory.js';
|
|
3
3
|
import { CommandExecutionStatus } from '../Model/Command/CommandExecutionStatus.js';
|
|
4
4
|
import { DataValueCollection } from '../Model/DataValueCollection.js';
|
|
5
|
+
import { State } from '../Model/State.js';
|
|
6
|
+
import { UserSummary } from '../Model/User/UserSummary.js';
|
|
5
7
|
import { Utils } from '../Utils.js';
|
|
6
8
|
import { Endpoint } from './Endpoint.js';
|
|
7
9
|
export class CommandExecutionEndpoint extends Endpoint {
|
|
@@ -15,7 +17,7 @@ export class CommandExecutionEndpoint extends Endpoint {
|
|
|
15
17
|
if (filter.type !== undefined && filter.type.length > 0) {
|
|
16
18
|
queryString.set('type', filter.type);
|
|
17
19
|
}
|
|
18
|
-
if (filter.requestedBy !== undefined) {
|
|
20
|
+
if (filter.requestedBy !== undefined && filter.requestedBy.length > 0) {
|
|
19
21
|
queryString.set('requested_by', filter.requestedBy);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
@@ -26,6 +28,20 @@ export class CommandExecutionEndpoint extends Endpoint {
|
|
|
26
28
|
const result = await this.requestObject(queryString, null, CommandExecutionEndpoint.parse, 'GET');
|
|
27
29
|
return result.getData();
|
|
28
30
|
}
|
|
31
|
+
/** Distinct users that requested commands, resolved to display-safe summaries (for the requester filter). */
|
|
32
|
+
async getDistinctRequesters() {
|
|
33
|
+
const queryString = new QueryString('/system/command-executions/users');
|
|
34
|
+
const result = await this.requestCollection(queryString, CommandExecutionEndpoint.parseSummary, null, 'GET');
|
|
35
|
+
return result.getData();
|
|
36
|
+
}
|
|
37
|
+
static parseSummary(raw) {
|
|
38
|
+
const summary = new UserSummary();
|
|
39
|
+
summary.id = raw.id;
|
|
40
|
+
summary.type = raw.type;
|
|
41
|
+
summary.state = (raw.state === null || raw.state === undefined) ? null : State.fromString(raw.state);
|
|
42
|
+
summary.displayName = raw.display_name;
|
|
43
|
+
return summary;
|
|
44
|
+
}
|
|
29
45
|
static parse(raw) {
|
|
30
46
|
const history = new CommandExecutionHistory();
|
|
31
47
|
history.id = raw.id;
|
|
@@ -7,8 +7,12 @@ import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
|
7
7
|
import { Endpoint } from './Endpoint.js';
|
|
8
8
|
export declare class StorageEndpoint extends Endpoint {
|
|
9
9
|
getInformation(projectEnvironmentId: string, storageType: StorageType): Promise<StorageInformation | null>;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
clearBucket(projectEnvironmentId: string, storageType: StorageType, bucketKey: string): Promise<boolean>;
|
|
11
|
+
getBucketItemsInformation(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<StorageItemInformation>>;
|
|
12
|
+
/** @deprecated Renamed to getBucketItemsInformation. Kept for backwards compatibility. */
|
|
13
|
+
getPoolItemsInformation(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<StorageItemInformation>>;
|
|
14
|
+
/** @deprecated Renamed to clearBucket. Kept for backwards compatibility. */
|
|
15
|
+
clearPool(projectEnvironmentId: string, storageType: StorageType, bucketKey: string): Promise<boolean>;
|
|
12
16
|
getItem(projectEnvironmentId: string, storageType: StorageType, poolKey: string, storageItemKey: string): Promise<StorageItem | null>;
|
|
13
17
|
getBucketItem(storageBucketId: string, storageItemKey: string): Promise<StorageItem | null>;
|
|
14
18
|
setItem(projectEnvironmentId: string, storageType: StorageType, poolKey: string, storageItem: StorageItem): Promise<StorageItem>;
|
|
@@ -25,8 +25,8 @@ export class StorageEndpoint extends Endpoint {
|
|
|
25
25
|
throw ex;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
async
|
|
29
|
-
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' +
|
|
28
|
+
async clearBucket(projectEnvironmentId, storageType, bucketKey) {
|
|
29
|
+
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + bucketKey;
|
|
30
30
|
try {
|
|
31
31
|
const parser = (raw) => raw.deleted;
|
|
32
32
|
const result = await this.requestObject(cmd, null, parser, 'DELETE');
|
|
@@ -43,8 +43,8 @@ export class StorageEndpoint extends Endpoint {
|
|
|
43
43
|
throw ex;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
async
|
|
47
|
-
const qs = new QueryString('/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' +
|
|
46
|
+
async getBucketItemsInformation(projectEnvironmentId, storageType, bucketKey, pagination = null) {
|
|
47
|
+
const qs = new QueryString('/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + bucketKey + '/items');
|
|
48
48
|
qs.addPagination(pagination);
|
|
49
49
|
try {
|
|
50
50
|
const result = await this.requestCollection(qs, StorageItemInformation.parse, null, 'GET');
|
|
@@ -57,6 +57,14 @@ export class StorageEndpoint extends Endpoint {
|
|
|
57
57
|
throw ex;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
/** @deprecated Renamed to getBucketItemsInformation. Kept for backwards compatibility. */
|
|
61
|
+
async getPoolItemsInformation(projectEnvironmentId, storageType, bucketKey, pagination = null) {
|
|
62
|
+
return this.getBucketItemsInformation(projectEnvironmentId, storageType, bucketKey, pagination);
|
|
63
|
+
}
|
|
64
|
+
/** @deprecated Renamed to clearBucket. Kept for backwards compatibility. */
|
|
65
|
+
async clearPool(projectEnvironmentId, storageType, bucketKey) {
|
|
66
|
+
return this.clearBucket(projectEnvironmentId, storageType, bucketKey);
|
|
67
|
+
}
|
|
60
68
|
async getItem(projectEnvironmentId, storageType, poolKey, storageItemKey) {
|
|
61
69
|
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + poolKey + '/items/' + storageItemKey;
|
|
62
70
|
try {
|
|
@@ -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;
|
package/dist/index.d.ts
CHANGED
|
@@ -129,6 +129,7 @@ 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';
|
|
132
133
|
export { UserSummary } from './Model/User/UserSummary.js';
|
|
133
134
|
export type { UserSummaryType } from './Model/User/UserSummary.js';
|
|
134
135
|
export { RunnerImage } from './Model/Runner/RunnerImage.js';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.69.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.69.0";
|