signalk-parquet
Version:
Vessel data Parquet file archive with automated value and geospatial triggers. History API compliant with cloud backups and queries.
60 lines • 2.16 kB
TypeScript
/**
* SignalK History API Provider
*
* This module implements the SignalK HistoryApi interface to register
* this plugin as the official history data provider for the SignalK server.
*/
import { ServerAPI } from '@signalk/server-api';
import { HistoryApi, ValuesRequest, ValuesResponse, ContextsRequest, ContextsResponse, PathsRequest, PathsResponse } from '@signalk/server-api/dist/history';
import { BufferStagingSource } from './utils/buffer-staging';
/** The slice of SQLiteBuffer the provider needs: staging plus schema lookups. */
type ProviderBufferSource = BufferStagingSource & {
getKnownPaths(): Set<string>;
getTableColumns(path: string): Set<string> | undefined;
};
/**
* History API Provider implementation
*/
export declare class HistoryProvider implements HistoryApi {
private selfId;
private dataDir;
private app;
private debug;
private sqliteBuffer?;
constructor(selfId: string, dataDir: string, app: ServerAPI, debug: (msg: string) => void);
setSqliteBuffer(buffer: ProviderBufferSource): void;
/**
* Get historical values for the specified query
*/
getValues(query: ValuesRequest): Promise<ValuesResponse>;
/**
* Get available contexts for the time range
*/
getContexts(query: ContextsRequest): Promise<ContextsResponse>;
/**
* Get available paths for the time range
*/
getPaths(query: PathsRequest): Promise<PathsResponse>;
/**
* Query a single path from parquet files
*/
private queryPath;
/**
* Convert aggregate method to SQL function
*/
private getAggregateFunction;
/**
* Merge data from multiple paths into time-aligned rows
*/
private mergePathData;
}
/**
* Register this plugin as the History API provider
*/
export declare function registerHistoryApiProvider(app: ServerAPI, selfId: string, dataDir: string, debug: (msg: string) => void, sqliteBuffer?: ProviderBufferSource): void;
/**
* Unregister this plugin as the History API provider
*/
export declare function unregisterHistoryApiProvider(app: ServerAPI): void;
export {};
//# sourceMappingURL=history-provider.d.ts.map