import type { OpenAPIV3_1 } from 'openapi-types'; import { type SupportedMethod, type BodyInfo } from './shared.js'; type OperationObject = OpenAPIV3_1.OperationObject; /** Represents a header parameter to validate. */ export interface HeaderParam { /** Header name as defined in the spec (e.g. 'x-api-key'). */ rawName: string; /** Whether the header is required. */ required: boolean; /** Allowed values from the schema enum constraint. */ enum?: string[]; /** Minimum string length from schema.minLength. */ minLength?: number; /** Maximum string length from schema.maxLength. */ maxLength?: number; /** Regex pattern from schema.pattern. */ pattern?: string; } /** Represents a cookie parameter to validate (in: cookie). */ export interface CookieParam { /** Cookie name as defined in the spec. Cookie names are case-sensitive. */ rawName: string; /** Whether the cookie is required. */ required: boolean; /** Allowed values from the schema enum constraint. */ enum?: string[]; /** Minimum string length from schema.minLength. */ minLength?: number; /** Maximum string length from schema.maxLength. */ maxLength?: number; /** Regex pattern from schema.pattern. */ pattern?: string; } export interface ResponseStatus { status: number; isVoid: boolean; /** * The content type declared by the success response. * Drives the framework-specific response emit (c.json / c.text / c.body). * Defaults to 'application/json' for JSON and void responses. */ responseContentType: 'application/json' | 'text/plain' | 'application/octet-stream'; /** * True when the operation declares more than one 2xx success response. * The service method returns { status: number; body: T } and the router * forwards result.status and result.body verbatim, letting the handler * choose the appropriate status code at runtime. */ isMultiStatus?: boolean; } /** * Minimal operation shape required by collectSortedBodyTypes and collectUsedResponseSchemaNames. * Both RouteOperation local types in router.ts and fastify-type-provider.ts satisfy this * interface structurally. */ export interface OperationBase { bodyInfo: BodyInfo | undefined; responseTypeName?: string; responseStatus: ResponseStatus; } /** * Collect header parameters from an operation, including schema constraints. */ export declare function getHeaderParams(operation: OperationObject, spec: OpenAPIV3_1.Document): HeaderParam[]; /** * Collect cookie parameters (in: cookie) from an operation, including schema constraints. * Cookie names are case-sensitive and are used as-is for both the Zod field key and value lookup. */ export declare function getCookieParams(operation: OperationObject, spec: OpenAPIV3_1.Document): CookieParam[]; export declare function getResponseStatus(operation: OperationObject, httpMethod: SupportedMethod): ResponseStatus; /** * Collect the subset of schemaNames used as body schemas for the given operations. * Used by the Fastify emitter, which handles non-JSON body content types (multipart, * octet-stream) separately at the route level rather than at the schema collection level. * Router-specific collection (with isNonJsonBody guard) stays in router.ts. */ export declare function collectUsedSchemaNames(operations: OperationBase[], schemaNames: Set): Set; /** Collect sorted body type names from all operations. * Synthesized names (inline schema, no $ref) are excluded because they have no * corresponding entry in models.ts and must not appear in the model import. */ export declare function collectSortedBodyTypes(operations: OperationBase[]): string[]; /** * Collect the subset of schemaNames used as Fastify response schemas. * Only operations with a resolvable $ref response type (direct or array-of-$ref) * and a matching schema in schemaNames are included. * Multi-status operations are excluded because they cannot be mapped to a single * status code in schema.response at generation time. */ export declare function collectUsedResponseSchemaNames(operations: OperationBase[], schemaNames: Set): Set; export {}; //# sourceMappingURL=operation-ir.d.ts.map