import type { components } from '../generated/api.js';
import { WorkspaceScopedResource } from './base.js';
export declare class FunctionsResource extends WorkspaceScopedResource {
    list(): Promise<{
        count: number;
        items: {
            catalog?: string | undefined;
            description?: components["schemas"]["DescriptionString"] | undefined;
            enabled?: boolean | undefined;
            function_type?: string | undefined;
            input_schema?: {
                [x: string]: unknown;
            } | undefined;
            name: components["schemas"]["NameString"];
            returns_table?: boolean | undefined;
            schema?: string | undefined;
        }[];
    } & import("../index.js").ResponseMetadata>;
    create(body: components['schemas']['FunctionCreateRequest']): Promise<{
        catalog?: string | undefined;
        description?: components["schemas"]["DescriptionString"] | undefined;
        enabled?: boolean | undefined;
        function_type?: string | undefined;
        input_schema?: {
            [x: string]: unknown;
        } | undefined;
        name: components["schemas"]["NameString"];
        returns_table?: boolean | undefined;
        schema?: string | undefined;
    } & import("../index.js").ResponseMetadata>;
    delete(functionName: string): Promise<void>;
    test(functionName: string, body: components['schemas']['FunctionTestRequest']): Promise<{
        duration_ms?: number | undefined;
        error?: string | null | undefined;
        function_name?: string | undefined;
        result?: unknown;
    } & import("../index.js").ResponseMetadata>;
    getCatalog(): Promise<{
        catalog?: string | undefined;
        count?: number | undefined;
        functions: {
            comment?: string | undefined;
            data_type?: string | undefined;
            name: string;
            registered?: boolean | undefined;
        }[];
        schema?: string | undefined;
    } & import("../index.js").ResponseMetadata>;
    query(body: components['schemas']['QueryRequest']): Promise<{
        count?: number | undefined;
        duration_ms?: number | undefined;
        error?: string | null | undefined;
        results?: {
            [x: string]: unknown;
        }[] | undefined;
    } & import("../index.js").ResponseMetadata>;
    sync(): Promise<{
        count: number;
        items: {
            catalog?: string | undefined;
            description?: components["schemas"]["DescriptionString"] | undefined;
            enabled?: boolean | undefined;
            function_type?: string | undefined;
            input_schema?: {
                [x: string]: unknown;
            } | undefined;
            name: components["schemas"]["NameString"];
            returns_table?: boolean | undefined;
            schema?: string | undefined;
        }[];
    } & import("../index.js").ResponseMetadata>;
    /**
     * Validate + register a new platform function version. Atomic:
     * validation + INSERT + ``latest`` alias rebind happen in one
     * transaction. Concurrent deploys race-fail on the UNIQUE
     * constraint and return 409.
     */
    deploy(body: components['schemas']['RegisteredFunction']): Promise<{
        deployed_at?: string | null | undefined;
        deployed_by?: string | null | undefined;
        description?: string | undefined;
        examples?: {
            [x: string]: unknown;
        }[] | undefined;
        function_type: string;
        input_schema?: {
            [x: string]: unknown;
        } | undefined;
        last_test_at?: string | null | undefined;
        last_test_duration_ms?: number | null | undefined;
        last_test_error?: string | null | undefined;
        last_test_status?: string | null | undefined;
        name: string;
        parameters?: {
            [x: string]: unknown;
        }[] | undefined;
        returns_kind: string;
        source_hash?: string | null | undefined;
        source_path?: string | null | undefined;
        sql_template: string;
        timeout_ms?: number | undefined;
        version: number;
        when_to_use?: string | undefined;
    } & import("../index.js").ResponseMetadata>;
    /**
     * List the ``latest`` version of every V109-registered platform
     * function in the workspace. Returns one row per function (the
     * alias-pinned latest version).
     *
     * Distinct from :meth:`list` which reads the legacy
     * ``workspace.settings["functions"]`` JSONB store; both surfaces
     * co-exist while callers migrate. Prefer this for V109 functions.
     */
    listRegistered(): Promise<{
        count: number;
        items: {
            deployed_at?: string | null | undefined;
            deployed_by?: string | null | undefined;
            description?: string | undefined;
            examples?: {
                [x: string]: unknown;
            }[] | undefined;
            function_type: string;
            input_schema?: {
                [x: string]: unknown;
            } | undefined;
            last_test_at?: string | null | undefined;
            last_test_duration_ms?: number | null | undefined;
            last_test_error?: string | null | undefined;
            last_test_status?: string | null | undefined;
            name: string;
            parameters?: {
                [x: string]: unknown;
            }[] | undefined;
            returns_kind: string;
            source_hash?: string | null | undefined;
            source_path?: string | null | undefined;
            sql_template: string;
            timeout_ms?: number | undefined;
            version: number;
            when_to_use?: string | undefined;
        }[];
    } & import("../index.js").ResponseMetadata>;
    /**
     * List all immutable versions of a registered function, newest first.
     */
    listVersions(functionName: string): Promise<{
        count: number;
        items: {
            deployed_at?: string | null | undefined;
            deployed_by?: string | null | undefined;
            description?: string | undefined;
            examples?: {
                [x: string]: unknown;
            }[] | undefined;
            function_type: string;
            input_schema?: {
                [x: string]: unknown;
            } | undefined;
            last_test_at?: string | null | undefined;
            last_test_duration_ms?: number | null | undefined;
            last_test_error?: string | null | undefined;
            last_test_status?: string | null | undefined;
            name: string;
            parameters?: {
                [x: string]: unknown;
            }[] | undefined;
            returns_kind: string;
            source_hash?: string | null | undefined;
            source_path?: string | null | undefined;
            sql_template: string;
            timeout_ms?: number | undefined;
            version: number;
            when_to_use?: string | undefined;
        }[];
    } & import("../index.js").ResponseMetadata>;
    /**
     * Resolve ``(function_name, alias)`` to a specific version row.
     * Default alias: ``latest``.
     */
    getVersion(functionName: string, alias?: 'latest' | 'staging' | 'production'): Promise<{
        deployed_at?: string | null | undefined;
        deployed_by?: string | null | undefined;
        description?: string | undefined;
        examples?: {
            [x: string]: unknown;
        }[] | undefined;
        function_type: string;
        input_schema?: {
            [x: string]: unknown;
        } | undefined;
        last_test_at?: string | null | undefined;
        last_test_duration_ms?: number | null | undefined;
        last_test_error?: string | null | undefined;
        last_test_status?: string | null | undefined;
        name: string;
        parameters?: {
            [x: string]: unknown;
        }[] | undefined;
        returns_kind: string;
        source_hash?: string | null | undefined;
        source_path?: string | null | undefined;
        sql_template: string;
        timeout_ms?: number | undefined;
        version: number;
        when_to_use?: string | undefined;
    } & import("../index.js").ResponseMetadata>;
    /**
     * Execute a registered function. Bound parameters validated against
     * the version's stored schema; ``ws_id`` auto-injected from request
     * context. Returns the executor's shaped response (rows for
     * ``returns=table``, scalar for ``returns=scalar``).
     */
    invoke(functionName: string, body: components['schemas']['InvokeRequest']): Promise<{
        duration_ms?: number | undefined;
        result?: unknown;
        row_count?: number | undefined;
        version?: number | undefined;
    } & import("../index.js").ResponseMetadata>;
    /**
     * Test invoke — same as ``invoke`` plus persists ``last_test_*``
     * telemetry on the version row so the DC tool list can show
     * health without re-running.
     *
     * Returns :type:`TestInvokeResponse` (superset of `InvokeResponse`)
     * so callers can read ``status`` / ``error`` / ``test_duration_ms``
     * directly off the response. The platform-api route catches
     * ``ServiceUnavailableError`` and converts it into ``status='fail'``
     * with the executor's error string in ``error`` — so even on a
     * blown-up SQL execution the response is a 200 with the failure
     * detail surfaced to the caller.
     */
    testV2(functionName: string, body: components['schemas']['InvokeRequest']): Promise<components['schemas']['TestInvokeResponse']>;
    /**
     * Rebind an alias (``latest`` / ``staging`` / ``production``) to a
     * specific version. Verifies the version exists before rebinding.
     */
    promote(functionName: string, body: components['schemas']['PromoteRequest']): Promise<{
        alias: string;
        name: string;
        version: number;
    } & import("../index.js").ResponseMetadata>;
    /**
     * Rebind ``latest`` and ``production`` to a prior version. The
     * "oops the new deploy was bad" path. ``staging`` stays untouched.
     */
    rollback(functionName: string, body: components['schemas']['RollbackRequest']): Promise<{
        name: string;
        rolled_back_to_version: number;
    } & import("../index.js").ResponseMetadata>;
}
//# sourceMappingURL=functions.d.ts.map