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 type Integration = components['schemas']['RestIntegrationResponse'];
export type IntegrationAuth = NonNullable<Integration['auth']>;
export type IntegrationAuthRequest = NonNullable<CreateIntegrationRequest['auth']>;
export type CustomTokenExchangeIntegrationAuthRequest = components['schemas']['CustomTokenExchangeAuthRequest'];
export type IntegrationIdentityBinding = NonNullable<CustomTokenExchangeIntegrationAuthRequest['identity_bindings']>[string];
export type IntegrationIdentityBindings = NonNullable<CustomTokenExchangeIntegrationAuthRequest['identity_bindings']>;
export type IntegrationIdentityBindingTestValues = NonNullable<CustomTokenExchangeIntegrationAuthRequest['identity_binding_test_values']>;
export type CreateIntegrationRequest = components['schemas']['src__routes__integrations__create_integration__Request'];
export type UpdateIntegrationRequest = components['schemas']['src__routes__integrations__update_integration__Request'];
export type IntegrationListResponse = components['schemas']['src__routes__integrations__list_integrations__Response'];
export type IntegrationEndpoint = components['schemas']['EndpointResponse'];
export type CreateIntegrationEndpointRequest = components['schemas']['src__routes__integrations__create_endpoint__Request'];
export type UpdateIntegrationEndpointRequest = components['schemas']['src__routes__integrations__update_endpoint__Request'];
export type IntegrationEndpointListResponse = components['schemas']['src__routes__integrations__list_endpoints__Response'];
export type TestIntegrationEndpointRequest = components['schemas']['src__routes__integrations__test_endpoint__Request'];
export type TestIntegrationEndpointResponse = components['schemas']['src__routes__integrations__test_endpoint__Response'];
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: CreateIntegrationRequest): Promise<Integration>;
    /** List integrations (REST + desktop) */
    list(params?: ListIntegrationsParams): Promise<IntegrationListResponse>;
    listAutoPaging(params?: ListIntegrationsParams): AsyncGenerator<{
        approval_policy?: "none" | "writes" | "all";
        auth?: components["schemas"]["StaticHeaderAuthDict"] | components["schemas"]["OAuth2ClientCredentialsAuthDict"] | components["schemas"]["OAuth2JwtBearerAuthDict"] | components["schemas"]["CustomTokenExchangeAuthDict"] | null;
        base_url: string;
        created_at: string;
        display_name: string;
        enabled: boolean;
        endpoint_count: number;
        id: string;
        kind?: "rest";
        name: string;
        updated_at: string;
        workspace_id: string;
    }, any, any>;
    /** Get a single integration */
    get(integrationId: IntegrationId | string): Promise<Integration>;
    /** Patch a REST integration. Pass `auth: null` to clear auth. */
    update(integrationId: IntegrationId | string, body: UpdateIntegrationRequest): Promise<Integration>;
    /** Delete a REST integration */
    delete(integrationId: IntegrationId | string): Promise<void>;
    /** List endpoints on a REST integration */
    listEndpoints(integrationId: IntegrationId | string, params?: ListEndpointsParams): Promise<IntegrationEndpointListResponse>;
    listEndpointsAutoPaging(integrationId: IntegrationId | string, params?: ListEndpointsParams): AsyncGenerator<{
        body_format?: "json" | "form";
        description: string;
        headers?: {
            [key: string]: string;
        };
        id: string;
        input_schema?: {
            [key: string]: unknown;
        };
        max_response_length?: number;
        max_retries?: number;
        method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
        name: string;
        path: string;
        response_template?: string | null;
        retry_on_status?: number[];
        static_body_fields?: {
            [key: string]: string;
        };
        timeout_seconds?: number;
    }, any, any>;
    /** Get a single endpoint */
    getEndpoint(integrationId: IntegrationId | string, endpointId: IntegrationEndpointId | string): Promise<IntegrationEndpoint>;
    /** Add an endpoint to a REST integration */
    createEndpoint(integrationId: IntegrationId | string, body: CreateIntegrationEndpointRequest): Promise<IntegrationEndpoint>;
    /** Patch an endpoint. The endpoint `name` is immutable. */
    updateEndpoint(integrationId: IntegrationId | string, endpointId: IntegrationEndpointId | string, body: UpdateIntegrationEndpointRequest): Promise<IntegrationEndpoint>;
    /** 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: TestIntegrationEndpointRequest): Promise<TestIntegrationEndpointResponse>;
}
//# sourceMappingURL=integrations.d.ts.map