UNPKG

buildx-connect

Version:

Official JavaScript/TypeScript SDK for Buildx low-code platform

41 lines (40 loc) 1.19 kB
import { Function, FunctionLog, ErrorResponse, BuildxConfig } from "../types/index"; /** * Functions service for Buildx * Handles serverless functions management * * @example * ```typescript * const functions = buildx.functions(); * * // Get all functions * const funcs = await functions.list(); * * // Get function by name * const func = await functions.getByName('function-name'); * * // Update function * await functions.update('function-name', { code: 'new code' }); * ``` */ export declare class Functions { private baseService; constructor(config: BuildxConfig); updateConfig(config: BuildxConfig): void; /** * List all functions in a project */ list(projectId?: string): Promise<Function[] | ErrorResponse>; /** * Get function by name */ getByName(functionName: string, projectId?: string): Promise<Function | ErrorResponse>; /** * Update function */ update(functionName: string, data: Partial<Function>, projectId?: string): Promise<Function | ErrorResponse>; /** * Get function logs */ getLogs(functionName: string, projectId?: string): Promise<FunctionLog[] | ErrorResponse>; }