interface ApisixResponse<T> {
    node?: {
        key: string;
        value: T;
        createdIndex?: number;
        modifiedIndex?: number;
    };
    key?: string;
    value?: T;
    createdIndex?: number;
    modifiedIndex?: number;
    action?: string;
}
interface ApisixListResponse<T> {
    total?: number;
    list?: Array<{
        key: string;
        value: T;
        createdIndex?: number;
        modifiedIndex?: number;
    }>;
    has_more?: boolean;
    node?: {
        key: string;
        nodes: Array<{
            key: string;
            value: T;
            createdIndex?: number;
            modifiedIndex?: number;
        }>;
        dir?: boolean;
    };
    count?: number;
    action?: string;
}
interface ListOptions {
    page?: number;
    page_size?: number;
    name?: string;
    label?: string;
    uri?: string;
    search?: string;
    sort?: string;
    order?: "asc" | "desc";
    status?: 0 | 1;
    method?: string | string[];
    host?: string;
    plugin?: string;
    upstream_id?: string;
    service_id?: string;
    consumer_id?: string;
    created_after?: number;
    created_before?: number;
    updated_after?: number;
    updated_before?: number;
    fields?: string[];
    exclude_fields?: string[];
    with_count?: boolean;
    [key: string]: string | number | boolean | string[] | undefined;
}
interface ErrorResponse {
    error_msg: string;
}
interface Route {
    id?: string;
    name?: string;
    desc?: string;
    uri?: string;
    uris?: string[];
    methods?: string[];
    host?: string;
    hosts?: string[];
    remote_addr?: string;
    remote_addrs?: string[];
    vars?: Array<[string, string, string]>;
    filter_func?: string;
    plugins?: Record<string, unknown>;
    upstream?: Upstream;
    upstream_id?: string;
    service_id?: string;
    plugin_config_id?: string;
    priority?: number;
    enable_websocket?: boolean;
    timeout?: {
        connect?: number;
        send?: number;
        read?: number;
    };
    status?: 0 | 1;
    labels?: Record<string, string>;
    create_time?: number;
    update_time?: number;
}
interface Service {
    id?: string;
    name?: string;
    desc?: string;
    upstream?: Upstream;
    upstream_id?: string;
    plugins?: Record<string, unknown>;
    plugin_config_id?: string;
    hosts?: string[];
    enable_websocket?: boolean;
    labels?: Record<string, string>;
    create_time?: number;
    update_time?: number;
}
type UpstreamType = "roundrobin" | "chash" | "ewma" | "least_conn";
type HashOn = "vars" | "header" | "cookie" | "consumer";
type HealthCheckType = "http" | "https" | "tcp";
type UpstreamScheme = "http" | "https" | "grpc" | "grpcs" | "tcp" | "udp" | "tls";
type PassHost = "pass" | "node" | "rewrite";
interface UpstreamNode {
    host: string;
    port: number;
    weight: number;
    priority?: number;
    metadata?: Record<string, unknown>;
}
interface HealthCheck {
    active?: {
        type?: HealthCheckType;
        timeout?: number;
        concurrency?: number;
        http_path?: string;
        https_verify_certificate?: boolean;
        req_headers?: string[];
        healthy?: {
            interval?: number;
            http_statuses?: number[];
            successes?: number;
        };
        unhealthy?: {
            interval?: number;
            http_statuses?: number[];
            http_failures?: number;
            tcp_failures?: number;
            timeouts?: number;
        };
    };
    passive?: {
        type?: HealthCheckType;
        healthy?: {
            http_statuses?: number[];
            successes?: number;
        };
        unhealthy?: {
            http_statuses?: number[];
            http_failures?: number;
            tcp_failures?: number;
            timeouts?: number;
        };
    };
}
interface KeepalivePool {
    size?: number;
    idle_timeout?: number;
    requests?: number;
}
interface UpstreamTLS {
    client_cert?: string;
    client_key?: string;
    client_cert_id?: string;
}
interface Upstream {
    id?: string;
    name?: string;
    desc?: string;
    type?: UpstreamType;
    nodes?: Record<string, number> | UpstreamNode[];
    service_name?: string;
    discovery_type?: string;
    hash_on?: HashOn;
    key?: string;
    checks?: HealthCheck;
    retries?: number;
    retry_timeout?: number;
    timeout?: {
        connect?: number;
        send?: number;
        read?: number;
    };
    keepalive_pool?: KeepalivePool;
    scheme?: UpstreamScheme;
    pass_host?: PassHost;
    upstream_host?: string;
    tls?: UpstreamTLS;
    labels?: Record<string, string>;
    create_time?: number;
    update_time?: number;
}
interface Consumer {
    id?: string;
    username: string;
    desc?: string;
    plugins?: Record<string, unknown>;
    group_id?: string;
    labels?: Record<string, string>;
    create_time?: number;
    update_time?: number;
}
interface Credential {
    id?: string;
    plugins: Record<string, unknown>;
    desc?: string;
    labels?: Record<string, string>;
    create_time?: number;
    update_time?: number;
}
interface SSL {
    id?: string;
    cert: string;
    key: string;
    certs?: string[];
    keys?: string[];
    snis?: string[];
    client?: {
        ca?: string;
        depth?: number;
        skip_mtls_uri_regex?: string[];
    };
    labels?: Record<string, string>;
    status?: 0 | 1;
    type?: "server" | "client";
    ssl_protocols?: string[];
    validity_start?: number;
    validity_end?: number;
    create_time?: number;
    update_time?: number;
}
interface GlobalRule {
    id?: string;
    plugins?: Record<string, unknown>;
    create_time?: number;
    update_time?: number;
}
interface ConsumerGroup {
    id?: string;
    desc?: string;
    plugins?: Record<string, unknown>;
    labels?: Record<string, string>;
    create_time?: number;
    update_time?: number;
}
interface PluginConfig {
    id?: string;
    desc?: string;
    plugins?: Record<string, unknown>;
    labels?: Record<string, string>;
    create_time?: number;
    update_time?: number;
}
interface StreamRoute {
    id?: string;
    desc?: string;
    remote_addr?: string;
    remote_addrs?: string[];
    server_addr?: string;
    server_port?: number;
    sni?: string;
    upstream?: Upstream;
    upstream_id?: string;
    service_id?: string;
    plugins?: Record<string, unknown>;
    protocol?: {
        name?: string;
        conf?: Record<string, unknown>;
    };
    create_time?: number;
    update_time?: number;
}
interface VaultSecret {
    id?: string;
    uri: string;
    prefix: string;
    token: string;
    namespace?: string;
    create_time?: number;
    update_time?: number;
}
interface AWSSecret {
    id?: string;
    access_key_id: string;
    secret_access_key: string;
    session_token?: string;
    region?: string;
    endpoint_url?: string;
    create_time?: number;
    update_time?: number;
}
interface GCPAuthConfig {
    client_email: string;
    private_key: string;
    project_id: string;
    token_uri?: string;
    entries_uri?: string;
    scope?: string[];
}
interface GCPSecret {
    id?: string;
    auth_config?: GCPAuthConfig;
    auth_file?: string;
    ssl_verify?: boolean;
    create_time?: number;
    update_time?: number;
}
type Secret = VaultSecret | AWSSecret | GCPSecret;
interface Plugin {
    name: string;
    version?: string;
    priority?: number;
    schema?: object;
    consumer_schema?: object;
    metadata_schema?: object;
    type?: string;
    disable?: boolean;
}
interface PluginInfo {
    name: string;
    version?: string;
    priority?: number;
    type?: string;
    status?: "enabled" | "disabled";
    [key: string]: unknown;
}
interface PluginList {
    [key: string]: boolean;
}
interface PluginMetadata {
    id?: string;
    [key: string]: unknown;
}
interface HealthCheckStatus {
    status: "ok" | "error";
    info?: {
        version: string;
        hostname: string;
        up_time: number;
    };
}
interface UpstreamHealthNode {
    host: string;
    port: number;
    status: "healthy" | "unhealthy" | "mostly_healthy" | "mostly_unhealthy";
    counter: {
        http_failure: number;
        tcp_failure: number;
        timeout_failure: number;
        success: number;
    };
}
interface UpstreamHealth {
    name: string;
    type: "http" | "https" | "tcp";
    nodes: UpstreamHealthNode[];
}
interface ServerInfo {
    hostname: string;
    version: string;
    up_time: number;
    boot_time: number;
    last_report_time: number;
    etcd_version: string;
}
interface SchemaInfo {
    main: {
        route: {
            properties: object;
        };
        upstream: {
            properties: object;
        };
        service: {
            properties: object;
        };
        consumer: {
            properties: object;
        };
        ssl: {
            properties: object;
        };
        [key: string]: {
            properties: object;
        };
    };
    plugins: Record<string, {
        consumer_schema?: object;
        metadata_schema?: object;
        schema?: object;
        type?: string;
        priority?: number;
        version?: number;
    }>;
    "stream-plugins": Record<string, object>;
}
interface DiscoveryServices {
    services: Record<string, Array<{
        host: string;
        port: number;
        weight: number;
    }>>;
    expire: number;
    last_update: number;
}
interface ApisixSDKConfig {
    adminAPI: {
        baseURL: string;
        apiKey?: string;
        timeout?: number;
        headers?: Record<string, string>;
    };
    controlAPI?: {
        baseURL: string;
        timeout?: number;
        headers?: Record<string, string>;
    };
}
type CreateInput<T> = Omit<T, "id" | "create_time" | "update_time">;
type UpdateInput<T> = Partial<Omit<T, "id" | "create_time" | "update_time">>;
interface ForceDeleteOptions {
    force?: boolean;
}
interface TTLOptions {
    ttl?: number;
}
interface FilterOptions extends ListOptions {
    name?: string;
    label?: string;
    uri?: string;
}
interface Proto {
    id?: string;
    desc?: string;
    content: string;
    labels?: Record<string, string>;
    create_time?: number;
    update_time?: number;
}
interface PrometheusMetrics {
    metrics: string;
}
interface RequestStatistics {
    total_requests: number;
    requests_per_second: number;
    average_response_time: number;
    error_rate: number;
}
interface ConnectionStatistics {
    active_connections: number;
    total_connections: number;
    requests_per_connection: number;
}
interface ConsumerCredential {
    id?: string;
    plugins: Record<string, unknown>;
    desc?: string;
    create_time?: number;
    update_time?: number;
}
interface DiscoveryDumpNode {
    host: string;
    port: number;
    weight: number;
    default_weight: number;
    id: string;
    client: Record<string, unknown>;
    service: {
        host: string;
        port: number;
        proto: string;
        enable_ipv6: boolean;
    };
}
interface DiscoveryDump {
    endpoints: Array<{
        endpoints: Array<{
            value: string;
            name: string;
        }>;
        id: string;
    }>;
    config: Array<{
        default_weight: number;
        id: string;
        client: Record<string, unknown>;
        service: {
            host: string;
            port: string;
            schema: string;
        };
        shared_size: string;
    }>;
}
interface DiscoveryDump {
    services: Record<string, DiscoveryDumpNode[]>;
}
interface DiscoveryDumpFile {
    path: string;
    size: number;
    last_modified: string;
}
interface VersionConfig {
    version: string;
    supportsCredentials: boolean;
    supportsSecrets: boolean;
    supportsNewResponseFormat: boolean;
    supportsStreamRoutes: boolean;
    supportedPlugins: string[];
    deprecatedFeatures: string[];
}
interface MigrationRecommendations {
    newFeatures: string[];
    deprecatedFeatures: string[];
    breakingChanges: string[];
}
interface ValidationResult {
    valid: boolean;
    errors: string[];
    warnings: string[];
}
interface BatchOperation<T> {
    operation: "create" | "update" | "delete";
    id?: string;
    data?: T;
}
interface BatchResult<T> {
    success: boolean;
    id?: string;
    data?: T;
    error?: string;
}
interface BatchResponse<T> {
    total: number;
    successful: number;
    failed: number;
    results: BatchResult<T>[];
}
interface ImportOptions {
    strategy?: "replace" | "merge" | "skip_existing";
    validate?: boolean;
    dry_run?: boolean;
}
interface ExportOptions {
    format?: "json" | "yaml" | "openapi";
    include?: string[];
    exclude?: string[];
    pretty?: boolean;
}
interface ImportResult {
    total: number;
    created: number;
    updated: number;
    skipped: number;
    errors: Array<{
        id?: string;
        error: string;
    }>;
}
interface OpenAPIRoute {
    operationId?: string;
    summary?: string;
    description?: string;
    tags?: string[];
    security?: Array<Record<string, string[]>>;
    parameters?: Array<{
        name: string;
        in: "path" | "query" | "header" | "cookie";
        required?: boolean;
        schema?: object;
        description?: string;
    }>;
    requestBody?: {
        content: Record<string, {
            schema?: object;
            example?: unknown;
        }>;
        required?: boolean;
    };
    responses?: Record<string, {
        description: string;
        content?: Record<string, {
            schema?: object;
            example?: unknown;
        }>;
    }>;
    "x-apisix-upstream"?: Upstream;
    "x-apisix-plugins"?: Record<string, unknown>;
    "x-apisix-service_id"?: string;
    "x-apisix-status"?: 0 | 1;
    "x-apisix-priority"?: number;
    "x-apisix-enableWebsocket"?: boolean;
    "x-apisix-labels"?: Record<string, string>;
    "x-apisix-vars"?: Array<[string, string, string]>;
}
interface OpenAPISpec {
    openapi: string;
    info: {
        title: string;
        version: string;
        description?: string;
        license?: {
            name: string;
            url?: string;
        };
    };
    servers?: Array<{
        url: string;
        description?: string;
    }>;
    paths: Record<string, Record<string, OpenAPIRoute>>;
    components?: {
        securitySchemes?: Record<string, {
            type: string;
            scheme?: string;
            bearerFormat?: string;
            in?: string;
            name?: string;
        }>;
        schemas?: Record<string, object>;
    };
    security?: Array<Record<string, string[]>>;
}

declare class ApisixClient {
    private adminBaseURL;
    private controlBaseURL;
    private apiKey?;
    private adminTimeout;
    private controlTimeout;
    private adminHeaders;
    private controlHeaders;
    private _serverInfo?;
    private _apiVersion?;
    constructor(config: ApisixSDKConfig);
    /**
     * Get cached server information or fetch if not available
     */
    getServerInfo(): Promise<ServerInfo>;
    /**
     * Get APISIX version
     */
    getVersion(): Promise<string>;
    /**
     * Check if current APISIX version is compatible with specified version
     */
    isVersionCompatible(minVersion: string): Promise<boolean>;
    /**
     * Compare two version strings (returns -1, 0, or 1)
     */
    private compareVersions;
    /**
     * Check if APISIX version is 3.0 or later
     */
    isVersion3OrLater(): Promise<boolean>;
    /**
     * Get API version-specific configuration
     */
    getApiVersionConfig(): Promise<{
        supportsCredentials: boolean;
        supportsSecrets: boolean;
        supportsNewResponseFormat: boolean;
        supportsStreamRoutes: boolean;
        supportsPagination: boolean;
    }>;
    /**
     * Make HTTP request with proper authentication and error handling
     */
    protected request<T>(endpoint: string, options?: {
        method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD";
        headers?: Record<string, string>;
        body?: Record<string, unknown> | string;
        params?: Record<string, string | number | boolean | string[] | undefined>;
    }): Promise<T>;
    /**
     * GET request
     */
    get<T>(endpoint: string, params?: Record<string, string | number | boolean | string[] | undefined>): Promise<T>;
    /**
     * POST request
     */
    post<T>(endpoint: string, body?: Record<string, unknown> | string): Promise<T>;
    /**
     * PUT request
     */
    put<T>(endpoint: string, body?: Record<string, unknown> | string): Promise<T>;
    /**
     * PATCH request
     */
    protected patch<T>(endpoint: string, body?: Record<string, unknown> | string): Promise<T>;
    /**
     * DELETE request
     */
    protected delete<T>(endpoint: string): Promise<T>;
    /**
     * Check if current APISIX version supports pagination
     */
    supportsPagination(): Promise<boolean>;
    /**
     * List resources with optional pagination and filtering
     * Automatically handles version compatibility
     */
    list<T>(endpoint: string, options?: ListOptions): Promise<ApisixListResponse<T>>;
    /**
     * Get single resource
     */
    getOne<T>(endpoint: string, id: string): Promise<ApisixResponse<T>>;
    /**
     * Create resource
     */
    create<T>(endpoint: string, data: Record<string, unknown>, id?: string): Promise<ApisixResponse<T>>;
    /**
     * Update resource
     */
    update<T>(endpoint: string, id: string, data: Record<string, unknown>): Promise<ApisixResponse<T>>;
    /**
     * Partially update resource
     */
    partialUpdate<T>(endpoint: string, id: string, data: Record<string, unknown>): Promise<ApisixResponse<T>>;
    /**
     * Delete resource
     */
    remove<T>(endpoint: string, id: string): Promise<ApisixResponse<T>>;
    /**
     * Delete resource with query parameters (e.g., force delete)
     */
    removeWithQuery<T>(endpoint: string, id: string, queryParams?: Record<string, string | number | boolean | undefined>): Promise<ApisixResponse<T>>;
    /**
     * Extract value from APISIX response format (version-aware)
     */
    extractValue<T>(response: ApisixResponse<T>): Promise<T>;
    /**
     * Extract list data from response, handling both v2.x and v3.x formats
     */
    extractList<T>(response: unknown): T[];
    /**
     * Extract pagination info from response
     */
    extractPaginationInfo(response: unknown): {
        total: number;
        hasMore: boolean;
    };
    /**
     * Get configuration for admin API endpoints
     */
    getAdminEndpoint(path: string): string;
    /**
     * Get configuration for control API endpoints
     */
    getControlEndpoint(path: string): string;
    /**
     * Make Control API request (convenience method)
     */
    controlRequest<T>(endpoint: string, options?: {
        method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD";
        headers?: Record<string, string>;
        body?: Record<string, unknown> | string;
        params?: Record<string, string | number | boolean | string[] | undefined>;
    }): Promise<T>;
    /**
     * Execute batch operations
     */
    batch<T>(endpoint: string, operations: Array<{
        operation: "create" | "update" | "delete";
        id?: string;
        data?: Record<string, unknown>;
    }>, options?: {
        continueOnError?: boolean;
        validateBeforeExecution?: boolean;
    }): Promise<{
        total: number;
        successful: number;
        failed: number;
        results: Array<{
            success: boolean;
            id?: string;
            data?: T;
            error?: string;
        }>;
    }>;
    /**
     * Import data from various formats
     */
    importData<T>(endpoint: string, data: T[] | string, options?: {
        strategy?: "replace" | "merge" | "skip_existing";
        validate?: boolean;
        dryRun?: boolean;
    }): Promise<{
        total: number;
        created: number;
        updated: number;
        skipped: number;
        errors: Array<{
            id?: string;
            error: string;
        }>;
    }>;
    /**
     * Export data in various formats
     */
    exportData<T>(endpoint: string, options?: {
        format?: "json" | "yaml";
        include?: string[];
        exclude?: string[];
        pretty?: boolean;
    }): Promise<string>;
    /**
     * Simple YAML serialization (basic implementation)
     */
    private toYaml;
    /**
     * Check if resource exists
     */
    private checkExists;
    /**
     * Validate data (placeholder for actual validation logic)
     */
    private validateData;
}

declare class ConsumerGroups {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all consumer groups with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<ConsumerGroup[]>;
    /**
     * Get a specific consumer group by ID
     */
    get(id: string): Promise<ConsumerGroup>;
    /**
     * Create a new consumer group
     */
    create(consumerGroup: CreateInput<ConsumerGroup>, id?: string): Promise<ConsumerGroup>;
    /**
     * Update an existing consumer group
     */
    update(id: string, consumerGroup: UpdateInput<ConsumerGroup>): Promise<ConsumerGroup>;
    /**
     * Partially update an existing consumer group
     */
    patch(id: string, consumerGroup: UpdateInput<ConsumerGroup>): Promise<ConsumerGroup>;
    /**
     * Delete a consumer group
     */
    delete(id: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if consumer group exists
     */
    exists(id: string): Promise<boolean>;
    /**
     * List consumer groups with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        consumerGroups: ConsumerGroup[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find consumer groups by label
     */
    findByLabel(key: string, value?: string): Promise<ConsumerGroup[]>;
    /**
     * Find consumer groups by plugin name
     */
    findByPlugin(pluginName: string): Promise<ConsumerGroup[]>;
    /**
     * Add plugin to consumer group
     */
    addPlugin(id: string, pluginName: string, config: Record<string, unknown>): Promise<ConsumerGroup>;
    /**
     * Remove plugin from consumer group
     */
    removePlugin(id: string, pluginName: string): Promise<ConsumerGroup>;
    /**
     * Update plugin configuration in consumer group
     */
    updatePlugin(id: string, pluginName: string, config: Record<string, unknown>): Promise<ConsumerGroup>;
    /**
     * Add label to consumer group
     */
    addLabel(id: string, key: string, value: string): Promise<ConsumerGroup>;
    /**
     * Remove label from consumer group
     */
    removeLabel(id: string, key: string): Promise<ConsumerGroup>;
    /**
     * Clone a consumer group with optional modifications
     */
    clone(sourceId: string, modifications?: Partial<ConsumerGroup>, newId?: string): Promise<ConsumerGroup>;
    /**
     * Get consumer group statistics
     */
    getStatistics(): Promise<{
        total: number;
        pluginUsage: Record<string, number>;
        labelUsage: Record<string, number>;
        topPlugins: Array<{
            plugin: string;
            count: number;
        }>;
        topLabels: Array<{
            label: string;
            count: number;
        }>;
    }>;
}

declare class Consumers {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all consumers with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<Consumer[]>;
    /**
     * Get a specific consumer by username
     */
    get(username: string): Promise<Consumer>;
    /**
     * Create a new consumer
     */
    create(consumer: CreateInput<Consumer>): Promise<Consumer>;
    /**
     * Update an existing consumer
     */
    update(username: string, consumer: UpdateInput<Consumer>): Promise<Consumer>;
    /**
     * Partially update an existing consumer
     */
    patch(username: string, consumer: UpdateInput<Consumer>): Promise<Consumer>;
    /**
     * Delete a consumer
     */
    delete(username: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if consumer exists
     */
    exists(username: string): Promise<boolean>;
    /**
     * List consumers with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        consumers: Consumer[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find consumers by label
     */
    findByLabel(key: string, value?: string): Promise<Consumer[]>;
    /**
     * List credentials for a consumer
     */
    listCredentials(username: string): Promise<ConsumerCredential[]>;
    /**
     * Get a specific credential for a consumer
     */
    getCredential(username: string, credentialId: string): Promise<ConsumerCredential>;
    /**
     * Create or update a credential for a consumer
     */
    createCredential(username: string, credentialId: string, credential: Omit<ConsumerCredential, "id" | "create_time" | "update_time">): Promise<ConsumerCredential>;
    /**
     * Update a credential for a consumer
     */
    updateCredential(username: string, credentialId: string, credential: Partial<Omit<ConsumerCredential, "id" | "create_time" | "update_time">>): Promise<ConsumerCredential>;
    /**
     * Delete a credential for a consumer
     */
    deleteCredential(username: string, credentialId: string): Promise<boolean>;
    /**
     * Add key-auth credential to consumer
     */
    addKeyAuth(username: string, key: string, credentialId?: string): Promise<ConsumerCredential>;
    /**
     * Add basic-auth credential to consumer
     */
    addBasicAuth(username: string, authUsername: string, password: string, credentialId?: string): Promise<ConsumerCredential>;
    /**
     * Add JWT auth credential to consumer
     */
    addJwtAuth(username: string, key: string, secret?: string, credentialId?: string): Promise<ConsumerCredential>;
    /**
     * Add HMAC auth credential to consumer
     */
    addHmacAuth(username: string, accessKey: string, secretKey: string, credentialId?: string): Promise<ConsumerCredential>;
}

declare class Control {
    private client;
    constructor(client: ApisixClient);
    /**
     * Get runtime upstreams information
     */
    getUpstreams(): Promise<Record<string, unknown>[]>;
    /**
     * Get specific upstream runtime information
     */
    getUpstream(upstreamId: string): Promise<Record<string, unknown>>;
    /**
     * Get all available schemas
     */
    getSchemas(): Promise<SchemaInfo>;
    /**
     * Get schema for a specific resource type
     */
    getSchema(resourceType: string): Promise<Record<string, unknown>>;
    /**
     * Get schema for a specific plugin
     */
    getPluginSchema(pluginName: string): Promise<Record<string, unknown>>;
    /**
     * Check if Control API is healthy
     */
    isHealthy(): Promise<boolean>;
    /**
     * Get server information
     */
    getServerInfo(): Promise<ServerInfo>;
    /**
     * Get all available plugins information
     * Note: This endpoint is not available via Control API, use Admin API instead
     */
    getPlugins(): Promise<PluginInfo[]>;
    /**
     * Get upstream health check status
     * Note: APISIX requires specific upstream ID for health check queries
     */
    getUpstreamHealth(upstreamName?: string): Promise<UpstreamHealth[]>;
    /**
     * Check if specific service discovery is available
     */
    hasDiscovery(service: string): Promise<boolean>;
    /**
     * Get available service discovery types
     */
    listDiscoveries(): Promise<string[]>;
    /**
     * Get services dump for service discovery
     * Note: Requires service discovery to be configured
     */
    getDiscoveryDump(service?: string): Promise<unknown>;
    /**
     * Get discovery dump files list
     * Note: Requires service discovery to be configured
     */
    getDiscoveryDumpFiles(service?: string): Promise<DiscoveryDumpFile[]>;
    /**
     * Get discovery dump file content
     */
    getDiscoveryDumpFile(filename: string): Promise<string>;
    /**
     * Get all plugin metadata
     */
    getPluginMetadata(): Promise<Array<{
        id: string;
        [key: string]: unknown;
    }>>;
    /**
     * Get specific plugin metadata
     */
    getPluginMetadataById(pluginName: string): Promise<{
        id: string;
        [key: string]: unknown;
    }>;
    /**
     * Get current APISIX configuration
     */
    getConfig(): Promise<Record<string, unknown>>;
    /**
     * Get active routes
     */
    getRoutes(): Promise<Record<string, unknown>[]>;
    /**
     * Get specific route runtime information
     */
    getRoute(routeId: string): Promise<Record<string, unknown>>;
    /**
     * Get active services
     */
    getServices(): Promise<Record<string, unknown>[]>;
    /**
     * Get specific service runtime information
     */
    getService(serviceId: string): Promise<Record<string, unknown>>;
    /**
     * Get active consumers
     */
    getConsumers(): Promise<Record<string, unknown>[]>;
    /**
     * Get specific consumer runtime information
     */
    getConsumer(consumerId: string): Promise<Record<string, unknown>>;
    /**
     * Get SSL certificates
     */
    getSSLCertificates(): Promise<Record<string, unknown>[]>;
    /**
     * Get specific SSL certificate
     */
    getSSLCertificate(certId: string): Promise<Record<string, unknown>>;
    /**
     * Get global rules
     */
    getGlobalRules(): Promise<Record<string, unknown>[]>;
    /**
     * Get specific global rule
     */
    getGlobalRule(ruleId: string): Promise<Record<string, unknown>>;
    /**
     * Get consumer groups
     */
    getConsumerGroups(): Promise<Record<string, unknown>[]>;
    /**
     * Get specific consumer group
     */
    getConsumerGroup(groupId: string): Promise<Record<string, unknown>>;
    /**
     * Trigger garbage collection
     */
    triggerGC(): Promise<{
        message: string;
    }>;
    /**
     * Get system overview with proper error handling for unavailable endpoints
     */
    getSystemOverview(): Promise<{
        server: ServerInfo;
        schemas: SchemaInfo;
        health: boolean;
        upstreamHealth: UpstreamHealth[];
        discoveryServices?: Record<string, unknown>;
    }>;
    /**
     * Get memory usage statistics
     */
    getMemoryStats(): Promise<Record<string, unknown>>;
    /**
     * Get Prometheus metrics (from Prometheus export server on port 9091)
     * Note: Prometheus metrics are NOT available via Control API port 9090
     */
    getPrometheusMetrics(): Promise<string>;
    /**
     * Health check endpoint
     */
    healthCheck(): Promise<HealthCheckStatus>;
    /**
     * Trigger plugins reload
     */
    reloadPlugins(): Promise<{
        message: string;
    }>;
    /**
     * Validate data against APISIX schemas
     */
    validateSchema(entityType: "route" | "service" | "upstream" | "consumer" | "ssl" | "plugin", data: Record<string, unknown>, options?: {
        pluginName?: string;
        validatePlugins?: boolean;
    }): Promise<{
        valid: boolean;
        errors: string[];
        warnings: string[];
    }>;
    /**
     * Validate multiple plugins configuration
     */
    private validatePlugins;
    /**
     * Basic validation logic (placeholder for proper JSON schema validation)
     */
    private performBasicValidation;
    /**
     * Get configuration validation recommendations
     */
    getValidationRecommendations(): Promise<{
        schemaVersion: string;
        availablePlugins: string[];
        deprecatedPlugins: string[];
        recommendedSettings: Array<{
            category: string;
            setting: string;
            description: string;
            recommended: unknown;
        }>;
    }>;
    /**
     * Get schema compatibility information
     */
    getSchemaCompatibility(targetVersion?: string): Promise<{
        currentVersion: string;
        targetVersion: string;
        compatible: boolean;
        breaking_changes: string[];
        new_features: string[];
        deprecated_features: string[];
    }>;
    /**
     * Compare version strings
     */
    private compareVersions;
}

declare class Credentials {
    private client;
    constructor(client: ApisixClient);
    /**
     * Create a new credential for a consumer
     * @param consumerId The consumer ID
     * @param credential The credential data
     * @param credentialId Optional credential ID
     */
    create(consumerId: string, credential: CreateInput<Credential>, credentialId?: string): Promise<Credential>;
    /**
     * Get a specific credential by consumer ID and credential ID
     */
    get(consumerId: string, credentialId: string): Promise<Credential>;
    /**
     * List all credentials for a consumer
     */
    list(consumerId: string, options?: ListOptions): Promise<Credential[]>;
    /**
     * Update an existing credential
     */
    update(consumerId: string, credentialId: string, credential: UpdateInput<Credential>): Promise<Credential>;
    /**
     * Partially update an existing credential
     * Note: PATCH method is not supported for credentials in APISIX
     * This method will fall back to using PUT method
     */
    patch(consumerId: string, credentialId: string, credential: UpdateInput<Credential>): Promise<Credential>;
    /**
     * Delete a credential
     */
    delete(consumerId: string, credentialId: string): Promise<boolean>;
    /**
     * Check if credential exists
     */
    exists(consumerId: string, credentialId: string): Promise<boolean>;
    /**
     * List credentials with pagination support
     */
    listPaginated(consumerId: string, page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        credentials: Credential[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find credentials by plugin type for a consumer
     */
    findByPlugin(consumerId: string, pluginName: string): Promise<Credential[]>;
    /**
     * Find credentials matching a pattern for a consumer
     */
    findByPattern(consumerId: string, pattern: RegExp): Promise<Credential[]>;
    /**
     * Clone a credential with optional modifications for a consumer
     */
    clone(sourceConsumerId: string, sourceCredentialId: string, targetConsumerId: string, modifications?: Partial<Credential>, newCredentialId?: string): Promise<Credential>;
    /**
     * Get credential statistics for a consumer
     */
    getStatistics(consumerId?: string): Promise<{
        total: number;
        byPlugin: Array<{
            plugin: string;
            count: number;
        }>;
        byConsumer: Array<{
            consumer: string;
            count: number;
        }>;
    }>;
}

declare class GlobalRules {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all global rules with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<GlobalRule[]>;
    /**
     * Get a specific global rule by ID
     */
    get(id: string): Promise<GlobalRule>;
    /**
     * Create a new global rule
     */
    create(globalRule: CreateInput<GlobalRule>, id?: string): Promise<GlobalRule>;
    /**
     * Update an existing global rule
     */
    update(id: string, globalRule: UpdateInput<GlobalRule>): Promise<GlobalRule>;
    /**
     * Partially update an existing global rule
     */
    patch(id: string, globalRule: UpdateInput<GlobalRule>): Promise<GlobalRule>;
    /**
     * Delete a global rule
     */
    delete(id: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if global rule exists
     */
    exists(id: string): Promise<boolean>;
    /**
     * List global rules with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        globalRules: GlobalRule[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find global rules by plugin name
     */
    findByPlugin(pluginName: string): Promise<GlobalRule[]>;
    /**
     * Add plugin to global rule
     */
    addPlugin(id: string, pluginName: string, config: Record<string, unknown>): Promise<GlobalRule>;
    /**
     * Remove plugin from global rule
     */
    removePlugin(id: string, pluginName: string): Promise<GlobalRule>;
    /**
     * Update plugin configuration in global rule
     */
    updatePlugin(id: string, pluginName: string, config: Record<string, unknown>): Promise<GlobalRule>;
    /**
     * Clone a global rule with optional modifications
     */
    clone(sourceId: string, modifications?: Partial<GlobalRule>, newId?: string): Promise<GlobalRule>;
    /**
     * Get global rule statistics
     */
    getStatistics(): Promise<{
        total: number;
        pluginUsage: Record<string, number>;
        topPlugins: Array<{
            plugin: string;
            count: number;
        }>;
    }>;
}

declare class PluginConfigs {
    private client;
    constructor(client: ApisixClient);
    /**
     * List all plugin configs
     */
    list(options?: {
        page?: number;
        page_size?: number;
        name?: string;
        label?: string;
    }): Promise<PluginConfig[]>;
    /**
     * Get plugin config by id
     */
    get(id: string): Promise<PluginConfig>;
    /**
     * Create plugin config
     */
    create(data: Omit<PluginConfig, "id" | "create_time" | "update_time">, id?: string): Promise<PluginConfig>;
    /**
     * Update plugin config
     */
    update(id: string, data: Partial<Omit<PluginConfig, "id" | "create_time" | "update_time">>): Promise<PluginConfig>;
    /**
     * Delete plugin config
     */
    delete(id: string): Promise<boolean>;
    /**
     * Add plugin to config
     */
    addPlugin(id: string, pluginName: string, config: Record<string, unknown>): Promise<PluginConfig>;
    /**
     * Remove plugin from config
     */
    removePlugin(id: string, pluginName: string): Promise<PluginConfig>;
    /**
     * Update plugin configuration in plugin config
     */
    updatePlugin(id: string, pluginName: string, config: Record<string, unknown>): Promise<PluginConfig>;
    /**
     * Enable/disable plugin in config
     */
    togglePlugin(id: string, pluginName: string, enabled: boolean): Promise<PluginConfig>;
    /**
     * Get plugin configs by label
     */
    getByLabel(label: string, value?: string): Promise<PluginConfig[]>;
    /**
     * Clone plugin config
     */
    clone(sourceId: string, newId: string, overrides?: Partial<Omit<PluginConfig, "id" | "create_time" | "update_time">>): Promise<PluginConfig>;
    /**
     * Validate plugin config
     */
    validate(config: PluginConfig): Promise<{
        valid: boolean;
        errors?: string[];
    }>;
    /**
     * Get plugin config template with common plugins
     */
    getTemplate(type: "basic" | "security" | "observability" | "traffic"): Partial<PluginConfig>;
    /**
     * Batch operations for plugin configs
     */
    batchCreate(configs: Array<{
        id?: string;
        data: Omit<PluginConfig, "id" | "create_time" | "update_time">;
    }>): Promise<PluginConfig[]>;
    /**
     * Export plugin config to JSON
     */
    export(id: string): Promise<string>;
    /**
     * Import plugin config from JSON
     */
    import(jsonString: string, newId?: string): Promise<PluginConfig>;
}

declare class Plugins {
    private client;
    private pluginCache;
    constructor(client: ApisixClient);
    /**
     * List all available plugins
     */
    list(): Promise<string[]>;
    /**
     * Get plugin schema
     */
    getSchema(pluginName: string): Promise<Record<string, unknown>>;
    /**
     * Set plugin global state (enable/disable globally)
     * Note: This feature may not be available in all APISIX versions
     */
    setGlobalState(pluginName: string, enabled: boolean): Promise<boolean>;
    /**
     * Enable plugin globally
     */
    enable(pluginName: string): Promise<boolean>;
    /**
     * Disable plugin globally
     */
    disable(pluginName: string): Promise<boolean>;
    /**
     * Get plugin metadata
     */
    getMetadata(pluginName: string): Promise<PluginMetadata>;
    /**
     * Update plugin metadata
     */
    updateMetadata(pluginName: string, metadata: Omit<PluginMetadata, "id">): Promise<PluginMetadata>;
    /**
     * Delete plugin metadata
     */
    deleteMetadata(pluginName: string): Promise<boolean>;
    /**
     * List all plugin metadata
     */
    listMetadata(): Promise<PluginMetadata[]>;
    /**
     * Check if plugin is available
     */
    isAvailable(pluginName: string): Promise<boolean>;
    /**
     * Validate plugin configuration
     */
    validateConfig(pluginName: string, config: Record<string, unknown>): Promise<{
        valid: boolean;
        errors?: string[];
    }>;
    /**
     * Get plugin configuration template
     */
    getConfigTemplate(pluginName: string): Promise<Record<string, unknown>>;
    /**
     * Get plugins by category
     */
    getPluginCategories(): Record<string, string[]>;
    /**
     * Get plugins by category
     */
    getPluginsByCategory(category: string): Promise<string[]>;
    /**
     * Get plugin documentation URL
     */
    getPluginDocUrl(pluginName: string): string;
    /**
     * Get comprehensive plugin information
     */
    getPluginInfo(pluginName: string): Promise<{
        name: string;
        available: boolean;
        schema?: Record<string, unknown>;
        metadata?: PluginMetadata;
        category?: string;
        docUrl: string;
    }>;
    /**
     * Clear plugin cache (useful when plugins are reloaded)
     */
    clearCache(): void;
    /**
     * Get list of available plugins with caching
     */
    getAvailablePlugins(): Promise<string[]>;
}

declare class Protos {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all proto definitions with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<Proto[]>;
    /**
     * Get a specific proto by ID
     */
    get(id: string): Promise<Proto>;
    /**
     * Create a new proto definition
     */
    create(proto: CreateInput<Proto>, id?: string): Promise<Proto>;
    /**
     * Update an existing proto definition
     */
    update(id: string, proto: UpdateInput<Proto>): Promise<Proto>;
    /**
     * Partially update an existing proto definition
     */
    patch(id: string, proto: UpdateInput<Proto>): Promise<Proto>;
    /**
     * Delete a proto definition
     */
    delete(id: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if proto exists
     */
    exists(id: string): Promise<boolean>;
    /**
     * List protos with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        protos: Proto[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find protos by label
     */
    findByLabel(label: string, value?: string): Promise<Proto[]>;
    /**
     * Clone a proto with optional modifications
     */
    clone(sourceId: string, modifications?: Partial<Proto>, newId?: string): Promise<Proto>;
    /**
     * Validate protobuf content
     */
    validateProtobufContent(content: string): {
        valid: boolean;
        errors?: string[];
    };
    /**
     * Create proto with validation
     */
    createWithValidation(proto: CreateInput<Proto>, id?: string): Promise<Proto>;
    /**
     * Get statistics for proto definitions
     */
    getStatistics(): Promise<{
        total: number;
        labelUsage: Record<string, number>;
        topLabels: Array<{
            label: string;
            count: number;
        }>;
    }>;
}

declare class Routes {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all routes with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<Route[]>;
    /**
     * Get a specific route by ID
     */
    get(id: string): Promise<Route>;
    /**
     * Create a new route
     */
    create(route: CreateInput<Route>, id?: string): Promise<Route>;
    /**
     * Update an existing route
     */
    update(id: string, route: UpdateInput<Route>): Promise<Route>;
    /**
     * Partially update an existing route
     */
    patch(id: string, route: UpdateInput<Route>): Promise<Route>;
    /**
     * Delete a route
     */
    delete(id: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if route exists
     */
    exists(id: string): Promise<boolean>;
    /**
     * List routes with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        routes: Route[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find routes by URI pattern
     */
    findByUri(uriPattern: string): Promise<Route[]>;
    /**
     * Find routes by method
     */
    findByMethod(method: string): Promise<Route[]>;
    /**
     * Find routes by host
     */
    findByHost(host: string): Promise<Route[]>;
    /**
     * Enable a route
     */
    enable(id: string): Promise<Route>;
    /**
     * Disable a route
     */
    disable(id: string): Promise<Route>;
    /**
     * Clone a route with optional modifications
     */
    clone(sourceId: string, modifications?: Partial<Route>, newId?: string): Promise<Route>;
    /**
     * Get route statistics
     */
    getStatistics(): Promise<{
        total: number;
        enabledCount: number;
        disabledCount: number;
        methodDistribution: Array<{
            method: string;
            count: number;
        }>;
        topPlugins: Array<{
            plugin: string;
            count: number;
        }>;
        hostCount: number;
        serviceRoutes: number;
        upstreamRoutes: number;
    }>;
    /**
     * Batch operations on routes
     */
    batchOperations(operations: Array<{
        operation: "create" | "update" | "delete";
        id?: string;
        data?: CreateInput<Route> | UpdateInput<Route>;
    }>): Promise<{
        total: number;
        successful: number;
        failed: number;
        results: Array<{
            success: boolean;
            id?: string;
            data?: Route;
            error?: string;
        }>;
    }>;
    /**
     * Advanced search with multiple criteria
     */
    search(criteria: {
        uri?: string;
        uriPattern?: string;
        methods?: string[];
        hosts?: string[];
        plugins?: string[];
        status?: 0 | 1;
        hasUpstream?: boolean;
        hasService?: boolean;
        labels?: Record<string, string>;
        createdAfter?: Date;
        createdBefore?: Date;
    }): Promise<Route[]>;
    /**
     * Import routes from OpenAPI specification
     */
    importFromOpenAPI(spec: {
        openapi: string;
        info: {
            title: string;
            version: string;
            description?: string;
        };
        paths: Record<string, Record<string, Record<string, unknown>>>;
    }, options?: {
        strategy?: "replace" | "merge" | "skip_existing";
        defaultUpstream?: Upstream;
        validateBeforeImport?: boolean;
    }): Promise<{
        total: number;
        created: number;
        updated: number;
        skipped: number;
        errors: Array<{
            path?: string;
            method?: string;
            error: string;
        }>;
    }>;
    /**
     * Export routes to OpenAPI specification
     */
    exportToOpenAPI(options?: {
        title?: string;
        version?: string;
        description?: string;
        serverUrl?: string;
        includeDisabled?: boolean;
        filterByLabels?: Record<string, string>;
    }): Promise<{
        openapi: string;
        info: {
            title: string;
            version: string;
            description?: string;
        };
        servers?: Array<{
            url: string;
        }>;
        paths: Record<string, Record<string, Record<string, unknown>>>;
    }>;
}

declare class Secrets {
    private client;
    constructor(client: ApisixClient);
    listVaultSecrets(options?: ListOptions): Promise<VaultSecret[]>;
    getVaultSecret(id: string): Promise<VaultSecret>;
    createVaultSecret(secret: CreateInput<VaultSecret>, id?: string): Promise<VaultSecret>;
    updateVaultSecret(id: string, secret: UpdateInput<VaultSecret>): Promise<VaultSecret>;
    deleteVaultSecret(id: string): Promise<boolean>;
    listAWSSecrets(options?: ListOptions): Promise<AWSSecret[]>;
    getAWSSecret(id: string): Promise<AWSSecret>;
    createAWSSecret(secret: CreateInput<AWSSecret>, id?: string): Promise<AWSSecret>;
    updateAWSSecret(id: string, secret: UpdateInput<AWSSecret>): Promise<AWSSecret>;
    deleteAWSSecret(id: string): Promise<boolean>;
    listGCPSecrets(options?: ListOptions): Promise<GCPSecret[]>;
    getGCPSecret(id: string): Promise<GCPSecret>;
    createGCPSecret(secret: CreateInput<GCPSecret>, id?: string): Promise<GCPSecret>;
    updateGCPSecret(id: string, secret: UpdateInput<GCPSecret>): Promise<GCPSecret>;
    deleteGCPSecret(id: string): Promise<boolean>;
    listAllSecrets(): Promise<{
        vault: VaultSecret[];
        aws: AWSSecret[];
        gcp: GCPSecret[];
    }>;
    testVaultConnection(id: string): Promise<{
        connected: boolean;
        error?: string;
    }>;
    testAWSConnection(id: string): Promise<{
        connected: boolean;
        error?: string;
    }>;
    testGCPConnection(id: string): Promise<{
        connected: boolean;
        error?: string;
    }>;
    findVaultSecretsByNamespace(namespace: string): Promise<VaultSecret[]>;
    findAWSSecretsByRegion(region: string): Promise<AWSSecret[]>;
    findSecretsByPrefix(prefix: string): Promise<VaultSecret[]>;
    /**
     * Create a Vault secret with validation
     */
    createVaultSecretWithValidation(config: {
        uri: string;
        prefix: string;
        token: string;
        namespace?: string;
    }, id?: string): Promise<VaultSecret>;
    /**
     * Create an AWS secret with validation
     */
    createAWSSecretWithValidation(config: {
        access_key_id: string;
        secret_access_key: string;
        session_token?: string;
        region?: string;
        endpoint_url?: string;
    }, id?: string): Promise<AWSSecret>;
    /**
     * Create a GCP secret with validation
     */
    createGCPSecretWithValidation(config: {
        auth_config?: {
            client_email: string;
            private_key: string;
            project_id: string;
            token_uri?: string;
            entries_uri?: string;
            scope?: string[];
        };
        auth_file?: string;
        ssl_verify?: boolean;
    }, id?: string): Promise<GCPSecret>;
}

declare class Services {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all services with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<Service[]>;
    /**
     * Get a specific service by ID
     */
    get(id: string): Promise<Service>;
    /**
     * Create a new service
     */
    create(service: CreateInput<Service>, id?: string): Promise<Service>;
    /**
     * Update an existing service
     */
    update(id: string, service: UpdateInput<Service>): Promise<Service>;
    /**
     * Partially update an existing service
     */
    patch(id: string, service: UpdateInput<Service>): Promise<Service>;
    /**
     * Delete a service
     */
    delete(id: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if service exists
     */
    exists(id: string): Promise<boolean>;
    /**
     * List services with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        services: Service[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find services by name
     */
    findByName(name: string): Promise<Service[]>;
    /**
     * Find services by host
     */
    findByHost(host: string): Promise<Service[]>;
    /**
     * Clone a service with optional modifications
     */
    clone(sourceId: string, modifications?: Partial<Service>, newId?: string): Promise<Service>;
    /**
     * Get service statistics
     */
    getStatistics(): Promise<{
        total: number;
        upstreamServices: number;
        websocketEnabled: number;
        topPlugins: Array<{
            plugin: string;
            count: number;
        }>;
        hostCount: number;
        pluginConfigServices: number;
    }>;
}

declare class SSLCertificates {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all SSL certificates with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<SSL[]>;
    /**
     * Get a specific SSL certificate by ID
     */
    get(id: string): Promise<SSL>;
    /**
     * Create a new SSL certificate
     */
    create(ssl: CreateInput<SSL>, id?: string): Promise<SSL>;
    /**
     * Update an existing SSL certificate
     */
    update(id: string, ssl: UpdateInput<SSL>): Promise<SSL>;
    /**
     * Partially update an existing SSL certificate
     */
    patch(id: string, ssl: UpdateInput<SSL>): Promise<SSL>;
    /**
     * Delete an SSL certificate
     */
    delete(id: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if SSL certificate exists
     */
    exists(id: string): Promise<boolean>;
    /**
     * List SSL certificates with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        certificates: SSL[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find SSL certificates by SNI (Server Name Indication)
     */
    findBySNI(sni: string): Promise<SSL[]>;
    /**
     * Find SSL certificates by status
     */
    findByStatus(status: 0 | 1): Promise<SSL[]>;
    /**
     * Enable an SSL certificate
     */
    enable(id: string): Promise<SSL>;
    /**
     * Disable an SSL certificate
     */
    disable(id: string): Promise<SSL>;
    /**
     * Check if SSL certificate is expired or will expire soon
     */
    checkExpiration(id: string, daysToExpire?: number): Promise<{
        isExpired: boolean;
        willExpireSoon: boolean;
        daysRemaining?: number;
        validityEnd?: number;
    }>;
    /**
     * Get all expiring certificates
     */
    getExpiringCertificates(daysToExpire?: number): Promise<Array<SSL & {
        expirationInfo: {
            isExpired: boolean;
            willExpireSoon: boolean;
            daysRemaining?: number;
            validityEnd?: number;
        };
    }>>;
    /**
     * Clone an SSL certificate with optional modifications
     */
    clone(sourceId: string, modifications?: Partial<SSL>, newId?: string): Promise<SSL>;
}

declare class StreamRoutes {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all stream routes with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<StreamRoute[]>;
    /**
     * Get a specific stream route by ID
     */
    get(id: string): Promise<StreamRoute>;
    /**
     * Create a new stream route
     */
    create(streamRoute: CreateInput<StreamRoute>, id?: string): Promise<StreamRoute>;
    /**
     * Update an existing stream route (full update)
     */
    update(id: string, streamRoute: UpdateInput<StreamRoute>): Promise<StreamRoute>;
    /**
     * Partially update an existing stream route
     * Note: PATCH method is not supported for stream routes in APISIX
     * This method will fall back to using PUT method
     */
    patch(id: string, streamRoute: UpdateInput<StreamRoute>): Promise<StreamRoute>;
    /**
     * Delete a stream route
     */
    delete(id: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if stream route exists
     */
    exists(id: string): Promise<boolean>;
    /**
     * List stream routes with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        streamRoutes: StreamRoute[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find stream routes by server address
     */
    findByServerAddress(serverAddr: string): Promise<StreamRoute[]>;
    /**
     * Find stream routes by server port
     */
    findByServerPort(serverPort: number): Promise<StreamRoute[]>;
    /**
     * Find stream routes by protocol name
     */
    findByProtocol(protocolName: string): Promise<StreamRoute[]>;
    /**
     * Find stream routes by SNI
     */
    findBySNI(sni: string): Promise<StreamRoute[]>;
    /**
     * Find stream routes by remote address
     */
    findByRemoteAddress(remoteAddr: string): Promise<StreamRoute[]>;
    /**
     * Clone a stream route with optional modifications
     */
    clone(sourceId: string, modifications?: Partial<StreamRoute>, newId?: string): Promise<StreamRoute>;
    /**
     * Create TCP stream route
     */
    createTCPRoute(data: CreateInput<StreamRoute>, id?: string): Promise<StreamRoute>;
    /**
     * Create UDP stream route
     */
    createUDPRoute(data: CreateInput<StreamRoute>, id?: string): Promise<StreamRoute>;
    /**
     * Create TLS stream route
     */
    createTLSRoute(data: CreateInput<StreamRoute>, id?: string): Promise<StreamRoute>;
    /**
     * Get stream routes by plugin
     */
    getByPlugin(pluginName: string): Promise<StreamRoute[]>;
    /**
     * Get stream routes by upstream ID
     */
    getByUpstreamId(upstreamId: string): Promise<StreamRoute[]>;
    /**
     * Get stream routes by service ID
     */
    getByServiceId(serviceId: string): Promise<StreamRoute[]>;
    /**
     * Validate stream route configuration
     */
    validateConfig(config: CreateInput<StreamRoute>): {
        valid: boolean;
        errors: string[];
    };
}

declare class Upstreams {
    private readonly endpoint;
    private client;
    constructor(client: ApisixClient);
    /**
     * List all upstreams with optional pagination and filtering
     */
    list(options?: ListOptions): Promise<Upstream[]>;
    /**
     * Get a specific upstream by ID
     */
    get(id: string): Promise<Upstream>;
    /**
     * Create a new upstream
     */
    create(upstream: CreateInput<Upstream>, id?: string): Promise<Upstream>;
    /**
     * Update an existing upstream
     */
    update(id: string, upstream: UpdateInput<Upstream>): Promise<Upstream>;
    /**
     * Partially update an existing upstream
     */
    patch(id: string, upstream: UpdateInput<Upstream>): Promise<Upstream>;
    /**
     * Delete an upstream
     */
    delete(id: string, options?: {
        force?: boolean;
    }): Promise<boolean>;
    /**
     * Check if upstream exists
     */
    exists(id: string): Promise<boolean>;
    /**
     * List upstreams with pagination support (v3 API)
     */
    listPaginated(page?: number, pageSize?: number, filters?: Record<string, string | number | boolean | undefined>): Promise<{
        upstreams: Upstream[];
        total?: number;
        hasMore?: boolean;
    }>;
    /**
     * Find upstreams by name
     */
    findByName(name: string): Promise<Upstream[]>;
    /**
     * Find upstreams by type
     */
    findByType(type: "roundrobin" | "chash" | "ewma" | "least_conn"): Promise<Upstream[]>;
    /**
     * Add node to upstream
     */
    addNode(id: string, host: string, port: number, weight?: number): Promise<Upstream>;
    /**
     * Remove node from upstream
     */
    removeNode(id: string, host: string, port: number): Promise<Upstream>;
    /**
     * Update node weight in upstream
     */
    updateNodeWeight(id: string, host: string, port: number, weight: number): Promise<Upstream>;
    /**
     * Clone an upstream with optional modifications
     */
    clone(sourceId: string, modifications?: Partial<Upstream>, newId?: string): Promise<Upstream>;
    /**
     * Get upstream statistics
     */
    getStatistics(): Promise<{
        total: number;
        healthy: number;
        unhealthy: number;
        typeDistribution: Array<{
            type: string;
            count: number;
        }>;
        nodeCount: number;
        averageNodesPerUpstream: number;
    }>;
}

declare class VersionManager {
    private client;
    private versionConfigs;
    constructor(client: ApisixClient);
    private initializeVersionConfigs;
    /**
     * Get version configuration for current APISIX version
     */
    getCurrentVersionConfig(): Promise<VersionConfig>;
    /**
     * Check if a feature is supported in current version
     */
    isFeatureSupported(feature: keyof Omit<VersionConfig, "version" | "supportedPlugins" | "deprecatedFeatures">): Promise<boolean>;
    /**
     * Check if a plugin is supported in current version
     */
    isPluginSupported(pluginName: string): Promise<boolean>;
    /**
     * Get list of deprecated features in current version
     */
    getDeprecatedFeatures(): Promise<string[]>;
    /**
     * Check if a feature is deprecated
     */
    isFeatureDeprecated(feature: string): Promise<boolean>;
    /**
     * Get migration recommendations for version upgrade
     */
    getMigrationRecommendations(targetVersion: string): Promise<MigrationRecommendations>;
    private getMajorVersion;
    /**
     * Validate configuration against current version
     */
    validateConfiguration(config: Record<string, unknown>): Promise<ValidationResult>;
    private hasNestedProperty;
}

/**
 * Apache APISIX SDK for Node.js
 *
 * Provides comprehensive access to APISIX Admin API and Control API
 */
declare class ApisixSDK {
    private client;
    readonly routes: Routes;
    readonly services: Services;
    readonly upstreams: Upstreams;
    readonly consumers: Consumers;
    readonly credentials: Credentials;
    readonly ssl: SSLCertificates;
    readonly globalRules: GlobalRules;
    readonly consumerGroups: ConsumerGroups;
    readonly pluginConfigs: PluginConfigs;
    readonly plugins: Plugins;
    readonly streamRoutes: StreamRoutes;
    readonly secrets: Secrets;
    readonly protos: Protos;
    readonly control: Control;
    readonly version: VersionManager;
    constructor(config: ApisixSDKConfig);
    /**
     * Get the underlying client for direct API access
     */
    getClient(): ApisixClient;
    /**
     * Test connection to APISIX Admin API
     */
    testConnection(): Promise<boolean>;
    /**
     * Test connection to APISIX Control API
     */
    testControlConnection(): Promise<boolean>;
    /**
     * Get comprehensive system status
     */
    getSystemStatus(): Promise<{
        adminApiConnected: boolean;
        controlApiConnected: boolean;
        systemOverview?: Awaited<ReturnType<Control["getSystemOverview"]>>;
    }>;
    /**
     * Get APISIX server information
     */
    getServerInfo(): Promise<ServerInfo>;
    /**
     * Get APISIX version
     */
    getVersion(): Promise<string>;
    /**
     * Check if current APISIX version supports a specific feature
     */
    supportsFeature(feature: "credentials" | "secrets" | "newResponseFormat" | "streamRoutes"): Promise<boolean>;
    /**
     * Get version compatibility information
     */
    getVersionCompatibility(): Promise<{
        version: string;
        majorVersion: string;
        features: {
            supportsCredentials: boolean;
            supportsSecrets: boolean;
            supportsNewResponseFormat: boolean;
            supportsStreamRoutes: boolean;
            supportsPagination: boolean;
        };
        supportedPlugins: string[];
        deprecatedFeatures: string[];
    }>;
    /**
     * Validate configuration data against APISIX schemas
     */
    validateData(entityType: "route" | "service" | "upstream" | "consumer" | "ssl" | "plugin", data: Record<string, unknown>, options?: {
        pluginName?: string;
        validatePlugins?: boolean;
    }): Promise<{
        valid: boolean;
        errors: string[];
        warnings: string[];
    }>;
    /**
     * Import data with validation and conflict resolution
     */
    importData<T>(entityType: "routes" | "services" | "upstreams" | "consumers" | "ssl", data: T[] | string, options?: {
        strategy?: "replace" | "merge" | "skip_existing";
        validate?: boolean;
        dryRun?: boolean;
    }): Promise<{
        total: number;
        created: number;
        updated: number;
        skipped: number;
        errors: {
            id?: string | undefined;
            error: string;
        }[];
    }>;
    /**
     * Export data in various formats
     */
    exportData<T>(entityType: "routes" | "services" | "upstreams" | "consumers" | "ssl", options?: {
        format?: "json" | "yaml";
        include?: string[];
        exclude?: string[];
        pretty?: boolean;
    }): Promise<string>;
    /**
     * Perform batch operations on multiple entities
     */
    batchOperations<T>(entityType: "routes" | "services" | "upstreams" | "consumers" | "ssl", operations: Array<{
        operation: "create" | "update" | "delete";
        id?: string;
        data?: Record<string, unknown>;
    }>, options?: {
        continueOnError?: boolean;
        validateBeforeExecution?: boolean;
    }): Promise<{
        total: number;
        successful: number;
        failed: number;
        results: {
            success: boolean;
            id?: string | undefined;
            data?: T | undefined;
            error?: string | undefined;
        }[];
    }>;
    /**
     * Get configuration recommendations and best practices
     */
    getConfigurationRecommendations(): Promise<{
        schemaVersion: string;
        availablePlugins: string[];
        deprecatedPlugins: string[];
        recommendedSettings: {
            category: string;
            setting: string;
            description: string;
            recommended: unknown;
        }[];
    }>;
    /**
     * Get schema compatibility information
     */
    getSchemaCompatibility(targetVersion?: string): Promise<{
        currentVersion: string;
        targetVersion: string;
        compatible: boolean;
        breaking_changes: string[];
        new_features: string[];
        deprecated_features: string[];
    }>;
    /**
     * Import routes from OpenAPI specification
     */
    importFromOpenAPI(spec: Record<string, unknown>, options?: {
        strategy?: "replace" | "merge" | "skip_existing";
        defaultUpstream?: Record<string, unknown>;
        validateBeforeImport?: boolean;
    }): Promise<{
        total: number;
        created: number;
        updated: number;
        skipped: number;
        errors: {
            path?: string | undefined;
            method?: string | undefined;
            error: string;
        }[];
    }>;
    /**
     * Export routes to OpenAPI specification
     */
    exportToOpenAPI(options?: {
        title?: string;
        version?: string;
        description?: string;
        serverUrl?: string;
        includeDisabled?: boolean;
        filterByLabels?: Record<string, string>;
    }): Promise<{
        openapi: string;
        info: {
            title: string;
            version: string;
            description?: string | undefined;
        };
        servers?: {
            url: string;
        }[] | undefined;
        paths: Record<string, Record<string, Record<string, unknown>>>;
    }>;
    /**
     * Advanced search across routes
     */
    searchRoutes(criteria: {
        uri?: string;
        uriPattern?: string;
        methods?: string[];
        hosts?: string[];
        plugins?: string[];
        status?: 0 | 1;
        hasUpstream?: boolean;
        hasService?: boolean;
        labels?: Record<string, string>;
        createdAfter?: Date;
        createdBefore?: Date;
    }): Promise<Route[]>;
    /**
     * Get entity endpoint based on type
     */
    private getEndpointForEntityType;
}
/**
 * Create a new APISIX SDK instance
 */
declare function createApisixSDK(config: ApisixSDKConfig): ApisixSDK;

export { ApisixClient, ApisixSDK, ConsumerGroups, Consumers, Control, Credentials, GlobalRules, PluginConfigs, Plugins, Protos, Routes, SSLCertificates, Secrets, Services, StreamRoutes, Upstreams, VersionManager, createApisixSDK, ApisixSDK as default };
export type { AWSSecret, ApisixListResponse, ApisixResponse, ApisixSDKConfig, BatchOperation, BatchResponse, BatchResult, ConnectionStatistics, Consumer, ConsumerCredential, ConsumerGroup, CreateInput, Credential, DiscoveryDump, DiscoveryDumpFile, DiscoveryDumpNode, DiscoveryServices, ErrorResponse, ExportOptions, FilterOptions, ForceDeleteOptions, GCPAuthConfig, GCPSecret, GlobalRule, HashOn, HealthCheck, HealthCheckStatus, HealthCheckType, ImportOptions, ImportResult, KeepalivePool, ListOptions, MigrationRecommendations, OpenAPIRoute, OpenAPISpec, PassHost, Plugin, PluginConfig, PluginInfo, PluginList, PluginMetadata, PrometheusMetrics, Proto, RequestStatistics, Route, SSL, SchemaInfo, Secret, ServerInfo, Service, StreamRoute, TTLOptions, UpdateInput, Upstream, UpstreamHealth, UpstreamHealthNode, UpstreamNode, UpstreamScheme, UpstreamTLS, UpstreamType, ValidationResult, VaultSecret, VersionConfig };
