rl-core-api 0.5.0 → 0.6.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.
@@ -49,6 +49,10 @@ class BaseGateway {
49
49
  this.logger.warn(`Evento ${event} descartado: sem sala de destino`);
50
50
  return;
51
51
  }
52
+ if (!this.server) {
53
+ this.logger.warn(`Evento ${event} descartado: servidor de socket não inicializado`);
54
+ return;
55
+ }
52
56
  this.server.to(targets).emit(event, (0, socketEvent_envelope_1.wrapSocketEvent)(event, data));
53
57
  }
54
58
  scheduleExpiry(socket, expiresAt) {
@@ -40,6 +40,6 @@ exports.NotificationsModule = NotificationsModule = __decorate([
40
40
  notifications_publisher_1.NotificationsPublisher,
41
41
  domainEvents_listener_1.DomainEventsListener,
42
42
  ],
43
- exports: [notifications_service_1.NotificationsService],
43
+ exports: [notifications_service_1.NotificationsService, notifications_publisher_1.NotificationsPublisher],
44
44
  })
45
45
  ], NotificationsModule);
package/dist/index.d.ts CHANGED
@@ -36,9 +36,13 @@ export { seedPermissions } from "./core/database/seeds/seedPermissions";
36
36
  export { AuditDataChange } from "./features/audit/infra/schema/auditDataChange.schema";
37
37
  export { RequestLog } from "./features/audit/infra/schema/requestLog.schema";
38
38
  export { AuthToken } from "./features/auth/infra/schema/authToken.schema";
39
+ export { NotificationType } from "./features/notifications/domain/enums/notificationType.enum";
40
+ export { ScopeType } from "./features/notifications/domain/enums/scopeType.enum";
41
+ export { NotificationsService, NotificationTarget, PublishNotificationParams, UserNotification, } from "./features/notifications/domain/notifications.service";
39
42
  export { Notification } from "./features/notifications/infra/schema/notification.schema";
40
43
  export { NotificationRead } from "./features/notifications/infra/schema/notificationRead.schema";
41
44
  export { NotificationScope } from "./features/notifications/infra/schema/notificationScope.schema";
45
+ export { NotificationsPublisher } from "./features/notifications/presentation/notifications.publisher";
42
46
  export { Action } from "./features/rbac/infra/schema/action.schema";
43
47
  export { Group } from "./features/rbac/infra/schema/group.schema";
44
48
  export { Permission } from "./features/rbac/infra/schema/permission.schema";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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;
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.NotificationsPublisher = exports.NotificationScope = exports.NotificationRead = exports.Notification = exports.NotificationsService = exports.ScopeType = exports.NotificationType = 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");
@@ -89,12 +89,20 @@ var requestLog_schema_1 = require("./features/audit/infra/schema/requestLog.sche
89
89
  Object.defineProperty(exports, "RequestLog", { enumerable: true, get: function () { return requestLog_schema_1.RequestLog; } });
90
90
  var authToken_schema_1 = require("./features/auth/infra/schema/authToken.schema");
91
91
  Object.defineProperty(exports, "AuthToken", { enumerable: true, get: function () { return authToken_schema_1.AuthToken; } });
92
+ var notificationType_enum_1 = require("./features/notifications/domain/enums/notificationType.enum");
93
+ Object.defineProperty(exports, "NotificationType", { enumerable: true, get: function () { return notificationType_enum_1.NotificationType; } });
94
+ var scopeType_enum_1 = require("./features/notifications/domain/enums/scopeType.enum");
95
+ Object.defineProperty(exports, "ScopeType", { enumerable: true, get: function () { return scopeType_enum_1.ScopeType; } });
96
+ var notifications_service_1 = require("./features/notifications/domain/notifications.service");
97
+ Object.defineProperty(exports, "NotificationsService", { enumerable: true, get: function () { return notifications_service_1.NotificationsService; } });
92
98
  var notification_schema_1 = require("./features/notifications/infra/schema/notification.schema");
93
99
  Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return notification_schema_1.Notification; } });
94
100
  var notificationRead_schema_1 = require("./features/notifications/infra/schema/notificationRead.schema");
95
101
  Object.defineProperty(exports, "NotificationRead", { enumerable: true, get: function () { return notificationRead_schema_1.NotificationRead; } });
96
102
  var notificationScope_schema_1 = require("./features/notifications/infra/schema/notificationScope.schema");
97
103
  Object.defineProperty(exports, "NotificationScope", { enumerable: true, get: function () { return notificationScope_schema_1.NotificationScope; } });
104
+ var notifications_publisher_1 = require("./features/notifications/presentation/notifications.publisher");
105
+ Object.defineProperty(exports, "NotificationsPublisher", { enumerable: true, get: function () { return notifications_publisher_1.NotificationsPublisher; } });
98
106
  var action_schema_1 = require("./features/rbac/infra/schema/action.schema");
99
107
  Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return action_schema_1.Action; } });
100
108
  var group_schema_1 = require("./features/rbac/infra/schema/group.schema");
@@ -33,6 +33,7 @@ let RlCoreModule = RlCoreModule_1 = class RlCoreModule {
33
33
  maintenance_module_1.MaintenanceModule,
34
34
  notifications_module_1.NotificationsModule,
35
35
  ],
36
+ exports: [notifications_module_1.NotificationsModule],
36
37
  };
37
38
  }
38
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rl-core-api",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Core NestJS: autenticação com 2FA, RBAC, auditoria, notificações e listagens com filtro dinâmico",
5
5
  "author": "Rodrigo Liberti",
6
6
  "license": "MIT",