UNPKG

@gsb-core/core

Version:

GSB core services and classes for platform-independent web applications

62 lines (61 loc) 2.08 kB
import { GsbWfFunction } from '../../models/gsb-function.model'; /** * Service for managing Serverless Functions in the application */ export declare class FunctionService { private entityService; private ENTITY_NAME; constructor(); /** * Get function by ID * @param id The function ID * @returns The function or null if not found */ getFunctionById(id: string): Promise<GsbWfFunction | null>; /** * Get all functions with pagination * @param page The page number (starting from 1) * @param pageSize The number of items per page * @returns An array of functions and the total count */ getFunctions(page?: number, pageSize?: number): Promise<{ functions: GsbWfFunction[]; totalCount: number; }>; /** * Search for functions * @param searchTerm The search term * @param page The page number (starting from 1) * @param pageSize The number of items per page * @returns An array of functions and the total count */ searchFunctions(searchTerm: string, page?: number, pageSize?: number): Promise<{ functions: GsbWfFunction[]; totalCount: number; }>; /** * Create a new function * @param func The function to create * @returns The created function ID or null if failed */ createFunction(func: GsbWfFunction): Promise<string | null>; /** * Update an existing function * @param func The function to update * @returns True if updated successfully, false otherwise */ updateFunction(func: GsbWfFunction): Promise<boolean>; /** * Delete a function * @param id The function ID to delete * @returns True if deleted successfully, false otherwise */ deleteFunction(id: string): Promise<boolean>; /** * Execute a function * @param id The function ID to execute * @param params The parameters to pass to the function * @returns The result of the function execution */ executeFunction(id: string, params?: any): Promise<any>; }