Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@appbaseio/reactivecore

Package Overview
Dependencies
Maintainers
4
Versions
289
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appbaseio/reactivecore - npm Package Compare versions

Comparing version 8.2.18 to 8.2.19

2

lib/actions/query.js

@@ -1,1 +0,1 @@

Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.setQuery=setQuery;exports.updateQueryOptions=updateQueryOptions;exports.logQuery=logQuery;exports.logCombinedQuery=logCombinedQuery;exports.setStreaming=setStreaming;exports.setHeaders=setHeaders;exports.setPromotedResults=setPromotedResults;exports.executeQuery=executeQuery;exports.setQueryOptions=setQueryOptions;exports.updateQuery=updateQuery;exports.loadMore=loadMore;exports.setQueryListener=setQueryListener;var _constants=require('../constants');var _value=require('./value');var _hits=require('./hits');var _helper=require('../utils/helper');var _analytics=require('../utils/analytics');var _analytics2=_interopRequireDefault(_analytics);var _maps=require('./maps');var _graphQL=require('../utils/graphQL');var _graphQL2=_interopRequireDefault(_graphQL);var _constants2=require('../../lib/utils/constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function setQuery(component,query){return{type:_constants.SET_QUERY,component:component,query:query};}function updateQueryOptions(component,options){return{type:_constants.SET_QUERY_OPTIONS,component:component,options:options};}function logQuery(component,query){return{type:_constants.LOG_QUERY,component:component,query:query};}function logCombinedQuery(component,query){return{type:_constants.LOG_COMBINED_QUERY,component:component,query:query};}function setLoading(component,isLoading){return{type:_constants.SET_LOADING,component:component,isLoading:isLoading};}function setError(component,error){return{type:_constants.SET_ERROR,component:component,error:error};}function setTimestamp(component,timestamp){return{type:_constants.SET_TIMESTAMP,component:component,timestamp:timestamp};}function setStreaming(component){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var ref=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return{type:_constants.SET_STREAMING,component:component,status:status,ref:ref};}function setHeaders(headers){return{type:_constants.SET_HEADERS,headers:headers};}function setPromotedResults(){var results=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return{type:_constants.SET_PROMOTED_RESULTS,results:results};}function setSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SEARCH_ID,searchId:searchId};}function setSuggestionsSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SUGGESTIONS_SEARCH_ID,searchId:searchId};}function msearch(query,orderOfQueries){var appendToHits=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var isInternalComponent=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var appendToAggs=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var componentType=arguments[5];return function(dispatch,getState){var _getState=getState(),appbaseRef=_getState.appbaseRef,config=_getState.config,headers=_getState.headers,queryListener=_getState.queryListener,analytics=_getState.analytics,selectedValues=_getState.selectedValues;var searchHeaders={};var suggestionsComponents=[_constants2.componentTypes.dataSearch,_constants2.componentTypes.categorySearch];var isSuggestionsQuery=isInternalComponent&&suggestionsComponents.indexOf(componentType)!==-1;if(config.analytics){if(config.analyticsConfig.suggestionAnalytics&&isSuggestionsQuery){var suggestionsSearchValue=analytics.suggestionsSearchValue;var shouldIncludeQuery=!!(config.analyticsConfig.emptyQuery||suggestionsSearchValue);if(shouldIncludeQuery){searchHeaders={'X-Search-Query':suggestionsSearchValue||''};}}else{var searchValue=analytics.searchValue,searchId=analytics.searchId;var filterString=(0,_analytics2.default)(selectedValues);if(searchId){searchHeaders=_extends({'X-Search-Id':searchId,'X-Search-Query':searchValue},filterString&&{'X-Search-Filters':filterString});}else{var _shouldIncludeQuery=!!(config.analyticsConfig.emptyQuery||searchValue);searchHeaders=_extends(_shouldIncludeQuery&&{'X-Search-Query':searchValue||''},filterString&&{'X-Search-Filters':filterString});}}if(config.analyticsConfig.searchStateHeader){var searchState=(0,_helper.getSearchState)(getState(),true);if(searchState&&Object.keys(searchState).length){searchHeaders['X-Search-State']=JSON.stringify(searchState);}}if(config.analyticsConfig.userId){searchHeaders['X-User-Id']=config.analyticsConfig.userId;}if(config.analyticsConfig.customEvents){searchHeaders['X-Search-CustomEvent']=(0,_analytics.parseCustomEvents)(config.analyticsConfig.customEvents);}}orderOfQueries.forEach(function(component){dispatch(setLoading(component,true));});var handleTransformResponse=function handleTransformResponse(res,component){if(config.transformResponse&&typeof config.transformResponse==='function'){return config.transformResponse(res,component);}return new Promise(function(resolve){return resolve(res);});};var handleError=function handleError(error){console.error(error);orderOfQueries.forEach(function(component){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}dispatch(setError(component,error));dispatch(setLoading(component,false));});};var handleResponse=function handleResponse(res){var searchId=res._headers?res._headers.get('X-Search-Id'):null;if(searchId){if(isSuggestionsQuery){dispatch(setSuggestionsSearchId(searchId));}else{dispatch(setSearchId(searchId));}}orderOfQueries.forEach(function(component,index){handleTransformResponse(res.responses[index],component).then(function(response){var _getState2=getState(),timestamp=_getState2.timestamp;if(timestamp[component]===undefined||timestamp[component]<res._timestamp){if(response.promoted){dispatch(setPromotedResults(response.promoted));}else{dispatch(setPromotedResults());}if(response.hits){dispatch(setTimestamp(component,res._timestamp));dispatch((0,_hits.updateHits)(component,response.hits,response.took,appendToHits));dispatch(setLoading(component,false));}if(response.aggregations){dispatch((0,_hits.updateAggs)(component,response.aggregations,appendToAggs));dispatch((0,_hits.updateCompositeAggs)(component,response.aggregations,appendToAggs));}}}).catch(function(err){handleError(err);});});};if(config.graphQLUrl){(0,_graphQL2.default)(config.graphQLUrl,config.url,config.credentials,config.app,query).then(function(res){handleResponse(res);}).catch(function(err){handleError(err);});}else{appbaseRef.setHeaders(_extends({},headers,searchHeaders));appbaseRef.msearch({type:config.type==='*'?'':config.type,body:query}).then(function(res){handleResponse(res);}).catch(function(err){handleError(err);});}};}function executeQueryListener(listener,oldQuery,newQuery){if(listener&&listener.onQueryChange){listener.onQueryChange(oldQuery,newQuery);}}function executeQuery(componentId){var executeWatchList=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var mustExecuteMapQuery=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var componentType=arguments[3];return function(dispatch,getState){var _getState3=getState(),queryLog=_getState3.queryLog,stream=_getState3.stream,appbaseRef=_getState3.appbaseRef,config=_getState3.config,mapData=_getState3.mapData,watchMan=_getState3.watchMan,dependencyTree=_getState3.dependencyTree,queryList=_getState3.queryList,queryOptions=_getState3.queryOptions,queryListener=_getState3.queryListener;var orderOfQueries=[];var finalQuery=[];var matchAllQuery={match_all:{}};var componentList=[componentId];if(executeWatchList){var watchList=watchMan[componentId]||[];componentList=[].concat(_toConsumableArray(componentList),_toConsumableArray(watchList));}componentList.forEach(function(component){var _buildQuery=(0,_helper.buildQuery)(component,dependencyTree,queryList,queryOptions),queryObj=_buildQuery.queryObj,options=_buildQuery.options;var validOptions=['aggs','from','sort'];if(queryObj&&!!Object.keys(queryObj).length||options&&Object.keys(options).some(function(item){return validOptions.includes(item);})){if(!queryObj||queryObj&&!Object.keys(queryObj).length){queryObj=_extends({},matchAllQuery);}var currentQuery=_extends({query:_extends({},queryObj)},options,queryOptions[component]);var queryToLog=_extends({query:_extends({},queryObj)},options,queryOptions[component]);var oldQuery=queryLog[component];if(mustExecuteMapQuery||!(0,_helper.isEqual)(currentQuery,oldQuery)){orderOfQueries=[].concat(_toConsumableArray(orderOfQueries),[component]);dispatch(logQuery(component,queryToLog));var isMapComponent=Object.keys(mapData).includes(component);if(isMapComponent&&mapData[component].query){var existingQuery=currentQuery.query;currentQuery.query={bool:{must:[existingQuery,mapData[component].query]}};if(!mapData[component].persistMapQuery){dispatch((0,_maps.updateMapData)(componentId,null,false));}var _getState4=getState(),combinedLog=_getState4.combinedLog;if((0,_helper.isEqual)(combinedLog[component],currentQuery))return;dispatch(logCombinedQuery(component,currentQuery));}executeQueryListener(queryListener[component],oldQuery,currentQuery);if(stream[component]&&stream[component].status){if(stream[component].ref){stream[component].ref.stop();}var ref=appbaseRef.searchStream({type:config.type==='*'?'':config.type,body:currentQuery},function(response){if(response._id){dispatch((0,_hits.pushToStreamHits)(component,response));}},function(error){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}console.warn(error);dispatch(setError(component,error));dispatch(setLoading(component,false));});dispatch(setStreaming(component,true,ref));}finalQuery=[].concat(_toConsumableArray(finalQuery),[{preference:component},currentQuery]);}}});if(finalQuery.length){dispatch(msearch(finalQuery,orderOfQueries,false,componentId.endsWith('__internal'),undefined,componentType));}};}function setQueryOptions(component,queryOptions){var execute=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return function(dispatch){dispatch(updateQueryOptions(component,queryOptions));if(execute){dispatch(executeQuery(component,true));}};}function updateQuery(_ref){var componentId=_ref.componentId,query=_ref.query,value=_ref.value,_ref$label=_ref.label,label=_ref$label===undefined?null:_ref$label,_ref$showFilter=_ref.showFilter,showFilter=_ref$showFilter===undefined?true:_ref$showFilter,_ref$URLParams=_ref.URLParams,URLParams=_ref$URLParams===undefined?false:_ref$URLParams,_ref$componentType=_ref.componentType,componentType=_ref$componentType===undefined?null:_ref$componentType,_ref$category=_ref.category,category=_ref$category===undefined?null:_ref$category;var execute=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return function(dispatch){var queryToDispatch=query;if(query&&query.query){queryToDispatch=query.query;}if(!componentId.endsWith('__internal')){dispatch((0,_value.setValue)(componentId,value,label,showFilter,URLParams,componentType,category));}dispatch(setQuery(componentId,queryToDispatch));if(execute)dispatch(executeQuery(componentId,true,false,componentType));};}function loadMore(component,newOptions){var appendToHits=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var appendToAggs=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return function(dispatch,getState){var store=getState();var _buildQuery2=(0,_helper.buildQuery)(component,store.dependencyTree,store.queryList,store.queryOptions),queryObj=_buildQuery2.queryObj,options=_buildQuery2.options;var queryLog=store.queryLog;if(!options)options={};options=_extends({},options,newOptions);if(!queryObj||queryObj&&!Object.keys(queryObj).length){queryObj={match_all:{}};}var currentQuery=_extends({query:_extends({},queryObj)},options);if((0,_helper.isEqual)(queryLog[component],currentQuery))return;dispatch(logQuery(component,currentQuery));var finalQuery=[{preference:component},currentQuery];dispatch(msearch(finalQuery,[component],appendToHits,false,appendToAggs));};}function setQueryListener(component,onQueryChange,onError){return{type:_constants.SET_QUERY_LISTENER,component:component,onQueryChange:onQueryChange,onError:onError};}
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.setQuery=setQuery;exports.updateQueryOptions=updateQueryOptions;exports.logQuery=logQuery;exports.logCombinedQuery=logCombinedQuery;exports.setStreaming=setStreaming;exports.setHeaders=setHeaders;exports.setPromotedResults=setPromotedResults;exports.executeQuery=executeQuery;exports.setQueryOptions=setQueryOptions;exports.updateQuery=updateQuery;exports.loadMore=loadMore;exports.setQueryListener=setQueryListener;var _constants=require('../constants');var _value=require('./value');var _hits=require('./hits');var _helper=require('../utils/helper');var _analytics=require('../utils/analytics');var _analytics2=_interopRequireDefault(_analytics);var _maps=require('./maps');var _graphQL=require('../utils/graphQL');var _graphQL2=_interopRequireDefault(_graphQL);var _constants2=require('../../lib/utils/constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function setQuery(component,query){return{type:_constants.SET_QUERY,component:component,query:query};}function updateQueryOptions(component,options){return{type:_constants.SET_QUERY_OPTIONS,component:component,options:options};}function logQuery(component,query){return{type:_constants.LOG_QUERY,component:component,query:query};}function logCombinedQuery(component,query){return{type:_constants.LOG_COMBINED_QUERY,component:component,query:query};}function setLoading(component,isLoading){return{type:_constants.SET_LOADING,component:component,isLoading:isLoading};}function setError(component,error){return{type:_constants.SET_ERROR,component:component,error:error};}function setTimestamp(component,timestamp){return{type:_constants.SET_TIMESTAMP,component:component,timestamp:timestamp};}function setStreaming(component){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var ref=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return{type:_constants.SET_STREAMING,component:component,status:status,ref:ref};}function setHeaders(headers){return{type:_constants.SET_HEADERS,headers:headers};}function setPromotedResults(){var results=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return{type:_constants.SET_PROMOTED_RESULTS,results:results};}function setSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SEARCH_ID,searchId:searchId};}function setSuggestionsSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SUGGESTIONS_SEARCH_ID,searchId:searchId};}function msearch(query,orderOfQueries){var appendToHits=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var isInternalComponent=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var appendToAggs=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var componentType=arguments[5];return function(dispatch,getState){var _getState=getState(),appbaseRef=_getState.appbaseRef,config=_getState.config,headers=_getState.headers,queryListener=_getState.queryListener,analytics=_getState.analytics,selectedValues=_getState.selectedValues;var searchHeaders={};var suggestionsComponents=[_constants2.componentTypes.dataSearch,_constants2.componentTypes.categorySearch];var isSuggestionsQuery=isInternalComponent&&suggestionsComponents.indexOf(componentType)!==-1;if(config.analytics){if(config.analyticsConfig.suggestionAnalytics&&isSuggestionsQuery){var suggestionsSearchValue=analytics.suggestionsSearchValue;var shouldIncludeQuery=!!(config.analyticsConfig.emptyQuery||suggestionsSearchValue);if(shouldIncludeQuery){searchHeaders={'X-Search-Query':suggestionsSearchValue||''};}}else{var searchValue=analytics.searchValue,searchId=analytics.searchId;var filterString=(0,_analytics2.default)(selectedValues);if(searchId){searchHeaders=_extends({'X-Search-Id':searchId,'X-Search-Query':searchValue},filterString&&{'X-Search-Filters':filterString});}else{var _shouldIncludeQuery=!!(config.analyticsConfig.emptyQuery||searchValue);searchHeaders=_extends(_shouldIncludeQuery&&{'X-Search-Query':searchValue||''},filterString&&{'X-Search-Filters':filterString});}}if(config.analyticsConfig.searchStateHeader){var searchState=(0,_helper.getSearchState)(getState(),true);if(searchState&&Object.keys(searchState).length){searchHeaders['X-Search-State']=JSON.stringify(searchState);}}if(config.analyticsConfig.userId){searchHeaders['X-User-Id']=config.analyticsConfig.userId;}if(config.analyticsConfig.customEvents){searchHeaders['X-Search-CustomEvent']=(0,_analytics.parseCustomEvents)(config.analyticsConfig.customEvents);}}orderOfQueries.forEach(function(component){dispatch(setLoading(component,true));});var handleTransformResponse=function handleTransformResponse(res,component){if(config.transformResponse&&typeof config.transformResponse==='function'){return config.transformResponse(res,component);}return new Promise(function(resolve){return resolve(res);});};var handleError=function handleError(error){console.error(error);orderOfQueries.forEach(function(component){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}dispatch(setError(component,error));dispatch(setLoading(component,false));});};var handleResponse=function handleResponse(res){var searchId=res._headers?res._headers.get('X-Search-Id'):null;if(searchId){if(isSuggestionsQuery){dispatch(setSuggestionsSearchId(searchId));}else{dispatch(setSearchId(searchId));}}orderOfQueries.forEach(function(component,index){handleTransformResponse(res.responses[index],component).then(function(response){var _getState2=getState(),timestamp=_getState2.timestamp;if(timestamp[component]===undefined||timestamp[component]<res._timestamp){var promotedResults=response.promoted||res.promoted;if(promotedResults){dispatch(setPromotedResults(promotedResults));}else{dispatch(setPromotedResults());}if(response.hits){dispatch(setTimestamp(component,res._timestamp));dispatch((0,_hits.updateHits)(component,response.hits,response.took,appendToHits));dispatch(setLoading(component,false));}if(response.aggregations){dispatch((0,_hits.updateAggs)(component,response.aggregations,appendToAggs));dispatch((0,_hits.updateCompositeAggs)(component,response.aggregations,appendToAggs));}}}).catch(function(err){handleError(err);});});};if(config.graphQLUrl){(0,_graphQL2.default)(config.graphQLUrl,config.url,config.credentials,config.app,query).then(function(res){handleResponse(res);}).catch(function(err){handleError(err);});}else{appbaseRef.setHeaders(_extends({},headers,searchHeaders));appbaseRef.msearch({type:config.type==='*'?'':config.type,body:query}).then(function(res){handleResponse(res);}).catch(function(err){handleError(err);});}};}function executeQueryListener(listener,oldQuery,newQuery){if(listener&&listener.onQueryChange){listener.onQueryChange(oldQuery,newQuery);}}function executeQuery(componentId){var executeWatchList=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var mustExecuteMapQuery=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var componentType=arguments[3];return function(dispatch,getState){var _getState3=getState(),queryLog=_getState3.queryLog,stream=_getState3.stream,appbaseRef=_getState3.appbaseRef,config=_getState3.config,mapData=_getState3.mapData,watchMan=_getState3.watchMan,dependencyTree=_getState3.dependencyTree,queryList=_getState3.queryList,queryOptions=_getState3.queryOptions,queryListener=_getState3.queryListener;var orderOfQueries=[];var finalQuery=[];var matchAllQuery={match_all:{}};var componentList=[componentId];if(executeWatchList){var watchList=watchMan[componentId]||[];componentList=[].concat(_toConsumableArray(componentList),_toConsumableArray(watchList));}componentList.forEach(function(component){var _buildQuery=(0,_helper.buildQuery)(component,dependencyTree,queryList,queryOptions),queryObj=_buildQuery.queryObj,options=_buildQuery.options;var validOptions=['aggs','from','sort'];if(queryObj&&!!Object.keys(queryObj).length||options&&Object.keys(options).some(function(item){return validOptions.includes(item);})){if(!queryObj||queryObj&&!Object.keys(queryObj).length){queryObj=_extends({},matchAllQuery);}var currentQuery=_extends({query:_extends({},queryObj)},options,queryOptions[component]);var queryToLog=_extends({query:_extends({},queryObj)},options,queryOptions[component]);var oldQuery=queryLog[component];if(mustExecuteMapQuery||!(0,_helper.isEqual)(currentQuery,oldQuery)){orderOfQueries=[].concat(_toConsumableArray(orderOfQueries),[component]);dispatch(logQuery(component,queryToLog));var isMapComponent=Object.keys(mapData).includes(component);if(isMapComponent&&mapData[component].query){var existingQuery=currentQuery.query;currentQuery.query={bool:{must:[existingQuery,mapData[component].query]}};if(!mapData[component].persistMapQuery){dispatch((0,_maps.updateMapData)(componentId,null,false));}var _getState4=getState(),combinedLog=_getState4.combinedLog;if((0,_helper.isEqual)(combinedLog[component],currentQuery))return;dispatch(logCombinedQuery(component,currentQuery));}executeQueryListener(queryListener[component],oldQuery,currentQuery);if(stream[component]&&stream[component].status){if(stream[component].ref){stream[component].ref.stop();}var ref=appbaseRef.searchStream({type:config.type==='*'?'':config.type,body:currentQuery},function(response){if(response._id){dispatch((0,_hits.pushToStreamHits)(component,response));}},function(error){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}console.warn(error);dispatch(setError(component,error));dispatch(setLoading(component,false));});dispatch(setStreaming(component,true,ref));}finalQuery=[].concat(_toConsumableArray(finalQuery),[{preference:component},currentQuery]);}}});if(finalQuery.length){dispatch(msearch(finalQuery,orderOfQueries,false,componentId.endsWith('__internal'),undefined,componentType));}};}function setQueryOptions(component,queryOptions){var execute=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return function(dispatch){dispatch(updateQueryOptions(component,queryOptions));if(execute){dispatch(executeQuery(component,true));}};}function updateQuery(_ref){var componentId=_ref.componentId,query=_ref.query,value=_ref.value,_ref$label=_ref.label,label=_ref$label===undefined?null:_ref$label,_ref$showFilter=_ref.showFilter,showFilter=_ref$showFilter===undefined?true:_ref$showFilter,_ref$URLParams=_ref.URLParams,URLParams=_ref$URLParams===undefined?false:_ref$URLParams,_ref$componentType=_ref.componentType,componentType=_ref$componentType===undefined?null:_ref$componentType,_ref$category=_ref.category,category=_ref$category===undefined?null:_ref$category;var execute=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return function(dispatch){var queryToDispatch=query;if(query&&query.query){queryToDispatch=query.query;}if(!componentId.endsWith('__internal')){dispatch((0,_value.setValue)(componentId,value,label,showFilter,URLParams,componentType,category));}dispatch(setQuery(componentId,queryToDispatch));if(execute)dispatch(executeQuery(componentId,true,false,componentType));};}function loadMore(component,newOptions){var appendToHits=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var appendToAggs=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return function(dispatch,getState){var store=getState();var _buildQuery2=(0,_helper.buildQuery)(component,store.dependencyTree,store.queryList,store.queryOptions),queryObj=_buildQuery2.queryObj,options=_buildQuery2.options;var queryLog=store.queryLog;if(!options)options={};options=_extends({},options,newOptions);if(!queryObj||queryObj&&!Object.keys(queryObj).length){queryObj={match_all:{}};}var currentQuery=_extends({query:_extends({},queryObj)},options);if((0,_helper.isEqual)(queryLog[component],currentQuery))return;dispatch(logQuery(component,currentQuery));var finalQuery=[{preference:component},currentQuery];dispatch(msearch(finalQuery,[component],appendToHits,false,appendToAggs));};}function setQueryListener(component,onQueryChange,onError){return{type:_constants.SET_QUERY_LISTENER,component:component,onQueryChange:onQueryChange,onError:onError};}

@@ -1,1 +0,1 @@

Object.defineProperty(exports,"__esModule",{value:true});var componentTypes=exports.componentTypes={reactiveList:'REACTIVELIST',dataSearch:'DATASEARCH',categorySearch:'CATEGORYSEARCH',singleList:'SINGLELIST',multiList:'MULTILIST',singleDataList:'SINGLEDATALIST',singleDropdownList:'SINGLEDROPDOWNLIST',multiDataList:'MULTIDATALIST',multiDropdownList:'MULTIDROPDOWNLIST',singleDropdownRange:'SINGLEDROPDOWNRANGE',numberBox:'NUMBERBOX',tagCloud:'TAGCLOUD',toggleButton:'TOGGLEBUTTON',datePicker:'DATEPICKER',dateRange:'DATERANGE',dynamicRangeSlider:'DYNAMICRANGESLIDER',multiDropdownRange:'MULTIDROPDOWNRANGE',singleRange:'SINGLERANGE',multiRange:'MULTIRANGE',rangeSlider:'RANGESLIDER',ratingsFilter:'RATINGSFILTER',rangeInput:'RANGEINPUT'};var validProps=exports.validProps=['componentType','dataField','includeFields','excludeFields','size','sortBy','sortOptions','pagination','autoFocus','autosuggest','debounce','defaultValue','defaultSuggestions','fieldWeights','filterLabel','fuzziness','highlight','highlightField','nestedField','placeholder','queryFormat','categoryField','strictSelection','selectAllLabel','showCheckbox','showFilter','showSearch','showCount','showLoadMore','loadMoreLabel','showMissing','missingLabel','data','showRadio','multiSelect','interval','showHistogram','snap','stepValue','range','showSlider'];
Object.defineProperty(exports,"__esModule",{value:true});var componentTypes=exports.componentTypes={reactiveList:'REACTIVELIST',dataSearch:'DATASEARCH',categorySearch:'CATEGORYSEARCH',singleList:'SINGLELIST',multiList:'MULTILIST',singleDataList:'SINGLEDATALIST',singleDropdownList:'SINGLEDROPDOWNLIST',multiDataList:'MULTIDATALIST',multiDropdownList:'MULTIDROPDOWNLIST',singleDropdownRange:'SINGLEDROPDOWNRANGE',numberBox:'NUMBERBOX',tagCloud:'TAGCLOUD',toggleButton:'TOGGLEBUTTON',datePicker:'DATEPICKER',dateRange:'DATERANGE',dynamicRangeSlider:'DYNAMICRANGESLIDER',multiDropdownRange:'MULTIDROPDOWNRANGE',singleRange:'SINGLERANGE',multiRange:'MULTIRANGE',rangeSlider:'RANGESLIDER',ratingsFilter:'RATINGSFILTER',rangeInput:'RANGEINPUT'};var validProps=exports.validProps=['componentType','dataField','includeFields','excludeFields','size','sortBy','sortOptions','pagination','autoFocus','autosuggest','debounce','defaultValue','defaultSuggestions','fieldWeights','filterLabel','fuzziness','highlight','highlightField','nestedField','placeholder','queryFormat','categoryField','strictSelection','selectAllLabel','showCheckbox','showFilter','showSearch','showCount','showLoadMore','loadMoreLabel','showMissing','missingLabel','data','showRadio','multiSelect','interval','showHistogram','snap','stepValue','range','showSlider'];var CLEAR_ALL=exports.CLEAR_ALL={NEVER:'never',ALWAYS:'always',DEFAULT:'default'};

@@ -1,1 +0,1 @@

Object.defineProperty(exports,"__esModule",{value:true});var _propTypes=require('prop-types');var _dateFormats=require('./dateFormats');var _dateFormats2=_interopRequireDefault(_dateFormats);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}var reactKeyType=(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),_propTypes.object,(0,_propTypes.arrayOf)(_propTypes.object)]);function validateLocation(props,propName){if(isNaN(props[propName])){return new Error(propName+' value must be a number');}if(propName==='lat'&&(props[propName]<-90||props[propName]>90)){return new Error(propName+' value should be between -90 and 90.');}else if(propName==='lng'&&(props[propName]<-180||props[propName]>180)){return new Error(propName+' value should be between -180 and 180.');}return null;}var types={any:_propTypes.any,analyticsConfig:(0,_propTypes.shape)({searchStateHeader:_propTypes.bool,emptyQuery:_propTypes.bool,suggestionAnalytics:_propTypes.bool,userId:_propTypes.string,customEvents:_propTypes.object}),bool:_propTypes.bool,boolRequired:_propTypes.bool.isRequired,components:(0,_propTypes.arrayOf)(_propTypes.string),children:_propTypes.any,data:(0,_propTypes.arrayOf)(_propTypes.object),dataFieldArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]).isRequired,dataNumberBox:(0,_propTypes.shape)({label:_propTypes.string,start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}).isRequired,date:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),dateObject:_propTypes.object,excludeFields:(0,_propTypes.arrayOf)(_propTypes.string),fieldWeights:(0,_propTypes.arrayOf)(_propTypes.number),filterLabel:_propTypes.string,func:_propTypes.func,funcRequired:_propTypes.func.isRequired,fuzziness:(0,_propTypes.oneOf)([0,1,2,'AUTO']),headers:_propTypes.object,hits:(0,_propTypes.arrayOf)(_propTypes.object),iconPosition:(0,_propTypes.oneOf)(['left','right']),includeFields:(0,_propTypes.arrayOf)(_propTypes.string),labelPosition:(0,_propTypes.oneOf)(['left','right','top','bottom']),number:_propTypes.number,options:(0,_propTypes.oneOfType)([(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object]),paginationAt:(0,_propTypes.oneOf)(['top','bottom','both']),range:(0,_propTypes.shape)({start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}),rangeLabels:(0,_propTypes.shape)({start:_propTypes.string.isRequired,end:_propTypes.string.isRequired}),react:(0,_propTypes.shape)({and:reactKeyType,or:reactKeyType,not:reactKeyType}),categorySearchValue:(0,_propTypes.shape)({term:_propTypes.string,category:_propTypes.string}),selectedValues:_propTypes.object,selectedValue:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object,_propTypes.number,(0,_propTypes.arrayOf)(_propTypes.number)]),suggestions:(0,_propTypes.arrayOf)(_propTypes.object),supportedOrientations:(0,_propTypes.oneOf)(['portrait','portrait-upside-down','landscape','landscape-left','landscape-right']),tooltipTrigger:(0,_propTypes.oneOf)(['hover','none','focus','always']),sortBy:(0,_propTypes.oneOf)(['asc','desc']),sortOptions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({label:_propTypes.string,dataField:_propTypes.string,sortBy:_propTypes.string})),sortByWithCount:(0,_propTypes.oneOf)(['asc','desc','count']),stats:(0,_propTypes.arrayOf)(_propTypes.object),string:_propTypes.string,stringArray:(0,_propTypes.arrayOf)(_propTypes.string),stringOrArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),stringRequired:_propTypes.string.isRequired,style:_propTypes.object,themePreset:(0,_propTypes.oneOf)(['light','dark']),queryFormatDate:(0,_propTypes.oneOf)(Object.keys(_dateFormats2.default)),queryFormatSearch:(0,_propTypes.oneOf)(['and','or']),queryFormatNumberBox:(0,_propTypes.oneOf)(['exact','lte','gte']),params:_propTypes.object.isRequired,props:_propTypes.object,rangeLabelsAlign:(0,_propTypes.oneOf)(['left','right']),title:(0,_propTypes.oneOfType)([_propTypes.string,_propTypes.any]),location:(0,_propTypes.shape)({lat:validateLocation,lng:validateLocation}),unit:(0,_propTypes.oneOf)(['mi','miles','yd','yards','ft','feet','in','inch','km','kilometers','m','meters','cm','centimeters','mm','millimeters','NM','nmi','nauticalmiles']),aggregationData:_propTypes.array};exports.default=types;
Object.defineProperty(exports,"__esModule",{value:true});var _propTypes=require('prop-types');var _dateFormats=require('./dateFormats');var _dateFormats2=_interopRequireDefault(_dateFormats);var _constants=require('./constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}var reactKeyType=(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),_propTypes.object,(0,_propTypes.arrayOf)(_propTypes.object)]);function validateLocation(props,propName){if(isNaN(props[propName])){return new Error(propName+' value must be a number');}if(propName==='lat'&&(props[propName]<-90||props[propName]>90)){return new Error(propName+' value should be between -90 and 90.');}else if(propName==='lng'&&(props[propName]<-180||props[propName]>180)){return new Error(propName+' value should be between -180 and 180.');}return null;}var types={any:_propTypes.any,analyticsConfig:(0,_propTypes.shape)({searchStateHeader:_propTypes.bool,emptyQuery:_propTypes.bool,suggestionAnalytics:_propTypes.bool,userId:_propTypes.string,customEvents:_propTypes.object}),bool:_propTypes.bool,boolRequired:_propTypes.bool.isRequired,components:(0,_propTypes.arrayOf)(_propTypes.string),children:_propTypes.any,data:(0,_propTypes.arrayOf)(_propTypes.object),dataFieldArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]).isRequired,dataNumberBox:(0,_propTypes.shape)({label:_propTypes.string,start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}).isRequired,date:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),dateObject:_propTypes.object,excludeFields:(0,_propTypes.arrayOf)(_propTypes.string),fieldWeights:(0,_propTypes.arrayOf)(_propTypes.number),filterLabel:_propTypes.string,func:_propTypes.func,funcRequired:_propTypes.func.isRequired,fuzziness:(0,_propTypes.oneOf)([0,1,2,'AUTO']),headers:_propTypes.object,hits:(0,_propTypes.arrayOf)(_propTypes.object),iconPosition:(0,_propTypes.oneOf)(['left','right']),includeFields:(0,_propTypes.arrayOf)(_propTypes.string),labelPosition:(0,_propTypes.oneOf)(['left','right','top','bottom']),number:_propTypes.number,options:(0,_propTypes.oneOfType)([(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object]),paginationAt:(0,_propTypes.oneOf)(['top','bottom','both']),range:(0,_propTypes.shape)({start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}),rangeLabels:(0,_propTypes.shape)({start:_propTypes.string.isRequired,end:_propTypes.string.isRequired}),react:(0,_propTypes.shape)({and:reactKeyType,or:reactKeyType,not:reactKeyType}),categorySearchValue:(0,_propTypes.shape)({term:_propTypes.string,category:_propTypes.string}),selectedValues:_propTypes.object,selectedValue:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object,_propTypes.number,(0,_propTypes.arrayOf)(_propTypes.number)]),suggestions:(0,_propTypes.arrayOf)(_propTypes.object),supportedOrientations:(0,_propTypes.oneOf)(['portrait','portrait-upside-down','landscape','landscape-left','landscape-right']),tooltipTrigger:(0,_propTypes.oneOf)(['hover','none','focus','always']),sortBy:(0,_propTypes.oneOf)(['asc','desc']),sortOptions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({label:_propTypes.string,dataField:_propTypes.string,sortBy:_propTypes.string})),sortByWithCount:(0,_propTypes.oneOf)(['asc','desc','count']),stats:(0,_propTypes.arrayOf)(_propTypes.object),string:_propTypes.string,stringArray:(0,_propTypes.arrayOf)(_propTypes.string),stringOrArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),stringRequired:_propTypes.string.isRequired,style:_propTypes.object,themePreset:(0,_propTypes.oneOf)(['light','dark']),queryFormatDate:(0,_propTypes.oneOf)(Object.keys(_dateFormats2.default)),queryFormatSearch:(0,_propTypes.oneOf)(['and','or']),queryFormatNumberBox:(0,_propTypes.oneOf)(['exact','lte','gte']),params:_propTypes.object.isRequired,props:_propTypes.object,rangeLabelsAlign:(0,_propTypes.oneOf)(['left','right']),title:(0,_propTypes.oneOfType)([_propTypes.string,_propTypes.any]),location:(0,_propTypes.shape)({lat:validateLocation,lng:validateLocation}),unit:(0,_propTypes.oneOf)(['mi','miles','yd','yards','ft','feet','in','inch','km','kilometers','m','meters','cm','centimeters','mm','millimeters','NM','nmi','nauticalmiles']),aggregationData:_propTypes.array,showClearAll:(0,_propTypes.oneOf)([_constants.CLEAR_ALL.NEVER,_constants.CLEAR_ALL.ALWAYS,_constants.CLEAR_ALL.DEFAULT,true,false])};exports.default=types;
{
"name": "@appbaseio/reactivecore",
"version": "8.2.18",
"version": "8.2.19",
"description": "Core architecture of reactive UI libraries",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc