Skip to content

Commit

Permalink
[SIEM][Detection Engine][Lists] Moves getQueryFilter to common folder…
Browse files Browse the repository at this point in the history
… for use by both front and backend

## Summary

* Moves querying and tests from server to common

The function we are interested using on the front end is:

```ts
export const getQueryFilter = (
  query: Query,
  language: Language,
  filters: Array<Partial<Filter>>,
  index: Index,
  lists: ExceptionListItemSchema[]
) => {
```

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
  • Loading branch information
FrankHassanabad authored Jun 30, 2020
1 parent b3f19da commit 7144db2
Show file tree
Hide file tree
Showing 6 changed files with 701 additions and 687 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import {
buildNested,
} from './build_exceptions_query';
import {
EntriesArray,
EntryNested,
EntryExists,
EntryMatch,
EntryMatchAny,
EntryNested,
} from '../../../../../lists/common/schemas';
import { getExceptionListItemSchemaMock } from '../../../../../lists/common/schemas/response/exception_list_item_schema.mock';
EntriesArray,
} from '../../../lists/common/schemas';
import { getExceptionListItemSchemaMock } from '../../../lists/common/schemas/response/exception_list_item_schema.mock';

describe('build_exceptions_query', () => {
describe('getLanguageBooleanOperator', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { Language, Query } from '../../../../common/detection_engine/schemas/common/schemas';
import { Query as DataQuery } from '../../../../../../../src/plugins/data/server';
import { Query as DataQuery } from '../../../../../src/plugins/data/common';
import {
Entry,
ExceptionListItemSchema,
EntryMatch,
EntryMatchAny,
EntryNested,
Expand All @@ -19,7 +17,9 @@ import {
entriesMatch,
entriesNested,
entriesList,
} from '../../../../../lists/common/schemas';
ExceptionListItemSchema,
} from '../../../lists/common/schemas';
import { Language, Query } from './schemas/common/schemas';

type Operators = 'and' | 'or' | 'not';
type LuceneOperators = 'AND' | 'OR' | 'NOT';
Expand Down
Loading

0 comments on commit 7144db2

Please sign in to comment.