import type { components } from '../generated/api.js';
import type { IntegrationId, IntegrationEndpointId } from '../core/branded-types.js';
import { WorkspaceScopedResource } from './base.js';
import type { ListParams } from '../core/utils.js';
export interface ListIntegrationsParams extends ListParams {
    enabled?: boolean | null;
    search?: string | null;
    sort_by?: string[];
}
export interface ListEndpointsParams extends ListParams {
    search?: string | null;
    sort_by?: string[];
}
/**
 * Manage integrations — connections to external systems (EHRs, CRMs, etc.).
 *
 * REST integrations carry workspace-level `base_url` + `auth` config. Their
 * endpoints are managed as a separate sub-resource: create the integration
 * first, then add endpoints via `createEndpoint` / `updateEndpoint` /
 * `deleteEndpoint`. Endpoints are identified by UUID (`endpoint_id`); the
 * `name` field is human-facing only.
 */
export declare class IntegrationsResource extends WorkspaceScopedResource {
    /** Create a new REST integration */
    create(body: components['schemas']['src__routes__integrations__create_integration__Request']): Promise<{
        approval_policy?: "none" | "writes" | "all" | undefined;
        auth?: {
            body_encoding: "json" | "form";
            exchange_url: string;
            identity_bindings: {
                [x: string]: string;
            };
            param_body_fields: {
                [x: string]: {
                    description: string;
                    param_name: string;
                };
            };
            param_headers: {
                [x: string]: {
                    description: string;
                    param_name: string;
                };
            };
            response_token_path: string;
            static_body_fields: {
                [x: string]: string;
            };
            static_headers: {
                [x: string]: string;
            };
            type: "custom_token_exchange";
        } | {
            client_auth_method: "basic" | "body";
            client_id: string;
            scopes: string[] | null;
            token_url: string;
            type: "oauth2_client_credentials";
        } | {
            assertion_algorithm: "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | "ES256" | "ES384" | "ES512";
            assertion_audience: string;
            assertion_issuer: string;
            assertion_lifetime_seconds: number;
            assertion_subject: string;
            extra_claims: {
                [x: string]: unknown;
            };
            include_iat: boolean;
            include_jti: boolean;
            scopes: string[] | null;
            token_url: string;
            type: "oauth2_jwt_bearer";
        } | {
            header_name: string;
            type: "static_header";
        } | null | undefined;
        base_url: string;
        created_at: string;
        display_name: string;
        enabled: boolean;
        endpoint_count: number;
        id: string;
        kind?: "rest" | undefined;
        name: string;
        updated_at: string;
        workspace_id: string;
    } & import("../index.js").ResponseMetadata>;
    /** List integrations (REST + desktop) */
    list(params?: ListIntegrationsParams): Promise<{
        continuation_token?: unknown;
        has_more: boolean;
        items: {
            approval_policy?: "none" | "writes" | "all" | undefined;
            auth?: {
                body_encoding: "json" | "form";
                exchange_url: string;
                identity_bindings: {
                    [x: string]: string;
                };
                param_body_fields: {
                    [x: string]: {
                        description: string;
                        param_name: string;
                    };
                };
                param_headers: {
                    [x: string]: {
                        description: string;
                        param_name: string;
                    };
                };
                response_token_path: string;
                static_body_fields: {
                    [x: string]: string;
                };
                static_headers: {
                    [x: string]: string;
                };
                type: "custom_token_exchange";
            } | {
                client_auth_method: "basic" | "body";
                client_id: string;
                scopes: string[] | null;
                token_url: string;
                type: "oauth2_client_credentials";
            } | {
                assertion_algorithm: "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | "ES256" | "ES384" | "ES512";
                assertion_audience: string;
                assertion_issuer: string;
                assertion_lifetime_seconds: number;
                assertion_subject: string;
                extra_claims: {
                    [x: string]: unknown;
                };
                include_iat: boolean;
                include_jti: boolean;
                scopes: string[] | null;
                token_url: string;
                type: "oauth2_jwt_bearer";
            } | {
                header_name: string;
                type: "static_header";
            } | null | undefined;
            base_url: string;
            created_at: string;
            display_name: string;
            enabled: boolean;
            endpoint_count: number;
            id: string;
            kind?: "rest" | undefined;
            name: string;
            updated_at: string;
            workspace_id: string;
        }[];
    } & import("../index.js").ResponseMetadata>;
    listAutoPaging(params?: ListIntegrationsParams): AsyncGenerator<{
        approval_policy?: "none" | "writes" | "all" | undefined;
        auth?: {
            body_encoding: "json" | "form";
            exchange_url: string;
            identity_bindings: {
                [x: string]: string;
            };
            param_body_fields: {
                [x: string]: {
                    description: string;
                    param_name: string;
                };
            };
            param_headers: {
                [x: string]: {
                    description: string;
                    param_name: string;
                };
            };
            response_token_path: string;
            static_body_fields: {
                [x: string]: string;
            };
            static_headers: {
                [x: string]: string;
            };
            type: "custom_token_exchange";
        } | {
            client_auth_method: "basic" | "body";
            client_id: string;
            scopes: string[] | null;
            token_url: string;
            type: "oauth2_client_credentials";
        } | {
            assertion_algorithm: "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | "ES256" | "ES384" | "ES512";
            assertion_audience: string;
            assertion_issuer: string;
            assertion_lifetime_seconds: number;
            assertion_subject: string;
            extra_claims: {
                [x: string]: unknown;
            };
            include_iat: boolean;
            include_jti: boolean;
            scopes: string[] | null;
            token_url: string;
            type: "oauth2_jwt_bearer";
        } | {
            header_name: string;
            type: "static_header";
        } | null | undefined;
        base_url: string;
        created_at: string;
        display_name: string;
        enabled: boolean;
        endpoint_count: number;
        id: string;
        kind?: "rest" | undefined;
        name: string;
        updated_at: string;
        workspace_id: string;
    }, any, any>;
    /** Get a single integration */
    get(integrationId: IntegrationId | string): Promise<{
        approval_policy?: "none" | "writes" | "all" | undefined;
        auth?: {
            body_encoding: "json" | "form";
            exchange_url: string;
            identity_bindings: {
                [x: string]: string;
            };
            param_body_fields: {
                [x: string]: {
                    description: string;
                    param_name: string;
                };
            };
            param_headers: {
                [x: string]: {
                    description: string;
                    param_name: string;
                };
            };
            response_token_path: string;
            static_body_fields: {
                [x: string]: string;
            };
            static_headers: {
                [x: string]: string;
            };
            type: "custom_token_exchange";
        } | {
            client_auth_method: "basic" | "body";
            client_id: string;
            scopes: string[] | null;
            token_url: string;
            type: "oauth2_client_credentials";
        } | {
            assertion_algorithm: "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | "ES256" | "ES384" | "ES512";
            assertion_audience: string;
            assertion_issuer: string;
            assertion_lifetime_seconds: number;
            assertion_subject: string;
            extra_claims: {
                [x: string]: unknown;
            };
            include_iat: boolean;
            include_jti: boolean;
            scopes: string[] | null;
            token_url: string;
            type: "oauth2_jwt_bearer";
        } | {
            header_name: string;
            type: "static_header";
        } | null | undefined;
        base_url: string;
        created_at: string;
        display_name: string;
        enabled: boolean;
        endpoint_count: number;
        id: string;
        kind?: "rest" | undefined;
        name: string;
        updated_at: string;
        workspace_id: string;
    } & import("../index.js").ResponseMetadata>;
    /** Patch a REST integration. Pass `auth: null` to clear auth. */
    update(integrationId: IntegrationId | string, body: components['schemas']['src__routes__integrations__update_integration__Request']): Promise<{
        approval_policy?: "none" | "writes" | "all" | undefined;
        auth?: {
            body_encoding: "json" | "form";
            exchange_url: string;
            identity_bindings: {
                [x: string]: string;
            };
            param_body_fields: {
                [x: string]: {
                    description: string;
                    param_name: string;
                };
            };
            param_headers: {
                [x: string]: {
                    description: string;
                    param_name: string;
                };
            };
            response_token_path: string;
            static_body_fields: {
                [x: string]: string;
            };
            static_headers: {
                [x: string]: string;
            };
            type: "custom_token_exchange";
        } | {
            client_auth_method: "basic" | "body";
            client_id: string;
            scopes: string[] | null;
            token_url: string;
            type: "oauth2_client_credentials";
        } | {
            assertion_algorithm: "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | "ES256" | "ES384" | "ES512";
            assertion_audience: string;
            assertion_issuer: string;
            assertion_lifetime_seconds: number;
            assertion_subject: string;
            extra_claims: {
                [x: string]: unknown;
            };
            include_iat: boolean;
            include_jti: boolean;
            scopes: string[] | null;
            token_url: string;
            type: "oauth2_jwt_bearer";
        } | {
            header_name: string;
            type: "static_header";
        } | null | undefined;
        base_url: string;
        created_at: string;
        display_name: string;
        enabled: boolean;
        endpoint_count: number;
        id: string;
        kind?: "rest" | undefined;
        name: string;
        updated_at: string;
        workspace_id: string;
    } & import("../index.js").ResponseMetadata>;
    /** Delete a REST integration */
    delete(integrationId: IntegrationId | string): Promise<void>;
    /** List endpoints on a REST integration */
    listEndpoints(integrationId: IntegrationId | string, params?: ListEndpointsParams): Promise<{
        continuation_token?: unknown;
        has_more: boolean;
        items: {
            body_format?: "json" | "form" | undefined;
            description: string;
            headers?: {
                [x: string]: string;
            } | undefined;
            id: string;
            input_schema?: {
                [x: string]: unknown;
            } | undefined;
            max_response_length?: number | undefined;
            max_retries?: number | undefined;
            method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
            name: string;
            path: string;
            response_template?: string | null | undefined;
            retry_on_status?: number[] | undefined;
            static_body_fields?: {
                [x: string]: string;
            } | undefined;
            timeout_seconds?: number | undefined;
        }[];
    } & import("../index.js").ResponseMetadata>;
    listEndpointsAutoPaging(integrationId: IntegrationId | string, params?: ListEndpointsParams): AsyncGenerator<{
        body_format?: "json" | "form" | undefined;
        description: string;
        headers?: {
            [x: string]: string;
        } | undefined;
        id: string;
        input_schema?: {
            [x: string]: unknown;
        } | undefined;
        max_response_length?: number | undefined;
        max_retries?: number | undefined;
        method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
        name: string;
        path: string;
        response_template?: string | null | undefined;
        retry_on_status?: number[] | undefined;
        static_body_fields?: {
            [x: string]: string;
        } | undefined;
        timeout_seconds?: number | undefined;
    }, any, any>;
    /** Get a single endpoint */
    getEndpoint(integrationId: IntegrationId | string, endpointId: IntegrationEndpointId | string): Promise<{
        body_format?: "json" | "form" | undefined;
        description: string;
        headers?: {
            [x: string]: string;
        } | undefined;
        id: string;
        input_schema?: {
            [x: string]: unknown;
        } | undefined;
        max_response_length?: number | undefined;
        max_retries?: number | undefined;
        method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
        name: string;
        path: string;
        response_template?: string | null | undefined;
        retry_on_status?: number[] | undefined;
        static_body_fields?: {
            [x: string]: string;
        } | undefined;
        timeout_seconds?: number | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Add an endpoint to a REST integration */
    createEndpoint(integrationId: IntegrationId | string, body: components['schemas']['src__routes__integrations__create_endpoint__Request']): Promise<{
        body_format?: "json" | "form" | undefined;
        description: string;
        headers?: {
            [x: string]: string;
        } | undefined;
        id: string;
        input_schema?: {
            [x: string]: unknown;
        } | undefined;
        max_response_length?: number | undefined;
        max_retries?: number | undefined;
        method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
        name: string;
        path: string;
        response_template?: string | null | undefined;
        retry_on_status?: number[] | undefined;
        static_body_fields?: {
            [x: string]: string;
        } | undefined;
        timeout_seconds?: number | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Patch an endpoint. The endpoint `name` is immutable. */
    updateEndpoint(integrationId: IntegrationId | string, endpointId: IntegrationEndpointId | string, body: components['schemas']['src__routes__integrations__update_endpoint__Request']): Promise<{
        body_format?: "json" | "form" | undefined;
        description: string;
        headers?: {
            [x: string]: string;
        } | undefined;
        id: string;
        input_schema?: {
            [x: string]: unknown;
        } | undefined;
        max_response_length?: number | undefined;
        max_retries?: number | undefined;
        method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
        name: string;
        path: string;
        response_template?: string | null | undefined;
        retry_on_status?: number[] | undefined;
        static_body_fields?: {
            [x: string]: string;
        } | undefined;
        timeout_seconds?: number | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Delete an endpoint from a REST integration */
    deleteEndpoint(integrationId: IntegrationId | string, endpointId: IntegrationEndpointId | string): Promise<void>;
    /**
     * Execute an endpoint with test parameters and return the full response
     * pipeline breakdown. Used by the developer console to validate config.
     */
    testEndpoint(integrationId: IntegrationId | string, endpointId: IntegrationEndpointId | string, body: components['schemas']['src__routes__integrations__test_endpoint__Request']): Promise<{
        duration_ms?: number | undefined;
        error?: string | null | undefined;
        final_result?: string | null | undefined;
        raw_response?: unknown;
        rendered?: string | null | undefined;
        retries?: number | undefined;
        status_code?: number | null | undefined;
    } & import("../index.js").ResponseMetadata>;
}
//# sourceMappingURL=integrations.d.ts.map