import { type LogService } from 'common-services'; import { type ValidateFunction } from 'ajv'; import { type OpenAPIParameter, type OpenAPIExtension, type OpenAPI, type OpenAPISecurityScheme, type OpenAPIReference, type OpenAPISecurityRequirement } from 'ya-open-api-types'; import { type WhookCoercionOptions } from './coercion.js'; import { JSONSchema, type ExpressiveJSONSchema } from 'ya-json-schema-types'; import { type WhookSchemaValidatorsService } from '../services/schemaValidators.js'; import { type WhookRequestBody } from '../types/http.js'; import { type WhookOpenAPIOperation, type WhookOpenAPI, type WhookSupportedParameter } from '../types/openapi.js'; export type WhookBodyValidator = (operation: WhookOpenAPIOperation, contentType: string, body: WhookRequestBody | undefined) => void; export declare function prepareBodyValidator({ API, schemaValidators, }: { API: OpenAPI; schemaValidators: WhookSchemaValidatorsService; }, operation: WhookOpenAPIOperation): Promise; export declare function extractSecuritySchemesNames(requirements: OpenAPISecurityRequirement[]): string[]; export declare function extractAPISchemesKeysCombinations({ API, }: { API: T; }): Promise; export declare function extractOperationSchemesKeysCombination({ API, }: { API: T; }, operation: WhookOpenAPIOperation): Promise; export declare function extractParametersFromSchemesKeysCombination({ API }: { API: T; }, schemesKeysCombination: string[]): Promise; export declare function extractOperationSecurityParameters({ API }: { API: WhookOpenAPI; }, operation: WhookOpenAPIOperation): Promise; export declare function extractAPISecurityParametersSchemas({ API, }: { API: WhookOpenAPI; }): Promise; export declare function extractParametersFromSecuritySchemes(securitySchemes: OpenAPISecurityScheme[]): WhookSupportedParameter[]; export declare function resolveParameters({ API, log, }: { API: T; log?: LogService; }, parameters: (OpenAPIParameter | OpenAPIReference>)[]): Promise; export type WhookParameterValue = boolean | boolean[] | string | string[] | number | number[] | undefined; export type WhookParameterCaster = (str: T) => WhookParameterValue; export type WhookParameterValidator = (str: T | undefined) => WhookParameterValue; export type WhookParametersValidators = Record<'query' | 'header' | 'path' | 'cookie' | 'querystring', Record>>; export declare function getCasterForSchema({ API, COERCION_OPTIONS, }: { API: WhookOpenAPI; COERCION_OPTIONS: WhookCoercionOptions; }, schema: JSONSchema): Promise>; export declare function createParameterValidator({ API, COERCION_OPTIONS, schemaValidators, }: { API: WhookOpenAPI; COERCION_OPTIONS: WhookCoercionOptions; schemaValidators: WhookSchemaValidatorsService; }, parameter: WhookSupportedParameter): Promise>; export declare function createParametersValidators({ API, COERCION_OPTIONS, schemaValidators, }: { API: WhookOpenAPI; COERCION_OPTIONS: WhookCoercionOptions; schemaValidators: WhookSchemaValidatorsService; }, parameters: WhookSupportedParameter[]): Promise>; export declare function validateParameter(parameter: OpenAPIParameter, caster: WhookParameterCaster | undefined, validator: ValidateFunction, str: T | undefined): WhookParameterValue | undefined;