import { BaseClient } from "../client-base.js"; import type { FunctionDetails, FunctionInfo, FunctionRevision, RequestOptions, RevisionInfo, RunRequest, RunResponse, StreamChunk, UpdateFunctionRequest } from "../types.js"; /** A single example for a function. */ export interface Example { readonly uuid?: string; readonly input: Record; readonly output: Record; readonly tag?: string; } /** Parameters for listing examples. */ export interface ListExamplesParams { readonly limit?: number; readonly offset?: number; readonly tag?: string; } /** * Client for the Functions API endpoints. * Provides methods to manage functions, revisions, examples, and execute functions. */ export declare class FunctionsClient extends BaseClient { /** * List all cached functions for the authenticated project. * GET /v3/functions */ list(options?: RequestOptions): Promise; /** * Get details of a specific function including its script source. * GET /v3/functions/{name} */ get(name: string, options?: RequestOptions): Promise; /** * Update the source code of a function. * PUT /v3/functions/{name} */ update(name: string, body: UpdateFunctionRequest, options?: RequestOptions): Promise; /** * Delete a cached function. * DELETE /v3/functions/{name} */ delete(name: string, options?: RequestOptions): Promise; /** * List all revisions of a function. * GET /v3/functions/{name}/revisions */ listRevisions(name: string, options?: RequestOptions): Promise; /** * Get a specific revision of a function. * GET /v3/functions/{name}/revisions/{revisionID} */ getRevision(name: string, revisionID: number, options?: RequestOptions): Promise; /** * Revert a function to a previous revision. * POST /v3/functions/{name}/revisions/{revisionID}/revert */ revertRevision(name: string, revisionID: number, options?: RequestOptions): Promise; /** * Execute a function with the given input. * POST /v3/functions/{name}/call */ run(name: string, body: RunRequest, options?: RequestOptions): Promise>; /** * Execute a function with SSE streaming output. * POST /v3/functions/{name}/stream * * Returns an async generator that yields StreamChunk events. */ stream(name: string, body: RunRequest, options?: RequestOptions): AsyncGenerator; /** * Create a single example for a function. * POST /v3/functions/{name}/examples */ createExample(name: string, body: Example, options?: RequestOptions): Promise; /** * Batch create multiple examples for a function. * POST /v3/functions/{name}/examples/batch */ createExamplesBatch(name: string, body: Example[], options?: RequestOptions): Promise; /** * List examples for a function. * GET /v3/functions/{name}/examples */ listExamples(name: string, params?: ListExamplesParams, options?: RequestOptions): Promise; /** * Delete an example. * DELETE /v3/functions/{name}/examples/{uuid} */ deleteExample(name: string, uuid: string, options?: RequestOptions): Promise; }