UNPKG

@pulzar/core

Version:

Next-generation Node.js framework for ultra-fast web applications with zero-reflection DI, GraphQL, WebSockets, events, and edge runtime support

63 lines 1.67 kB
import { z } from "zod"; export interface OpenAPIConfig { title: string; version: string; description?: string; servers?: Array<{ url: string; description?: string; }>; contact?: { name?: string; email?: string; url?: string; }; license?: { name: string; url?: string; }; security?: Array<Record<string, string[]>>; } export interface RouteMetadata { summary?: string; description?: string; tags?: string[]; parameters?: Array<{ name: string; in: "path" | "query" | "header" | "cookie"; required?: boolean; schema: z.ZodSchema; description?: string; }>; requestBody?: { required?: boolean; content: Record<string, { schema: z.ZodSchema; }>; }; responses: Record<string, { description: string; content?: Record<string, { schema: z.ZodSchema; }>; }>; security?: Array<Record<string, string[]>>; } export declare class OpenAPIGenerator { private config; private routes; private schemas; constructor(config: OpenAPIConfig); addRoute(path: string, method: string, metadata: RouteMetadata): void; addSchema(name: string, schema: z.ZodSchema): void; generate(): any; private generatePaths; private generateSchemas; private generateSecuritySchemes; private zodToOpenAPI; private normalizePath; generateJSON(): string; generateYAML(): string; } export declare function createOpenAPIGenerator(config: OpenAPIConfig): OpenAPIGenerator; //# sourceMappingURL=generator.d.ts.map