Skip to content

Commit

Permalink
Fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Jul 2, 2020
1 parent a44ec20 commit 441f331
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export {
// API schema - misc setup, status
GetFleetStatusResponse,
// API schemas - Agent Config
GetAgentConfigsRequest,
GetAgentConfigsResponse,
GetAgentConfigsResponseItem,
GetOneAgentConfigResponse,
Expand Down Expand Up @@ -91,6 +92,7 @@ export {
ServiceName,
GetCategoriesResponse,
GetPackagesResponse,
GetLimitedPackagesResponse,
GetInfoResponse,
InstallPackageResponse,
DeletePackageResponse,
Expand Down
12 changes: 7 additions & 5 deletions x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
import { TypeOf } from '@kbn/config-schema';
import { RequestHandler, CustomHttpResponseOptions } from 'src/core/server';
import {
GetPackagesRequestSchema,
GetFileRequestSchema,
GetInfoRequestSchema,
InstallPackageRequestSchema,
DeletePackageRequestSchema,
GetInfoResponse,
InstallPackageResponse,
DeletePackageResponse,
GetCategoriesResponse,
GetPackagesResponse,
GetLimitedPackagesResponse,
} from '../../../common';
import {
GetPackagesRequestSchema,
GetFileRequestSchema,
GetInfoRequestSchema,
InstallPackageRequestSchema,
DeletePackageRequestSchema,
} from '../../types';
import {
getCategories,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jest.mock('../../services/package_config', (): {
assignPackageStream: jest.fn((packageInfo, dataInputs) => Promise.resolve(dataInputs)),
buildPackageConfigFromPackage: jest.fn(),
bulkCreate: jest.fn(),
create: jest.fn((soClient, newData) =>
create: jest.fn((soClient, callCluster, newData) =>
Promise.resolve({
...newData,
id: '1',
Expand Down Expand Up @@ -213,7 +213,7 @@ describe('When calling package config', () => {
const request = getCreateKibanaRequest();
await routeHandler(context, request, response);
expect(response.ok).toHaveBeenCalled();
expect(packageConfigServiceMock.create.mock.calls[0][1]).toEqual({
expect(packageConfigServiceMock.create.mock.calls[0][2]).toEqual({
config_id: 'a5ca00c0-b30c-11ea-9732-1bb05811278c',
description: '',
enabled: true,
Expand Down Expand Up @@ -294,7 +294,7 @@ describe('When calling package config', () => {
const request = getCreateKibanaRequest();
await routeHandler(context, request, response);
expect(response.ok).toHaveBeenCalled();
expect(packageConfigServiceMock.create.mock.calls[0][1]).toEqual({
expect(packageConfigServiceMock.create.mock.calls[0][2]).toEqual({
config_id: 'a5ca00c0-b30c-11ea-9732-1bb05811278c',
description: '',
enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TypeOf } from '@kbn/config-schema';
import Boom from 'boom';
import { RequestHandler } from 'src/core/server';
import { appContextService, packageConfigService } from '../../services';
import { ensureInstalledPackage, getPackageInfo } from '../../services/epm/packages';
import { getPackageInfo } from '../../services/epm/packages';
import {
GetPackageConfigsRequestSchema,
GetOnePackageConfigRequestSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
PackageConfigInput,
PackageConfigInputStream,
PackageInfo,
ListWithKuery,
packageToPackageConfig,
isPackageLimited,
doesAgentConfigAlreadyIncludePackage,
Expand All @@ -18,9 +19,9 @@ import { PACKAGE_CONFIG_SAVED_OBJECT_TYPE } from '../constants';
import {
NewPackageConfig,
PackageConfig,
ListWithKuery,
PackageConfigSOAttributes,
RegistryPackage,
CallESAsCurrentUser,
} from '../types';
import { agentConfigService } from './agent_config';
import { outputService } from './output';
Expand Down

0 comments on commit 441f331

Please sign in to comment.