mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-08-29 14:50:36 +02:00
18 lines
545 B
TypeScript
18 lines
545 B
TypeScript
import { Get, RestController } from '@n8n/decorators';
|
|
|
|
import { AuthenticatedRequest } from '@/requests';
|
|
|
|
import { EventService } from './event.service';
|
|
|
|
/** This controller holds endpoints that the frontend uses to trigger telemetry events */
|
|
@RestController('/events')
|
|
export class EventsController {
|
|
constructor(private readonly eventService: EventService) {}
|
|
|
|
@Get('/session-started')
|
|
sessionStarted(req: AuthenticatedRequest) {
|
|
const pushRef = req.headers['push-ref'];
|
|
this.eventService.emit('session-started', { pushRef });
|
|
}
|
|
}
|