/** * Queries over HTTP (SPEC.md §15, §43). * * The read half of `mountCommands`. Reads travel the Query Bus and writes the * Command Bus (ADR-0014), and until now only the Command Bus had an endpoint for * every registered name — so a page's history, declared and authorized like anything * else, was unreachable from a browser. * * These are `GET`, because a read has no side effects and must not need a CSRF token * to be allowed. Like the command endpoints they are safe by construction rather than * by care: the Query Bus validates and authorizes before a handler runs, and * authorization denies by default (SPEC.md §12, §51). */ import type { QueryBus, SchemaRegistry } from '@assemora/core'; import type { JsonSchema } from '@assemora/schema'; import type { Route } from './route.js'; /** The part of a query description these endpoints need. */ export type QueryEndpoint = { readonly name: string; readonly description?: string; readonly input: JsonSchema; /** Absent when the query did not say what it answers with. */ readonly output?: JsonSchema; readonly module?: string; }; /** Reads the query descriptions out of the registry, whoever put them there. */ export declare const queryEndpoints: (registry: SchemaRegistry) => QueryEndpoint[]; export declare const queryRoutes: (endpoints: readonly QueryEndpoint[], queries: QueryBus) => Route[]; //# sourceMappingURL=queries.d.ts.map