UNPKG

@toriihq/torii-mcp

Version:

Model Context Protocol server for Torii API

71 lines (70 loc) 1.98 kB
import { Parameter } from '../api/filters.js'; export interface ApiRequest { method: string; path: string; headers?: Record<string, string>; } export interface Filter { key: string; op: 'equals' | 'notEquals' | 'contains' | 'notContains' | 'anyOf' | 'noneOf' | 'allOf' | 'isExactly' | 'isSet' | 'isNotSet' | 'gt' | 'gte' | 'lt' | 'lte' | 'dayAfter' | 'dayOnOrAfter' | 'dayBefore' | 'dayOnOrBefore' | 'nested' | 'relativeDateToday' | 'relativeDateOn' | 'relativeDateLess' | 'relativeDateMore' | 'exists' | 'notExists' | 'or' | 'and'; value?: any; } export declare enum AGGREGATION_TYPES { METRIC = "metric", GROUP_BY = "groupBy", DATE_RANGE = "date_range", DATE_HISTOGRAM = "date_histogram" } export declare enum METRIC_FUNCTIONS { TOTAL = "total", SUM = "sum", AVG = "avg", MAX = "max", MIN = "min" } export declare enum AGGREGATION_SORT_ORDERS { DESC = "desc", ASC = "asc" } export declare enum DATE_HISTOGRAM_PERIODS { WEEKLY = "weekly", MONTHLY = "monthly", QUARTERLY = "quarterly", YEARLY = "yearly" } type Bounds = { min?: string; max?: string; }; export type Aggregation = { field: string; aggregationType: AGGREGATION_TYPES; options?: { metricFunction?: METRIC_FUNCTIONS; ranges?: Array<{ from: string; to?: string; }>; dateHistogramOptions?: { hardBounds?: Bounds; extendedBounds?: Bounds; datePeriod?: DATE_HISTOGRAM_PERIODS; }; size?: number; sort?: { field?: string; aggFunc?: METRIC_FUNCTIONS; order: AGGREGATION_SORT_ORDERS; }; }; aggs?: Aggregation; }; export interface ListParams { aggs?: string; baseFilters?: string; cursor?: string; fields?: string; filters?: string; } export declare function convertArgsToParameters(args: Record<string, any>): Parameter[]; export {};