Skip to content

Commit

Permalink
[Ingest] EMT-146: agent status impl preparation (#62557)
Browse files Browse the repository at this point in the history
[Ingest] EMT-146: very light refactor a precursor for endpoint status change
  • Loading branch information
nnamdifrankie authored Apr 6, 2020
1 parent dfa083d commit 29abe5b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/endpoint/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { PluginSetupContract as FeaturesPluginSetupContract } from '../../featur
import { createConfig$, EndpointConfigType } from './config';
import { EndpointAppContext } from './types';

import { registerEndpointRoutes } from './routes/metadata';
import { registerAlertRoutes } from './routes/alerts';
import { registerResolverRoutes } from './routes/resolver';
import { registerEndpointRoutes } from './routes/metadata';

export type EndpointPluginStart = void;
export type EndpointPluginSetup = void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AlertEvent, EndpointAppConstants } from '../../../../common/types';
import { EndpointAppContext } from '../../../types';
import { AlertDetailsRequestParams } from '../types';
import { AlertDetailsPagination } from './lib';
import { getHostData } from '../../../routes/metadata';
import { getHostData } from '../../metadata';

export const alertDetailsHandlerWrapper = function(
endpointAppContext: EndpointAppContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ import { IRouter, RequestHandlerContext } from 'kibana/server';
import { SearchResponse } from 'elasticsearch';
import { schema } from '@kbn/config-schema';

import {
kibanaRequestToMetadataListESQuery,
getESQueryHostMetadataByID,
} from '../services/endpoint/metadata_query_builders';
import { HostMetadata, HostResultList } from '../../common/types';
import { EndpointAppContext } from '../types';
import { HostMetadata, HostResultList } from '../../../common/types';
import { EndpointAppContext } from '../../types';
import { getESQueryHostMetadataByID, kibanaRequestToMetadataListESQuery } from './query_builders';

interface HitSource {
_source: HostMetadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import {
httpServerMock,
httpServiceMock,
loggingServiceMock,
} from '../../../../../src/core/server/mocks';
import { HostMetadata, HostResultList } from '../../common/types';
} from '../../../../../../src/core/server/mocks';
import { HostMetadata, HostResultList } from '../../../common/types';
import { SearchResponse } from 'elasticsearch';
import { registerEndpointRoutes } from './metadata';
import { EndpointConfigSchema } from '../config';
import * as data from '../test_data/all_metadata_data.json';
import { EndpointConfigSchema } from '../../config';
import * as data from '../../test_data/all_metadata_data.json';
import { registerEndpointRoutes } from './index';

describe('test endpoint route', () => {
let routerMock: jest.Mocked<IRouter>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
*/
import { httpServerMock, loggingServiceMock } from '../../../../../../src/core/server/mocks';
import { EndpointConfigSchema } from '../../config';
import {
kibanaRequestToMetadataListESQuery,
getESQueryHostMetadataByID,
} from './metadata_query_builders';
import { kibanaRequestToMetadataListESQuery, getESQueryHostMetadataByID } from './query_builders';
import { EndpointAppConstants } from '../../../common/types';

describe('query builder', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { KibanaRequest } from 'kibana/server';
import { EndpointAppConstants } from '../../../common/types';
import { EndpointAppContext } from '../../types';
import { esKuery } from '../../../../../../src/plugins/data/server';
import { EndpointAppContext } from '../../types';
import { EndpointAppConstants } from '../../../common/types';

export const kibanaRequestToMetadataListESQuery = async (
request: KibanaRequest<any, any, any>,
Expand Down

0 comments on commit 29abe5b

Please sign in to comment.