import { type BackendResult, type ConjunctionScreenRequest, type ConjunctionScreenResult, type DataScanResult, type DataSummary, type LocalObjectSummary, type NodeAccessUser, type NodeSummary, type ObservedSdnPeer, type RawDataQuery, type RawDataRecord, type RawDataStreamRequest, type SearchResult, type SharedSearchRequest, type DataSearchRow, type ProviderSearchRow, type SdnBackendMode, type StorageSummary } from './sdn-backend'; export type FetchLike = (url: string, init?: RequestInit) => Promise; export declare const RAW_FLATBUFFER_STREAM_CONTENT_TYPE = "application/vnd.sdn.flatbuffers.stream"; export interface BackendDeps { fetch?: FetchLike; } export declare function resolveFetch(fetchLike?: FetchLike): FetchLike; export declare function joinUrl(base: string | null | undefined, path: string): string; export declare function getJson(fetchLike: FetchLike, url: string, capabilityId: string, init?: RequestInit): Promise>; export declare function getBytes(fetchLike: FetchLike, url: string, capabilityId: string, init?: RequestInit): Promise>; export declare function nodeSummaryFromProfile(profile: Record, runtime: SdnBackendMode): NodeSummary; export declare function normalizePeerPayload(payload: unknown): ObservedSdnPeer[]; export declare function normalizeObjectPayload(payload: unknown): LocalObjectSummary[]; export declare function recordsFromPayload(payload: unknown): Array>; export declare function normalizeNodeAccessPayload(payload: unknown): NodeAccessUser[]; export declare function normalizeStorageSummary(payload: unknown): StorageSummary; export declare function normalizeDataSummary(payload: unknown): DataSummary; export declare function normalizeDataScanResult(payload: unknown): DataScanResult; export declare function normalizeRawDataRecords(payload: unknown): RawDataRecord[]; /** * Parse an aligned size-prefixed FlatBuffer record stream. The wire format * is u32 LITTLE-ENDIAN length prefixes — the FlatSQL engine framing the * server advertises as `X-SDN-Stream-Format: flatsql-size-prefixed-le-u32` * (sdn-server writeFlatBufferPayloadStream / WriteRawRecordFrames). Frames * are zero-copy subarray views into `bytes`. */ export declare function parseRawFlatbufferStream(bytes: Uint8Array): Uint8Array[]; export declare function attachRawFlatbufferStream(records: RawDataRecord[], streamBytes: Uint8Array): RawDataRecord[]; /** Datasync raw-query JSON payload (shared by the remote + desktop adapters). */ export declare function rawDataQueryPayload(query: RawDataQuery): Record; /** Authenticated POST that asks for the aligned FlatBuffer record stream. */ export declare function authRawFlatbufferStreamRequest(body: Record): RequestInit; /** * Raw data query in ONE stream request (loop D.3 — the base64-era double * round-trip is gone): POST `/api/v1/data/query` with the FlatBuffer-stream * Accept header; the response headers carry the schema * (`X-SDN-Schema`) and record count (`X-SDN-Record-Count`), the body is the * aligned size-prefixed record stream. Record identity is reconstructed * client-side: cid = sha256 hex of the payload bytes — exactly the server's * computeCID (sdn-server internal/storage/flatsql.go) — and the query's own * provider/source/batch filters stamp the provenance columns they pinned. */ export declare function queryRawDataViaStream(fetchLike: FetchLike, baseUrl: string | null | undefined, capabilityId: string, query: RawDataQuery): Promise>; export declare function rawDataStreamPayload(request: RawDataStreamRequest): Record; export declare function conjunctionScreenPayload(request: ConjunctionScreenRequest): Record; export declare function sharedSearchPayload(request: SharedSearchRequest): Record; export declare function normalizeProviderSearchResult(payload: unknown): SearchResult; export declare function normalizeDataSearchResult(payload: unknown): SearchResult; export declare function normalizeConjunctionScreenResult(payload: unknown): ConjunctionScreenResult; //# sourceMappingURL=sdn-backend-adapter-utils.d.ts.map