UNPKG

@statezero/core

Version:

The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate

52 lines (51 loc) 1.59 kB
/** * Process a list of numbers with various mathematical operations * * @param any[] data - List of numbers to process * @param 'sum' | 'avg' | 'max' | 'min' operation - Mathematical operation to perform * @param {Object} [axiosOverrides] - Allows overriding Axios request parameters. * @returns {Promise<Object>} A promise that resolves with the action's result. */ export function processData(data: any, operation: any, axiosOverrides?: Object): Promise<Object>; export namespace processData { let actionName: string; let title: string; let app: string; let permissions: string[]; let configKey: string; } /** * Zod schema for the input of processData. * NOTE: This is an object schema for validating the data payload. */ export const processDataInputSchema: z.ZodObject<{ data: z.ZodArray<z.ZodAny, "many">; operation: z.ZodEnum<["sum", "avg", "max", "min"]>; }, "strip", z.ZodTypeAny, { data: any[]; operation: "min" | "max" | "avg" | "sum"; }, { data: any[]; operation: "min" | "max" | "avg" | "sum"; }>; /** * Zod schema for the response of processData. */ export const processDataResponseSchema: z.ZodObject<{ operation: z.ZodString; result: z.ZodNumber; processed_count: z.ZodNumber; execution_time_ms: z.ZodNumber; }, "strip", z.ZodTypeAny, { operation: string; result: number; processed_count: number; execution_time_ms: number; }, { operation: string; result: number; processed_count: number; execution_time_ms: number; }>; export default processData; import { z } from 'zod';