@adonis-agora/filter
Version:
Server-side query filtering/sorting/pagination for AdonisJS — Spatie-style input, a Lucid adapter, and field allow-listing. Part of the Agora ecosystem.
18 lines • 936 B
TypeScript
import type { InputSource } from './types.js';
/**
* Resolve the raw structured input from a request according to an
* {@link InputSource}:
*
* - a function — a custom extractor, called with the request.
* - `'query'` / `'body'` — always that container.
* - `'auto'` (or any other bare token) — query on reads (GET/HEAD), query+body
* merged (body wins) on writes (POST/PUT/PATCH/DELETE).
* - a dot-path (e.g. `'body.filters'`) — the nested object at that path, or `{}`
* when the path is missing or does not resolve to an object.
*
* The `req` is treated structurally (`{ method, query, body }`), so an AdonisJS
* `HttpContext.request` — whose `qs()`/`body()` you pass in — or a plain object
* both work. The result is always a fresh shallow copy.
*/
export declare function resolveInputFromRequest(req: unknown, source: InputSource): Record<string, unknown>;
//# sourceMappingURL=source_resolver.d.ts.map