UNPKG

n8n

Version:

n8n Workflow Automation Tool

20 lines (19 loc) 823 B
import SSEChannel from 'sse-channel'; import { Logger } from '../Logger'; import { AbstractPush } from './abstract.push'; import type { PushRequest, PushResponse } from './types'; import type { User } from '../databases/entities/User'; import { OrchestrationService } from '../services/orchestration.service'; type Connection = { req: PushRequest; res: PushResponse; }; export declare class SSEPush extends AbstractPush<Connection> { readonly channel: SSEChannel; readonly connections: Record<string, Connection>; constructor(logger: Logger, orchestrationService: OrchestrationService); add(pushRef: string, userId: User['id'], connection: Connection): void; protected close({ res }: Connection): void; protected sendToOneConnection(connection: Connection, data: string): void; } export {};