/**
 * API Validator - Backend skill validation with authentication
 *
 * Tests API endpoints using curl/fetch, handles various auth strategies,
 * and generates Postman collections.
 *
 * @since v1.0.130
 */
/**
 * Authentication strategies
 */
export type AuthStrategy = 'jwt' | 'api_key' | 'basic' | 'oauth2' | 'none';
/**
 * Endpoint test definition
 */
export interface EndpointTest {
    method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
    path: string;
    body_file?: string;
    body?: Record<string, unknown>;
    expected_status: number;
    expected_shape?: Record<string, string>;
    headers?: Record<string, string>;
    description?: string;
}
/**
 * API test configuration
 */
export interface ApiTestConfig {
    base_url: string;
    health_check: string;
    auth_strategy: AuthStrategy;
    auth_env_var?: string;
    auth_header?: string;
    auth_prefix?: string;
    endpoints_to_test: EndpointTest[];
    timeout_ms?: number;
}
/**
 * Result of a single endpoint test
 */
export interface EndpointTestResult {
    endpoint: string;
    method: string;
    passed: boolean;
    status_code?: number;
    expected_status: number;
    duration_ms: number;
    response_body?: string;
    error?: string;
}
/**
 * Result of full API validation
 */
export interface ApiTestResult {
    passed: boolean;
    server_running: boolean;
    auth_valid: boolean;
    endpoints: EndpointTestResult[];
    duration_ms: number;
    summary: string;
}
/**
 * Postman collection format (simplified)
 */
interface PostmanCollection {
    info: {
        name: string;
        schema: string;
        description?: string;
    };
    item: PostmanItem[];
    auth?: PostmanAuth;
    variable?: PostmanVariable[];
}
interface PostmanItem {
    name: string;
    request: {
        method: string;
        url: string | {
            raw: string;
        };
        header?: Array<{
            key: string;
            value: string;
        }>;
        body?: {
            mode: string;
            raw?: string;
        };
        auth?: PostmanAuth;
    };
    response?: unknown[];
}
interface PostmanAuth {
    type: string;
    bearer?: Array<{
        key: string;
        value: string;
    }>;
    apikey?: Array<{
        key: string;
        value: string;
        in: string;
    }>;
    basic?: Array<{
        key: string;
        value: string;
    }>;
}
interface PostmanVariable {
    key: string;
    value: string;
}
/**
 * API Validator
 *
 * Validates backend APIs with authentication support
 */
export declare class ApiValidator {
    private config;
    private authToken?;
    private verbose;
    constructor(config: ApiTestConfig, options?: {
        verbose?: boolean;
    });
    /**
     * Run full API validation
     */
    validate(): Promise<ApiTestResult>;
    /**
     * Check if server is running via health check
     */
    private checkServerRunning;
    /**
     * Setup authentication based on strategy
     */
    private setupAuth;
    /**
     * Setup JWT authentication from env var
     */
    private setupJwtAuth;
    /**
     * Setup API key authentication
     */
    private setupApiKeyAuth;
    /**
     * Setup Basic authentication
     */
    private setupBasicAuth;
    /**
     * Setup OAuth2 authentication (simplified)
     */
    private setupOAuth2Auth;
    /**
     * Test a single endpoint
     */
    private testEndpoint;
    /**
     * Make HTTP request using curl
     */
    private makeRequest;
    /**
     * Generate Postman collection from endpoint tests
     */
    generatePostmanCollection(name: string): PostmanCollection;
    /**
     * Save Postman collection to file
     * Also generates environment file automatically
     */
    savePostmanCollection(outputPath: string, name: string): Promise<void>;
    /**
     * Generate Postman environment file
     */
    generatePostmanEnvironment(name: string): Record<string, unknown>;
    /**
     * Format validation result for display
     */
    formatResult(result: ApiTestResult): string;
}
/**
 * Run API validation with default config detection
 */
export declare function validateApi(config: ApiTestConfig, options?: {
    verbose?: boolean;
}): Promise<ApiTestResult>;
/**
 * Generate Postman collection from API config
 */
export declare function generatePostmanFromConfig(config: ApiTestConfig, outputPath: string, name: string): Promise<void>;
export {};
//# sourceMappingURL=api-validator.d.ts.map