@masterteam/audit-logs 0.0.3 → 0.0.5
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/assets/audit-logs.css +1 -1
- package/assets/i18n/ar.json +60 -1
- package/assets/i18n/en.json +60 -1
- package/fesm2022/masterteam-audit-logs.mjs +650 -145
- package/fesm2022/masterteam-audit-logs.mjs.map +1 -1
- package/package.json +15 -14
- package/types/masterteam-audit-logs.d.ts +201 -80
|
@@ -1,126 +1,247 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { TemplateRef } from '@angular/core';
|
|
3
3
|
import * as _masterteam_audit_logs from '@masterteam/audit-logs';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { StatisticCardData } from '@masterteam/components/statistic-card';
|
|
5
|
+
import { TableFilters, ColumnDef } from '@masterteam/components/table';
|
|
6
|
+
import { EntityUserValue } from '@masterteam/components/entities';
|
|
6
7
|
import * as rxjs from 'rxjs';
|
|
7
|
-
import { StateContext } from '@ngxs/store';
|
|
8
8
|
import { CrudStateBase } from '@masterteam/components';
|
|
9
|
+
import { StateContext } from '@ngxs/store';
|
|
9
10
|
|
|
10
11
|
declare class AuditLogs {
|
|
11
12
|
private readonly router;
|
|
12
13
|
private readonly translocoService;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
icon
|
|
17
|
-
|
|
14
|
+
private readonly activeLang;
|
|
15
|
+
protected get breadcrumbItems(): ({
|
|
16
|
+
label: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
routerLink: string;
|
|
19
|
+
} | {
|
|
20
|
+
label: string;
|
|
21
|
+
routerLink: string;
|
|
22
|
+
icon?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
label: string;
|
|
25
|
+
icon?: undefined;
|
|
26
|
+
routerLink?: undefined;
|
|
27
|
+
})[];
|
|
18
28
|
goBack(): void;
|
|
19
29
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuditLogs, never>;
|
|
20
30
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AuditLogs, "mt-audit-logs", never, {}, {}, never, never, true, never>;
|
|
21
31
|
}
|
|
22
32
|
|
|
23
|
-
declare class AuditLogsList {
|
|
24
|
-
userCol: _angular_core.Signal<TemplateRef<any>>;
|
|
25
|
-
private readonly facade;
|
|
26
|
-
private readonly translocoService;
|
|
27
|
-
context: HttpContext;
|
|
28
|
-
auditLogs: _angular_core.Signal<_masterteam_audit_logs.AuditLog[]>;
|
|
29
|
-
fullDataAuditLogs: _angular_core.Signal<{
|
|
30
|
-
items: _masterteam_audit_logs.AuditLog[];
|
|
31
|
-
page?: number;
|
|
32
|
-
pageSize?: number;
|
|
33
|
-
totalCount?: number;
|
|
34
|
-
}>;
|
|
35
|
-
tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
|
|
36
|
-
loading: _angular_core.Signal<boolean>;
|
|
37
|
-
onLazyLoad(event: any): void;
|
|
38
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuditLogsList, never>;
|
|
39
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AuditLogsList, "mt-audit-logs-list", never, {}, {}, never, never, true, never>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
33
|
interface LoadingStateShape<L extends string = string> {
|
|
43
34
|
loadingActive: L[];
|
|
44
35
|
errors: Partial<Record<L, string>>;
|
|
45
36
|
}
|
|
46
37
|
|
|
47
|
-
interface
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
originalUserId?: {
|
|
51
|
-
id?: string;
|
|
52
|
-
userId?: string;
|
|
53
|
-
displayName?: string;
|
|
54
|
-
mobile?: string;
|
|
55
|
-
userName?: string;
|
|
56
|
-
email?: string;
|
|
57
|
-
photo?: string;
|
|
58
|
-
};
|
|
59
|
-
date?: {
|
|
60
|
-
displayValue?: string;
|
|
61
|
-
actualValue?: string;
|
|
62
|
-
};
|
|
63
|
-
description?: string;
|
|
64
|
-
title?: string;
|
|
65
|
-
userIpAddress?: string;
|
|
38
|
+
interface AuditTrailCodeLabel {
|
|
39
|
+
code: string;
|
|
40
|
+
label: string;
|
|
66
41
|
}
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
interface AuditTrailListItem {
|
|
43
|
+
eventId: string;
|
|
44
|
+
summary: string;
|
|
45
|
+
category: AuditTrailCodeLabel;
|
|
46
|
+
operation: AuditTrailCodeLabel;
|
|
47
|
+
importance: AuditTrailCodeLabel;
|
|
48
|
+
surface: AuditTrailCodeLabel;
|
|
49
|
+
occurredAtUtc: string;
|
|
50
|
+
actorUserId?: string | null;
|
|
51
|
+
primarySubjectType?: string | null;
|
|
52
|
+
primarySubjectId?: string | null;
|
|
53
|
+
levelId?: number | null;
|
|
54
|
+
levelDataId?: number | null;
|
|
55
|
+
moduleDataId?: number | null;
|
|
56
|
+
moduleKey?: string | null;
|
|
69
57
|
}
|
|
70
|
-
interface
|
|
71
|
-
|
|
72
|
-
items: AuditLog[];
|
|
73
|
-
page?: number;
|
|
74
|
-
pageSize?: number;
|
|
75
|
-
totalCount?: number;
|
|
76
|
-
};
|
|
58
|
+
interface AuditTrailSearchResponse {
|
|
59
|
+
totalCount: number;
|
|
77
60
|
page: number;
|
|
78
61
|
pageSize: number;
|
|
62
|
+
items: AuditTrailListItem[];
|
|
63
|
+
}
|
|
64
|
+
interface AuditTrailRequestContext {
|
|
65
|
+
eventName: string;
|
|
66
|
+
aggregateType: string;
|
|
67
|
+
aggregateId: string;
|
|
68
|
+
action: string;
|
|
69
|
+
correlationId?: string | null;
|
|
70
|
+
actorUserId?: string | null;
|
|
71
|
+
actorUser?: EntityUserValue | null;
|
|
72
|
+
occurredAtUtc: string;
|
|
73
|
+
}
|
|
74
|
+
interface AuditTrailSubject {
|
|
75
|
+
subjectType: string;
|
|
76
|
+
subjectId: string;
|
|
77
|
+
relation: string;
|
|
78
|
+
label: string;
|
|
79
|
+
levelId?: number | null;
|
|
80
|
+
levelDataId?: number | null;
|
|
81
|
+
moduleDataId?: number | null;
|
|
82
|
+
moduleKey?: string | null;
|
|
83
|
+
}
|
|
84
|
+
type AuditTrailValueKind = 'Empty' | 'Text' | 'Number' | 'Boolean' | 'DateTime' | 'Json' | string;
|
|
85
|
+
interface AuditTrailChange {
|
|
86
|
+
fieldKey: string;
|
|
87
|
+
fieldLabel: string;
|
|
88
|
+
oldValue?: string | null;
|
|
89
|
+
newValue?: string | null;
|
|
90
|
+
valueKind: AuditTrailValueKind;
|
|
91
|
+
changeSource?: string | null;
|
|
92
|
+
}
|
|
93
|
+
interface AuditTrailChangeGroup {
|
|
94
|
+
key: string;
|
|
95
|
+
label: string;
|
|
96
|
+
changes: AuditTrailChange[];
|
|
97
|
+
}
|
|
98
|
+
interface AuditTrailEvidence {
|
|
99
|
+
type: string;
|
|
100
|
+
contentJson: string;
|
|
101
|
+
}
|
|
102
|
+
interface AuditTrailEventDetail {
|
|
103
|
+
eventId: string;
|
|
104
|
+
summary: string;
|
|
105
|
+
category: AuditTrailCodeLabel;
|
|
106
|
+
operation: AuditTrailCodeLabel;
|
|
107
|
+
importance: AuditTrailCodeLabel;
|
|
108
|
+
surface: AuditTrailCodeLabel;
|
|
109
|
+
requestContext: AuditTrailRequestContext;
|
|
110
|
+
subjects: AuditTrailSubject[];
|
|
111
|
+
changeGroups: AuditTrailChangeGroup[];
|
|
112
|
+
evidence: AuditTrailEvidence[];
|
|
113
|
+
}
|
|
114
|
+
interface AuditTrailSearchFilters {
|
|
115
|
+
search?: string;
|
|
116
|
+
category?: string;
|
|
117
|
+
operation?: string;
|
|
118
|
+
importance?: string;
|
|
119
|
+
surface?: string;
|
|
120
|
+
actorUserId?: string;
|
|
121
|
+
subjectType?: string;
|
|
122
|
+
subjectId?: string;
|
|
123
|
+
fromUtc?: string;
|
|
124
|
+
toUtc?: string;
|
|
125
|
+
language?: string;
|
|
126
|
+
}
|
|
127
|
+
interface AuditTrailOption {
|
|
128
|
+
label: string;
|
|
129
|
+
value: string;
|
|
130
|
+
}
|
|
131
|
+
declare enum AuditLogsActionKey {
|
|
132
|
+
GetAuditLogs = "getAuditLogs",
|
|
133
|
+
GetAuditLogDetail = "getAuditLogDetail"
|
|
134
|
+
}
|
|
135
|
+
interface AuditLogsStateModel extends LoadingStateShape<AuditLogsActionKey> {
|
|
136
|
+
auditLogs: AuditTrailSearchResponse;
|
|
137
|
+
filters: AuditTrailSearchFilters;
|
|
138
|
+
selectedEventId: string | null;
|
|
139
|
+
selectedEventDetail: AuditTrailEventDetail | null;
|
|
79
140
|
}
|
|
80
141
|
|
|
81
142
|
declare class GetAuditLogs {
|
|
82
143
|
page: number;
|
|
83
144
|
pageSize: number;
|
|
84
|
-
filters
|
|
85
|
-
static readonly type = "[AuditLogs] Get Audit
|
|
86
|
-
constructor(page
|
|
145
|
+
filters: AuditTrailSearchFilters;
|
|
146
|
+
static readonly type = "[AuditLogs] Get Audit Trail Search";
|
|
147
|
+
constructor(page?: number, pageSize?: number, filters?: AuditTrailSearchFilters);
|
|
148
|
+
}
|
|
149
|
+
declare class GetAuditLogDetail {
|
|
150
|
+
eventId: string;
|
|
151
|
+
language?: string | undefined;
|
|
152
|
+
static readonly type = "[AuditLogs] Get Audit Trail Detail";
|
|
153
|
+
constructor(eventId: string, language?: string | undefined);
|
|
154
|
+
}
|
|
155
|
+
declare class ClearAuditLogDetail {
|
|
156
|
+
static readonly type = "[AuditLogs] Clear Audit Trail Detail";
|
|
87
157
|
}
|
|
88
158
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
159
|
+
interface Response<T> {
|
|
160
|
+
endpoint: string;
|
|
161
|
+
status: number;
|
|
162
|
+
code: number;
|
|
163
|
+
locale: string;
|
|
164
|
+
message?: string | null;
|
|
165
|
+
errors?: any | null;
|
|
166
|
+
data: T;
|
|
167
|
+
cacheSession?: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare class AuditLogsState extends CrudStateBase<AuditTrailListItem, AuditLogsStateModel, AuditLogsActionKey> {
|
|
171
|
+
private readonly http;
|
|
172
|
+
private readonly context;
|
|
173
|
+
private readonly baseUrl;
|
|
174
|
+
static getAuditLogs(state: AuditLogsStateModel): AuditTrailSearchResponse;
|
|
175
|
+
static getFilters(state: AuditLogsStateModel): AuditTrailSearchFilters;
|
|
176
|
+
static getSelectedEventId(state: AuditLogsStateModel): string | null;
|
|
177
|
+
static getSelectedEventDetail(state: AuditLogsStateModel): AuditTrailEventDetail | null;
|
|
99
178
|
static getLoadingActive(state: AuditLogsStateModel): string[];
|
|
100
179
|
static getErrors(state: AuditLogsStateModel): Record<string, string | null>;
|
|
101
|
-
getAuditLogs(ctx: StateContext<AuditLogsStateModel>, { page, pageSize, filters }: GetAuditLogs): rxjs.Observable<
|
|
180
|
+
getAuditLogs(ctx: StateContext<AuditLogsStateModel>, { page, pageSize, filters }: GetAuditLogs): rxjs.Observable<Response<AuditTrailSearchResponse>>;
|
|
181
|
+
getAuditLogDetail(ctx: StateContext<AuditLogsStateModel>, { eventId, language }: GetAuditLogDetail): rxjs.Observable<Response<AuditTrailEventDetail>>;
|
|
182
|
+
clearAuditLogDetail(ctx: StateContext<AuditLogsStateModel>): void;
|
|
183
|
+
private buildQueryParams;
|
|
184
|
+
private sanitizeFilters;
|
|
102
185
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuditLogsState, never>;
|
|
103
186
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AuditLogsState>;
|
|
104
187
|
}
|
|
105
188
|
|
|
106
189
|
declare class AuditLogsFacade {
|
|
107
190
|
private readonly store;
|
|
108
|
-
readonly auditLogs: _angular_core.Signal<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
totalCount?: number;
|
|
113
|
-
}>;
|
|
114
|
-
readonly page: _angular_core.Signal<number>;
|
|
115
|
-
readonly pageSize: _angular_core.Signal<number>;
|
|
191
|
+
readonly auditLogs: _angular_core.Signal<_masterteam_audit_logs.AuditTrailSearchResponse>;
|
|
192
|
+
readonly filters: _angular_core.Signal<AuditTrailSearchFilters>;
|
|
193
|
+
readonly selectedEventId: _angular_core.Signal<string | null>;
|
|
194
|
+
readonly selectedEventDetail: _angular_core.Signal<_masterteam_audit_logs.AuditTrailEventDetail | null>;
|
|
116
195
|
private readonly loadingActive;
|
|
117
196
|
private readonly errors;
|
|
118
197
|
readonly isLoadingAuditLogs: _angular_core.Signal<boolean>;
|
|
198
|
+
readonly isLoadingAuditLogDetail: _angular_core.Signal<boolean>;
|
|
119
199
|
readonly getAuditLogsError: _angular_core.Signal<string | null>;
|
|
120
|
-
|
|
200
|
+
readonly getAuditLogDetailError: _angular_core.Signal<string | null>;
|
|
201
|
+
readonly activeFilterCount: _angular_core.Signal<number>;
|
|
202
|
+
getAuditLogs(page?: number, pageSize?: number, filters?: AuditTrailSearchFilters): rxjs.Observable<void>;
|
|
203
|
+
getAuditLogDetail(eventId: string, language?: string): rxjs.Observable<void>;
|
|
204
|
+
clearAuditLogDetail(): rxjs.Observable<void>;
|
|
121
205
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuditLogsFacade, never>;
|
|
122
206
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AuditLogsFacade>;
|
|
123
207
|
}
|
|
124
208
|
|
|
125
|
-
|
|
126
|
-
|
|
209
|
+
declare class AuditLogsList {
|
|
210
|
+
readonly summaryCol: _angular_core.Signal<TemplateRef<any>>;
|
|
211
|
+
readonly actorCol: _angular_core.Signal<TemplateRef<any>>;
|
|
212
|
+
private readonly facade;
|
|
213
|
+
private readonly translocoService;
|
|
214
|
+
private readonly activeLang;
|
|
215
|
+
readonly auditLogs: _angular_core.Signal<_masterteam_audit_logs.AuditTrailSearchResponse>;
|
|
216
|
+
readonly appliedFilters: _angular_core.Signal<AuditTrailSearchFilters>;
|
|
217
|
+
readonly loading: _angular_core.Signal<boolean>;
|
|
218
|
+
readonly error: _angular_core.Signal<string | null>;
|
|
219
|
+
readonly detail: _angular_core.Signal<_masterteam_audit_logs.AuditTrailEventDetail | null>;
|
|
220
|
+
readonly detailError: _angular_core.Signal<string | null>;
|
|
221
|
+
readonly loadingDetail: _angular_core.Signal<boolean>;
|
|
222
|
+
readonly drawerVisible: _angular_core.WritableSignal<boolean>;
|
|
223
|
+
readonly tableFilters: _angular_core.WritableSignal<TableFilters>;
|
|
224
|
+
readonly summaryCards: _angular_core.Signal<StatisticCardData[]>;
|
|
225
|
+
readonly activeFilterBadges: _angular_core.Signal<string[]>;
|
|
226
|
+
readonly tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
|
|
227
|
+
onLazyLoad(event: {
|
|
228
|
+
currentPage?: number;
|
|
229
|
+
pageSize?: number;
|
|
230
|
+
filters?: TableFilters;
|
|
231
|
+
}): void;
|
|
232
|
+
openEventDetail(row: AuditTrailListItem): void;
|
|
233
|
+
onDrawerVisibleChange(visible: boolean): void;
|
|
234
|
+
retry(): void;
|
|
235
|
+
protected formatSubjectType(row: AuditTrailListItem): string;
|
|
236
|
+
private currentLanguage;
|
|
237
|
+
private translate;
|
|
238
|
+
private pushFilterBadge;
|
|
239
|
+
private formatFilterDate;
|
|
240
|
+
private readFilterValue;
|
|
241
|
+
private normalizeDateBoundary;
|
|
242
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuditLogsList, never>;
|
|
243
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AuditLogsList, "mt-audit-logs-list", never, {}, {}, never, never, true, never>;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export { AuditLogs, AuditLogsActionKey, AuditLogsFacade, AuditLogsList, AuditLogsState, ClearAuditLogDetail, GetAuditLogDetail, GetAuditLogs };
|
|
247
|
+
export type { AuditLogsStateModel, AuditTrailChange, AuditTrailChangeGroup, AuditTrailCodeLabel, AuditTrailEventDetail, AuditTrailEvidence, AuditTrailListItem, AuditTrailOption, AuditTrailRequestContext, AuditTrailSearchFilters, AuditTrailSearchResponse, AuditTrailSubject, AuditTrailValueKind };
|