mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
refactor(core): Rename EventRelay to EventService (no-changelog) (#10110)
This commit is contained in:
@@ -23,7 +23,7 @@ import { InternalHooks } from '@/InternalHooks';
|
||||
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
|
||||
import { UserRepository } from '@/databases/repositories/user.repository';
|
||||
import { isApiEnabled } from '@/PublicApi';
|
||||
import { EventRelay } from '@/eventbus/event-relay.service';
|
||||
import { EventService } from '@/eventbus/event.service';
|
||||
|
||||
export const isApiEnabledMiddleware: RequestHandler = (_, res, next) => {
|
||||
if (isApiEnabled()) {
|
||||
@@ -43,7 +43,7 @@ export class MeController {
|
||||
private readonly userService: UserService,
|
||||
private readonly passwordUtility: PasswordUtility,
|
||||
private readonly userRepository: UserRepository,
|
||||
private readonly eventRelay: EventRelay,
|
||||
private readonly eventService: EventService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -100,7 +100,7 @@ export class MeController {
|
||||
|
||||
const fieldsChanged = Object.keys(payload);
|
||||
void this.internalHooks.onUserUpdate({ user, fields_changed: fieldsChanged });
|
||||
this.eventRelay.emit('user-updated', { user, fieldsChanged });
|
||||
this.eventService.emit('user-updated', { user, fieldsChanged });
|
||||
|
||||
const publicUser = await this.userService.toPublic(user);
|
||||
|
||||
@@ -150,7 +150,7 @@ export class MeController {
|
||||
this.authService.issueCookie(res, updatedUser, req.browserId);
|
||||
|
||||
void this.internalHooks.onUserUpdate({ user: updatedUser, fields_changed: ['password'] });
|
||||
this.eventRelay.emit('user-updated', { user: updatedUser, fieldsChanged: ['password'] });
|
||||
this.eventService.emit('user-updated', { user: updatedUser, fieldsChanged: ['password'] });
|
||||
|
||||
await this.externalHooks.run('user.password.update', [updatedUser.email, updatedUser.password]);
|
||||
|
||||
@@ -199,7 +199,7 @@ export class MeController {
|
||||
await this.userService.update(req.user.id, { apiKey });
|
||||
|
||||
void this.internalHooks.onApiKeyCreated({ user: req.user, public_api: false });
|
||||
this.eventRelay.emit('api-key-created', { user: req.user });
|
||||
this.eventService.emit('api-key-created', { user: req.user });
|
||||
|
||||
return { apiKey };
|
||||
}
|
||||
@@ -220,7 +220,7 @@ export class MeController {
|
||||
await this.userService.update(req.user.id, { apiKey: null });
|
||||
|
||||
void this.internalHooks.onApiKeyDeleted({ user: req.user, public_api: false });
|
||||
this.eventRelay.emit('api-key-deleted', { user: req.user });
|
||||
this.eventService.emit('api-key-deleted', { user: req.user });
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user