@appbaseio/reactivesearch-vue 1.34.0 → 1.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1163,7 +1163,7 @@
1163
1163
  geo: 'geo',
1164
1164
  suggestion: 'suggestion'
1165
1165
  };
1166
- var validProps = exports.validProps = ['type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', 'unit', 'enablePopularSuggestions', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint', 'enableEndpointSuggestions'];
1166
+ var validProps = exports.validProps = ['type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'compoundClause', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', 'unit', 'enablePopularSuggestions', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint', 'enableEndpointSuggestions'];
1167
1167
  var CLEAR_ALL = exports.CLEAR_ALL = {
1168
1168
  NEVER: 'never',
1169
1169
  ALWAYS: 'always',
@@ -5959,9 +5959,14 @@
5959
5959
  return null;
5960
5960
  }
5961
5961
  var endpoint = void 0;
5962
+ var compoundClause = props.compoundClause;
5962
5963
  if (props.endpoint instanceof Object) {
5963
5964
  endpoint = props.endpoint;
5964
5965
  }
5966
+ if (compoundClause && !['filter', 'must'].includes(compoundClause)) {
5967
+ console.error("Reactivesearch Error: Invalid prop supplied - compoundClause. Prop can be one of ['filter', 'must']");
5968
+ compoundClause = undefined;
5969
+ }
5965
5970
  return _extends({
5966
5971
  id: componentId,
5967
5972
  type: queryType,
@@ -6000,7 +6005,8 @@
6000
6005
  queryString: props.queryString,
6001
6006
  distinctField: props.distinctField,
6002
6007
  distinctFieldConfig: props.distinctFieldConfig,
6003
- index: props.index
6008
+ index: props.index,
6009
+ compoundClause: compoundClause
6004
6010
  }, queryType === constants$1.queryTypes.suggestion ? _extends({
6005
6011
  enablePopularSuggestions: props.enablePopularSuggestions,
6006
6012
  enableEndpointSuggestions: props.enableEndpointSuggestions,
@@ -6932,6 +6938,17 @@
6932
6938
  var componentId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
6933
6939
  return componentId + '__suggestions';
6934
6940
  };
6941
+ function errorToObject(error) {
6942
+ if (!(error instanceof Error)) {
6943
+ return error;
6944
+ }
6945
+ var errorObject = {};
6946
+ var errorProperties = Object.getOwnPropertyNames(error);
6947
+ errorProperties.forEach(function (property) {
6948
+ errorObject[property] = error[property];
6949
+ });
6950
+ return errorObject;
6951
+ }
6935
6952
  var handleError = exports.handleError = function handleError() {
6936
6953
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
6937
6954
  _ref$orderOfQueries = _ref.orderOfQueries,
@@ -6940,19 +6957,20 @@
6940
6957
  error = _ref$error === undefined ? null : _ref$error;
6941
6958
  var getState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
6942
6959
  var dispatch = arguments[2];
6960
+ var processedError = errorToObject(error);
6943
6961
  var _getState2 = getState(),
6944
6962
  queryListener = _getState2.queryListener;
6945
6963
  try {
6946
- console.error(JSON.stringify(error));
6964
+ console.error(JSON.stringify(processedError));
6947
6965
  } catch (e) {
6948
- console.error(error);
6966
+ console.error(processedError);
6949
6967
  }
6950
6968
  orderOfQueries.forEach(function (component) {
6951
6969
  if (isComponentActive(getState, component)) {
6952
6970
  if (queryListener[component] && queryListener[component].onError) {
6953
- queryListener[component].onError(error);
6971
+ queryListener[component].onError(processedError);
6954
6972
  }
6955
- dispatch((0, misc.setError)(component, error));
6973
+ dispatch((0, misc.setError)(component, processedError));
6956
6974
  dispatch((0, misc.setLoading)(component, false));
6957
6975
  }
6958
6976
  });
@@ -14697,16 +14715,21 @@
14697
14715
  var transformedRequest = Object.assign({}, ts);
14698
14716
  var url = transformedRequest.url;
14699
14717
  delete transformedRequest.url;
14718
+ var controller = new AbortController();
14719
+ var signal = controller.signal;
14700
14720
  var fetchPromise = fetch$1(url || finalURL, Object.assign({}, transformedRequest, {
14701
14721
  // apply timestamp header for RS API
14702
14722
  headers: isRSAPI && !isMongoRequest ? Object.assign({}, transformedRequest.headers, {
14703
14723
  'x-timestamp': new Date().getTime()
14704
- }) : transformedRequest.headers
14724
+ }) : transformedRequest.headers,
14725
+ signal: signal // Attach the abort signal to the fetch request
14705
14726
  }));
14727
+
14706
14728
  var timeoutPromise = new Promise(function (_, rejectTP) {
14707
14729
  if (httpRequestTimeout > 0) {
14708
14730
  setTimeout(function () {
14709
14731
  rejectTP(new Error('Request timeout'));
14732
+ controller.abort();
14710
14733
  }, httpRequestTimeout);
14711
14734
  }
14712
14735
  });
@@ -34862,7 +34885,7 @@
34862
34885
  });
34863
34886
  }
34864
34887
 
34865
- var version = "1.34.0";
34888
+ var version = "1.34.1";
34866
34889
 
34867
34890
  var components$1 = [RLConnected, ResultCard, ResultList, ReactiveBase, DSConnected, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4];
34868
34891
  function install (Vue) {