@appbaseio/reactivecore
Advanced tools
Comparing version 10.0.0-alpha.24 to 10.0.0-alpha.25
@@ -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.loadPopularSuggestions=loadPopularSuggestions;exports.executeQuery=executeQuery;exports.setQueryOptions=setQueryOptions;exports.updateQuery=updateQuery;exports.loadMore=loadMore;exports.loadDataToExport=loadDataToExport;exports.fetchAIResponse=fetchAIResponse;var _value2=require('./value');var _utils=require('./utils');var _misc=require('./misc');var _helper=require('../utils/helper');var _maps=require('./maps');var _constants=require('../utils/constants');var _transform=require('../utils/transform');var _transform2=require('../../lib/utils/transform');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return 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 loadPopularSuggestions(componentId){return function(dispatch,getState){var _getState=getState(),config=_getState.config,appbaseRef=_getState.appbaseRef,props=_getState.props,internalValues=_getState.internalValues;var componentProps=props[componentId]||{};var internalValue=internalValues[componentId];var value=internalValue&&internalValue.value||'';if(componentProps.enablePopularSuggestions){if(config.mongodb){dispatch((0,_misc.setDefaultPopularSuggestions)([],componentId.split('__internal')[0]));return;}var suggQuery=(0,_utils.getSuggestionQuery)(getState,componentId);appbaseRef.getQuerySuggestions(suggQuery).then(function(suggestions){var querySuggestion=suggestions[(0,_utils.getQuerySuggestionsId)(componentId)];if(value){dispatch((0,_misc.setPopularSuggestions)(querySuggestion&&querySuggestion.hits&&querySuggestion.hits.hits,componentId.split('__internal')[0]));}else{dispatch((0,_misc.setDefaultPopularSuggestions)(querySuggestion&&querySuggestion.hits&&querySuggestion.hits.hits,componentId.split('__internal')[0]));}}).catch(function(e){(0,_utils.handleError)({orderOfQueries:[componentId],error:e},getState,dispatch);});}};}function appbaseSearch(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},queryId=_ref.queryId,query=_ref.query,orderOfQueries=_ref.orderOfQueries,_ref$appendToHits=_ref.appendToHits,appendToHits=_ref$appendToHits===undefined?false:_ref$appendToHits,_ref$isSuggestionsQue=_ref.isSuggestionsQuery,isSuggestionsQuery=_ref$isSuggestionsQue===undefined?false:_ref$isSuggestionsQue,searchComponentID=_ref.searchComponentID,_ref$appendToAggs=_ref.appendToAggs,appendToAggs=_ref$appendToAggs===undefined?false:_ref$appendToAggs;return function(dispatch,getState){var _getState2=getState(),appbaseRef=_getState2.appbaseRef,config=_getState2.config,headers=_getState2.headers,props=_getState2.props;var isAnalyticsEnabled=false;if(config){if((0,_utils.isPropertyDefined)(config.analytics)){isAnalyticsEnabled=config.analytics;}else if(config.analyticsConfig){if((0,_utils.isPropertyDefined)(config.analyticsConfig.recordAnalytics)){isAnalyticsEnabled=config.analyticsConfig.recordAnalytics;}else if((0,_utils.isPropertyDefined)(config.analyticsConfig.analytics)){isAnalyticsEnabled=config.analyticsConfig.analytics;}}}var settings={recordAnalytics:isAnalyticsEnabled};if(config.analyticsConfig){settings.userId=(0,_utils.isPropertyDefined)(config.analyticsConfig.userId)?config.analyticsConfig.userId:undefined;settings.enableQueryRules=(0,_utils.isPropertyDefined)(config.analyticsConfig.enableQueryRules)?config.analyticsConfig.enableQueryRules:undefined;settings.customEvents=(0,_utils.isPropertyDefined)(config.analyticsConfig.customEvents)?config.analyticsConfig.customEvents:undefined;settings.emptyQuery=(0,_utils.isPropertyDefined)(config.analyticsConfig.emptyQuery)?config.analyticsConfig.emptyQuery:undefined;var searchRelevancy=config.analyticsConfig.enableSearchRelevancy;settings.enableSearchRelevancy=(0,_utils.isPropertyDefined)(searchRelevancy)?searchRelevancy:undefined;settings.suggestionAnalytics=(0,_utils.isPropertyDefined)(config.analyticsConfig.suggestionAnalytics)?config.analyticsConfig.suggestionAnalytics:undefined;settings.useCache=(0,_utils.isPropertyDefined)(config.analyticsConfig.useCache)?config.analyticsConfig.useCache:undefined;settings.queryParams=(0,_utils.isPropertyDefined)(config.analyticsConfig.queryParams)?config.analyticsConfig.queryParams:undefined;}orderOfQueries.forEach(function(component){dispatch((0,_misc.setLoading)(component,true));if(props[component]&&props[component].enableAI){dispatch((0,_misc.removeAIResponse)(component));}dispatch((0,_misc.setError)(component,null));});appbaseRef.setHeaders(_extends({},headers));if(isSuggestionsQuery&&searchComponentID){dispatch(loadPopularSuggestions(searchComponentID));}appbaseRef.reactiveSearch(query,settings,settings.queryParams).then(function(res){(0,_utils.handleResponse)({res:res,orderOfQueries:orderOfQueries,appendToHits:appendToHits,appendToAggs:appendToAggs,query:query,queryId:queryId},getState,dispatch);}).catch(function(err){(0,_utils.handleError)({orderOfQueries:orderOfQueries,error:err,queryId:queryId},getState,dispatch);});};}var requestStack=[];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];var metaOptions=arguments[4];var requestId=arguments[5];return function(dispatch,getState){var _getState3=getState(),queryLog=_getState3.queryLog,config=_getState3.config,mapData=_getState3.mapData,watchMan=_getState3.watchMan,queryListener=_getState3.queryListener,props=_getState3.props,internalValues=_getState3.internalValues,lock=_getState3.lock,dependencyTree=_getState3.dependencyTree,queryList=_getState3.queryList,queryOptions=_getState3.queryOptions;var lockTime=config.initialQueriesSyncTime||100;var initialTimestamp=config.initialTimestamp;var queryId=requestId||new Date().getTime();if(config.queryLockConfig instanceof Object){lockTime=config.queryLockConfig.lockTime;initialTimestamp=config.queryLockConfig.initialTimestamp;}var componentList=[componentId];var finalQuery=[];var appbaseQuery={};var orderOfQueries=[];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;if(!queryObj&&!options){return;}var value=void 0;var isInternalComponent=componentId.endsWith('__internal');var mainComponentProps=props[componentId];if(isInternalComponent&&mainComponentProps&&(0,_transform.isSearchComponent)(mainComponentProps.componentType)){value=internalValues[componentId]&&internalValues[componentId].value;}var query=(0,_transform.getRSQuery)(component,(0,_transform.extractPropsFromState)(getState(),component,_extends({},value?{value:value}:null,metaOptions?_extends({from:metaOptions.from},value&&metaOptions.enableAI===true?{enableAI:true,type:'search'}:{}):null)));if(query&&!!Object.keys(query).length){var currentQuery=query;var oldQuery=queryLog[component];var componentProps=props[component];var dependentQueries=(0,_transform.getDependentQueries)(getState(),component,orderOfQueries);var queryToLog=_extends(_defineProperty({},component,currentQuery),Object.keys(dependentQueries).reduce(function(acc,q){return _extends({},acc,_defineProperty({},q,_extends({},dependentQueries[q],{execute:false},dependentQueries[q].type===_constants.queryTypes.suggestion?{type:'search'}:{})));},{}));var queryType=_transform.componentToTypeMap[componentProps&&componentProps.componentType];if([_constants.queryTypes.range,_constants.queryTypes.term].includes(queryType)){var _value=currentQuery.value,rest=_objectWithoutProperties(currentQuery,['value']);queryToLog=_extends(_defineProperty({},component,rest),Object.keys(dependentQueries).reduce(function(acc,q){return _extends({},acc,_defineProperty({},q,_extends({},dependentQueries[q],{execute:false},dependentQueries[q].type===_constants.queryTypes.suggestion?{type:'search'}:{})));},{}));}if(mustExecuteMapQuery||!(0,_helper.compareQueries)(queryToLog,oldQuery,false)){orderOfQueries=[].concat(_toConsumableArray(orderOfQueries),[component]);var isMapComponent=Object.keys(mapData).includes(component);if(isMapComponent){dispatch((0,_misc.setLastUsedAppbaseQuery)(_defineProperty({},component,{queryId:queryId})));}dispatch((0,_misc.logQuery)(component,queryToLog));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.compareQueries)(combinedLog[component],currentQuery))return;dispatch((0,_misc.logCombinedQuery)(component,currentQuery));}(0,_utils.executeQueryListener)(queryListener[component],oldQuery,currentQuery);if(query){appbaseQuery=_extends({},appbaseQuery,_defineProperty({},component,query),(0,_transform.getDependentQueries)(getState(),component,orderOfQueries));}if(isMapComponent){var internalComponent=(0,_transform2.getInternalComponentID)(component);var internalQuery=(0,_transform.getRSQuery)(internalComponent,(0,_transform.extractPropsFromState)(getState(),internalComponent,metaOptions?{from:metaOptions.from}:null));if(internalQuery){appbaseQuery[internalComponent]=_extends({},internalQuery,{execute:false});}}}}});finalQuery=Object.keys(appbaseQuery).map(function(component){return appbaseQuery[component];});if(finalQuery.length){var suggestionsComponents=[_constants.componentTypes.dataSearch,_constants.componentTypes.categorySearch];var isInternalComponent=componentId.endsWith('__internal');var isSuggestionsQuery=isInternalComponent&&suggestionsComponents.indexOf(componentType)!==-1;var currentTime=new Date().getTime();if(currentTime-initialTimestamp<lockTime){if(!lock||config.queryLockConfig){setTimeout(function(){var finalOrderOfQueries=[];var finalIsSuggestionsQuery=false;var finalSearchComponentID='';var orderOfQueriesMap={};var processedQueriesMap={};var queryExecutionMap={};requestStack.forEach(function(request){if(!finalIsSuggestionsQuery){finalIsSuggestionsQuery=request.isSuggestionsQuery;}if(!finalSearchComponentID){finalSearchComponentID=request.searchComponentID;}if(Array.isArray(request.query)){request.query.forEach(function(query){if(query.execute){queryExecutionMap[query.id]=query.execute;}var newQuery=query;if(queryExecutionMap[query.id]){newQuery.execute=true;}if(processedQueriesMap[query.id]&&processedQueriesMap[query.id].type===_constants.queryTypes.suggestion&&newQuery.type!==_constants.queryTypes.suggestion){processedQueriesMap[query.id+'__suggestion_type']=_extends({},processedQueriesMap[query.id]);processedQueriesMap[query.id]=_extends({},newQuery,{execute:false});return;}processedQueriesMap[query.id]=newQuery;});}if(Array.isArray(request.orderOfQueries)){request.orderOfQueries.forEach(function(query){if(!orderOfQueriesMap[query.id]){finalOrderOfQueries=[query].concat(_toConsumableArray(finalOrderOfQueries));}else{orderOfQueriesMap[query.id]=true;}});}});var finalCombinedQuery=Object.values(processedQueriesMap);if(finalCombinedQuery.length){dispatch(appbaseSearch({query:finalCombinedQuery,orderOfQueries:finalOrderOfQueries,isSuggestionsQuery:finalIsSuggestionsQuery,searchComponentID:finalSearchComponentID}));}requestStack=[];dispatch((0,_utils.updateStoreConfig)({queryLockConfig:undefined}));},lockTime);}dispatch((0,_utils.updateStoreConfig)({lock:true}));requestStack.push({query:finalQuery,orderOfQueries:orderOfQueries,isSuggestionsQuery:isSuggestionsQuery,searchComponentID:componentId});}else{dispatch(appbaseSearch({queryId:queryId,query:finalQuery,orderOfQueries:orderOfQueries,isSuggestionsQuery:isSuggestionsQuery,searchComponentID:componentId}));}}};}function setQueryOptions(component,queryOptions){var execute=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return function(dispatch){dispatch((0,_misc.updateQueryOptions)(component,queryOptions));if(execute){dispatch(executeQuery(component,true));}};}function updateQuery(_ref2){var componentId=_ref2.componentId,query=_ref2.query,value=_ref2.value,_ref2$label=_ref2.label,label=_ref2$label===undefined?null:_ref2$label,_ref2$showFilter=_ref2.showFilter,showFilter=_ref2$showFilter===undefined?true:_ref2$showFilter,_ref2$URLParams=_ref2.URLParams,URLParams=_ref2$URLParams===undefined?false:_ref2$URLParams,_ref2$componentType=_ref2.componentType,componentType=_ref2$componentType===undefined?null:_ref2$componentType,_ref2$category=_ref2.category,category=_ref2$category===undefined?null:_ref2$category,_ref2$meta=_ref2.meta,meta=_ref2$meta===undefined?{}:_ref2$meta;var execute=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var shouldSetInternalValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return function(dispatch){var queryToDispatch=query;if(query&&query.query){queryToDispatch=query.query;}if(!componentId.endsWith('__internal')){dispatch((0,_value2.setValue)(componentId,value,label,showFilter,URLParams,componentType,category,meta));if(shouldSetInternalValue){if(componentType===_constants.componentTypes.dynamicRangeSlider){dispatch((0,_value2.setInternalValue)((0,_transform.getHistogramComponentID)(componentId),value,componentType,category,meta));}else{dispatch((0,_value2.setInternalValue)(componentId+'__internal',value,componentType,category,meta));}}}else{dispatch((0,_value2.setInternalValue)(componentId,value,componentType,category,meta));}dispatch((0,_misc.setQuery)(componentId,queryToDispatch));if(execute){dispatch(executeQuery(componentId,true,false,componentType,componentType===_constants.componentTypes.searchBox&&meta&&typeof meta.enableAI==='boolean'?{enableAI:meta.enableAI}:undefined));}};}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 appbaseQuery={};var componentProps=store.props[component]||{};var compositeAggregationField=componentProps.aggregationField;var queryType=_transform.componentToTypeMap[componentProps.componentType];if(queryType===_constants.queryTypes.term){compositeAggregationField=componentProps.dataField;}var query=(0,_transform.getRSQuery)(component,(0,_transform.extractPropsFromState)(store,component,{from:options.from,after:store.aggregations[component]&&store.aggregations[component][compositeAggregationField]&&store.aggregations[component][compositeAggregationField].after_key||undefined}));appbaseQuery=_extends(_defineProperty({},component,query),(0,_transform.getDependentQueries)(getState(),component,[]));if((0,_helper.compareQueries)(queryLog[component],appbaseQuery))return;dispatch((0,_misc.logQuery)(component,appbaseQuery));var finalQuery=Object.keys(appbaseQuery).map(function(c){return appbaseQuery[c];});dispatch(appbaseSearch({query:finalQuery,orderOfQueries:[component],appendToHits:appendToHits,appendToAggs:appendToAggs}));};}function loadDataToExport(componentId){var deepPaginationCursor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var totalResults=arguments[2];var data=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[];return function(dispatch,getState){var _getState5=getState(),appbaseRef=_getState5.appbaseRef,lastUsedAppbaseQuery=_getState5.lastUsedAppbaseQuery;var queryFromStore=lastUsedAppbaseQuery[componentId];if(queryFromStore){var query=queryFromStore.map(function(queryItem){if(queryItem.id===componentId){var finalQueryItem=_extends({},queryItem,{deepPaginationConfig:{cursor:deepPaginationCursor},deepPagination:true,size:totalResults<1000?totalResults:1000,sortField:'_id',sortBy:'asc'});delete finalQueryItem.from;return finalQueryItem;}return queryItem;});if(totalResults&&Array.isArray(data)&&totalResults<=data.length){return data;}return appbaseRef.reactiveSearchv3(query).then(function(res){var newDataChunk=res[componentId].hits.hits;if(!Array.isArray(newDataChunk)||newDataChunk.length===0){return data;}return dispatch(loadDataToExport(componentId,newDataChunk[newDataChunk.length-1]._id,res[componentId].hits.total.value,[].concat(_toConsumableArray(data),_toConsumableArray(newDataChunk))));}).catch(function(err){console.error('Error fetching data to export! ',err);});}return console.error('Error fetching data to export!');};}function processJSONResponse(dispatch,componentId,AIAnswerKey,localCache,parsedRes){var meta=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};try{var finalResponse=_extends({},parsedRes);if(finalResponse.answer){finalResponse.answer.role=_constants.AI_ROLES.ASSISTANT;}dispatch((0,_misc.setAIResponse)(componentId,{meta:meta,sessionId:AIAnswerKey,messages:[].concat(_toConsumableArray(localCache&&localCache.messages||[]),_toConsumableArray(finalResponse.question?[{content:finalResponse.question,role:_constants.AI_ROLES.USER}]:[]),_toConsumableArray(finalResponse.answer?[{content:finalResponse.answer.text,role:_constants.AI_ROLES.ASSISTANT}]:[])),response:_extends({},finalResponse)}));}catch(e){(0,_helper.getStackTrace)();dispatch((0,_misc.setAIResponseError)(componentId,e,{sessionId:AIAnswerKey}));}}function processStream(res,dispatch,componentId,AIAnswerKey,localCache){var meta=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};var question=arguments[6];var metaInfoPromise=arguments[7];var reader=res.body.getReader();var decoder=new TextDecoder();var responseText='';var answerIndex=void 0;var questionMessage=question?{content:question,role:_constants.AI_ROLES.USER}:null;var updateMessage=function updateMessage(content){responseText+=content;var messages=[].concat(_toConsumableArray(localCache&&localCache.messages||[]));if(questionMessage&&messages.findIndex(function(msg){return msg.content===questionMessage.content&&msg.role===questionMessage.role;})===-1){messages.push(questionMessage);}if(answerIndex===undefined){answerIndex=messages.length;messages.push({content:responseText,role:_constants.AI_ROLES.ASSISTANT});}else{messages[answerIndex]={content:responseText,role:_constants.AI_ROLES.ASSISTANT};}dispatch((0,_misc.setAIResponseDelayed)(componentId,{meta:meta,sessionId:AIAnswerKey,isTyping:true,messages:messages,response:{answer:{text:responseText,role:_constants.AI_ROLES.ASSISTANT}}}));};function readStream(){reader.read().then(function(_ref3){var value=_ref3.value,done=_ref3.done;if(done){reader.releaseLock();return;}var chunk=decoder.decode(value,{stream:true});var lines=chunk.split('\n');var shouldStop=false;for(var i=0;i<lines.length;i++){var line=lines[i];if(line.startsWith('data: ')){var content=line.slice(6);if(content==='[DONE]'){shouldStop=true;if(Promise.resolve(metaInfoPromise)===metaInfoPromise){metaInfoPromise.then(function(resMeta){return resMeta.json();}).then(function(parsedRes){dispatch((0,_misc.setAIResponseDelayed)(componentId,{meta:meta,sessionId:AIAnswerKey,response:_extends({},parsedRes),isTyping:false}));}).catch(function(e){console.error('Error fetching meta details for sessionId: '+AIAnswerKey,e);});}break;}updateMessage(content);}}if(shouldStop){reader.releaseLock();}else{readStream();}}).catch(function(e){reader.releaseLock();dispatch((0,_misc.setAIResponseError)(componentId,e,{sessionId:AIAnswerKey}));});}readStream();}var cancellationTokens={};function fetchAIResponse(AIAnswerKey,componentId,question){var meta=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var shouldFetchMetaInfoUsingGET=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;return function(dispatch,getState){var isPostRequest=!!question;dispatch((0,_misc.setAIResponseLoading)(componentId,true));var _getState6=getState(),_getState6$config=_getState6.config,url=_getState6$config.url,configCredentials=_getState6$config.credentials,endpoint=_getState6$config.endpoint;var regex=/https:\/\/[^/]+/;var urlObj=new URL(url.match(regex)[0]);var credentials=configCredentials;if(urlObj.username&&urlObj.password){credentials=urlObj.username+':'+urlObj.password;urlObj.username='';urlObj.password='';}var fetchUrl=urlObj.toString()+'_ai/'+AIAnswerKey;var ssefetchUrl=fetchUrl+'/sse';var headers=new Headers();if(credentials){var encodedCredentials=btoa(credentials);headers.append('Authorization','Basic '+encodedCredentials);}else if(endpoint&&endpoint.headers&&endpoint.headers.Authorization){headers.append('Authorization',endpoint.headers.Authorization);}var method=isPostRequest?'POST':'GET';var localCache=((0,_helper.getObjectFromLocalStorage)(_constants.AI_LOCAL_CACHE_KEY)||{})[componentId];var requestOptions={headers:headers,method:method,body:isPostRequest?JSON.stringify({question:question}):undefined};var attempt=1;var maxAttempts=2;var doFetch=function doFetch(){var controller=new AbortController();if(cancellationTokens[componentId]){cancellationTokens[componentId].abort();}cancellationTokens[componentId]=controller;fetch(ssefetchUrl,_extends({},requestOptions,{signal:controller.signal})).then(function(res){if(!res.ok){if(attempt<maxAttempts){attempt++;setTimeout(doFetch,1000);return;}}var contentType=res.headers.get('content-type');if(contentType&&contentType.startsWith('application/json')){res.json().then(function(parsedRes){if(parsedRes.error){dispatch((0,_misc.setAIResponseError)(componentId,parsedRes.error));}else{processJSONResponse(dispatch,componentId,AIAnswerKey,localCache,parsedRes,meta);}});}else{var metaInfoPromise=void 0;if(shouldFetchMetaInfoUsingGET){metaInfoPromise=fetch(fetchUrl,requestOptions);}processStream(res,dispatch,componentId,AIAnswerKey,localCache,meta,question,metaInfoPromise);}}).catch(function(e){if(e.name==='AbortError'){return;}dispatch((0,_misc.setAIResponseError)(componentId,e,{sessionId:AIAnswerKey}));});};doFetch();};} | ||
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.loadPopularSuggestions=loadPopularSuggestions;exports.executeQuery=executeQuery;exports.setQueryOptions=setQueryOptions;exports.updateQuery=updateQuery;exports.loadMore=loadMore;exports.loadDataToExport=loadDataToExport;exports.fetchAIResponse=fetchAIResponse;var _value2=require('./value');var _utils=require('./utils');var _misc=require('./misc');var _helper=require('../utils/helper');var _maps=require('./maps');var _constants=require('../utils/constants');var _transform=require('../utils/transform');var _transform2=require('../../lib/utils/transform');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return 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 loadPopularSuggestions(componentId){return function(dispatch,getState){var _getState=getState(),config=_getState.config,appbaseRef=_getState.appbaseRef,props=_getState.props,internalValues=_getState.internalValues;var componentProps=props[componentId]||{};var internalValue=internalValues[componentId];var value=internalValue&&internalValue.value||'';if(componentProps.enablePopularSuggestions){if(config.mongodb){dispatch((0,_misc.setDefaultPopularSuggestions)([],componentId.split('__internal')[0]));return;}var suggQuery=(0,_utils.getSuggestionQuery)(getState,componentId);appbaseRef.getQuerySuggestions(suggQuery).then(function(suggestions){var querySuggestion=suggestions[(0,_utils.getQuerySuggestionsId)(componentId)];if(value){dispatch((0,_misc.setPopularSuggestions)(querySuggestion&&querySuggestion.hits&&querySuggestion.hits.hits,componentId.split('__internal')[0]));}else{dispatch((0,_misc.setDefaultPopularSuggestions)(querySuggestion&&querySuggestion.hits&&querySuggestion.hits.hits,componentId.split('__internal')[0]));}}).catch(function(e){(0,_utils.handleError)({orderOfQueries:[componentId],error:e},getState,dispatch);});}};}function appbaseSearch(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},queryId=_ref.queryId,query=_ref.query,orderOfQueries=_ref.orderOfQueries,_ref$appendToHits=_ref.appendToHits,appendToHits=_ref$appendToHits===undefined?false:_ref$appendToHits,_ref$isSuggestionsQue=_ref.isSuggestionsQuery,isSuggestionsQuery=_ref$isSuggestionsQue===undefined?false:_ref$isSuggestionsQue,searchComponentID=_ref.searchComponentID,_ref$appendToAggs=_ref.appendToAggs,appendToAggs=_ref$appendToAggs===undefined?false:_ref$appendToAggs;return function(dispatch,getState){var _getState2=getState(),appbaseRef=_getState2.appbaseRef,config=_getState2.config,headers=_getState2.headers,props=_getState2.props;var isAnalyticsEnabled=false;if(config){if((0,_utils.isPropertyDefined)(config.analytics)){isAnalyticsEnabled=config.analytics;}else if(config.analyticsConfig){if((0,_utils.isPropertyDefined)(config.analyticsConfig.recordAnalytics)){isAnalyticsEnabled=config.analyticsConfig.recordAnalytics;}else if((0,_utils.isPropertyDefined)(config.analyticsConfig.analytics)){isAnalyticsEnabled=config.analyticsConfig.analytics;}}}var settings={recordAnalytics:isAnalyticsEnabled};if(config.analyticsConfig){settings.userId=(0,_utils.isPropertyDefined)(config.analyticsConfig.userId)?config.analyticsConfig.userId:undefined;settings.enableQueryRules=(0,_utils.isPropertyDefined)(config.analyticsConfig.enableQueryRules)?config.analyticsConfig.enableQueryRules:undefined;settings.customEvents=(0,_utils.isPropertyDefined)(config.analyticsConfig.customEvents)?config.analyticsConfig.customEvents:undefined;settings.emptyQuery=(0,_utils.isPropertyDefined)(config.analyticsConfig.emptyQuery)?config.analyticsConfig.emptyQuery:undefined;var searchRelevancy=config.analyticsConfig.enableSearchRelevancy;settings.enableSearchRelevancy=(0,_utils.isPropertyDefined)(searchRelevancy)?searchRelevancy:undefined;settings.suggestionAnalytics=(0,_utils.isPropertyDefined)(config.analyticsConfig.suggestionAnalytics)?config.analyticsConfig.suggestionAnalytics:undefined;settings.useCache=(0,_utils.isPropertyDefined)(config.analyticsConfig.useCache)?config.analyticsConfig.useCache:undefined;settings.queryParams=(0,_utils.isPropertyDefined)(config.analyticsConfig.queryParams)?config.analyticsConfig.queryParams:undefined;}orderOfQueries.forEach(function(component){dispatch((0,_misc.setLoading)(component,true));if(props[component]&&props[component].enableAI){dispatch((0,_misc.removeAIResponse)(component));}dispatch((0,_misc.setError)(component,null));});appbaseRef.setHeaders(_extends({},headers));if(isSuggestionsQuery&&searchComponentID){dispatch(loadPopularSuggestions(searchComponentID));}appbaseRef.reactiveSearch(query,settings,settings.queryParams).then(function(res){(0,_utils.handleResponse)({res:res,orderOfQueries:orderOfQueries,appendToHits:appendToHits,appendToAggs:appendToAggs,query:query,queryId:queryId},getState,dispatch);}).catch(function(err){(0,_utils.handleError)({orderOfQueries:orderOfQueries,error:err,queryId:queryId},getState,dispatch);});};}var requestStack=[];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];var metaOptions=arguments[4];var requestId=arguments[5];return function(dispatch,getState){var _getState3=getState(),queryLog=_getState3.queryLog,config=_getState3.config,mapData=_getState3.mapData,watchMan=_getState3.watchMan,queryListener=_getState3.queryListener,props=_getState3.props,internalValues=_getState3.internalValues,lock=_getState3.lock,dependencyTree=_getState3.dependencyTree,queryList=_getState3.queryList,queryOptions=_getState3.queryOptions;var lockTime=config.initialQueriesSyncTime||100;var initialTimestamp=config.initialTimestamp;var queryId=requestId||new Date().getTime();if(config.queryLockConfig instanceof Object){lockTime=config.queryLockConfig.lockTime;initialTimestamp=config.queryLockConfig.initialTimestamp;}var componentList=[componentId];var finalQuery=[];var appbaseQuery={};var orderOfQueries=[];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;if(!queryObj&&!options){return;}var value=void 0;var isInternalComponent=componentId.endsWith('__internal');var mainComponentProps=props[componentId];if(isInternalComponent&&mainComponentProps&&(0,_transform.isSearchComponent)(mainComponentProps.componentType)){value=internalValues[componentId]&&internalValues[componentId].value;}var query=(0,_transform.getRSQuery)(component,(0,_transform.extractPropsFromState)(getState(),component,_extends({},value?{value:value}:null,metaOptions?_extends({from:metaOptions.from},value&&metaOptions.enableAI===true?{enableAI:true,type:'search'}:{}):null)));if(query&&!!Object.keys(query).length){var currentQuery=query;var oldQuery=queryLog[component];var componentProps=props[component];var dependentQueries=(0,_transform.getDependentQueries)(getState(),component,orderOfQueries);var queryToLog=_extends(_defineProperty({},component,currentQuery),Object.keys(dependentQueries).reduce(function(acc,q){return _extends({},acc,_defineProperty({},q,_extends({},dependentQueries[q],{execute:false},dependentQueries[q].type===_constants.queryTypes.suggestion?{type:'search'}:{})));},{}));var queryType=_transform.componentToTypeMap[componentProps&&componentProps.componentType];if([_constants.queryTypes.range,_constants.queryTypes.term].includes(queryType)){var _value=currentQuery.value,rest=_objectWithoutProperties(currentQuery,['value']);queryToLog=_extends(_defineProperty({},component,rest),Object.keys(dependentQueries).reduce(function(acc,q){return _extends({},acc,_defineProperty({},q,_extends({},dependentQueries[q],{execute:false},dependentQueries[q].type===_constants.queryTypes.suggestion?{type:'search'}:{})));},{}));}if(mustExecuteMapQuery||!(0,_helper.compareQueries)(queryToLog,oldQuery,false)){orderOfQueries=[].concat(_toConsumableArray(orderOfQueries),[component]);var isMapComponent=Object.keys(mapData).includes(component);if(isMapComponent){dispatch((0,_misc.setLastUsedAppbaseQuery)(_defineProperty({},component,{queryId:queryId})));}dispatch((0,_misc.logQuery)(component,queryToLog));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.compareQueries)(combinedLog[component],currentQuery))return;dispatch((0,_misc.logCombinedQuery)(component,currentQuery));}(0,_utils.executeQueryListener)(queryListener[component],oldQuery,currentQuery);if(query){appbaseQuery=_extends({},appbaseQuery,_defineProperty({},component,query),(0,_transform.getDependentQueries)(getState(),component,orderOfQueries));}if(isMapComponent){var internalComponent=(0,_transform2.getInternalComponentID)(component);var internalQuery=(0,_transform.getRSQuery)(internalComponent,(0,_transform.extractPropsFromState)(getState(),internalComponent,metaOptions?{from:metaOptions.from}:null));if(internalQuery){appbaseQuery[internalComponent]=_extends({},internalQuery,{execute:false});}}}}});finalQuery=Object.keys(appbaseQuery).map(function(component){return appbaseQuery[component];});if(finalQuery.length){var suggestionsComponents=[_constants.componentTypes.dataSearch,_constants.componentTypes.categorySearch];var isInternalComponent=componentId.endsWith('__internal');var isSuggestionsQuery=isInternalComponent&&suggestionsComponents.indexOf(componentType)!==-1;var currentTime=new Date().getTime();if(currentTime-initialTimestamp<lockTime){if(!lock||config.queryLockConfig){setTimeout(function(){var finalOrderOfQueries=[];var finalIsSuggestionsQuery=false;var finalSearchComponentID='';var orderOfQueriesMap={};var processedQueriesMap={};var queryExecutionMap={};requestStack.forEach(function(request){if(!finalIsSuggestionsQuery){finalIsSuggestionsQuery=request.isSuggestionsQuery;}if(!finalSearchComponentID){finalSearchComponentID=request.searchComponentID;}if(Array.isArray(request.query)){request.query.forEach(function(query){if(query.execute){queryExecutionMap[query.id]=query.execute;}var newQuery=query;if(queryExecutionMap[query.id]){newQuery.execute=true;}if(processedQueriesMap[query.id]&&processedQueriesMap[query.id].type===_constants.queryTypes.suggestion&&newQuery.type!==_constants.queryTypes.suggestion){processedQueriesMap[query.id+'__suggestion_type']=_extends({},processedQueriesMap[query.id]);processedQueriesMap[query.id]=_extends({},newQuery,{execute:false});return;}processedQueriesMap[query.id]=newQuery;});}if(Array.isArray(request.orderOfQueries)){request.orderOfQueries.forEach(function(query){if(!orderOfQueriesMap[query.id]){finalOrderOfQueries=[query].concat(_toConsumableArray(finalOrderOfQueries));}else{orderOfQueriesMap[query.id]=true;}});}});var finalCombinedQuery=Object.values(processedQueriesMap);if(finalCombinedQuery.length){dispatch(appbaseSearch({query:finalCombinedQuery,orderOfQueries:finalOrderOfQueries,isSuggestionsQuery:finalIsSuggestionsQuery,searchComponentID:finalSearchComponentID}));}requestStack=[];dispatch((0,_utils.updateStoreConfig)({queryLockConfig:undefined}));},lockTime);}dispatch((0,_utils.updateStoreConfig)({lock:true}));requestStack.push({query:finalQuery,orderOfQueries:orderOfQueries,isSuggestionsQuery:isSuggestionsQuery,searchComponentID:componentId});}else{dispatch(appbaseSearch({queryId:queryId,query:finalQuery,orderOfQueries:orderOfQueries,isSuggestionsQuery:isSuggestionsQuery,searchComponentID:componentId}));}}};}function setQueryOptions(component,queryOptions){var execute=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return function(dispatch){dispatch((0,_misc.updateQueryOptions)(component,queryOptions));if(execute){dispatch(executeQuery(component,true));}};}function updateQuery(_ref2){var componentId=_ref2.componentId,query=_ref2.query,value=_ref2.value,_ref2$label=_ref2.label,label=_ref2$label===undefined?null:_ref2$label,_ref2$showFilter=_ref2.showFilter,showFilter=_ref2$showFilter===undefined?true:_ref2$showFilter,_ref2$URLParams=_ref2.URLParams,URLParams=_ref2$URLParams===undefined?false:_ref2$URLParams,_ref2$componentType=_ref2.componentType,componentType=_ref2$componentType===undefined?null:_ref2$componentType,_ref2$category=_ref2.category,category=_ref2$category===undefined?null:_ref2$category,_ref2$meta=_ref2.meta,meta=_ref2$meta===undefined?{}:_ref2$meta;var execute=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var shouldSetInternalValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return function(dispatch){var queryToDispatch=query;if(query&&query.query){queryToDispatch=query.query;}if(!componentId.endsWith('__internal')){dispatch((0,_value2.setValue)(componentId,value,label,showFilter,URLParams,componentType,category,meta));if(shouldSetInternalValue){if(componentType===_constants.componentTypes.dynamicRangeSlider){dispatch((0,_value2.setInternalValue)((0,_transform.getHistogramComponentID)(componentId),value,componentType,category,meta));}else{dispatch((0,_value2.setInternalValue)(componentId+'__internal',value,componentType,category,meta));}}}else{dispatch((0,_value2.setInternalValue)(componentId,value,componentType,category,meta));}dispatch((0,_misc.setQuery)(componentId,queryToDispatch));if(execute){dispatch(executeQuery(componentId,true,false,componentType,componentType===_constants.componentTypes.searchBox&&meta&&typeof meta.enableAI==='boolean'?{enableAI:meta.enableAI}:undefined));}};}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 appbaseQuery={};var componentProps=store.props[component]||{};var compositeAggregationField=componentProps.aggregationField;var queryType=_transform.componentToTypeMap[componentProps.componentType];if(queryType===_constants.queryTypes.term){compositeAggregationField=componentProps.dataField;}var query=(0,_transform.getRSQuery)(component,(0,_transform.extractPropsFromState)(store,component,{from:options.from,after:store.aggregations[component]&&store.aggregations[component][compositeAggregationField]&&store.aggregations[component][compositeAggregationField].after_key||undefined}));appbaseQuery=_extends(_defineProperty({},component,query),(0,_transform.getDependentQueries)(getState(),component,[]));if((0,_helper.compareQueries)(queryLog[component],appbaseQuery))return;dispatch((0,_misc.logQuery)(component,appbaseQuery));var finalQuery=Object.keys(appbaseQuery).map(function(c){return appbaseQuery[c];});dispatch(appbaseSearch({query:finalQuery,orderOfQueries:[component],appendToHits:appendToHits,appendToAggs:appendToAggs}));};}function loadDataToExport(componentId){var deepPaginationCursor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var totalResults=arguments[2];var data=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[];return function(dispatch,getState){var _getState5=getState(),appbaseRef=_getState5.appbaseRef,lastUsedAppbaseQuery=_getState5.lastUsedAppbaseQuery;var queryFromStore=lastUsedAppbaseQuery[componentId];if(queryFromStore){var query=queryFromStore.map(function(queryItem){if(queryItem.id===componentId){var finalQueryItem=_extends({},queryItem,{deepPaginationConfig:{cursor:deepPaginationCursor},deepPagination:true,size:totalResults<1000?totalResults:1000,sortField:'_id',sortBy:'asc'});delete finalQueryItem.from;return finalQueryItem;}return queryItem;});if(totalResults&&Array.isArray(data)&&totalResults<=data.length){return data;}return appbaseRef.reactiveSearchv3(query).then(function(res){var newDataChunk=res[componentId].hits.hits;if(!Array.isArray(newDataChunk)||newDataChunk.length===0){return data;}return dispatch(loadDataToExport(componentId,newDataChunk[newDataChunk.length-1]._id,res[componentId].hits.total.value,[].concat(_toConsumableArray(data),_toConsumableArray(newDataChunk))));}).catch(function(err){console.error('Error fetching data to export! ',err);});}return console.error('Error fetching data to export!');};}function processJSONResponse(dispatch,componentId,AIAnswerKey,localCache,parsedRes){var meta=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};try{var finalResponse=_extends({},parsedRes);if(finalResponse.answer){finalResponse.answer.role=_constants.AI_ROLES.ASSISTANT;}dispatch((0,_misc.setAIResponse)(componentId,{meta:meta,sessionId:AIAnswerKey,messages:[].concat(_toConsumableArray(localCache&&localCache.messages||[]),_toConsumableArray(finalResponse.question?[{content:finalResponse.question,role:_constants.AI_ROLES.USER}]:[]),_toConsumableArray(finalResponse.answer?[{content:finalResponse.answer.text,role:_constants.AI_ROLES.ASSISTANT}]:[])),response:_extends({},finalResponse)}));}catch(e){(0,_helper.getStackTrace)();dispatch((0,_misc.setAIResponseError)(componentId,e,{sessionId:AIAnswerKey}));}}function processStream(res,dispatch,componentId,AIAnswerKey,localCache){var meta=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};var question=arguments[6];var metaInfoPromise=arguments[7];var reader=res.body.getReader();var decoder=new TextDecoder();var responseText='';var answerIndex=void 0;var questionMessage=question?{content:question,role:_constants.AI_ROLES.USER}:null;var updateMessage=function updateMessage(content){responseText+=content;var messages=[].concat(_toConsumableArray(localCache&&localCache.messages||[]));if(questionMessage&&messages.findIndex(function(msg){return msg.content===questionMessage.content&&msg.role===questionMessage.role;})===-1){messages.push(questionMessage);}if(answerIndex===undefined){answerIndex=messages.length;messages.push({content:responseText,role:_constants.AI_ROLES.ASSISTANT});}else{messages[answerIndex]={content:responseText,role:_constants.AI_ROLES.ASSISTANT};}dispatch((0,_misc.setAIResponseDelayed)(componentId,{meta:meta,sessionId:AIAnswerKey,isTyping:true,messages:messages,response:{answer:{text:responseText,role:_constants.AI_ROLES.ASSISTANT}}}));};function readStream(){reader.read().then(function(_ref3){var value=_ref3.value,done=_ref3.done;if(done){reader.releaseLock();return;}var chunk=decoder.decode(value,{stream:true});var regex=/\n\n(?=data:)/;var lines=chunk.split(regex);var shouldStop=false;for(var i=0;i<lines.length;i++){var line=lines[i];if(line.startsWith('data: ')){var content=line.slice(6);if(content==='[DONE]\n\n'){shouldStop=true;if(Promise.resolve(metaInfoPromise)===metaInfoPromise){metaInfoPromise.then(function(resMeta){return resMeta.json();}).then(function(parsedRes){dispatch((0,_misc.setAIResponseDelayed)(componentId,{meta:meta,sessionId:AIAnswerKey,response:_extends({},parsedRes),isTyping:false}));}).catch(function(e){console.error('Error fetching meta details for sessionId: '+AIAnswerKey,e);});}break;}updateMessage(content);}}if(shouldStop){reader.releaseLock();}else{readStream();}}).catch(function(e){reader.releaseLock();dispatch((0,_misc.setAIResponseError)(componentId,e,{sessionId:AIAnswerKey}));});}readStream();}var cancellationTokens={};function fetchAIResponse(AIAnswerKey,componentId,question){var meta=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var shouldFetchMetaInfoUsingGET=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;return function(dispatch,getState){var isPostRequest=!!question;dispatch((0,_misc.setAIResponseLoading)(componentId,true));var _getState6=getState(),_getState6$config=_getState6.config,url=_getState6$config.url,configCredentials=_getState6$config.credentials,endpoint=_getState6$config.endpoint;var regex=/https:\/\/[^/]+/;var urlObj=new URL(url.match(regex)[0]);var credentials=configCredentials;if(urlObj.username&&urlObj.password){credentials=urlObj.username+':'+urlObj.password;urlObj.username='';urlObj.password='';}var fetchUrl=urlObj.toString()+'_ai/'+AIAnswerKey;var ssefetchUrl=fetchUrl+'/sse';var headers=new Headers();if(credentials){var encodedCredentials=btoa(credentials);headers.append('Authorization','Basic '+encodedCredentials);}else if(endpoint&&endpoint.headers&&endpoint.headers.Authorization){headers.append('Authorization',endpoint.headers.Authorization);}var method=isPostRequest?'POST':'GET';var localCache=((0,_helper.getObjectFromLocalStorage)(_constants.AI_LOCAL_CACHE_KEY)||{})[componentId];var requestOptions={headers:headers,method:method,body:isPostRequest?JSON.stringify({question:question}):undefined};var attempt=1;var maxAttempts=2;var doFetch=function doFetch(){var controller=new AbortController();if(cancellationTokens[componentId]){cancellationTokens[componentId].abort();}cancellationTokens[componentId]=controller;fetch(ssefetchUrl,_extends({},requestOptions,{signal:controller.signal})).then(function(res){if(!res.ok){if(attempt<maxAttempts){attempt++;setTimeout(doFetch,1000);return;}}var contentType=res.headers.get('content-type');if(contentType&&contentType.startsWith('application/json')){res.json().then(function(parsedRes){if(parsedRes.error){dispatch((0,_misc.setAIResponseError)(componentId,parsedRes.error));}else{processJSONResponse(dispatch,componentId,AIAnswerKey,localCache,parsedRes,meta);}});}else{var metaInfoPromise=void 0;if(shouldFetchMetaInfoUsingGET){metaInfoPromise=fetch(fetchUrl,requestOptions);}processStream(res,dispatch,componentId,AIAnswerKey,localCache,meta,question,metaInfoPromise);}}).catch(function(e){if(e.name==='AbortError'){return;}dispatch((0,_misc.setAIResponseError)(componentId,e,{sessionId:AIAnswerKey}));});};doFetch();};} |
{ | ||
"name": "@appbaseio/reactivecore", | ||
"version": "10.0.0-alpha.24", | ||
"version": "10.0.0-alpha.25", | ||
"description": "Core architecture of reactive UI libraries", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231213