Skip to content

Commit

Permalink
improve types for useSearchStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
lgestc committed Sep 13, 2023
1 parent 5944944 commit 766e198
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { EventEnrichmentRequestOptionsInput } from '../../../../../common/a
import type { CtiEventEnrichmentStrategyResponse } from '../../../../../common/search_strategy/security_solution/cti';
import { CtiQueries } from '../../../../../common/search_strategy/security_solution/cti';

type GetEventEnrichmentProps = EventEnrichmentRequestOptionsInput & {
type GetEventEnrichmentProps = Omit<EventEnrichmentRequestOptionsInput, 'factoryQueryType'> & {
data: DataPublicPluginStart;
signal: AbortSignal;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const useFirstLastSeen = ({
useEffect(() => {
search({
defaultIndex,
factoryQueryType: FirstLastSeenQuery,
field,
value,
order,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const useSearch = <QueryType extends FactoryQueryTypes>(

const observable = data.search
.search<StrategyRequestInputType<QueryType>, StrategyResponseType<QueryType>>(
{ ...request, factoryQueryType } as unknown as StrategyRequestInputType<QueryType>,
{ ...request, factoryQueryType } as StrategyRequestInputType<QueryType>,
{
strategy: 'securitySolutionSearchStrategy',
abortSignal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type { GlobalTimeArgs } from '../../../common/containers/use_global_time'
import { OTHER_DATA_SOURCE_TITLE } from '../../components/overview_cti_links/translations';
import { OTHER_TI_DATASET_KEY } from '../../../../common/cti/constants';

type GetThreatIntelSourcProps = ThreatIntelSourceRequestOptionsInput & {
type GetThreatIntelSourceProps = Omit<ThreatIntelSourceRequestOptionsInput, 'factoryQueryType'> & {
data: DataPublicPluginStart;
signal: AbortSignal;
};
Expand All @@ -33,7 +33,7 @@ export const getTiDataSources = ({
defaultIndex,
timerange,
signal,
}: GetThreatIntelSourcProps): Observable<CtiDataSourceStrategyResponse> =>
}: GetThreatIntelSourceProps): Observable<CtiDataSourceStrategyResponse> =>
data.search.search<ThreatIntelSourceRequestOptionsInput, CtiDataSourceStrategyResponse>(
{
defaultIndex,
Expand All @@ -47,7 +47,7 @@ export const getTiDataSources = ({
);

export const getTiDataSourcesComplete = (
props: GetThreatIntelSourcProps
props: GetThreatIntelSourceProps
): Observable<CtiDataSourceStrategyResponse> => {
return getTiDataSources(props).pipe(
filter((response) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export const useManagedUser = (userName: string) => {
if (!isInitializing) {
search({
defaultIndex: MANAGED_USER_INDEX,
factoryQueryType: UsersQueries.managedDetails,
userName,
});
}
Expand Down

0 comments on commit 766e198

Please sign in to comment.