/** * Case convention for the wire format. Affects how request bodies and * query-string filters are mapped to bean setters / SQL columns and how * responses are serialized. * * - `'snake'` (default): clients send and receive snake_case (matching the DB * columns). Incoming snake_case body keys are translated to camelCase * before being applied to the bean — currently those would be silently * dropped because the bean's setters are camelCase. CamelCase input * continues to work, so this is backward-compatible with v0.2.x. * - `'camel'`: clients send and receive camelCase. Output keys are * translated snake → camel; input body and query filter keys are * translated camel → snake before being applied to bean / SQL. * - `'preserve'`: legacy behavior — input goes through Object.assign as * given (so camelCase works, snake_case is dropped), output is whatever * `bean.toJSON()` returns (snake_case from mtbdb). */ export type CaseConvention = 'snake' | 'camel' | 'preserve'; export declare const DEFAULT_CASE_CONVENTION: CaseConvention; /** Convert a snake_case identifier to camelCase. Idempotent on input that has no underscores. */ export declare function toCamel(s: string): string; /** Convert a camelCase identifier to snake_case. Idempotent on input that has no uppercase letters. */ export declare function toSnake(s: string): string; /** Apply a key transform to a flat record, leaving values alone. */ export declare function mapKeys(obj: Record, transform: (key: string) => string): Record; /** * Translate an incoming request body to the form expected by `Object.assign(bean, body)`. * Bean setters are always camelCase (mtbdb codegen), regardless of column casing, * so: * - 'snake' mode: snake_case keys → camelCase keys (passthrough for already-camel keys). * - 'camel' mode: same — camel input maps directly to setters. * - 'preserve' mode: no transformation. */ export declare function applyInputCase(body: Record, convention: CaseConvention): Record; /** * Translate a query-string filter to the form QueryBuilder consumes (snake_case * column names). 'camel' mode flips camelCase query keys to snake_case; * 'snake' mode passes through; 'preserve' mode also passes through. */ export declare function applyFilterCase(filter: Record, convention: CaseConvention): Record; /** * Translate a serialized bean (snake_case columns) to the wire shape. * Only 'camel' mode rewrites; 'snake' and 'preserve' both pass through. */ export declare function applyOutputCase(payload: Record, convention: CaseConvention): Record; //# sourceMappingURL=caseConvention.d.ts.map