/** * Input Helpers - Utilities for detecting and processing action inputs */ import { IActionRequest, IAppAction } from '../../types'; import { IResolveOptions } from './input-resolver'; import { AuthContextManager } from './auth-context-manager'; /** * Check if the input appears to be a structured IActionRequest format * * Structured format has ONLY these keys: body, params, query, headers, input * Flat format has arbitrary keys that need to be resolved * * @param input - Input to check * @returns true if structured, false if flat */ export declare function isStructuredInput(input: Record): boolean; /** * Check if input contains any flat-style prefixed keys * * @param input - Input to check * @returns true if contains prefixed keys like 'body:key', 'params:id' */ export declare function hasPrefixedKeys(input: Record): boolean; /** * Options for processing action input */ export interface IProcessInputOptions extends IResolveOptions { /** Skip validation after resolution */ skipValidation?: boolean; } /** * Process action input - detect format and resolve if flat * * This is the main entry point for action input processing: * 1. Detects if input is structured or flat * 2. If flat, resolves it using the action schema * 3. Merges auth context if provided * 4. Optionally validates required fields * * @param input - Raw input (structured or flat) * @param action - Action schema for resolution * @param authManager - Optional auth context manager * @param app - App tag for auth context lookup * @param env - Env slug for auth context lookup * @param product - Optional product tag for auth context lookup * @param options - Processing options * @returns Structured IActionRequest ready for execution * @throws InputResolutionError for invalid inputs in strict mode */ export declare function processActionInput(input: Record, action: IAppAction, authManager?: AuthContextManager, app?: string, env?: string, product?: string, options?: IProcessInputOptions): IActionRequest; /** * Create a flat input validator for an action * * Returns a function that validates flat input against the action schema * without actually resolving it. Useful for pre-validation. * * @param action - Action schema * @returns Validator function */ export declare function createFlatInputValidator(action: IAppAction): (input: Record) => void; /** * Get a user-friendly summary of valid input keys for an action * * @param action - Action schema * @returns Human-readable summary string */ export declare function getInputKeySummary(action: IAppAction): string;