UNPKG

@hotmeshio/hotmesh

Version:

Permanent-Memory Workflows & AI Agents

85 lines (84 loc) 1.82 kB
type MetricTypes = 'count' | 'sum' | 'avg' | 'mdn' | 'max' | 'min' | 'index'; interface StatType { target: string; metric: MetricTypes; value: number | string; } interface Measure { target: string; type: string; value: number; } interface Segment { time: string; count: number; measures: Measure[]; } interface StatsType { general: StatType[]; index: StatType[]; median: StatType[]; } interface JobStats { count?: number; [field: string]: number; } interface JobStatsRange { [key: string]: JobStats; } interface JobStatsInput { data: Record<string, unknown>; range?: string; start?: string; end?: string; sparse?: boolean; scrub?: boolean; } interface GetStatsOptions { key: string; granularity: string; range?: string; start?: string; end?: string; sparse?: boolean; } interface StatsResponse { key: string; granularity: string; range: string; end: string | Date; count: number; measures: Measure[]; segments?: Segment[]; } interface AggregatedData { [key: string]: number; } interface IdsData { [target: string]: string[]; } interface MeasureIds { time: string; target: string; count: number; type: 'ids'; ids: string[]; } interface TimeSegment { time: string; measures: MeasureIds[]; } interface CountByFacet { facet: string; count: number; } interface IdsResponse { key: string; facets: string[]; granularity: string; range: string; start: string; counts: CountByFacet[]; segments: TimeSegment[]; } export { StatsType, StatType, MetricTypes, JobStats, JobStatsRange, JobStatsInput, GetStatsOptions, StatsResponse, AggregatedData, Measure, Segment, IdsData, MeasureIds, TimeSegment, IdsResponse, CountByFacet, };