/// /// import { KHit, User } from "kuzzle"; import { UUID } from "node:crypto"; import { AbstractExporter, Column, ExportParams } from "../shared"; import { MeasureContent } from "./exports"; interface MeasureSearchParams extends ExportParams { id: string; type?: string; startAt?: string; endAt?: string; } interface MeasuresSearchOptions { from?: number; size?: number; } interface MeasureExportParams extends ExportParams { id: string; model: string; } export declare class MeasureExporter extends AbstractExporter { protected exportRedisKey(engineId: string, exportId: string): string; protected getLink(engineId: string, exportId: UUID, params: MeasureExportParams): string; /** * Searches for measures and return them in a standard JSON */ search(engineId: string, params: MeasureSearchParams, options?: MeasuresSearchOptions): Promise<{ measures: KHit>[]; total: number; }>; /** * Prepare a measure export by saving the parameters in Redis. * * We need this method to process the export in 2 steps: * - preparing the export with a POST or WebSocket request * - download the export (only with a browser link) * * Never return a rejected promise and write potential error on the stream */ prepareExport(engineId: string, user: User, params: MeasureSearchParams): Promise; protected formatHit(columns: Array, hit: KHit): any[]; /** * Retrieve a prepared export and write each document as a CSV in the stream * * This method never returns a rejected promise, but write potential error in * the stream. */ sendExport(engineId: string, exportId: string): Promise; private generateMeasureColumns; private prepareMeasureSearch; } export {};