/** * HTTP Transport — fetch-based client for SDN server API endpoints. */ import type { AuthProvider } from './auth'; /** A single schema entry in the catalog. */ export interface SchemaCatalogEntry { name: string; record_count: number; total_bytes: number; oldest_epoch?: string; newest_epoch?: string; } /** Catalog response from GET /api/v1/catalog. */ export interface NodeCatalog { peer_id: string; schemas: SchemaCatalogEntry[]; capabilities: string[]; rate_limits: Record; } /** Options for querying data. */ export interface DataQueryOptions { schema: string; day?: string; noradCatId?: number; entityId?: string; limit?: number; includeData?: boolean; format?: 'json' | 'flatbuffers'; } /** A data record returned by a query. */ export interface DataRecord { cid: string; peer_id: string; timestamp: string; data_base64?: string; } /** Query response envelope. */ export interface DataQueryResponse { schema: string; query: Record; count: number; results: DataRecord[]; } /** Result of a publish operation. */ export interface PublishResult { cid: string; schema: string; stored_at: string; bytes: number; } /** Batch publish result. */ export interface BatchPublishResult { schema: string; stored_at: string; count: number; results: Array<{ cid?: string; error?: string; bytes: number; }>; } /** Log head response from GET /api/v1/log/{schema}/head. */ export interface LogHeadResponse { schema_type: string; publisher_peer_id: string; head_sequence: number; head_entry_hash: string; record_count: number; oldest_epoch_day: string; newest_epoch_day: string; } /** A single PLG log entry (base64-encoded). */ export interface LogEntry { data_base64: string; bytes: number; } /** Log entries response from GET /api/v1/log/{schema}/entries. */ export interface LogEntriesResponse { schema_type: string; publisher_peer_id: string; since_sequence: number; count: number; entries: LogEntry[]; } /** A single publisher's log head info. */ export interface LogHeadInfo { publisher_peer_id: string; schema_type: string; head_sequence: number; head_entry_hash: string; timestamp: string; } /** Log heads response from GET /api/v1/log/{schema}/heads. */ export interface LogHeadsResponse { schema_type: string; count: number; heads: LogHeadInfo[]; } /** HTTP transport for SDN server APIs. */ export declare class HttpTransport { private baseUrl; private authProvider?; constructor(baseUrl: string, authProvider?: AuthProvider); /** Fetch the node's schema catalog. */ getCatalog(): Promise; /** Query data records for a schema. */ queryData(opts: DataQueryOptions): Promise; /** Get a single record by CID. */ getRecord(schema: string, cid: string): Promise; /** Publish a single FlatBuffer record. Requires authentication. */ publishData(schema: string, data: Uint8Array): Promise; /** Publish multiple records as a uint32BE-length-prefixed stream. */ publishBatch(schema: string, records: Uint8Array[]): Promise; /** Get log head for a publisher+schema. */ getLogHead(schema: string, publisherPeerID: string): Promise; /** Get log entries for a publisher+schema since a given sequence. */ getLogEntries(schema: string, publisherPeerID: string, sinceSequence?: number, limit?: number): Promise; /** Get all publishers' log heads for a schema. */ getLogHeads(schema: string): Promise; /** Get node info. */ getNodeInfo(): Promise>; /** Internal fetch with auth headers. */ private fetch; } /** Error thrown by HttpTransport on non-2xx responses. */ export declare class SDNTransportError extends Error { status: number; body: string; url: string; constructor(status: number, body: string, url: string); } //# sourceMappingURL=http.d.ts.map