/** * Remote epoch-stream client (loop D.3) — ONE conditional stream request. * * Pulls bulk SDS records from a flow-served SDN endpoint * (`GET /api/v1/data//bulk`, default Content-Type * `application/vnd.sdn.flatbuffers.stream`) and feeds the aligned * size-prefixed FlatBuffer stream STRAIGHT into the local FlatSQL-WASM * engine store (`ingestFlatBufferStream`) — no base64, no JSON re-encode, * no per-record round-trips. * * Conditional requests: the client remembers the `ETag` (`W/"fnv1a64-…"`) * per query shape and sends `If-None-Match` once it holds a local copy. * A 304 answer is served from the local engine store via * `queryEpochRawStream` — the same profile SQL the server ran, byte-parity * proven by the D.2 isomorphism harness. */ import type { DataQueryOptions, DataQueryStreamResult } from './transport/http'; import type { EngineEpochQueryRequest } from './epoch-query-sql'; /** The transport surface this client needs (HttpTransport satisfies it). */ export interface EpochStreamTransport { queryData(opts: DataQueryOptions & { format?: 'flatbuffers'; }): Promise; } /** * The local engine store surface this client needs * (FlatSQLEngineRecordStore satisfies it). */ export interface EpochStreamLocalStore { ingestFlatBufferStream(standardId: string, streamBytes: Uint8Array, options?: { source?: string | null; } | null): Promise; queryEpochRawStream(standardId: string, request?: EngineEpochQueryRequest | null): Uint8Array; } export interface RemoteEpochStreamRequest { /** SDS schema/standard identifier (`OMM.fbs`, `OMM`, or `omm`). */ schema: string; /** Epoch profile (`nearest` / `as_of` / `forward`). Absent = server default. */ profile?: string; /** * Target epoch (unix seconds or RFC3339). Pin this when you rely on * 304-from-local-store replay — an absent epoch defaults to "now" on both * hosts, which drifts between the original fetch and the replay. */ epoch?: number | string; /** Row limit (positive integer). */ limit?: number; /** Remote provider source partition (bare name, e.g. `celestrak-gp`). */ source?: string; /** * Local source partition the stream materializes into * (`@` shadow table). Defaults to `source`, falling back * to the store default (`local`). */ ingestSource?: string; } export interface RemoteEpochStreamResult { /** Aligned size-prefixed FlatBuffer record stream (u32 LE framing). */ stream: Uint8Array; /** Zero-copy per-record frame iterator over `stream`. */ frames(): Generator; /** True when the server answered 304 and the local engine store served the bytes. */ fromLocalStore: boolean; /** Entity tag the response validated against (cached for the next request). */ etag: string | null; /** Server record count (200) or local frame count (304 replay). */ recordCount: number; /** Records newly materialized into the local store by this call (0 on 304). */ ingested: number; } /** * Conditional bulk-stream fetcher: one HTTP request per call, `If-None-Match` * once a local copy exists, 304 served zero-copy from the local engine store. */ export declare class RemoteEpochStreamClient { private readonly transport; private readonly store; private readonly etags; constructor(transport: EpochStreamTransport, store: EpochStreamLocalStore); fetchEpochStream(request: RemoteEpochStreamRequest): Promise; /** The etag currently cached for a query shape (tests / introspection). */ cachedEtag(request: RemoteEpochStreamRequest): string | null; private cacheKey; private localReplayRequest; } //# sourceMappingURL=remote-epoch-stream.d.ts.map