rl-core-api 0.3.0 → 0.5.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/README.md +1 -1
- package/dist/core/auth/actor.interface.d.ts +4 -0
- package/dist/core/auth/actor.interface.js +2 -0
- package/dist/core/auth/permissionScope.util.d.ts +3 -0
- package/dist/core/auth/permissionScope.util.js +10 -0
- package/dist/core/config/env.schema.d.ts +3 -3
- package/dist/core/config/env.schema.js +3 -3
- package/dist/core/config/env.service.d.ts +1 -0
- package/dist/core/config/env.service.js +3 -0
- package/dist/core/context/auditContext.d.ts +1 -0
- package/dist/core/context/auditContext.js +8 -1
- package/dist/core/context/requestLog.context.d.ts +10 -0
- package/dist/core/context/requestLog.context.js +26 -0
- package/dist/core/database/migrations/1710000000000-InitialSchema.js +63 -36
- package/dist/core/database/migrations/{1786233600000-Notifications.d.ts → 1787270400000-GroupManager.d.ts} +1 -1
- package/dist/core/database/migrations/1787270400000-GroupManager.js +26 -0
- package/dist/core/database/migrations/index.js +2 -6
- package/dist/core/events/appEvent.enum.d.ts +19 -1
- package/dist/core/events/appEvent.enum.js +1 -0
- package/dist/core/filters/allExceptions.filter.d.ts +6 -0
- package/dist/core/filters/allExceptions.filter.js +47 -2
- package/dist/core/filters/appErrorCode.enum.d.ts +3 -1
- package/dist/core/filters/appErrorCode.enum.js +2 -0
- package/dist/core/query/parseFilter.util.js +6 -4
- package/dist/core/utils/ip.util.d.ts +1 -0
- package/dist/core/utils/ip.util.js +8 -0
- package/dist/core/websocket/baseGateway.d.ts +1 -0
- package/dist/core/websocket/baseGateway.js +3 -0
- package/dist/coreEntities.d.ts +2 -3
- package/dist/coreEntities.js +2 -4
- package/dist/features/audit/audit.module.js +5 -7
- package/dist/features/audit/domain/audit.service.d.ts +14 -17
- package/dist/features/audit/domain/audit.service.js +22 -35
- package/dist/features/audit/domain/classifyError.util.d.ts +1 -1
- package/dist/features/audit/domain/classifyError.util.js +8 -8
- package/dist/features/audit/domain/enums/errorType.enum.d.ts +9 -0
- package/dist/features/audit/domain/enums/errorType.enum.js +13 -0
- package/dist/features/audit/domain/enums/requestOutcome.enum.d.ts +5 -0
- package/dist/features/audit/domain/enums/requestOutcome.enum.js +9 -0
- package/dist/features/audit/domain/index.d.ts +2 -0
- package/dist/features/audit/domain/index.js +2 -0
- package/dist/features/audit/infra/auditData.subscriber.js +21 -12
- package/dist/features/audit/infra/index.d.ts +2 -4
- package/dist/features/audit/infra/index.js +2 -4
- package/dist/features/audit/infra/repositories/requestLog.repository.d.ts +7 -0
- package/dist/features/audit/infra/repositories/{auditChange.repository.js → requestLog.repository.js} +10 -10
- package/dist/features/audit/infra/schema/auditDataChange.schema.d.ts +3 -3
- package/dist/features/audit/infra/schema/auditDataChange.schema.js +8 -7
- package/dist/features/audit/infra/schema/requestLog.schema.d.ts +20 -0
- package/dist/features/audit/infra/schema/requestLog.schema.js +92 -0
- package/dist/features/audit/presentation/audit.controller.d.ts +4 -8
- package/dist/features/audit/presentation/audit.controller.js +8 -31
- package/dist/features/audit/presentation/audit.interceptor.d.ts +5 -1
- package/dist/features/audit/presentation/audit.interceptor.js +53 -28
- package/dist/features/audit/presentation/decorators/auditable.decorator.d.ts +10 -0
- package/dist/features/audit/presentation/decorators/auditable.decorator.js +10 -0
- package/dist/features/audit/presentation/filters/audit.filters.d.ts +1 -2
- package/dist/features/audit/presentation/filters/audit.filters.js +65 -49
- package/dist/features/audit/presentation/httpError.listener.d.ts +8 -0
- package/dist/features/audit/presentation/httpError.listener.js +61 -0
- package/dist/features/audit/presentation/index.d.ts +3 -0
- package/dist/features/audit/presentation/index.js +3 -0
- package/dist/features/audit/presentation/responses/auditDataChange.response.js +1 -1
- package/dist/features/audit/presentation/responses/log.response.d.ts +12 -27
- package/dist/features/audit/presentation/responses/log.response.js +66 -88
- package/dist/features/audit/presentation/userRolesChanged.listener.d.ts +7 -0
- package/dist/features/audit/presentation/userRolesChanged.listener.js +43 -0
- package/dist/features/auth/domain/auth.service.d.ts +7 -4
- package/dist/features/auth/domain/auth.service.js +22 -4
- package/dist/features/auth/domain/twoFactor.service.d.ts +2 -0
- package/dist/features/auth/domain/twoFactor.service.js +7 -2
- package/dist/features/auth/infra/schema/authToken.schema.d.ts +5 -5
- package/dist/features/auth/infra/schema/authToken.schema.js +7 -7
- package/dist/features/auth/presentation/auth.controller.d.ts +2 -5
- package/dist/features/auth/presentation/auth.controller.js +11 -0
- package/dist/features/maintenance/domain/cleanup.service.d.ts +1 -4
- package/dist/features/maintenance/domain/cleanup.service.js +1 -26
- package/dist/features/maintenance/maintenance.module.js +1 -2
- package/dist/features/notifications/domain/enums/channelType.enum.d.ts +5 -5
- package/dist/features/notifications/domain/enums/channelType.enum.js +5 -5
- package/dist/features/notifications/domain/enums/deliveryStatus.enum.d.ts +6 -6
- package/dist/features/notifications/domain/enums/deliveryStatus.enum.js +6 -6
- package/dist/features/notifications/domain/enums/notificationType.enum.d.ts +4 -4
- package/dist/features/notifications/domain/enums/notificationType.enum.js +4 -4
- package/dist/features/notifications/domain/enums/scopeType.enum.d.ts +3 -3
- package/dist/features/notifications/domain/enums/scopeType.enum.js +3 -3
- package/dist/features/notifications/infra/schema/notification.schema.js +2 -2
- package/dist/features/notifications/infra/schema/notificationScope.schema.js +2 -2
- package/dist/features/notifications/presentation/commands/createNotification.command.js +2 -2
- package/dist/features/notifications/presentation/domainEvents.listener.d.ts +5 -2
- package/dist/features/notifications/presentation/domainEvents.listener.js +24 -2
- package/dist/features/notifications/presentation/responses/notification.response.js +1 -1
- package/dist/features/rbac/domain/rbac.catalog.js +31 -2
- package/dist/features/rbac/domain/rbac.service.d.ts +1 -0
- package/dist/features/rbac/domain/rbac.service.js +14 -0
- package/dist/features/rbac/domain/teamScope.service.d.ts +15 -0
- package/dist/features/rbac/domain/teamScope.service.js +74 -0
- package/dist/features/rbac/infra/repositories/group.repository.d.ts +2 -0
- package/dist/features/rbac/infra/repositories/group.repository.js +26 -0
- package/dist/features/rbac/infra/schema/group.schema.d.ts +1 -0
- package/dist/features/rbac/infra/schema/group.schema.js +5 -0
- package/dist/features/rbac/presentation/commands/createGroup.command.d.ts +1 -0
- package/dist/features/rbac/presentation/commands/createGroup.command.js +7 -0
- package/dist/features/rbac/presentation/rbac.controller.d.ts +1 -0
- package/dist/features/rbac/presentation/rbac.controller.js +16 -0
- package/dist/features/rbac/presentation/responses/rbac.response.d.ts +1 -0
- package/dist/features/rbac/presentation/responses/rbac.response.js +4 -0
- package/dist/features/rbac/rbac.module.js +3 -0
- package/dist/features/users/domain/users.service.d.ts +16 -8
- package/dist/features/users/domain/users.service.js +72 -14
- package/dist/features/users/infra/repositories/user.repository.d.ts +1 -1
- package/dist/features/users/infra/repositories/user.repository.js +9 -1
- package/dist/features/users/presentation/commands/createUser.command.d.ts +1 -0
- package/dist/features/users/presentation/commands/createUser.command.js +8 -0
- package/dist/features/users/presentation/filters/users.filters.js +8 -0
- package/dist/features/users/presentation/users.controller.d.ts +5 -5
- package/dist/features/users/presentation/users.controller.js +38 -27
- package/dist/features/users/users.module.js +2 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.js +14 -6
- package/package.json +1 -1
- package/dist/core/database/migrations/1786060800000-FirstAccessTokenType.d.ts +0 -6
- package/dist/core/database/migrations/1786060800000-FirstAccessTokenType.js +0 -19
- package/dist/core/database/migrations/1786147200000-PermanentAccountLock.d.ts +0 -6
- package/dist/core/database/migrations/1786147200000-PermanentAccountLock.js +0 -15
- package/dist/core/database/migrations/1786233600000-Notifications.js +0 -59
- package/dist/features/audit/infra/repositories/auditChange.repository.d.ts +0 -7
- package/dist/features/audit/infra/repositories/errorLog.repository.d.ts +0 -7
- package/dist/features/audit/infra/repositories/errorLog.repository.js +0 -35
- package/dist/features/audit/infra/schema/auditChange.schema.d.ts +0 -14
- package/dist/features/audit/infra/schema/auditChange.schema.js +0 -68
- package/dist/features/audit/infra/schema/errorLog.schema.d.ts +0 -21
- package/dist/features/audit/infra/schema/errorLog.schema.js +0 -69
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Paginated, PaginationQuery } from "../../../core/utils/pagination.util";
|
|
2
|
-
import { AuditChangeRepository } from "../infra/repositories/auditChange.repository";
|
|
3
2
|
import { AuditDataChangeRepository } from "../infra/repositories/auditDataChange.repository";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ErrorLog } from "../infra/schema/errorLog.schema";
|
|
3
|
+
import { RequestLogRepository } from "../infra/repositories/requestLog.repository";
|
|
4
|
+
import { AuditDataAction, AuditDataChange } from "../infra/schema/auditDataChange.schema";
|
|
5
|
+
import { RequestLog } from "../infra/schema/requestLog.schema";
|
|
8
6
|
import { UserRepository } from "../../users/infra/repositories/user.repository";
|
|
9
7
|
export type WithUserRef<T> = T & {
|
|
10
8
|
user?: {
|
|
@@ -15,21 +13,20 @@ export type WithUserRef<T> = T & {
|
|
|
15
13
|
};
|
|
16
14
|
export type AuditDataChangeWithUser = WithUserRef<Pick<AuditDataChange, "id" | "createdAt" | "updatedAt" | "deletedAt" | "entity" | "entityId" | "action" | "oldData" | "newData" | "userId" | "ipAddress">>;
|
|
17
15
|
export declare class AuditService {
|
|
18
|
-
private readonly
|
|
19
|
-
private readonly errorRepo;
|
|
16
|
+
private readonly requestLogRepo;
|
|
20
17
|
private readonly dataChangeRepo;
|
|
21
18
|
private readonly userRepo;
|
|
22
19
|
private readonly logger;
|
|
23
|
-
constructor(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
constructor(requestLogRepo: RequestLogRepository, dataChangeRepo: AuditDataChangeRepository, userRepo: UserRepository);
|
|
21
|
+
recordRequest(data: Partial<RequestLog>): Promise<void>;
|
|
22
|
+
recordChange(data: {
|
|
23
|
+
entity: string;
|
|
24
|
+
entityId: string | null;
|
|
25
|
+
action: AuditDataAction;
|
|
26
|
+
oldData: Record<string, unknown> | null;
|
|
27
|
+
newData: Record<string, unknown> | null;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
listRequests(query: PaginationQuery): Promise<Paginated<WithUserRef<RequestLog>>>;
|
|
33
30
|
listDataChanges(query: PaginationQuery): Promise<Paginated<AuditDataChangeWithUser>>;
|
|
34
31
|
private enrichWithUser;
|
|
35
32
|
}
|
|
@@ -13,56 +13,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.AuditService = void 0;
|
|
14
14
|
const common_1 = require("@nestjs/common");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
+
const auditContext_1 = require("../../../core/context/auditContext");
|
|
16
17
|
const pagination_util_1 = require("../../../core/utils/pagination.util");
|
|
17
|
-
const auditChange_repository_1 = require("../infra/repositories/auditChange.repository");
|
|
18
18
|
const auditDataChange_repository_1 = require("../infra/repositories/auditDataChange.repository");
|
|
19
|
-
const
|
|
19
|
+
const requestLog_repository_1 = require("../infra/repositories/requestLog.repository");
|
|
20
20
|
const user_repository_1 = require("../../users/infra/repositories/user.repository");
|
|
21
21
|
let AuditService = AuditService_1 = class AuditService {
|
|
22
|
-
constructor(
|
|
23
|
-
this.
|
|
24
|
-
this.errorRepo = errorRepo;
|
|
22
|
+
constructor(requestLogRepo, dataChangeRepo, userRepo) {
|
|
23
|
+
this.requestLogRepo = requestLogRepo;
|
|
25
24
|
this.dataChangeRepo = dataChangeRepo;
|
|
26
25
|
this.userRepo = userRepo;
|
|
27
26
|
this.logger = new common_1.Logger(AuditService_1.name);
|
|
28
27
|
}
|
|
29
|
-
async
|
|
28
|
+
async recordRequest(data) {
|
|
30
29
|
try {
|
|
31
|
-
await this.
|
|
30
|
+
await this.requestLogRepo.save(this.requestLogRepo.create(data));
|
|
32
31
|
}
|
|
33
32
|
catch (err) {
|
|
34
|
-
this.logger.warn(`Falha ao gravar
|
|
33
|
+
this.logger.warn(`Falha ao gravar RequestLog: ${err.message}`);
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
|
-
async
|
|
36
|
+
async recordChange(data) {
|
|
38
37
|
try {
|
|
39
|
-
|
|
38
|
+
const ctx = auditContext_1.auditContext.getStore();
|
|
39
|
+
await this.dataChangeRepo.save(this.dataChangeRepo.create({
|
|
40
|
+
...data,
|
|
41
|
+
userId: ctx?.userId ?? null,
|
|
42
|
+
ipAddress: ctx?.ipAddress ?? null,
|
|
43
|
+
}));
|
|
40
44
|
}
|
|
41
45
|
catch (err) {
|
|
42
|
-
this.logger.warn(`Falha ao gravar
|
|
46
|
+
this.logger.warn(`Falha ao gravar AuditDataChange (${data.entity}): ${err.message}`);
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
|
-
async
|
|
46
|
-
const
|
|
47
|
-
const removed = await this.dataChangeRepo.delete({
|
|
48
|
-
createdAt: (0, typeorm_1.LessThan)(cutoff),
|
|
49
|
-
});
|
|
50
|
-
return removed.affected ?? 0;
|
|
51
|
-
}
|
|
52
|
-
async cleanupOldLogs(retentionDays) {
|
|
53
|
-
const cutoff = new Date(Date.now() - retentionDays * 24 * 60 * 60 * 1000);
|
|
54
|
-
const changes = await this.changeRepo.delete({
|
|
55
|
-
createdAt: (0, typeorm_1.LessThan)(cutoff),
|
|
56
|
-
});
|
|
57
|
-
const errors = await this.errorRepo.delete({ createdAt: (0, typeorm_1.LessThan)(cutoff) });
|
|
58
|
-
return { changes: changes.affected ?? 0, errors: errors.affected ?? 0 };
|
|
59
|
-
}
|
|
60
|
-
async listChanges(query) {
|
|
61
|
-
const [items, total] = await this.changeRepo.findPaginated(query);
|
|
62
|
-
return new pagination_util_1.Paginated(await this.enrichWithUser(items), total, query.page, query.limit);
|
|
63
|
-
}
|
|
64
|
-
async listErrors(query) {
|
|
65
|
-
const [items, total] = await this.errorRepo.findPaginated(query);
|
|
49
|
+
async listRequests(query) {
|
|
50
|
+
const [items, total] = await this.requestLogRepo.findPaginated(query);
|
|
66
51
|
return new pagination_util_1.Paginated(await this.enrichWithUser(items), total, query.page, query.limit);
|
|
67
52
|
}
|
|
68
53
|
async listDataChanges(query) {
|
|
@@ -85,7 +70,10 @@ let AuditService = AuditService_1 = class AuditService {
|
|
|
85
70
|
const user = item.userId ? usersById.get(item.userId) : undefined;
|
|
86
71
|
return {
|
|
87
72
|
...item,
|
|
88
|
-
user: user
|
|
73
|
+
user: user
|
|
74
|
+
?
|
|
75
|
+
{ id: user.id, name: user.fullName, email: user.email }
|
|
76
|
+
: null,
|
|
89
77
|
};
|
|
90
78
|
});
|
|
91
79
|
}
|
|
@@ -93,8 +81,7 @@ let AuditService = AuditService_1 = class AuditService {
|
|
|
93
81
|
exports.AuditService = AuditService;
|
|
94
82
|
exports.AuditService = AuditService = AuditService_1 = __decorate([
|
|
95
83
|
(0, common_1.Injectable)(),
|
|
96
|
-
__metadata("design:paramtypes", [
|
|
97
|
-
errorLog_repository_1.ErrorLogRepository,
|
|
84
|
+
__metadata("design:paramtypes", [requestLog_repository_1.RequestLogRepository,
|
|
98
85
|
auditDataChange_repository_1.AuditDataChangeRepository,
|
|
99
86
|
user_repository_1.UserRepository])
|
|
100
87
|
], AuditService);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ErrorType } from "
|
|
1
|
+
import { ErrorType } from "./enums/errorType.enum";
|
|
2
2
|
export declare function classifyError(exception: unknown, status: number): ErrorType;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.classifyError = classifyError;
|
|
4
|
-
const
|
|
4
|
+
const errorType_enum_1 = require("./enums/errorType.enum");
|
|
5
5
|
function classifyError(exception, status) {
|
|
6
|
-
if (status === 400) {
|
|
7
|
-
return
|
|
6
|
+
if (status === 400 || status === 422) {
|
|
7
|
+
return errorType_enum_1.ErrorType.VALIDATION;
|
|
8
8
|
}
|
|
9
9
|
if (status === 401 || status === 403) {
|
|
10
|
-
return
|
|
10
|
+
return errorType_enum_1.ErrorType.AUTH;
|
|
11
11
|
}
|
|
12
12
|
if (status === 404) {
|
|
13
|
-
return
|
|
13
|
+
return errorType_enum_1.ErrorType.NOT_FOUND;
|
|
14
14
|
}
|
|
15
15
|
if (status === 429) {
|
|
16
|
-
return
|
|
16
|
+
return errorType_enum_1.ErrorType.RATE_LIMIT;
|
|
17
17
|
}
|
|
18
18
|
const name = exception?.name ?? "";
|
|
19
19
|
if (name.includes("QueryFailedError") ||
|
|
20
20
|
name.includes("EntityNotFoundError")) {
|
|
21
|
-
return
|
|
21
|
+
return errorType_enum_1.ErrorType.DATABASE;
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return errorType_enum_1.ErrorType.INTERNAL;
|
|
24
24
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorType = void 0;
|
|
4
|
+
var ErrorType;
|
|
5
|
+
(function (ErrorType) {
|
|
6
|
+
ErrorType[ErrorType["VALIDATION"] = 0] = "VALIDATION";
|
|
7
|
+
ErrorType[ErrorType["AUTH"] = 1] = "AUTH";
|
|
8
|
+
ErrorType[ErrorType["NOT_FOUND"] = 2] = "NOT_FOUND";
|
|
9
|
+
ErrorType[ErrorType["RATE_LIMIT"] = 3] = "RATE_LIMIT";
|
|
10
|
+
ErrorType[ErrorType["DATABASE"] = 4] = "DATABASE";
|
|
11
|
+
ErrorType[ErrorType["INTEGRATION"] = 5] = "INTEGRATION";
|
|
12
|
+
ErrorType[ErrorType["INTERNAL"] = 6] = "INTERNAL";
|
|
13
|
+
})(ErrorType || (exports.ErrorType = ErrorType = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestOutcome = void 0;
|
|
4
|
+
var RequestOutcome;
|
|
5
|
+
(function (RequestOutcome) {
|
|
6
|
+
RequestOutcome[RequestOutcome["SUCCESS"] = 0] = "SUCCESS";
|
|
7
|
+
RequestOutcome[RequestOutcome["ERROR"] = 1] = "ERROR";
|
|
8
|
+
RequestOutcome[RequestOutcome["ABORTED"] = 2] = "ABORTED";
|
|
9
|
+
})(RequestOutcome || (exports.RequestOutcome = RequestOutcome = {}));
|
|
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./audit.service"), exports);
|
|
18
18
|
__exportStar(require("./classifyError.util"), exports);
|
|
19
|
+
__exportStar(require("./enums/errorType.enum"), exports);
|
|
20
|
+
__exportStar(require("./enums/requestOutcome.enum"), exports);
|
|
@@ -15,6 +15,9 @@ const common_1 = require("@nestjs/common");
|
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const auditContext_1 = require("../../../core/context/auditContext");
|
|
17
17
|
const auditDataChange_schema_1 = require("./schema/auditDataChange.schema");
|
|
18
|
+
const requestLog_schema_1 = require("./schema/requestLog.schema");
|
|
19
|
+
const authToken_schema_1 = require("../../auth/infra/schema/authToken.schema");
|
|
20
|
+
const passwordHistory_schema_1 = require("../../users/infra/schema/passwordHistory.schema");
|
|
18
21
|
function entityIdOf(source) {
|
|
19
22
|
if (source && typeof source === "object" && "id" in source) {
|
|
20
23
|
const id = source.id;
|
|
@@ -22,24 +25,30 @@ function entityIdOf(source) {
|
|
|
22
25
|
}
|
|
23
26
|
return null;
|
|
24
27
|
}
|
|
25
|
-
const EXCLUDED_ENTITIES = new Set([
|
|
26
|
-
|
|
27
|
-
"ErrorLog",
|
|
28
|
-
"AuditDataChange",
|
|
29
|
-
"AuthToken",
|
|
30
|
-
"PasswordHistory",
|
|
31
|
-
]);
|
|
28
|
+
const EXCLUDED_ENTITIES = new Set([requestLog_schema_1.RequestLog, auditDataChange_schema_1.AuditDataChange, authToken_schema_1.AuthToken, passwordHistory_schema_1.PasswordHistory].map((entity) => entity.name));
|
|
29
|
+
const isJunction = (metadata) => metadata.isJunction;
|
|
32
30
|
const BASE_FIELDS = new Set(["id", "createdAt", "updatedAt", "deletedAt"]);
|
|
33
31
|
const SENSITIVE_FIELDS = {
|
|
34
32
|
User: new Set(["password", "twoFactorSecret", "backupCodes"]),
|
|
35
33
|
};
|
|
34
|
+
const OPERATIONAL_FIELDS = {
|
|
35
|
+
User: new Set([
|
|
36
|
+
"failedLoginAttempts",
|
|
37
|
+
"twoFactorEnabled",
|
|
38
|
+
"twoFactorConfirmedAt",
|
|
39
|
+
]),
|
|
40
|
+
};
|
|
41
|
+
const excludedFieldsOf = (entityName) => new Set([
|
|
42
|
+
...(SENSITIVE_FIELDS[entityName] ?? []),
|
|
43
|
+
...(OPERATIONAL_FIELDS[entityName] ?? []),
|
|
44
|
+
]);
|
|
36
45
|
let AuditDataSubscriber = AuditDataSubscriber_1 = class AuditDataSubscriber {
|
|
37
46
|
constructor(dataSource) {
|
|
38
47
|
this.logger = new common_1.Logger(AuditDataSubscriber_1.name);
|
|
39
48
|
dataSource.subscribers.push(this);
|
|
40
49
|
}
|
|
41
50
|
async afterInsert(event) {
|
|
42
|
-
if (EXCLUDED_ENTITIES.has(event.metadata.name)) {
|
|
51
|
+
if (isJunction(event.metadata) || EXCLUDED_ENTITIES.has(event.metadata.name)) {
|
|
43
52
|
return;
|
|
44
53
|
}
|
|
45
54
|
await this.persist(event.metadata, event.manager, {
|
|
@@ -50,13 +59,13 @@ let AuditDataSubscriber = AuditDataSubscriber_1 = class AuditDataSubscriber {
|
|
|
50
59
|
});
|
|
51
60
|
}
|
|
52
61
|
async afterUpdate(event) {
|
|
53
|
-
if (EXCLUDED_ENTITIES.has(event.metadata.name)) {
|
|
62
|
+
if (isJunction(event.metadata) || EXCLUDED_ENTITIES.has(event.metadata.name)) {
|
|
54
63
|
return;
|
|
55
64
|
}
|
|
56
65
|
if (!event.updatedColumns.length) {
|
|
57
66
|
return;
|
|
58
67
|
}
|
|
59
|
-
const excluded =
|
|
68
|
+
const excluded = excludedFieldsOf(event.metadata.name);
|
|
60
69
|
const oldData = {};
|
|
61
70
|
const newData = {};
|
|
62
71
|
for (const col of event.updatedColumns) {
|
|
@@ -84,7 +93,7 @@ let AuditDataSubscriber = AuditDataSubscriber_1 = class AuditDataSubscriber {
|
|
|
84
93
|
await this.recordRemoval(event);
|
|
85
94
|
}
|
|
86
95
|
async recordRemoval(event) {
|
|
87
|
-
if (EXCLUDED_ENTITIES.has(event.metadata.name)) {
|
|
96
|
+
if (isJunction(event.metadata) || EXCLUDED_ENTITIES.has(event.metadata.name)) {
|
|
88
97
|
return;
|
|
89
98
|
}
|
|
90
99
|
await this.persist(event.metadata, event.manager, {
|
|
@@ -95,7 +104,7 @@ let AuditDataSubscriber = AuditDataSubscriber_1 = class AuditDataSubscriber {
|
|
|
95
104
|
});
|
|
96
105
|
}
|
|
97
106
|
snapshot(source, metadata) {
|
|
98
|
-
const excluded =
|
|
107
|
+
const excluded = excludedFieldsOf(metadata.name);
|
|
99
108
|
const result = {};
|
|
100
109
|
for (const col of metadata.columns) {
|
|
101
110
|
const prop = col.propertyName;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export * from "./auditData.subscriber";
|
|
2
|
-
export * from "./repositories/auditChange.repository";
|
|
3
2
|
export * from "./repositories/auditDataChange.repository";
|
|
4
|
-
export * from "./repositories/
|
|
5
|
-
export * from "./schema/auditChange.schema";
|
|
3
|
+
export * from "./repositories/requestLog.repository";
|
|
6
4
|
export * from "./schema/auditDataChange.schema";
|
|
7
|
-
export * from "./schema/
|
|
5
|
+
export * from "./schema/requestLog.schema";
|
|
@@ -15,9 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./auditData.subscriber"), exports);
|
|
18
|
-
__exportStar(require("./repositories/auditChange.repository"), exports);
|
|
19
18
|
__exportStar(require("./repositories/auditDataChange.repository"), exports);
|
|
20
|
-
__exportStar(require("./repositories/
|
|
21
|
-
__exportStar(require("./schema/auditChange.schema"), exports);
|
|
19
|
+
__exportStar(require("./repositories/requestLog.repository"), exports);
|
|
22
20
|
__exportStar(require("./schema/auditDataChange.schema"), exports);
|
|
23
|
-
__exportStar(require("./schema/
|
|
21
|
+
__exportStar(require("./schema/requestLog.schema"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DataSource, Repository } from "typeorm";
|
|
2
|
+
import { PaginationQuery } from "../../../../core/utils/pagination.util";
|
|
3
|
+
import { RequestLog } from "../schema/requestLog.schema";
|
|
4
|
+
export declare class RequestLogRepository extends Repository<RequestLog> {
|
|
5
|
+
constructor(dataSource: DataSource);
|
|
6
|
+
findPaginated(query: PaginationQuery): Promise<[RequestLog[], number]>;
|
|
7
|
+
}
|
|
@@ -9,27 +9,27 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.RequestLogRepository = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
15
|
const paginateWithFilter_util_1 = require("../../../../core/query/paginateWithFilter.util");
|
|
16
|
-
const
|
|
16
|
+
const requestLog_schema_1 = require("../schema/requestLog.schema");
|
|
17
17
|
const audit_filters_1 = require("../../presentation/filters/audit.filters");
|
|
18
|
-
let
|
|
18
|
+
let RequestLogRepository = class RequestLogRepository extends typeorm_1.Repository {
|
|
19
19
|
constructor(dataSource) {
|
|
20
|
-
super(
|
|
20
|
+
super(requestLog_schema_1.RequestLog, dataSource.createEntityManager());
|
|
21
21
|
}
|
|
22
22
|
findPaginated(query) {
|
|
23
|
-
return (0, paginateWithFilter_util_1.paginateWithFilter)(this.createQueryBuilder("
|
|
23
|
+
return (0, paginateWithFilter_util_1.paginateWithFilter)(this.createQueryBuilder("requestLog"), {
|
|
24
24
|
query,
|
|
25
|
-
catalog: audit_filters_1.
|
|
25
|
+
catalog: audit_filters_1.REQUEST_LOGS_FILTER_CATALOG,
|
|
26
26
|
defaultSort: "createdAt",
|
|
27
|
-
searchFields: ["path", "action"],
|
|
27
|
+
searchFields: ["path", "action", "errorMessage"],
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
31
|
+
exports.RequestLogRepository = RequestLogRepository;
|
|
32
|
+
exports.RequestLogRepository = RequestLogRepository = __decorate([
|
|
33
33
|
(0, common_1.Injectable)(),
|
|
34
34
|
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
35
|
-
],
|
|
35
|
+
], RequestLogRepository);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseEntity } from "../../../../core/database/base.schema";
|
|
2
2
|
export declare enum AuditDataAction {
|
|
3
|
-
CREATE =
|
|
4
|
-
UPDATE =
|
|
5
|
-
DELETE =
|
|
3
|
+
CREATE = 0,
|
|
4
|
+
UPDATE = 1,
|
|
5
|
+
DELETE = 2
|
|
6
6
|
}
|
|
7
7
|
export declare class AuditDataChange extends BaseEntity {
|
|
8
8
|
entity: string;
|
|
@@ -14,9 +14,9 @@ const typeorm_1 = require("typeorm");
|
|
|
14
14
|
const base_schema_1 = require("../../../../core/database/base.schema");
|
|
15
15
|
var AuditDataAction;
|
|
16
16
|
(function (AuditDataAction) {
|
|
17
|
-
AuditDataAction["CREATE"] = "CREATE";
|
|
18
|
-
AuditDataAction["UPDATE"] = "UPDATE";
|
|
19
|
-
AuditDataAction["DELETE"] = "DELETE";
|
|
17
|
+
AuditDataAction[AuditDataAction["CREATE"] = 0] = "CREATE";
|
|
18
|
+
AuditDataAction[AuditDataAction["UPDATE"] = 1] = "UPDATE";
|
|
19
|
+
AuditDataAction[AuditDataAction["DELETE"] = 2] = "DELETE";
|
|
20
20
|
})(AuditDataAction || (exports.AuditDataAction = AuditDataAction = {}));
|
|
21
21
|
let AuditDataChange = class AuditDataChange extends base_schema_1.BaseEntity {
|
|
22
22
|
};
|
|
@@ -30,8 +30,8 @@ __decorate([
|
|
|
30
30
|
__metadata("design:type", Object)
|
|
31
31
|
], AuditDataChange.prototype, "entityId", void 0);
|
|
32
32
|
__decorate([
|
|
33
|
-
(0, typeorm_1.Column)({ type: "
|
|
34
|
-
__metadata("design:type",
|
|
33
|
+
(0, typeorm_1.Column)({ type: "tinyint", unsigned: true }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
35
|
], AuditDataChange.prototype, "action", void 0);
|
|
36
36
|
__decorate([
|
|
37
37
|
(0, typeorm_1.Column)({ name: "old_data", type: "json", nullable: true }),
|
|
@@ -51,6 +51,7 @@ __decorate([
|
|
|
51
51
|
], AuditDataChange.prototype, "ipAddress", void 0);
|
|
52
52
|
exports.AuditDataChange = AuditDataChange = __decorate([
|
|
53
53
|
(0, typeorm_1.Entity)("audit_data_changes"),
|
|
54
|
-
(0, typeorm_1.Index)(["
|
|
55
|
-
(0, typeorm_1.Index)(["
|
|
54
|
+
(0, typeorm_1.Index)(["createdAt"]),
|
|
55
|
+
(0, typeorm_1.Index)(["entity", "entityId", "createdAt"]),
|
|
56
|
+
(0, typeorm_1.Index)(["userId", "createdAt"])
|
|
56
57
|
], AuditDataChange);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseEntity } from "../../../../core/database/base.schema";
|
|
2
|
+
import { ErrorType } from "../../domain/enums/errorType.enum";
|
|
3
|
+
import { RequestOutcome } from "../../domain/enums/requestOutcome.enum";
|
|
4
|
+
export declare class RequestLog extends BaseEntity {
|
|
5
|
+
outcome: RequestOutcome;
|
|
6
|
+
action?: string | null;
|
|
7
|
+
method?: string | null;
|
|
8
|
+
path?: string | null;
|
|
9
|
+
route?: string | null;
|
|
10
|
+
statusCode?: number | null;
|
|
11
|
+
durationMs?: number | null;
|
|
12
|
+
userId?: string | null;
|
|
13
|
+
ipHash?: string | null;
|
|
14
|
+
userAgent?: string | null;
|
|
15
|
+
requestId?: string | null;
|
|
16
|
+
errorType?: ErrorType | null;
|
|
17
|
+
errorCode?: string | null;
|
|
18
|
+
errorMessage?: string | null;
|
|
19
|
+
errorStack?: string | null;
|
|
20
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RequestLog = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_schema_1 = require("../../../../core/database/base.schema");
|
|
15
|
+
const requestOutcome_enum_1 = require("../../domain/enums/requestOutcome.enum");
|
|
16
|
+
let RequestLog = class RequestLog extends base_schema_1.BaseEntity {
|
|
17
|
+
};
|
|
18
|
+
exports.RequestLog = RequestLog;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.Column)({ type: "tinyint", unsigned: true }),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], RequestLog.prototype, "outcome", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
|
|
25
|
+
__metadata("design:type", Object)
|
|
26
|
+
], RequestLog.prototype, "action", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 10, nullable: true }),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], RequestLog.prototype, "method", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], RequestLog.prototype, "path", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], RequestLog.prototype, "route", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ name: "status_code", type: "int", nullable: true }),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], RequestLog.prototype, "statusCode", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ name: "duration_ms", type: "int", nullable: true }),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], RequestLog.prototype, "durationMs", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ name: "user_id", type: "char", length: 36, nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], RequestLog.prototype, "userId", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ name: "ip_hash", type: "char", length: 64, nullable: true }),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], RequestLog.prototype, "ipHash", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ name: "user_agent", type: "varchar", length: 255, nullable: true }),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], RequestLog.prototype, "userAgent", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ name: "request_id", type: "char", length: 36, nullable: true }),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], RequestLog.prototype, "requestId", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({
|
|
65
|
+
name: "error_type",
|
|
66
|
+
type: "tinyint",
|
|
67
|
+
unsigned: true,
|
|
68
|
+
nullable: true,
|
|
69
|
+
}),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], RequestLog.prototype, "errorType", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ name: "error_code", type: "varchar", length: 100, nullable: true }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], RequestLog.prototype, "errorCode", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ name: "error_message", type: "varchar", length: 255, nullable: true }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], RequestLog.prototype, "errorMessage", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ name: "error_stack", type: "text", nullable: true }),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], RequestLog.prototype, "errorStack", void 0);
|
|
84
|
+
exports.RequestLog = RequestLog = __decorate([
|
|
85
|
+
(0, typeorm_1.Entity)("request_logs"),
|
|
86
|
+
(0, typeorm_1.Index)(["createdAt"]),
|
|
87
|
+
(0, typeorm_1.Index)(["outcome", "createdAt"]),
|
|
88
|
+
(0, typeorm_1.Index)(["statusCode", "createdAt"]),
|
|
89
|
+
(0, typeorm_1.Index)(["userId", "createdAt"]),
|
|
90
|
+
(0, typeorm_1.Index)(["route", "createdAt"]),
|
|
91
|
+
(0, typeorm_1.Index)(["requestId"])
|
|
92
|
+
], RequestLog);
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { FilterFieldResponse } from "../../../core/query/filterSchema.response";
|
|
2
2
|
import { Paginated, PaginationQuery } from "../../../core/utils/pagination.util";
|
|
3
|
-
import { AuditService } from "../domain/audit.service";
|
|
4
|
-
import {
|
|
5
|
-
import { AuditChange } from "../infra/schema/auditChange.schema";
|
|
6
|
-
import { ErrorLog } from "../infra/schema/errorLog.schema";
|
|
3
|
+
import { AuditDataChangeWithUser, AuditService, WithUserRef } from "../domain/audit.service";
|
|
4
|
+
import { RequestLog } from "../infra/schema/requestLog.schema";
|
|
7
5
|
export declare class AuditController {
|
|
8
6
|
private readonly audit;
|
|
9
7
|
constructor(audit: AuditService);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
errors(query: PaginationQuery): Promise<Paginated<WithUserRef<ErrorLog>>>;
|
|
13
|
-
errorsFilterSchema(): FilterFieldResponse[];
|
|
8
|
+
requests(query: PaginationQuery): Promise<Paginated<WithUserRef<RequestLog>>>;
|
|
9
|
+
requestsFilterSchema(): FilterFieldResponse[];
|
|
14
10
|
dataChanges(query: PaginationQuery): Promise<Paginated<AuditDataChangeWithUser>>;
|
|
15
11
|
dataChangesFilterSchema(): FilterFieldResponse[];
|
|
16
12
|
}
|
|
@@ -27,17 +27,11 @@ let AuditController = class AuditController {
|
|
|
27
27
|
constructor(audit) {
|
|
28
28
|
this.audit = audit;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
return this.audit.
|
|
30
|
+
requests(query) {
|
|
31
|
+
return this.audit.listRequests(query);
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
return (0, filterSchema_response_1.toFilterSchema)(audit_filters_1.
|
|
35
|
-
}
|
|
36
|
-
errors(query) {
|
|
37
|
-
return this.audit.listErrors(query);
|
|
38
|
-
}
|
|
39
|
-
errorsFilterSchema() {
|
|
40
|
-
return (0, filterSchema_response_1.toFilterSchema)(audit_filters_1.ERROR_LOGS_FILTER_CATALOG);
|
|
33
|
+
requestsFilterSchema() {
|
|
34
|
+
return (0, filterSchema_response_1.toFilterSchema)(audit_filters_1.REQUEST_LOGS_FILTER_CATALOG);
|
|
41
35
|
}
|
|
42
36
|
dataChanges(query) {
|
|
43
37
|
return this.audit.listDataChanges(query);
|
|
@@ -48,39 +42,22 @@ let AuditController = class AuditController {
|
|
|
48
42
|
};
|
|
49
43
|
exports.AuditController = AuditController;
|
|
50
44
|
__decorate([
|
|
51
|
-
(0, common_1.Get)("
|
|
45
|
+
(0, common_1.Get)("requests"),
|
|
52
46
|
(0, requirePermission_decorator_1.RequirePermission)("audit:read:any"),
|
|
53
47
|
(0, swagger_1.ApiOkResponse)({ type: log_response_1.PaginatedRequestLogsResponse }),
|
|
54
48
|
__param(0, (0, common_1.Query)()),
|
|
55
49
|
__metadata("design:type", Function),
|
|
56
50
|
__metadata("design:paramtypes", [pagination_util_1.PaginationQuery]),
|
|
57
51
|
__metadata("design:returntype", Promise)
|
|
58
|
-
], AuditController.prototype, "
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, common_1.Get)("changes/filter-schema"),
|
|
61
|
-
(0, requirePermission_decorator_1.RequirePermission)("audit:read:any"),
|
|
62
|
-
(0, swagger_1.ApiOkResponse)({ type: filterSchema_response_1.FilterFieldResponse, isArray: true }),
|
|
63
|
-
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", []),
|
|
65
|
-
__metadata("design:returntype", Array)
|
|
66
|
-
], AuditController.prototype, "changesFilterSchema", null);
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, common_1.Get)("errors"),
|
|
69
|
-
(0, requirePermission_decorator_1.RequirePermission)("audit:read:any"),
|
|
70
|
-
(0, swagger_1.ApiOkResponse)({ type: log_response_1.PaginatedErrorLogsResponse }),
|
|
71
|
-
__param(0, (0, common_1.Query)()),
|
|
72
|
-
__metadata("design:type", Function),
|
|
73
|
-
__metadata("design:paramtypes", [pagination_util_1.PaginationQuery]),
|
|
74
|
-
__metadata("design:returntype", Promise)
|
|
75
|
-
], AuditController.prototype, "errors", null);
|
|
52
|
+
], AuditController.prototype, "requests", null);
|
|
76
53
|
__decorate([
|
|
77
|
-
(0, common_1.Get)("
|
|
54
|
+
(0, common_1.Get)("requests/filter-schema"),
|
|
78
55
|
(0, requirePermission_decorator_1.RequirePermission)("audit:read:any"),
|
|
79
56
|
(0, swagger_1.ApiOkResponse)({ type: filterSchema_response_1.FilterFieldResponse, isArray: true }),
|
|
80
57
|
__metadata("design:type", Function),
|
|
81
58
|
__metadata("design:paramtypes", []),
|
|
82
59
|
__metadata("design:returntype", Array)
|
|
83
|
-
], AuditController.prototype, "
|
|
60
|
+
], AuditController.prototype, "requestsFilterSchema", null);
|
|
84
61
|
__decorate([
|
|
85
62
|
(0, common_1.Get)("data-changes"),
|
|
86
63
|
(0, requirePermission_decorator_1.RequirePermission)("audit:read-trail:any"),
|