import type { FastifyPluginAsync } from "fastify"; import type { CollectorConfig } from "../config.js"; import type { CollectorStore } from "../store.js"; import type { LiveBus } from "../liveBus.js"; interface Options { store: CollectorStore; config: CollectorConfig; liveBus: LiveBus; } /** * Ingestion route. Validates the batch against the schema, authorizes it against * the (public) project id, enriches each event with the cookieless visitor id * (raw IP never stored), publishes to the live bus (ADR 0032 §2), and inserts. * Kept thin — all storage logic lives in the store. * * Browser beacons (`navigator.sendBeacon`) cannot carry a secret header, so the * `projectId` in the envelope is the public ingest credential (like a GA * measurement id). The route therefore (a) requires every event in a batch to * share one `projectId` and (b) rejects batches for a project that does not * exist, so events can never be written under an arbitrary/spoofed project. CORS * origin allow-listing and a dedicated per-client rate limit bound the rest. */ export declare const collectRoutes: FastifyPluginAsync; export {}; //# sourceMappingURL=collect.d.ts.map