Skip to content

Commit

Permalink
cleanup security_solution types
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski committed Jun 10, 2020
1 parent 64f08da commit 4218caf
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 73 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
},
"resolutions": {
"**/@types/node": ">=10.17.17 <10.20.0",
"**/@types/react": "^16.9.19",
"**/@types/react": "^16.9.36",
"**/@types/react-router": "^5.1.3",
"**/@types/hapi": "^17.0.18",
"**/@types/angular": "^1.6.56",
Expand Down Expand Up @@ -371,8 +371,8 @@
"@types/podium": "^1.0.0",
"@types/prop-types": "^15.5.3",
"@types/reach__router": "^1.2.6",
"@types/react": "^16.9.19",
"@types/react-dom": "^16.9.5",
"@types/react": "^16.9.36",
"@types/react-dom": "^16.9.8",
"@types/react-grid-layout": "^0.16.7",
"@types/react-redux": "^7.1.7",
"@types/react-resize-detector": "^4.0.1",
Expand Down Expand Up @@ -507,4 +507,4 @@
"node": "10.21.0",
"yarn": "^1.21.1"
}
}
}
6 changes: 3 additions & 3 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
"@types/prop-types": "^15.5.3",
"@types/proper-lockfile": "^3.0.1",
"@types/puppeteer": "^1.20.1",
"@types/react": "^16.9.19",
"@types/react": "^16.9.36",
"@types/react-beautiful-dnd": "^12.1.1",
"@types/react-dom": "^16.9.5",
"@types/react-dom": "^16.9.8",
"@types/react-redux": "^7.1.7",
"@types/react-router-dom": "^5.1.3",
"@types/react-sticky": "^6.0.3",
Expand Down Expand Up @@ -380,4 +380,4 @@
"cypress-multi-reporters"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { UUID } from '../types/uuid';
import { IsoDateString } from '../types/iso_date_string';
import { PositiveIntegerGreaterThanZero } from '../types/positive_integer_greater_than_zero';
import { PositiveInteger } from '../types/positive_integer';
import { SavedObjectAttributesRuntimeType } from '../../../types/saved_objects';

export const description = t.string;
export type Description = t.TypeOf<typeof description>;
Expand Down Expand Up @@ -42,7 +41,7 @@ export type ExcludeExportDetails = t.TypeOf<typeof exclude_export_details>;
* TODO: Right now the filters is an "unknown", when it could more than likely
* become the actual ESFilter as a type.
*/
export const filters = t.array(t.record(t.string, t.unknown)); // Filters are not easily type-able yet
export const filters = t.array(t.unknown); // Filters are not easily type-able yet
export type Filters = t.TypeOf<typeof filters>; // Filters are not easily type-able yet

/**
Expand All @@ -52,12 +51,13 @@ export type Filters = t.TypeOf<typeof filters>; // Filters are not easily type-a
export const action_group = t.string;
export const action_id = t.string;
export const action_action_type_id = t.string;
export const action_params = t.object;
export const action = t.exact(
t.type({
group: action_group,
id: action_id,
action_type_id: action_action_type_id,
params: SavedObjectAttributesRuntimeType,
params: action_params,
})
);

Expand Down Expand Up @@ -162,7 +162,7 @@ export type MachineLearningJobIdOrUndefined = t.TypeOf<typeof machineLearningJob
* TODO: Strip away extra information and possibly even "freeze" this object
* so we have tighter control over 3rd party data structures.
*/
export const meta = t.record(t.string, t.union([t.string, t.object]));
export const meta = t.object;
export type Meta = t.TypeOf<typeof meta>;
export const metaOrUndefined = t.union([meta, t.undefined]);
export type MetaOrUndefined = t.TypeOf<typeof metaOrUndefined>;
Expand Down
37 changes: 0 additions & 37 deletions x-pack/plugins/security_solution/common/types/saved_objects.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const AnomaliesQueryTabBody = ({
startDate={startDate}
endDate={endDate}
skip={skip}
type={type as never}
type={type}
narrowDateRange={narrowDateRange}
flowTarget={flowTarget}
ip={ip}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
*/

import { ESTermQuery } from '../../../../../common/typed_json';
import {
AnomaliesHostTableProps,
AnomaliesNetworkTableProps,
NarrowDateRange,
} from '../../../components/ml/types';
import { NarrowDateRange } from '../../../components/ml/types';
import { UpdateDateRange } from '../../../components/charts/common';
import { SetQuery } from '../../../../hosts/pages/navigation/types';
import { FlowTarget } from '../../../../graphql/types';
Expand All @@ -23,14 +19,8 @@ interface QueryTabBodyProps {

export type AnomaliesQueryTabBodyProps = QueryTabBodyProps & {
anomaliesFilterQuery?: object;
AnomaliesTableComponent: React.NamedExoticComponent<
| (AnomaliesHostTableProps & {
type: HostsType & NetworkType;
})
| (AnomaliesNetworkTableProps & {
type: HostsType & NetworkType;
})
>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
AnomaliesTableComponent: React.NamedExoticComponent<any>;
deleteQuery?: ({ id }: { id: string }) => void;
endDate: number;
flowTarget?: FlowTarget;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { defaultsDeep } from 'lodash/fp';
import { defaults } from 'lodash/fp';
import { LegacyEndpointEvent } from '../../../common/endpoint/types';

type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
Expand All @@ -15,7 +15,7 @@ type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
* The other fields are populated by the function unless provided in 'parts'
*/
export function mockProcessEvent(parts: DeepPartial<LegacyEndpointEvent>): LegacyEndpointEvent {
return defaultsDeep(
return defaults(
{
endgame: {
event_timestamp: 1,
Expand All @@ -38,5 +38,5 @@ export function mockProcessEvent(parts: DeepPartial<LegacyEndpointEvent>): Legac
},
},
parts
);
) as LegacyEndpointEvent;
}
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5504,10 +5504,10 @@
dependencies:
"@types/react" "*"

"@types/react-dom@*", "@types/react-dom@^16.9.5":
version "16.9.5"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.5.tgz#5de610b04a35d07ffd8f44edad93a71032d9aaa7"
integrity sha512-BX6RQ8s9D+2/gDhxrj8OW+YD4R+8hj7FEM/OJHGNR0KipE1h1mSsf39YeyC81qafkq+N3rU3h3RFbLSwE5VqUg==
"@types/react-dom@*", "@types/react-dom@^16.9.8":
version "16.9.8"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.8.tgz#fe4c1e11dfc67155733dfa6aa65108b4971cb423"
integrity sha512-ykkPQ+5nFknnlU6lDd947WbQ6TE3NNzbQAkInC2EKY1qeYdTKp7onFusmYZb+ityzx2YviqT6BXSu+LyWWJwcA==
dependencies:
"@types/react" "*"

Expand Down Expand Up @@ -5608,10 +5608,10 @@
"@types/prop-types" "*"
"@types/react" "*"

"@types/react@*", "@types/react@^16.8.23", "@types/react@^16.9.19":
version "16.9.23"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.23.tgz#1a66c6d468ba11a8943ad958a8cb3e737568271c"
integrity sha512-SsGVT4E7L2wLN3tPYLiF20hmZTPGuzaayVunfgXzUn1x4uHVsKH6QDJQ/TdpHqwsTLd4CwrmQ2vOgxN7gE24gw==
"@types/react@*", "@types/react@^16.8.23", "@types/react@^16.9.36":
version "16.9.36"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.36.tgz#ade589ff51e2a903e34ee4669e05dbfa0c1ce849"
integrity sha512-mGgUb/Rk/vGx4NCvquRuSH0GHBQKb1OqpGS9cT9lFxlTLHZgkksgI60TuIxubmn7JuCb+sENHhQciqa0npm0AQ==
dependencies:
"@types/prop-types" "*"
csstype "^2.2.0"
Expand Down

0 comments on commit 4218caf

Please sign in to comment.