import type { OpenAPIV3_1 } from 'openapi-types'; type ReferenceObject = OpenAPIV3_1.ReferenceObject; type ParameterObject = OpenAPIV3_1.ParameterObject; export declare const SUPPORTED_METHODS: readonly ["get", "post", "put", "patch", "delete"]; export type SupportedMethod = (typeof SUPPORTED_METHODS)[number]; export declare function isRef(obj: unknown): obj is ReferenceObject; export declare function refToName(ref: string): string; /** * Extract path param names from an OpenAPI path string in template order. * Returns raw names as they appear in the path (e.g. 'job-id', not 'jobId'). * Callers that need valid TypeScript identifiers must sanitize with sanitizeOperationId. */ export declare function extractPathParamsFromPath(path: string): string[]; export declare function resolveParam(p: ParameterObject | ReferenceObject, spec: OpenAPIV3_1.Document): ParameterObject | undefined; export declare function deriveServiceName(spec: OpenAPIV3_1.Document): string; /** * Converts a raw operationId into a valid camelCase JS identifier. * Handles kebab-case, snake_case, dots, spaces, parens, braces and other * non-alphanumeric separators found in real-world OpenAPI specs. * e.g. "post-applePay-sessions" -> "postApplePaySessions" * e.g. "calendar.calendars.insert" -> "calendarCalendarsInsert" * e.g. "Get User Profile" -> "getUserProfile" * e.g. "forgotPassword(oneTimeCode)" -> "forgotPasswordOneTimeCode" */ export declare function sanitizeOperationId(id: string): string; export declare function deriveMethodName(operationId: string | undefined, method: string, path: string): string; export declare function deriveOperationName(method: string, path: string): string; /** Normalize a raw query param name to a valid TypeScript identifier. * Strips trailing [] (array marker), converts separators to camelCase. */ export declare function normalizeParamName(name: string): string; export declare function schemaToTsType(schema: OpenAPIV3_1.SchemaObject | ReferenceObject | undefined): string; export interface QueryParam { name: string; /** Raw parameter name as it appears in the spec (before normalizeParamName). */ rawName: string; tsType: string; required: boolean; /** Allowed values from the schema enum constraint. */ enum?: string[]; /** Inclusive minimum from schema.minimum. */ minimum?: number; /** Inclusive maximum from schema.maximum. */ maximum?: number; /** Exclusive minimum from schema.exclusiveMinimum (numeric form, OpenAPI 3.1). */ exclusiveMinimum?: number; /** Exclusive maximum from schema.exclusiveMaximum (numeric form, OpenAPI 3.1). */ exclusiveMaximum?: number; /** Minimum string length from schema.minLength. */ minLength?: number; /** Maximum string length from schema.maxLength. */ maxLength?: number; /** Regex pattern from schema.pattern. */ pattern?: string; /** * Delimiter style for array query params with explode:false. * 'csv' = comma (style:form + explode:false), 'ssv' = space, 'psv' = pipe. * When set, the raw query string value must be split on the delimiter before Zod validation. */ delimiterStyle?: 'csv' | 'ssv' | 'psv'; /** * When true, this param uses style:deepObject (e.g. filter[gte]=10&filter[lte]=20). * The router must collect all name[key]=value query entries and assemble them into a * nested object before Zod validation. */ isDeepObject?: boolean; /** * For deepObject params: property names and their types from the schema object. * Used to emit typed coercion (e.g. z.coerce.number()) per property. */ deepObjectProperties?: Array<{ key: string; tsType: string; }>; /** * When true, this param is a plain repeated-key array (type:array, explode:true which is * the default for arrays). The router must emit z.array() for the querystring * schema to match the service T[] type. This is distinct from delimiterStyle (explode:false) * and deepObject, which have their own handling. */ isArray?: boolean; /** * TypeScript type of the array items, derived from schema.items. Used to emit typed Zod * coercion (e.g. z.coerce.number() for integer/number items) inside z.array(). */ itemsTsType?: string; } export declare function getQueryParams(operation: OpenAPIV3_1.OperationObject, spec: OpenAPIV3_1.Document): QueryParam[]; /** * Entries of spec.paths whose path-item is a usable Path Item Object, in declaration order. * Malformed entries (array/null/primitive) are filtered out here so every operation collector * iterates only valid path items without repeating a guard, and pathItem[method] never throws. * warnOnNonObjectPathItems separately surfaces the dropped entries as a diagnostic (#375, #378). */ export declare function objectPathItemEntries(spec: OpenAPIV3_1.Document): Array<[string, Record]>; /** * Warn for each path-item that is not a valid Path Item Object (e.g. a JSON array, primitive, * or null). Such entries are silently skipped by every operation collector because * pathItem[method] is undefined, dropping ALL of that path's operations with no diagnostic. * Emitting a named warning surfaces the drop instead of losing it silently (#375, #378). A valid * but operation-less path item ({} or { parameters, description }) is a legitimate object and * does not warn; a $ref path item is also an object and is left alone (out of scope). */ export declare function warnOnNonObjectPathItems(spec: OpenAPIV3_1.Document): void; export interface BodyInfo { typeName: string | undefined; /** * When the body $ref points to a schema that has a writable variant (readOnly/writeOnly * properties, directly or transitively via nested $refs), this field holds the XWritable * type name to use for the TypeScript type annotation and casts. * The Zod validation schema name always uses the base typeName (${typeName}Schema) so * runtime validation is unchanged. * Undefined when there is no writable variant or typeName is synthesized/undefined. */ writableTypeName: string | undefined; /** The request body content type that was matched. Drives parser choice in the router. */ contentType: 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'application/octet-stream'; /** * True when typeName was synthesized from the operationId (inline schema, no $ref). * Synthesized names exist only for schema lookup (XxxSchema.safeParse) and are NOT * emitted as a TypeScript model type import — they have no entry in models.ts. */ isSynthesized: boolean; } export declare function getBodyInfo(operation: OpenAPIV3_1.OperationObject, writableVariantMap?: Map): BodyInfo | undefined; export {}; //# sourceMappingURL=shared.d.ts.map