/** * CLI utility functions for type coercion and input handling. * * Provides helpers for CLI commands: type coercion (string CLI args to proper * GraphQL types), field filtering (strip extra minimist fields), * mutation input parsing, and select field parsing. */ export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; } /** * Coerce CLI string arguments to their proper GraphQL types based on a field schema. * CLI args always arrive as strings from minimist, but GraphQL expects * Boolean, Int, Float, JSON, etc. */ export declare function coerceAnswers(answers: Record, schema: FieldSchema): Record; /** * Strip undefined values and filter to only schema-defined keys. * This removes extra fields injected by minimist (like _, tty, etc.) * and any fields that were coerced to undefined. */ export declare function stripUndefined(obj: Record, schema?: FieldSchema): Record; /** * Parse mutation input from CLI. * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ export declare function parseMutationInput(answers: Record): Record; /** * Build a select object from a comma-separated list of dot-notation paths. * Uses `nested-obj` to parse paths like 'clientMutationId,result.accessToken,result.userId' * into the nested structure expected by the ORM: * * { clientMutationId: true, result: { select: { accessToken: true, userId: true } } } * * Paths without dots set the key to `true` (scalar select). * Paths with dots create nested `{ select: { ... } }` wrappers, matching the * ORM's expected structure for OBJECT sub-fields. * * @param paths - Comma-separated dot-notation field paths * @returns The nested select object for the ORM */ export declare function buildSelectFromPaths(paths: string): Record;