@nestjsvn/swagger-sse
Version:
OpenAPI documentation and interactive Swagger UI for NestJS Server-Sent Events endpoints
33 lines (32 loc) • 1.16 kB
TypeScript
import { Type } from '@nestjs/common';
/**
* Security requirement object for OpenAPI
*/
export interface SecurityRequirementObject {
[]: string[];
}
/**
* Configuration options for the @ApiSse decorator
*/
export interface ApiSseOptions {
/** Map of event names to their corresponding DTO types */
events: {
[]: Type<unknown> | (new (...args: any[]) => any) | [new (...args: any[]) => any] | string;
};
/** Default event type for messages without explicit event name */
defaultEvent?: Type<unknown> | (new (...args: any[]) => any) | [new (...args: any[]) => any] | string;
/** Response content type (defaults to 'text/event-stream') */
produces?: string;
/** Short summary of the operation */
summary?: string;
/** Detailed description of the operation */
description?: string;
/** Unique operation identifier */
operationId?: string;
/** Tags for grouping operations */
tags?: string[];
/** Mark operation as deprecated */
deprecated?: boolean;
/** Security requirements for the operation */
security?: SecurityRequirementObject[];
}