kibana/x-pack/plugins/osquery/common/typed_json.ts
Liza Katz 204efae5bf
[Data cleanup] unify serializable state (#107745)
* Use Serializable from package

* Rename to align with core

* fix

* more replacements

* docssss

* fix

* Move it to @kbn/utility-types and remove core export

* buildy build

* tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-10 13:03:48 +02:00

58 lines
1.1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { DslQuery, Filter } from '@kbn/es-query';
import { JsonObject } from '@kbn/utility-types';
export type ESQuery =
| ESRangeQuery
| ESQueryStringQuery
| ESMatchQuery
| ESTermQuery
| ESBoolQuery
| JsonObject;
export interface ESRangeQuery {
range: {
[name: string]: {
gte: number;
lte: number;
format: string;
};
};
}
export interface ESMatchQuery {
match: {
[name: string]: {
query: string;
operator: string;
zero_terms_query: string;
};
};
}
export interface ESQueryStringQuery {
query_string: {
query: string;
analyze_wildcard: boolean;
};
}
export interface ESTermQuery {
term: Record<string, string>;
}
export interface ESBoolQuery {
bool: {
must: DslQuery[];
filter: Filter[];
should: never[];
must_not: Filter[];
};
}