diff --git a/api/src/types/query.ts b/api/src/types/query.ts index b93d113bf2..60705d1063 100644 --- a/api/src/types/query.ts +++ b/api/src/types/query.ts @@ -10,6 +10,8 @@ export type Query = { meta?: Meta[]; search?: string; export?: 'json' | 'csv' | 'xml'; + group?: string[]; + aggregate?: Aggregate; deep?: Record; }; @@ -22,6 +24,27 @@ export type Filter = { [keyOrOperator: string]: Filter | any; }; +/** + * Aggregate operation. Contains column name, and the field alias it should be returned as + */ +export type Aggregate = { + avg?: { + [column: string]: string; + }; + min?: { + [column: string]: string; + }; + max?: { + [column: string]: string; + }; + count?: { + [column: string]: string; + }; + sum?: { + [column: string]: string; + }; +}; + export type FilterOperator = | 'eq' | 'neq'