Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Jul 27, 2021
1 parent 434f9bb commit 49098d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { buildSiemResponse } from '../../detection_engine/routes/utils';
import { IndexPattern, IndexPatternsService } from '../../../../../../../src/plugins/data/common';
import { buildRouteValidation } from '../../../utils/build_validation/route_validation';
import { sourcererSchema } from './schema';
import { PluginStart } from '../../../../../../../src/plugins/data/server';
import { StartPlugins } from '../../../plugin';

const getKibanaIndexPattern = async (
indexPatternsService: IndexPatternsService,
Expand All @@ -38,7 +38,7 @@ const getKibanaIndexPattern = async (

export const createSourcererIndexPatternRoute = (
router: SecuritySolutionPluginRouter,
getStartServices: StartServicesAccessor<{}, PluginStart>
getStartServices: StartServicesAccessor<StartPlugins>
) => {
router.post(
{
Expand All @@ -53,7 +53,12 @@ export const createSourcererIndexPatternRoute = (
async (context, request, response) => {
const siemResponse = buildSiemResponse(response);
try {
const [, , { indexPatterns }] = await getStartServices();
const [
,
{
data: { indexPatterns },
},
] = await getStartServices();
const indexPatternService = await indexPatterns.indexPatternsServiceFactory(
context.core.savedObjects.client,
context.core.elasticsearch.client.asInternalUser
Expand Down
5 changes: 2 additions & 3 deletions x-pack/plugins/security_solution/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ import { persistNoteRoute } from '../lib/timeline/routes/notes';

import { persistPinnedEventRoute } from '../lib/timeline/routes/pinned_events';

import { SetupPlugins } from '../plugin';
import { SetupPlugins, StartPlugins } from '../plugin';
import { ConfigType } from '../config';
import { installPrepackedTimelinesRoute } from '../lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines';
import { createSourcererIndexPatternRoute } from '../lib/sourcerer/routes';
import { PluginStart } from '../../../../../src/plugins/data/server';

export const initRoutes = (
router: SecuritySolutionPluginRouter,
Expand All @@ -67,7 +66,7 @@ export const initRoutes = (
security: SetupPlugins['security'],
ml: SetupPlugins['ml'],
ruleDataClient: RuleDataClient | null,
getStartServices: StartServicesAccessor<{}, PluginStart>
getStartServices: StartServicesAccessor<StartPlugins>
) => {
// Detection Engine Rule routes that have the REST endpoints of /api/detection_engine/rules
// All REST rule creation, deletion, updating, etc......
Expand Down

0 comments on commit 49098d4

Please sign in to comment.