import type { OpenAPIV3_1 } from 'openapi-types'; import type { GeneratedFile } from './types.js'; type OperationObject = OpenAPIV3_1.OperationObject; type PathItemObject = OpenAPIV3_1.PathItemObject; /** * Normalize a query parameter name to a valid TypeScript identifier. * - Strips the [] suffix used by some APIs (PHP/Rails array convention): 'ids[]' -> 'ids' * - Converts dot/hyphen-separated names to camelCase: 'place.fields' -> 'placeFields' * The original name is preserved separately (as urlName) for URL query string building. * * Uses a linear character scan (via camelCaseSeparators) instead of the * regex `/[^a-zA-Z0-9]+([a-zA-Z])/g` which is polynomial-backtracking * vulnerable (CodeQL js/polynomial-redos, issue #261). */ export declare function normalizeQueryParamName(name: string): string; /** * Returns flags indicating whether an operation has a `params` object in its * client function signature, and whether that object is required. * * Mirrors the client generator's exact rule: params is present when the * operation has at least one query or header parameter; it is required when at * least one of those parameters is required. Resolves $ref parameters and * merges path-item level parameters so the result is accurate for specs that * define parameters via $ref. * * Exported so the hooks generator can reuse this single source of truth * instead of forking a subtly-different copy. */ export declare function getParamPresence(pathItem: PathItemObject, operation: OperationObject, spec: OpenAPIV3_1.Document): { hasParams: boolean; hasRequiredParams: boolean; }; /** * Structured description of the auth schemes declared in a spec. * Drives conditional code-gen in both the request helpers and ClientConfig. */ export interface AuthSchemes { /** Spec declares http bearer, OAuth 2, or any unrecognized http scheme. */ hasBearerOrOAuth: boolean; /** Spec declares http basic authentication. */ hasBasicAuth: boolean; /** * Header names for apiKey-in-header schemes (e.g. ["X-API-Key"]). * Populated from the `name` field of each apiKey scheme with `in: header`. */ apiKeyHeaderNames: string[]; /** * Query parameter names for apiKey-in-query schemes (e.g. ["api_key"]). * Populated from the `name` field of each apiKey scheme with `in: query`. */ apiKeyQueryNames: string[]; } /** * Detects the auth schemes declared in a spec and returns a structured description. * Skips $ref security scheme entries and cookie apiKey (handled separately via hasCookieAuth). * * Fallback: when a security requirement references a scheme name that is NOT defined in * components/securitySchemes (or has no scheme definitions at all), we treat it as * bearer-style auth. Cookie-only specs are NOT treated as bearer. */ export declare function detectAuthSchemes(spec: OpenAPIV3_1.Document): AuthSchemes; export interface ClientOptions { schemaNames?: Set; schemaImportPath?: string; } export declare function hasCookieAuth(spec: OpenAPIV3_1.Document): boolean; /** * Names that are defined or imported at file scope in the generated client output. * Any spec-derived operation whose sanitized name matches one of these receives a * numeric suffix (_2, _3, ...) so it never shadows a client-internal identifier. * * Exported so the hooks generator can pre-seed its own uniquification pass with the * same set, keeping both generators in sync without duplicating this list. */ export declare const CLIENT_INTERNAL_NAMES: ReadonlySet; export declare function generateClient(spec: OpenAPIV3_1.Document, options?: ClientOptions, writableVariantMap?: Map): GeneratedFile; export {}; //# sourceMappingURL=client.d.ts.map