2020-07-27 22:04:12 +02:00
|
|
|
// @flow
|
|
|
|
import * as ACTIONS from 'constants/action_types';
|
|
|
|
|
|
|
|
declare type SearchOptions = {
|
|
|
|
// :(
|
|
|
|
// https://github.com/facebook/flow/issues/6492
|
|
|
|
RESULT_COUNT: number,
|
|
|
|
CLAIM_TYPE: string,
|
|
|
|
INCLUDE_FILES: string,
|
|
|
|
INCLUDE_CHANNELS: string,
|
|
|
|
INCLUDE_FILES_AND_CHANNELS: string,
|
|
|
|
MEDIA_AUDIO: string,
|
|
|
|
MEDIA_VIDEO: string,
|
|
|
|
MEDIA_TEXT: string,
|
|
|
|
MEDIA_IMAGE: string,
|
|
|
|
MEDIA_APPLICATION: string,
|
2021-03-23 06:52:32 +01:00
|
|
|
SORT: string,
|
2022-05-30 04:04:34 +02:00
|
|
|
SORT_ASCENDING: string,
|
2021-03-23 06:52:32 +01:00
|
|
|
SORT_DESCENDING: string,
|
2021-03-23 09:55:37 +01:00
|
|
|
EXACT: string,
|
2021-03-30 07:57:37 +02:00
|
|
|
TIME_FILTER: string,
|
|
|
|
TIME_FILTER_LAST_HOUR: string,
|
|
|
|
TIME_FILTER_TODAY: string,
|
|
|
|
TIME_FILTER_THIS_WEEK: string,
|
|
|
|
TIME_FILTER_THIS_MONTH: string,
|
|
|
|
TIME_FILTER_THIS_YEAR: string,
|
2020-07-27 22:04:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
declare type SearchState = {
|
|
|
|
options: SearchOptions,
|
2022-06-22 15:43:54 +02:00
|
|
|
resultsByQuery: { [string]: { uris: Array<string>, recsys: string, uuid: string } },
|
2021-12-06 20:39:39 +01:00
|
|
|
results: Array<string>,
|
2021-03-26 09:33:30 +01:00
|
|
|
hasReachedMaxResultsLength: {},
|
2020-12-03 18:29:47 +01:00
|
|
|
searching: boolean,
|
2021-12-07 19:17:29 +01:00
|
|
|
mentionQuery: string,
|
2022-03-24 02:07:18 +01:00
|
|
|
personalRecommendations: { gid: string, uris: Array<string>, fetched: boolean },
|
2020-07-27 22:04:12 +02:00
|
|
|
};
|
|
|
|
|
2022-06-22 15:43:54 +02:00
|
|
|
declare type SearchResults = {
|
|
|
|
body: Array<{ name: string, claimId: string}>,
|
|
|
|
poweredBy: string,
|
|
|
|
uuid: string,
|
|
|
|
};
|
|
|
|
|
2020-07-27 22:04:12 +02:00
|
|
|
declare type SearchSuccess = {
|
|
|
|
type: ACTIONS.SEARCH_SUCCESS,
|
|
|
|
data: {
|
|
|
|
query: string,
|
2021-04-07 12:50:15 +02:00
|
|
|
from: number,
|
2021-03-26 09:33:30 +01:00
|
|
|
size: number,
|
2020-07-27 22:04:12 +02:00
|
|
|
uris: Array<string>,
|
2022-06-22 15:43:54 +02:00
|
|
|
poweredBy: string,
|
|
|
|
uuid: string,
|
2020-07-27 22:04:12 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
declare type UpdateSearchOptions = {
|
|
|
|
type: ACTIONS.UPDATE_SEARCH_OPTIONS,
|
|
|
|
data: SearchOptions,
|
|
|
|
};
|
2022-03-15 20:07:31 +01:00
|
|
|
|
|
|
|
declare type FypParam = {
|
|
|
|
gid: string,
|
|
|
|
uuid: string,
|
|
|
|
};
|