import { OpenAPIObject } from 'openapi3-ts/oas31'; import { ServiceDefinition } from '../ServiceDefinition.ts'; import { PrismApp } from '../app/PrismApp.ts'; import express from 'express'; export interface OpenAPIConfig { enable: boolean; enableSwagger?: boolean; } export type ParseExpressPathForOpenAPIResult = { openApiPath: string; pathParams: string[]; }; export interface OpenAPIDocumentInfo { version: string; title: string; description: string; } /** * Transforms path parameters in an Express-style URL path (e.g. :pathParameter) into their OpenAPI equivalents (e.g. {pathParameter}) * Returns the transformed OpenAPI-style URL path along with any path parameters found. * * @param {string} expressApiPath - An Express-style URL path * @returns {ParseExpressPathForOpenAPIResult} - the transformed OpenAPI-style URL path with any path parameters found */ export declare function parseExpressPathForOpenAPI(expressApiPath: string): ParseExpressPathForOpenAPIResult; /** * Generates the Open API Schema for all services. * * @param {ServiceDefinition[]} services - Array of service definitions to generate OpenAPI schema for * @param {OpenAPIDocumentInfo} documentInfo - Metadata for the OpenAPI document * @returns {OpenAPIObject} - the Open API schema for all service definitions. */ export declare function generateOpenAPISchema(services: ServiceDefinition[], documentInfo: OpenAPIDocumentInfo): OpenAPIObject; /** * Sets up Swagger UI to serve interactive API documentation * * @param app - Express application instance * @param openApiJsonPath - Path where the OpenAPI JSON schema is served (default: '/openapi.json') */ export interface ProblematicEndpoint { serviceName: string; path: string; method: string; error: string; } /** * Finds endpoints that will fail OpenAPI schema generation. * Tests each endpoint individually to identify which ones have unsupported Zod types. * * @param services - Array of service definitions to check * @returns Array of problematic endpoints with error details */ export declare function findProblematicEndpoints(services: ServiceDefinition[]): ProblematicEndpoint[]; export declare function setupSwaggerUI(app: express.Application, openApiJsonPath?: string): void; export declare function mountOpenAPIEndpoints(config: OpenAPIConfig, expressApp: express.Application, prismApp: PrismApp): void; //# sourceMappingURL=OpenAPI.d.ts.map