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; /** * Reconstruct nested objects from dot-notation CLI answers. * When INPUT_OBJECT args are flattened to dot-notation questions * (e.g. `--input.email foo --input.password bar`), this function * rebuilds the nested structure expected by the ORM: * * { 'input.email': 'foo', 'input.password': 'bar' } * → { input: { email: 'foo', password: 'bar' } } * * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ export declare function unflattenDotNotation(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 (e.g. `SignUpPayloadSelect.result`). * * @param paths - Comma-separated dot-notation field paths (e.g. 'clientMutationId,result.accessToken') * @returns The nested select object for the ORM */ /** * Parse a CLI flag as an integer. * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ export declare function parseIntFlag(argv: Record, name: string): number | undefined; /** * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ export declare function parseStringFlag(argv: Record, name: string): string | undefined; /** * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ export declare function parseOrderByFlag(argv: Record): string[] | undefined; /** * Parse --select flag into a select object, falling back to a default. * e.g. --select id,name → { id: true, name: true } */ export declare function parseSelectFlag(argv: Record, defaultSelect: Record): Record; /** * Build the full findManyArgs object from CLI argv. * Parses all pagination, filtering, ordering, and field selection flags * in one call. Accepts an optional `extraWhere` to merge with dot-notation * --where flags (used by the search handler to inject search clauses). * * @example * const findManyArgs = parseFindManyArgs(argv, { id: true, name: true }); * const result = await client.user.findMany(findManyArgs).execute(); */ export declare function parseFindManyArgs>(argv: Record, defaultSelect: Record, extraWhere?: Record): T; /** * Build findFirst args from CLI argv. * Like parseFindManyArgs but without pagination flags (no limit/offset/after/before/last) * — findFirst returns the first matching record. Supports select, where, and orderBy. */ export declare function parseFindFirstArgs>(argv: Record, defaultSelect: Record): T; export declare function buildSelectFromPaths(paths: string): Record;