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
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.normalizeIp = exports.sha256 = exports.randomToken = exports.numericCode = exports.backupCode = exports.encryptSecret = exports.decryptSecret = exports.MailerService = exports.createAppLogger = exports.WS_USER_RESOLVER = exports.WsAuthService = exports.wrapSocketEvent = exports.SOCKET_EVENT_VERSION = exports.userRoom = exports.SESSION_REFRESH_EVENT = exports.roleRoom = exports.NOTIFICATIONS_NAMESPACE = exports.BaseGateway = exports.codedUnauthorized = exports.codedTooManyRequests = exports.codedBadRequest = exports.AppErrorCode = exports.AppEvent = exports.auditContext = exports.User = exports.PasswordHistory = exports.Scope = exports.Role = exports.Resource = exports.Permission = exports.Group = exports.Action = exports.NotificationScope = exports.NotificationRead = exports.Notification = exports.AuthToken = void 0;
|
|
3
|
+
exports.seedPermissions = exports.seedAdmin = exports.BaseEntity = exports.PaginationMetaResponse = exports.resolveOrder = exports.PaginationQuery = exports.Paginated = exports.parseFilter = exports.paginateWithFilter = exports.resolveCatalogOrder = exports.toFilterSchema = exports.FilterOptionResponse = exports.FilterFieldResponse = exports.FilterOperator = exports.FilterCombinator = exports.FilterFieldType = exports.FILTER_MAX_NODES = exports.FILTER_MAX_LENGTH = exports.FILTER_MAX_IN_ITEMS = exports.FILTER_MAX_DEPTH = exports.DEFAULT_OPERATORS = exports.applyFilter = exports.SCOPE_TEAM = exports.SCOPE_ANY = exports.anyOrTeam = exports.PermissionsGuard = exports.JwtAuthGuard = exports.CsrfGuard = exports.AppThrottlerGuard = exports.RequirePermission = exports.RequireAnyPermission = exports.PERMISSIONS_KEY = exports.ANY_PERMISSIONS_KEY = exports.Public = exports.IS_PUBLIC_KEY = exports.CurrentUser = exports.setAuthCookies = exports.REFRESH_COOKIE = exports.clearAuthCookies = exports.ACCESS_COOKIE = exports.EnvService = exports.validateEnv = exports.envSchema = exports.ConfigModule = exports.RlCoreModule = exports.coreEntities = exports.coreMigrations = exports.createCoreDataSource = exports.CoreModule = exports.bootstrapCore = void 0;
|
|
4
|
+
exports.normalizeIp = exports.sha256 = exports.randomToken = exports.numericCode = exports.backupCode = exports.encryptSecret = exports.decryptSecret = exports.MailerService = exports.createAppLogger = exports.WS_USER_RESOLVER = exports.WsAuthService = exports.wrapSocketEvent = exports.SOCKET_EVENT_VERSION = exports.userRoom = exports.SESSION_REFRESH_EVENT = exports.roleRoom = exports.NOTIFICATIONS_NAMESPACE = exports.BaseGateway = exports.Auditable = exports.RequestOutcome = exports.ErrorType = exports.codedUnauthorized = exports.codedTooManyRequests = exports.codedBadRequest = exports.AppErrorCode = exports.AppEvent = exports.auditContext = exports.User = exports.PasswordHistory = exports.Scope = exports.Role = exports.Resource = exports.Permission = exports.Group = exports.Action = exports.NotificationScope = exports.NotificationRead = exports.Notification = exports.AuthToken = exports.RequestLog = exports.AuditDataChange = void 0;
|
|
5
5
|
var bootstrapCore_util_1 = require("./core/bootstrap/bootstrapCore.util");
|
|
6
6
|
Object.defineProperty(exports, "bootstrapCore", { enumerable: true, get: function () { return bootstrapCore_util_1.bootstrapCore; } });
|
|
7
7
|
var core_module_1 = require("./core/core.module");
|
|
@@ -44,6 +44,10 @@ var jwtAuth_guard_1 = require("./core/auth/guards/jwtAuth.guard");
|
|
|
44
44
|
Object.defineProperty(exports, "JwtAuthGuard", { enumerable: true, get: function () { return jwtAuth_guard_1.JwtAuthGuard; } });
|
|
45
45
|
var permissions_guard_1 = require("./core/auth/guards/permissions.guard");
|
|
46
46
|
Object.defineProperty(exports, "PermissionsGuard", { enumerable: true, get: function () { return permissions_guard_1.PermissionsGuard; } });
|
|
47
|
+
var permissionScope_util_1 = require("./core/auth/permissionScope.util");
|
|
48
|
+
Object.defineProperty(exports, "anyOrTeam", { enumerable: true, get: function () { return permissionScope_util_1.anyOrTeam; } });
|
|
49
|
+
Object.defineProperty(exports, "SCOPE_ANY", { enumerable: true, get: function () { return permissionScope_util_1.SCOPE_ANY; } });
|
|
50
|
+
Object.defineProperty(exports, "SCOPE_TEAM", { enumerable: true, get: function () { return permissionScope_util_1.SCOPE_TEAM; } });
|
|
47
51
|
var applyFilter_util_1 = require("./core/query/applyFilter.util");
|
|
48
52
|
Object.defineProperty(exports, "applyFilter", { enumerable: true, get: function () { return applyFilter_util_1.applyFilter; } });
|
|
49
53
|
var filter_constants_1 = require("./core/query/filter.constants");
|
|
@@ -79,12 +83,10 @@ var seedAdmin_1 = require("./core/database/seeds/seedAdmin");
|
|
|
79
83
|
Object.defineProperty(exports, "seedAdmin", { enumerable: true, get: function () { return seedAdmin_1.seedAdmin; } });
|
|
80
84
|
var seedPermissions_1 = require("./core/database/seeds/seedPermissions");
|
|
81
85
|
Object.defineProperty(exports, "seedPermissions", { enumerable: true, get: function () { return seedPermissions_1.seedPermissions; } });
|
|
82
|
-
var auditChange_schema_1 = require("./features/audit/infra/schema/auditChange.schema");
|
|
83
|
-
Object.defineProperty(exports, "AuditChange", { enumerable: true, get: function () { return auditChange_schema_1.AuditChange; } });
|
|
84
86
|
var auditDataChange_schema_1 = require("./features/audit/infra/schema/auditDataChange.schema");
|
|
85
87
|
Object.defineProperty(exports, "AuditDataChange", { enumerable: true, get: function () { return auditDataChange_schema_1.AuditDataChange; } });
|
|
86
|
-
var
|
|
87
|
-
Object.defineProperty(exports, "
|
|
88
|
+
var requestLog_schema_1 = require("./features/audit/infra/schema/requestLog.schema");
|
|
89
|
+
Object.defineProperty(exports, "RequestLog", { enumerable: true, get: function () { return requestLog_schema_1.RequestLog; } });
|
|
88
90
|
var authToken_schema_1 = require("./features/auth/infra/schema/authToken.schema");
|
|
89
91
|
Object.defineProperty(exports, "AuthToken", { enumerable: true, get: function () { return authToken_schema_1.AuthToken; } });
|
|
90
92
|
var notification_schema_1 = require("./features/notifications/infra/schema/notification.schema");
|
|
@@ -119,6 +121,12 @@ var codedError_util_1 = require("./core/utils/codedError.util");
|
|
|
119
121
|
Object.defineProperty(exports, "codedBadRequest", { enumerable: true, get: function () { return codedError_util_1.codedBadRequest; } });
|
|
120
122
|
Object.defineProperty(exports, "codedTooManyRequests", { enumerable: true, get: function () { return codedError_util_1.codedTooManyRequests; } });
|
|
121
123
|
Object.defineProperty(exports, "codedUnauthorized", { enumerable: true, get: function () { return codedError_util_1.codedUnauthorized; } });
|
|
124
|
+
var errorType_enum_1 = require("./features/audit/domain/enums/errorType.enum");
|
|
125
|
+
Object.defineProperty(exports, "ErrorType", { enumerable: true, get: function () { return errorType_enum_1.ErrorType; } });
|
|
126
|
+
var requestOutcome_enum_1 = require("./features/audit/domain/enums/requestOutcome.enum");
|
|
127
|
+
Object.defineProperty(exports, "RequestOutcome", { enumerable: true, get: function () { return requestOutcome_enum_1.RequestOutcome; } });
|
|
128
|
+
var auditable_decorator_1 = require("./features/audit/presentation/decorators/auditable.decorator");
|
|
129
|
+
Object.defineProperty(exports, "Auditable", { enumerable: true, get: function () { return auditable_decorator_1.Auditable; } });
|
|
122
130
|
var baseGateway_1 = require("./core/websocket/baseGateway");
|
|
123
131
|
Object.defineProperty(exports, "BaseGateway", { enumerable: true, get: function () { return baseGateway_1.BaseGateway; } });
|
|
124
132
|
var socket_constants_1 = require("./core/websocket/socket.constants");
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FirstAccessTokenType1786060800000 = void 0;
|
|
4
|
-
class FirstAccessTokenType1786060800000 {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.name = "FirstAccessTokenType1786060800000";
|
|
7
|
-
}
|
|
8
|
-
async up(queryRunner) {
|
|
9
|
-
await queryRunner.query(`
|
|
10
|
-
ALTER TABLE auth_tokens
|
|
11
|
-
MODIFY COLUMN type ENUM('password_reset','first_access','two_factor_email','refresh_token','totp_used') NOT NULL
|
|
12
|
-
`);
|
|
13
|
-
}
|
|
14
|
-
async down(queryRunner) {
|
|
15
|
-
await queryRunner.query(`DELETE FROM auth_tokens WHERE type = 'first_access'`);
|
|
16
|
-
await queryRunner.query(`ALTER TABLE auth_tokens MODIFY COLUMN type varchar(30) NOT NULL`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.FirstAccessTokenType1786060800000 = FirstAccessTokenType1786060800000;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PermanentAccountLock1786147200000 = void 0;
|
|
4
|
-
class PermanentAccountLock1786147200000 {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.name = "PermanentAccountLock1786147200000";
|
|
7
|
-
}
|
|
8
|
-
async up(queryRunner) {
|
|
9
|
-
await queryRunner.query(`ALTER TABLE users DROP COLUMN locked_until`);
|
|
10
|
-
}
|
|
11
|
-
async down(queryRunner) {
|
|
12
|
-
await queryRunner.query(`ALTER TABLE users ADD COLUMN locked_until datetime NULL`);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.PermanentAccountLock1786147200000 = PermanentAccountLock1786147200000;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Notifications1786233600000 = void 0;
|
|
4
|
-
class Notifications1786233600000 {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.name = "Notifications1786233600000";
|
|
7
|
-
}
|
|
8
|
-
async up(queryRunner) {
|
|
9
|
-
const ts = `
|
|
10
|
-
created_at datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
|
|
11
|
-
updated_at datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
|
|
12
|
-
deleted_at datetime(6) NULL
|
|
13
|
-
`;
|
|
14
|
-
await queryRunner.query(`
|
|
15
|
-
CREATE TABLE notifications (
|
|
16
|
-
id char(36) NOT NULL,
|
|
17
|
-
title varchar(255) NOT NULL,
|
|
18
|
-
body text NOT NULL,
|
|
19
|
-
payload json NULL,
|
|
20
|
-
type enum('INFO','SUCCESS','WARNING','ERROR') NOT NULL,
|
|
21
|
-
created_by char(36) NULL,
|
|
22
|
-
${ts},
|
|
23
|
-
PRIMARY KEY (id),
|
|
24
|
-
KEY IDX_notifications_created_at (created_at)
|
|
25
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
26
|
-
`);
|
|
27
|
-
await queryRunner.query(`
|
|
28
|
-
CREATE TABLE notification_scopes (
|
|
29
|
-
id char(36) NOT NULL,
|
|
30
|
-
notification_id char(36) NOT NULL,
|
|
31
|
-
scope_type enum('USER','ROLE','ALL') NOT NULL,
|
|
32
|
-
scope_key varchar(100) NULL,
|
|
33
|
-
${ts},
|
|
34
|
-
PRIMARY KEY (id),
|
|
35
|
-
KEY IDX_notification_scopes_notification (notification_id),
|
|
36
|
-
KEY IDX_notification_scopes_target (scope_type, scope_key),
|
|
37
|
-
CONSTRAINT FK_notification_scopes_notification
|
|
38
|
-
FOREIGN KEY (notification_id) REFERENCES notifications (id) ON DELETE CASCADE
|
|
39
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
40
|
-
`);
|
|
41
|
-
await queryRunner.query(`
|
|
42
|
-
CREATE TABLE notification_reads (
|
|
43
|
-
notification_id char(36) NOT NULL,
|
|
44
|
-
user_id char(36) NOT NULL,
|
|
45
|
-
read_at datetime NOT NULL,
|
|
46
|
-
PRIMARY KEY (notification_id, user_id),
|
|
47
|
-
KEY IDX_notification_reads_user (user_id),
|
|
48
|
-
CONSTRAINT FK_notification_reads_notification
|
|
49
|
-
FOREIGN KEY (notification_id) REFERENCES notifications (id) ON DELETE CASCADE
|
|
50
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
51
|
-
`);
|
|
52
|
-
}
|
|
53
|
-
async down(queryRunner) {
|
|
54
|
-
await queryRunner.query(`DROP TABLE notification_reads`);
|
|
55
|
-
await queryRunner.query(`DROP TABLE notification_scopes`);
|
|
56
|
-
await queryRunner.query(`DROP TABLE notifications`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.Notifications1786233600000 = Notifications1786233600000;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DataSource, Repository } from "typeorm";
|
|
2
|
-
import { PaginationQuery } from "../../../../core/utils/pagination.util";
|
|
3
|
-
import { AuditChange } from "../schema/auditChange.schema";
|
|
4
|
-
export declare class AuditChangeRepository extends Repository<AuditChange> {
|
|
5
|
-
constructor(dataSource: DataSource);
|
|
6
|
-
findPaginated(query: PaginationQuery): Promise<[AuditChange[], number]>;
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DataSource, Repository } from "typeorm";
|
|
2
|
-
import { PaginationQuery } from "../../../../core/utils/pagination.util";
|
|
3
|
-
import { ErrorLog } from "../schema/errorLog.schema";
|
|
4
|
-
export declare class ErrorLogRepository extends Repository<ErrorLog> {
|
|
5
|
-
constructor(dataSource: DataSource);
|
|
6
|
-
findPaginated(query: PaginationQuery): Promise<[ErrorLog[], number]>;
|
|
7
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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.ErrorLogRepository = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const typeorm_1 = require("typeorm");
|
|
15
|
-
const paginateWithFilter_util_1 = require("../../../../core/query/paginateWithFilter.util");
|
|
16
|
-
const errorLog_schema_1 = require("../schema/errorLog.schema");
|
|
17
|
-
const audit_filters_1 = require("../../presentation/filters/audit.filters");
|
|
18
|
-
let ErrorLogRepository = class ErrorLogRepository extends typeorm_1.Repository {
|
|
19
|
-
constructor(dataSource) {
|
|
20
|
-
super(errorLog_schema_1.ErrorLog, dataSource.createEntityManager());
|
|
21
|
-
}
|
|
22
|
-
findPaginated(query) {
|
|
23
|
-
return (0, paginateWithFilter_util_1.paginateWithFilter)(this.createQueryBuilder("errorLog"), {
|
|
24
|
-
query,
|
|
25
|
-
catalog: audit_filters_1.ERROR_LOGS_FILTER_CATALOG,
|
|
26
|
-
defaultSort: "createdAt",
|
|
27
|
-
searchFields: ["message", "path"],
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
exports.ErrorLogRepository = ErrorLogRepository;
|
|
32
|
-
exports.ErrorLogRepository = ErrorLogRepository = __decorate([
|
|
33
|
-
(0, common_1.Injectable)(),
|
|
34
|
-
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
35
|
-
], ErrorLogRepository);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BaseEntity } from "../../../../core/database/base.schema";
|
|
2
|
-
export declare class AuditChange extends BaseEntity {
|
|
3
|
-
userId?: string | null;
|
|
4
|
-
action: string;
|
|
5
|
-
entity?: string | null;
|
|
6
|
-
entityId?: string | null;
|
|
7
|
-
method?: string | null;
|
|
8
|
-
path?: string | null;
|
|
9
|
-
ipAddress?: string | null;
|
|
10
|
-
statusCode?: number | null;
|
|
11
|
-
durationMs?: number | null;
|
|
12
|
-
requestId?: string | null;
|
|
13
|
-
metadata?: Record<string, unknown> | null;
|
|
14
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
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.AuditChange = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const base_schema_1 = require("../../../../core/database/base.schema");
|
|
15
|
-
let AuditChange = class AuditChange extends base_schema_1.BaseEntity {
|
|
16
|
-
};
|
|
17
|
-
exports.AuditChange = AuditChange;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.Column)({ name: "user_id", type: "char", length: 36, nullable: true }),
|
|
20
|
-
__metadata("design:type", Object)
|
|
21
|
-
], AuditChange.prototype, "userId", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 100 }),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], AuditChange.prototype, "action", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
|
|
28
|
-
__metadata("design:type", Object)
|
|
29
|
-
], AuditChange.prototype, "entity", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)({ name: "entity_id", type: "varchar", length: 36, nullable: true }),
|
|
32
|
-
__metadata("design:type", Object)
|
|
33
|
-
], AuditChange.prototype, "entityId", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 10, nullable: true }),
|
|
36
|
-
__metadata("design:type", Object)
|
|
37
|
-
], AuditChange.prototype, "method", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
40
|
-
__metadata("design:type", Object)
|
|
41
|
-
], AuditChange.prototype, "path", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.Column)({ name: "ip_address", type: "varchar", length: 45, nullable: true }),
|
|
44
|
-
__metadata("design:type", Object)
|
|
45
|
-
], AuditChange.prototype, "ipAddress", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.Column)({ name: "status_code", type: "int", nullable: true }),
|
|
48
|
-
__metadata("design:type", Object)
|
|
49
|
-
], AuditChange.prototype, "statusCode", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typeorm_1.Column)({ name: "duration_ms", type: "int", nullable: true }),
|
|
52
|
-
__metadata("design:type", Object)
|
|
53
|
-
], AuditChange.prototype, "durationMs", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, typeorm_1.Column)({ name: "request_id", type: "char", length: 36, nullable: true }),
|
|
56
|
-
__metadata("design:type", Object)
|
|
57
|
-
], AuditChange.prototype, "requestId", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, typeorm_1.Column)({ type: "json", nullable: true }),
|
|
60
|
-
__metadata("design:type", Object)
|
|
61
|
-
], AuditChange.prototype, "metadata", void 0);
|
|
62
|
-
exports.AuditChange = AuditChange = __decorate([
|
|
63
|
-
(0, typeorm_1.Entity)("audit_changes"),
|
|
64
|
-
(0, typeorm_1.Index)(["userId"]),
|
|
65
|
-
(0, typeorm_1.Index)(["entity"]),
|
|
66
|
-
(0, typeorm_1.Index)(["requestId"]),
|
|
67
|
-
(0, typeorm_1.Index)(["statusCode"])
|
|
68
|
-
], AuditChange);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BaseEntity } from "../../../../core/database/base.schema";
|
|
2
|
-
export declare enum ErrorType {
|
|
3
|
-
VALIDATION = "VALIDATION",
|
|
4
|
-
AUTH = "AUTH",
|
|
5
|
-
NOT_FOUND = "NOT_FOUND",
|
|
6
|
-
RATE_LIMIT = "RATE_LIMIT",
|
|
7
|
-
DATABASE = "DATABASE",
|
|
8
|
-
INTEGRATION = "INTEGRATION",
|
|
9
|
-
INTERNAL = "INTERNAL"
|
|
10
|
-
}
|
|
11
|
-
export declare class ErrorLog extends BaseEntity {
|
|
12
|
-
statusCode?: number | null;
|
|
13
|
-
type: ErrorType;
|
|
14
|
-
message: string;
|
|
15
|
-
stack?: string | null;
|
|
16
|
-
method?: string | null;
|
|
17
|
-
path?: string | null;
|
|
18
|
-
userId?: string | null;
|
|
19
|
-
ipAddress?: string | null;
|
|
20
|
-
requestId?: string | null;
|
|
21
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
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.ErrorLog = exports.ErrorType = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const base_schema_1 = require("../../../../core/database/base.schema");
|
|
15
|
-
var ErrorType;
|
|
16
|
-
(function (ErrorType) {
|
|
17
|
-
ErrorType["VALIDATION"] = "VALIDATION";
|
|
18
|
-
ErrorType["AUTH"] = "AUTH";
|
|
19
|
-
ErrorType["NOT_FOUND"] = "NOT_FOUND";
|
|
20
|
-
ErrorType["RATE_LIMIT"] = "RATE_LIMIT";
|
|
21
|
-
ErrorType["DATABASE"] = "DATABASE";
|
|
22
|
-
ErrorType["INTEGRATION"] = "INTEGRATION";
|
|
23
|
-
ErrorType["INTERNAL"] = "INTERNAL";
|
|
24
|
-
})(ErrorType || (exports.ErrorType = ErrorType = {}));
|
|
25
|
-
let ErrorLog = class ErrorLog extends base_schema_1.BaseEntity {
|
|
26
|
-
};
|
|
27
|
-
exports.ErrorLog = ErrorLog;
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, typeorm_1.Column)({ name: "status_code", type: "int", nullable: true }),
|
|
30
|
-
__metadata("design:type", Object)
|
|
31
|
-
], ErrorLog.prototype, "statusCode", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, typeorm_1.Column)({ type: "enum", enum: ErrorType, default: ErrorType.INTERNAL }),
|
|
34
|
-
__metadata("design:type", String)
|
|
35
|
-
], ErrorLog.prototype, "type", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 255 }),
|
|
38
|
-
__metadata("design:type", String)
|
|
39
|
-
], ErrorLog.prototype, "message", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
42
|
-
__metadata("design:type", Object)
|
|
43
|
-
], ErrorLog.prototype, "stack", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 10, nullable: true }),
|
|
46
|
-
__metadata("design:type", Object)
|
|
47
|
-
], ErrorLog.prototype, "method", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
50
|
-
__metadata("design:type", Object)
|
|
51
|
-
], ErrorLog.prototype, "path", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, typeorm_1.Column)({ name: "user_id", type: "char", length: 36, nullable: true }),
|
|
54
|
-
__metadata("design:type", Object)
|
|
55
|
-
], ErrorLog.prototype, "userId", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, typeorm_1.Column)({ name: "ip_address", type: "varchar", length: 45, nullable: true }),
|
|
58
|
-
__metadata("design:type", Object)
|
|
59
|
-
], ErrorLog.prototype, "ipAddress", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, typeorm_1.Column)({ name: "request_id", type: "char", length: 36, nullable: true }),
|
|
62
|
-
__metadata("design:type", Object)
|
|
63
|
-
], ErrorLog.prototype, "requestId", void 0);
|
|
64
|
-
exports.ErrorLog = ErrorLog = __decorate([
|
|
65
|
-
(0, typeorm_1.Entity)("error_logs"),
|
|
66
|
-
(0, typeorm_1.Index)(["statusCode"]),
|
|
67
|
-
(0, typeorm_1.Index)(["type"]),
|
|
68
|
-
(0, typeorm_1.Index)(["requestId"])
|
|
69
|
-
], ErrorLog);
|