import type { OpenAPIV3 } from 'openapi-types'; export type McpFileDescriptor = { name?: string; contentType?: string; } & ({ base64: string; } | { text: string; } | { filePath: string; }); export declare function isMcpFileDescriptor(value: unknown): value is McpFileDescriptor; export interface SchemeOauth2Config { tokenUrl?: string; scopes?: string[]; tokenEndpointAuthMethod?: 'client_secret_basic' | 'client_secret_post'; authMethod?: 'device_code' | 'authorization_code'; deviceAuthorizationEndpoint?: string; pkce?: boolean; } /** @deprecated Use per-scheme oauth2 config instead */ export interface ApiOauth2Config { tokenUrlOverride?: string; scopes?: string[]; tokenEndpointAuthMethod?: 'client_secret_basic' | 'client_secret_post'; } export type Oauth2ConfigMap = Record; export interface Retry429Config { maxRetries?: number; baseDelayMs?: number; maxDelayMs?: number; jitterRatio?: number; respectRetryAfter?: boolean; } export interface ApiConfig { name: string; specPath?: string; specUrl?: string; baseUrl?: string; timeoutMs?: number; headers?: Record; /** @deprecated Use per-scheme oauth2 config instead */ oauth2?: ApiOauth2Config; oauth2Schemes?: Oauth2ConfigMap; retry429?: Retry429Config; } export interface RootConfig { version: 1; apis: ApiConfig[]; } export type HttpMethod = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace'; export interface EndpointDefinition { endpointId: string; method: HttpMethod; path: string; operationId?: string; summary?: string; description?: string; tags?: string[]; operation: OpenAPIV3.OperationObject; pathItem: OpenAPIV3.PathItemObject; } export interface ResolvedApiKeyAuth { type: 'apiKey'; schemeName: string; in: 'query' | 'header' | 'cookie'; name: string; value: string; } export interface ResolvedOAuth2Auth { type: 'oauth2'; schemeName: string; token: string; } export interface ResolvedHttpAuth { type: 'http'; schemeName: string; scheme: 'bearer' | 'basic'; token?: string; username?: string; password?: string; } export type ResolvedAuthScheme = ResolvedApiKeyAuth | ResolvedOAuth2Auth | ResolvedHttpAuth; export interface ResolvedAuthResult { authUsed: string[]; schemes: ResolvedAuthScheme[]; interactiveAuth?: unknown; } export interface LoadedApi { config: ApiConfig; schemaPath: string; schema: OpenAPIV3.Document; baseUrl: string; endpoints: EndpointDefinition[]; endpointById: Map; authSchemeNames: string[]; } export interface ApiRegistry { byName: Map; } export interface MakeEndpointRequestInput { apiName: string; endpointId: string; pathParams?: Record; query?: Record; headers?: Record; cookies?: Record; body?: unknown; contentType?: string; accept?: string; timeoutMs?: number; retry429?: Retry429Config; } export interface RequestExecutionResult { request: { url: string; method: string; headersRedacted: Record; endpointId: string; }; requestBodyPreview?: RequestBodyPreview; response: { status: number; headers: Record; bodyType: 'json' | 'text' | 'binary' | 'empty'; bodyJson?: unknown; bodyText?: string; bodyBase64?: string; }; timingMs: number; authUsed: string[]; } export type RequestBodyPreview = { bodyType: 'empty'; } | { bodyType: 'json'; bodyJson: unknown; } | { bodyType: 'text'; bodyText: string; } | { bodyType: 'binary'; bodyBase64?: string; } | { bodyType: 'form-data'; fields: FormDataPreviewField[]; }; export interface FormDataPreviewField { name: string; valueType: 'text' | 'json' | 'file'; valueText?: string; valueJson?: unknown; fileName?: string; contentType?: string; sizeBytes?: number; }