Skip to content

Commit

Permalink
[Security Solution] Remove graphQL host (#94592) (#96303)
Browse files Browse the repository at this point in the history
* rm host from graphql

* clean up

* rm SortRequestDirection

* fix types

* rm comment

* fix types

* fix unit test

* fix unit test

* Update x-pack/plugins/security_solution/public/hosts/components/hosts_table/columns.tsx

Co-authored-by: Xavier Mouligneau <[email protected]>

* revert assertUnreachable

* use estypes

* rename details to HostDetails

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Xavier Mouligneau <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Xavier Mouligneau <[email protected]>
  • Loading branch information
3 people authored Apr 6, 2021
1 parent cb10d26 commit 031f893
Show file tree
Hide file tree
Showing 53 changed files with 2,106 additions and 5,445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { IEsSearchResponse } from '../../../../../../../../src/plugins/data/common';

import { HostItem, HostsFields } from '../common';
import { CursorType, Inspect, Maybe, PageInfoPaginated } from '../../../common';
import { CursorType, Direction, Inspect, Maybe, PageInfoPaginated } from '../../../common';
import { RequestOptionsPaginated } from '../..';

export interface HostsEdges {
Expand All @@ -26,3 +26,9 @@ export interface HostsStrategyResponse extends IEsSearchResponse {
export interface HostsRequestOptions extends RequestOptionsPaginated<HostsFields> {
defaultIndex: string[];
}

export interface HostsSortField {
field: HostsFields;

direction: Direction;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface HostItem {
cloud?: Maybe<CloudEcs>;
endpoint?: Maybe<EndpointFields>;
host?: Maybe<HostEcs>;
lastSeen?: Maybe<string>;
lastSeen?: Maybe<string[]>;
}

export interface HostValue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { estypes } from '@elastic/elasticsearch';
import { IEsSearchResponse } from '../../../../../../../../src/plugins/data/common';

import { Inspect, Maybe, TimerangeInput } from '../../../common';
Expand All @@ -22,3 +23,7 @@ export interface HostDetailsRequestOptions extends Partial<RequestOptionsPaginat
timerange: TimerangeInput;
inspect?: Maybe<Inspect>;
}

export interface AggregationRequest {
[aggField: string]: estypes.AggregationContainer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
*/

import { IEsSearchResponse } from '../../../../../../../../src/plugins/data/common';
import { Inspect, Maybe } from '../../../common';
import { Inspect, Maybe, Direction } from '../../../common';
import { RequestOptionsPaginated } from '../..';
import { HostsFields } from '../common';

export interface HostFirstLastSeenRequestOptions
extends Partial<RequestOptionsPaginated<HostsFields>> {
hostName: string;
order: 'asc' | 'desc';
order: Direction.asc | Direction.desc;
}

export interface HostFirstLastSeenStrategyResponse extends IEsSearchResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export * from './uncommon_processes';

export enum HostsQueries {
authentications = 'authentications',
details = 'details',
details = 'hostDetails',
firstOrLastSeen = 'firstOrLastSeen',
hosts = 'hosts',
overview = 'overviewHost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { HostItem } from '../../../../graphql/types';
import { HostItem } from '../../../../../common/search_strategy/security_solution/hosts';
import { CriteriaFields } from '../types';
import { hostToCriteria } from './host_to_criteria';

Expand All @@ -28,6 +28,7 @@ describe('host_to_criteria', () => {
test('returns an empty array if the host.name is null', () => {
const hostItem: HostItem = {
host: {
// @ts-expect-error
name: null,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { HostItem } from '../../../../../common/search_strategy/security_solution/hosts';
import { CriteriaFields } from '../types';
import { HostItem } from '../../../../graphql/types';

export const hostToCriteria = (hostItem: HostItem): CriteriaFields[] => {
if (hostItem.host != null && hostItem.host.name != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { HostItem } from '../../../../../common/search_strategy/security_solution/hosts';
import { InfluencerInput } from '../types';
import { HostItem } from '../../../../graphql/types';

export const hostToInfluencers = (hostItem: HostItem): InfluencerInput[] | null => {
if (hostItem.host != null && hostItem.host.name != null) {
Expand Down
Loading

0 comments on commit 031f893

Please sign in to comment.