@appbaseio/reactivesearch-vue 1.16.0-alpha.25 → 1.16.0-alpha.26
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.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +277 -59
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +4 -4
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/DataSearch.js +1 -1
- package/dist/cjs/{DropDown-d3c78c41.js → DropDown-323d7048.js} +1 -1
- package/dist/cjs/DynamicRangeSlider.js +1 -1
- package/dist/cjs/MultiDropdownList.js +2 -2
- package/dist/cjs/MultiList.js +1 -1
- package/dist/cjs/MultiRange.js +1 -1
- package/dist/cjs/{Pagination-d4dbfd5a.js → Pagination-0b9ec0fc.js} +1 -1
- package/dist/cjs/RangeInput.js +1 -1
- package/dist/cjs/RangeSlider.js +1 -1
- package/dist/cjs/ReactiveBase.js +13 -7
- package/dist/cjs/ReactiveComponent.js +12 -12
- package/dist/cjs/ReactiveGoogleMap.js +2 -2
- package/dist/cjs/ReactiveList.js +7 -2
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +1 -1
- package/dist/cjs/SingleDropdownList.js +2 -2
- package/dist/cjs/SingleList.js +1 -1
- package/dist/cjs/SingleRange.js +1 -1
- package/dist/cjs/ToggleButton.js +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/initReactivesearch.js +12 -12
- package/dist/cjs/install.js +3 -3
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-409348b0.js → vueTypes-829a5f2c.js} +5 -1
- package/dist/es/DataSearch.js +1 -1
- package/dist/es/{DropDown-8894cc22.js → DropDown-c4ef3292.js} +1 -1
- package/dist/es/DynamicRangeSlider.js +1 -1
- package/dist/es/MultiDropdownList.js +2 -2
- package/dist/es/MultiList.js +1 -1
- package/dist/es/MultiRange.js +1 -1
- package/dist/es/{Pagination-a2ab7fcb.js → Pagination-e8216949.js} +1 -1
- package/dist/es/RangeInput.js +1 -1
- package/dist/es/RangeSlider.js +1 -1
- package/dist/es/ReactiveBase.js +13 -7
- package/dist/es/ReactiveComponent.js +12 -12
- package/dist/es/ReactiveGoogleMap.js +2 -2
- package/dist/es/ReactiveList.js +7 -2
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +1 -1
- package/dist/es/SingleDropdownList.js +2 -2
- package/dist/es/SingleList.js +1 -1
- package/dist/es/SingleRange.js +1 -1
- package/dist/es/ToggleButton.js +1 -1
- package/dist/es/index.js +3 -3
- package/dist/es/initReactivesearch.js +12 -12
- package/dist/es/install.js +3 -3
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-a9b9d5c9.js → vueTypes-98819a12.js} +5 -1
- package/package.json +3 -3
|
@@ -8402,6 +8402,11 @@
|
|
|
8402
8402
|
var value = internalValue && internalValue.value || '';
|
|
8403
8403
|
|
|
8404
8404
|
if (isAppbaseEnabled && (componentProps.enablePopularSuggestions || componentProps.enableQuerySuggestions)) {
|
|
8405
|
+
if (config.mongodb) {
|
|
8406
|
+
dispatch((0, misc.setDefaultPopularSuggestions)([], componentId.split('__internal')[0]));
|
|
8407
|
+
return;
|
|
8408
|
+
}
|
|
8409
|
+
|
|
8405
8410
|
var suggQuery = (0, utils.getSuggestionQuery)(getState, componentId);
|
|
8406
8411
|
appbaseRef.getQuerySuggestions(suggQuery).then(function (suggestions) {
|
|
8407
8412
|
var querySuggestion = suggestions[(0, utils.getQuerySuggestionsId)(componentId)];
|
|
@@ -9132,7 +9137,8 @@
|
|
|
9132
9137
|
protocol = _getState$appbaseRef.protocol,
|
|
9133
9138
|
credentials = _getState$appbaseRef.credentials;
|
|
9134
9139
|
|
|
9135
|
-
var app = config.app
|
|
9140
|
+
var app = config.app,
|
|
9141
|
+
mongodb = config.mongodb;
|
|
9136
9142
|
var esURL = protocol + '://' + url;
|
|
9137
9143
|
var parsedURL = (esURL || '').replace(/\/+$/, '');
|
|
9138
9144
|
var requestOptions = {
|
|
@@ -9179,7 +9185,14 @@
|
|
|
9179
9185
|
}
|
|
9180
9186
|
}
|
|
9181
9187
|
|
|
9182
|
-
|
|
9188
|
+
if (mongodb) {
|
|
9189
|
+
return dispatch({
|
|
9190
|
+
type: constants.RECENT_SEARCHES_SUCCESS,
|
|
9191
|
+
data: []
|
|
9192
|
+
});
|
|
9193
|
+
}
|
|
9194
|
+
|
|
9195
|
+
return fetch(parsedURL + '/_analytics/' + app + '/recent-searches?' + queryString, requestOptions).then(function (res) {
|
|
9183
9196
|
if (res.status >= 500 || res.status >= 400) {
|
|
9184
9197
|
return dispatch({
|
|
9185
9198
|
type: constants.RECENT_SEARCHES_ERROR,
|
|
@@ -12811,7 +12824,11 @@
|
|
|
12811
12824
|
userId: VueTypes.string,
|
|
12812
12825
|
customEvents: VueTypes.object,
|
|
12813
12826
|
enableTelemetry: VueTypes.bool.def(true)
|
|
12814
|
-
}).def({})
|
|
12827
|
+
}).def({}),
|
|
12828
|
+
mongodb: VueTypes.shape({
|
|
12829
|
+
db: VueTypes.string,
|
|
12830
|
+
collection: VueTypes.string
|
|
12831
|
+
})
|
|
12815
12832
|
};
|
|
12816
12833
|
|
|
12817
12834
|
var getClassName = lib_8.getClassName,
|
|
@@ -14448,6 +14465,11 @@
|
|
|
14448
14465
|
renderNoResult: function renderNoResult() {
|
|
14449
14466
|
var h = this.$createElement;
|
|
14450
14467
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
14468
|
+
|
|
14469
|
+
if (this.$scopedSlots.renderNoResults) {
|
|
14470
|
+
return isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults;
|
|
14471
|
+
}
|
|
14472
|
+
|
|
14451
14473
|
return h("p", {
|
|
14452
14474
|
"class": getClassName$1(this.$props.innerClass, 'noResults') || null
|
|
14453
14475
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
@@ -15436,8 +15458,33 @@
|
|
|
15436
15458
|
return encodedHeaders;
|
|
15437
15459
|
}
|
|
15438
15460
|
|
|
15439
|
-
function
|
|
15461
|
+
function getMongoRequest(app, mongo) {
|
|
15462
|
+
var mongodb = {};
|
|
15463
|
+
|
|
15464
|
+
if (app) {
|
|
15465
|
+
mongodb.index = app;
|
|
15466
|
+
}
|
|
15467
|
+
|
|
15468
|
+
if (mongo) {
|
|
15469
|
+
if (mongo.db) {
|
|
15470
|
+
mongodb.db = mongo.db;
|
|
15471
|
+
}
|
|
15472
|
+
|
|
15473
|
+
if (mongo.collection) {
|
|
15474
|
+
mongodb.collection = mongo.collection;
|
|
15475
|
+
}
|
|
15476
|
+
}
|
|
15477
|
+
|
|
15478
|
+
return mongodb;
|
|
15479
|
+
}
|
|
15480
|
+
|
|
15481
|
+
function getTelemetryHeaders(enableTelemetry, shouldSetHeaders) {
|
|
15440
15482
|
var headers = {};
|
|
15483
|
+
|
|
15484
|
+
if (!shouldSetHeaders) {
|
|
15485
|
+
return headers;
|
|
15486
|
+
}
|
|
15487
|
+
|
|
15441
15488
|
Object.assign(headers, {
|
|
15442
15489
|
'X-Search-Client': 'Appbase JS'
|
|
15443
15490
|
});
|
|
@@ -15450,6 +15497,133 @@
|
|
|
15450
15497
|
|
|
15451
15498
|
return headers;
|
|
15452
15499
|
}
|
|
15500
|
+
|
|
15501
|
+
var backendAlias = {
|
|
15502
|
+
MONGODB: 'mongodb',
|
|
15503
|
+
// mongodb
|
|
15504
|
+
ELASTICSEARCH: 'elasticsearch' // elasticsearch
|
|
15505
|
+
|
|
15506
|
+
};
|
|
15507
|
+
var dataTypes = {
|
|
15508
|
+
ARRAY: 'array',
|
|
15509
|
+
FUNCTION: 'function',
|
|
15510
|
+
OBJECT: 'object',
|
|
15511
|
+
NUMBER: 'number',
|
|
15512
|
+
BOOLEAN: 'boolean',
|
|
15513
|
+
STRING: 'string'
|
|
15514
|
+
};
|
|
15515
|
+
|
|
15516
|
+
var checkDataType = function checkDataType(temp) {
|
|
15517
|
+
// eslint-disable-next-line
|
|
15518
|
+
if ((typeof temp === 'undefined' ? 'undefined' : _typeof$1(temp)) === dataTypes.OBJECT) {
|
|
15519
|
+
if (Array.isArray(temp)) {
|
|
15520
|
+
return dataTypes.ARRAY;
|
|
15521
|
+
}
|
|
15522
|
+
|
|
15523
|
+
return dataTypes.OBJECT;
|
|
15524
|
+
}
|
|
15525
|
+
|
|
15526
|
+
return typeof temp === 'undefined' ? 'undefined' : _typeof$1(temp);
|
|
15527
|
+
};
|
|
15528
|
+
|
|
15529
|
+
function validateSchema() {
|
|
15530
|
+
var passedProperties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15531
|
+
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15532
|
+
var backendName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
15533
|
+
var passedPropertiesKeys = Object.keys(passedProperties).filter(function (propertyKey) {
|
|
15534
|
+
return !!passedProperties[propertyKey];
|
|
15535
|
+
});
|
|
15536
|
+
var acceptedProperties = Object.keys(schema);
|
|
15537
|
+
var requiredProperties = []; // fetch required properties
|
|
15538
|
+
|
|
15539
|
+
acceptedProperties.forEach(function (propName) {
|
|
15540
|
+
var currentProperty = schema[propName];
|
|
15541
|
+
|
|
15542
|
+
if (currentProperty.required) {
|
|
15543
|
+
requiredProperties.push(propName);
|
|
15544
|
+
}
|
|
15545
|
+
}); // check for required properties
|
|
15546
|
+
|
|
15547
|
+
requiredProperties.forEach(function (requiredProperty) {
|
|
15548
|
+
if (!passedPropertiesKeys.includes(requiredProperty)) {
|
|
15549
|
+
throw new Error(requiredProperty + ' is required when using the ' + backendName + ' Search backend.');
|
|
15550
|
+
}
|
|
15551
|
+
}); // check for accepted properties
|
|
15552
|
+
|
|
15553
|
+
passedPropertiesKeys.forEach(function (passedPropertyKey) {
|
|
15554
|
+
if (!acceptedProperties.includes(passedPropertyKey)) {
|
|
15555
|
+
throw new Error(passedPropertyKey + ' property isn\'t accepted property by ' + backendName + ' backend.');
|
|
15556
|
+
}
|
|
15557
|
+
|
|
15558
|
+
var acceptedTypes = Array.isArray(schema[passedPropertyKey].type) ? schema[passedPropertyKey].type : [].concat(schema[passedPropertyKey].type);
|
|
15559
|
+
var receivedPropertyType = checkDataType(passedProperties[passedPropertyKey]);
|
|
15560
|
+
|
|
15561
|
+
if (!acceptedTypes.includes(receivedPropertyType)) {
|
|
15562
|
+
throw new Error('The property ' + passedPropertyKey + ' is expected with type(s) [' + acceptedTypes.join(', ') + '], but type was set as ' + receivedPropertyType + '.');
|
|
15563
|
+
}
|
|
15564
|
+
});
|
|
15565
|
+
}
|
|
15566
|
+
|
|
15567
|
+
var mongodb = {
|
|
15568
|
+
url: {
|
|
15569
|
+
type: dataTypes.STRING,
|
|
15570
|
+
required: true
|
|
15571
|
+
},
|
|
15572
|
+
app: {
|
|
15573
|
+
type: dataTypes.STRING,
|
|
15574
|
+
required: false
|
|
15575
|
+
},
|
|
15576
|
+
credentials: {
|
|
15577
|
+
type: dataTypes.STRING,
|
|
15578
|
+
required: false
|
|
15579
|
+
},
|
|
15580
|
+
enableTelemetry: {
|
|
15581
|
+
type: dataTypes.BOOLEAN,
|
|
15582
|
+
required: false
|
|
15583
|
+
},
|
|
15584
|
+
mongodb: {
|
|
15585
|
+
type: dataTypes.OBJECT,
|
|
15586
|
+
required: true
|
|
15587
|
+
},
|
|
15588
|
+
username: {
|
|
15589
|
+
type: dataTypes.STRING,
|
|
15590
|
+
required: false
|
|
15591
|
+
},
|
|
15592
|
+
password: {
|
|
15593
|
+
type: dataTypes.STRING,
|
|
15594
|
+
required: false
|
|
15595
|
+
}
|
|
15596
|
+
};
|
|
15597
|
+
var elasticsearch = {
|
|
15598
|
+
url: {
|
|
15599
|
+
type: dataTypes.STRING,
|
|
15600
|
+
required: true
|
|
15601
|
+
},
|
|
15602
|
+
app: {
|
|
15603
|
+
type: dataTypes.STRING,
|
|
15604
|
+
required: true
|
|
15605
|
+
},
|
|
15606
|
+
credentials: {
|
|
15607
|
+
type: dataTypes.STRING,
|
|
15608
|
+
required: false
|
|
15609
|
+
},
|
|
15610
|
+
enableTelemetry: {
|
|
15611
|
+
type: dataTypes.BOOLEAN,
|
|
15612
|
+
required: false
|
|
15613
|
+
},
|
|
15614
|
+
username: {
|
|
15615
|
+
type: dataTypes.STRING,
|
|
15616
|
+
required: false
|
|
15617
|
+
},
|
|
15618
|
+
password: {
|
|
15619
|
+
type: dataTypes.STRING,
|
|
15620
|
+
required: false
|
|
15621
|
+
}
|
|
15622
|
+
};
|
|
15623
|
+
var SCHEMA = {
|
|
15624
|
+
mongodb: mongodb,
|
|
15625
|
+
elasticsearch: elasticsearch
|
|
15626
|
+
};
|
|
15453
15627
|
/**
|
|
15454
15628
|
* Returns an instance of Appbase client
|
|
15455
15629
|
* @param {Object} config To configure properties
|
|
@@ -15459,10 +15633,10 @@
|
|
|
15459
15633
|
* @param {String} config.username
|
|
15460
15634
|
* @param {String} config.password
|
|
15461
15635
|
* @param {Boolean} config.enableTelemetry
|
|
15636
|
+
* @param {Object} config.mongodb
|
|
15462
15637
|
* A callback function which will be invoked before a fetch request made
|
|
15463
15638
|
*/
|
|
15464
15639
|
|
|
15465
|
-
|
|
15466
15640
|
function AppBase(config) {
|
|
15467
15641
|
var _URL = urlParserLite(config.url || ''),
|
|
15468
15642
|
_URL$auth = _URL.auth,
|
|
@@ -15474,30 +15648,42 @@
|
|
|
15474
15648
|
_URL$protocol = _URL.protocol,
|
|
15475
15649
|
protocol = _URL$protocol === undefined ? '' : _URL$protocol;
|
|
15476
15650
|
|
|
15477
|
-
var url =
|
|
15651
|
+
var url = config.url;
|
|
15652
|
+
url = host + path; // Parse url
|
|
15478
15653
|
|
|
15479
|
-
if (
|
|
15480
|
-
|
|
15654
|
+
if (url.slice(-1) === '/') {
|
|
15655
|
+
url = url.slice(0, -1);
|
|
15481
15656
|
}
|
|
15482
15657
|
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15658
|
+
var backendName = backendAlias[config.mongodb ? 'MONGODB' : 'ELASTICSEARCH']; // eslint-disable-next-line
|
|
15659
|
+
|
|
15660
|
+
var schema = SCHEMA[backendName];
|
|
15661
|
+
validateSchema({
|
|
15662
|
+
url: config.url,
|
|
15663
|
+
app: config.app,
|
|
15664
|
+
credentials: config.credentials,
|
|
15665
|
+
username: config.username,
|
|
15666
|
+
password: config.password,
|
|
15667
|
+
enableTelemetry: config.enableTelemetry,
|
|
15668
|
+
mongodb: config.mongodb
|
|
15669
|
+
}, schema, backendName);
|
|
15486
15670
|
|
|
15487
15671
|
if (typeof protocol !== 'string' || protocol === '') {
|
|
15488
15672
|
throw new Error('Protocol is not present in url. URL should be of the form https://appbase-demo-ansible-abxiydt-arc.searchbase.io');
|
|
15489
|
-
} // Parse url
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
if (url.slice(-1) === '/') {
|
|
15493
|
-
url = url.slice(0, -1);
|
|
15494
15673
|
}
|
|
15495
15674
|
|
|
15496
15675
|
var credentials = auth || null;
|
|
15676
|
+
|
|
15677
|
+
if (!config.mongodb) {
|
|
15678
|
+
if (isAppbase(url) && credentials === null) {
|
|
15679
|
+
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15680
|
+
}
|
|
15681
|
+
}
|
|
15497
15682
|
/**
|
|
15498
15683
|
* Credentials can be provided as a part of the URL,
|
|
15499
15684
|
* as username, password args or as a credentials argument directly */
|
|
15500
15685
|
|
|
15686
|
+
|
|
15501
15687
|
if (typeof config.credentials === 'string' && config.credentials !== '') {
|
|
15502
15688
|
// eslint-disable-next-line
|
|
15503
15689
|
credentials = config.credentials;
|
|
@@ -15505,15 +15691,15 @@
|
|
|
15505
15691
|
credentials = config.username + ':' + config.password;
|
|
15506
15692
|
}
|
|
15507
15693
|
|
|
15508
|
-
if (isAppbase(url) && credentials === null) {
|
|
15509
|
-
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15510
|
-
}
|
|
15511
|
-
|
|
15512
15694
|
this.url = url;
|
|
15513
15695
|
this.protocol = protocol;
|
|
15514
15696
|
this.app = config.app;
|
|
15515
15697
|
this.credentials = credentials;
|
|
15516
15698
|
|
|
15699
|
+
if (config.mongodb) {
|
|
15700
|
+
this.mongodb = config.mongodb;
|
|
15701
|
+
}
|
|
15702
|
+
|
|
15517
15703
|
if (typeof config.enableTelemetry === 'boolean') {
|
|
15518
15704
|
this.enableTelemetry = config.enableTelemetry;
|
|
15519
15705
|
}
|
|
@@ -15542,7 +15728,9 @@
|
|
|
15542
15728
|
params = parsedArgs.params,
|
|
15543
15729
|
body = parsedArgs.body,
|
|
15544
15730
|
isRSAPI = parsedArgs.isRSAPI,
|
|
15545
|
-
isSuggestionsAPI = parsedArgs.isSuggestionsAPI
|
|
15731
|
+
isSuggestionsAPI = parsedArgs.isSuggestionsAPI,
|
|
15732
|
+
_parsedArgs$isMongoRe = parsedArgs.isMongoRequest,
|
|
15733
|
+
isMongoRequest = _parsedArgs$isMongoRe === undefined ? false : _parsedArgs$isMongoRe;
|
|
15546
15734
|
var app = isSuggestionsAPI ? '.suggestions' : _this.app;
|
|
15547
15735
|
var bodyCopy = body;
|
|
15548
15736
|
var contentType = path.endsWith('msearch') || path.endsWith('bulk') ? 'application/x-ndjson' : 'application/json';
|
|
@@ -15593,7 +15781,7 @@
|
|
|
15593
15781
|
paramsString = '?' + querystring.stringify(params);
|
|
15594
15782
|
}
|
|
15595
15783
|
|
|
15596
|
-
var finalURL = _this.protocol + '://' + _this.url + '/' + app + '/' + path + paramsString;
|
|
15784
|
+
var finalURL = isMongoRequest ? _this.protocol + '://' + _this.url : _this.protocol + '://' + _this.url + '/' + app + '/' + path + paramsString;
|
|
15597
15785
|
return handleTransformRequest(Object.assign({}, {
|
|
15598
15786
|
url: finalURL
|
|
15599
15787
|
}, requestOptions)).then(function (ts) {
|
|
@@ -15602,7 +15790,7 @@
|
|
|
15602
15790
|
delete transformedRequest.url;
|
|
15603
15791
|
return browserPonyfill$1(url || finalURL, Object.assign({}, transformedRequest, {
|
|
15604
15792
|
// apply timestamp header for RS API
|
|
15605
|
-
headers: isRSAPI ? Object.assign({}, transformedRequest.headers, {
|
|
15793
|
+
headers: isRSAPI && !isMongoRequest ? Object.assign({}, transformedRequest.headers, {
|
|
15606
15794
|
'x-timestamp': new Date().getTime()
|
|
15607
15795
|
}) : transformedRequest.headers
|
|
15608
15796
|
})).then(function (res) {
|
|
@@ -15630,7 +15818,7 @@
|
|
|
15630
15818
|
|
|
15631
15819
|
if (data) {
|
|
15632
15820
|
Object.keys(data).forEach(function (key) {
|
|
15633
|
-
if (data[key] && Object.prototype.hasOwnProperty.call(data[key], 'error')) {
|
|
15821
|
+
if (data[key] && Object.prototype.hasOwnProperty.call(data[key], 'error') && !!data[key].error) {
|
|
15634
15822
|
errorResponses += 1;
|
|
15635
15823
|
}
|
|
15636
15824
|
});
|
|
@@ -15967,12 +16155,20 @@
|
|
|
15967
16155
|
settings: parsedSettings,
|
|
15968
16156
|
query: query
|
|
15969
16157
|
};
|
|
16158
|
+
|
|
16159
|
+
if (this.mongodb) {
|
|
16160
|
+
Object.assign(body, {
|
|
16161
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16162
|
+
});
|
|
16163
|
+
}
|
|
16164
|
+
|
|
15970
16165
|
return this.performFetchRequest({
|
|
15971
16166
|
method: 'POST',
|
|
15972
16167
|
path: '_reactivesearch',
|
|
15973
16168
|
body: body,
|
|
15974
|
-
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
15975
|
-
isRSAPI: true
|
|
16169
|
+
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
16170
|
+
isRSAPI: true,
|
|
16171
|
+
isMongoRequest: !!this.mongodb
|
|
15976
16172
|
});
|
|
15977
16173
|
}
|
|
15978
16174
|
/**
|
|
@@ -15999,12 +16195,20 @@
|
|
|
15999
16195
|
settings: parsedSettings,
|
|
16000
16196
|
query: query
|
|
16001
16197
|
};
|
|
16198
|
+
|
|
16199
|
+
if (this.mongodb) {
|
|
16200
|
+
Object.assign(body, {
|
|
16201
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16202
|
+
});
|
|
16203
|
+
}
|
|
16204
|
+
|
|
16002
16205
|
return this.performFetchRequest({
|
|
16003
16206
|
method: 'POST',
|
|
16004
16207
|
path: '_reactivesearch.v3',
|
|
16005
16208
|
body: body,
|
|
16006
|
-
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
16007
|
-
isRSAPI: true
|
|
16209
|
+
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
16210
|
+
isRSAPI: true,
|
|
16211
|
+
isMongoRequest: !!this.mongodb
|
|
16008
16212
|
});
|
|
16009
16213
|
}
|
|
16010
16214
|
/**
|
|
@@ -16042,13 +16246,21 @@
|
|
|
16042
16246
|
settings: parsedSettings,
|
|
16043
16247
|
query: query
|
|
16044
16248
|
};
|
|
16249
|
+
|
|
16250
|
+
if (this.mongodb) {
|
|
16251
|
+
Object.assign(body, {
|
|
16252
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16253
|
+
});
|
|
16254
|
+
}
|
|
16255
|
+
|
|
16045
16256
|
return this.performFetchRequest({
|
|
16046
16257
|
method: 'POST',
|
|
16047
16258
|
path: '_reactivesearch.v3',
|
|
16048
16259
|
body: body,
|
|
16049
16260
|
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
16050
16261
|
isRSAPI: true,
|
|
16051
|
-
isSuggestionsAPI: true
|
|
16262
|
+
isSuggestionsAPI: true,
|
|
16263
|
+
isMongoRequest: !!this.mongodb
|
|
16052
16264
|
});
|
|
16053
16265
|
}
|
|
16054
16266
|
|
|
@@ -16781,7 +16993,7 @@
|
|
|
16781
16993
|
}
|
|
16782
16994
|
},
|
|
16783
16995
|
props: {
|
|
16784
|
-
app: types.
|
|
16996
|
+
app: types.string,
|
|
16785
16997
|
analytics: VueTypes.bool,
|
|
16786
16998
|
analyticsConfig: types.analyticsConfig,
|
|
16787
16999
|
appbaseConfig: types.appbaseConfig,
|
|
@@ -16801,7 +17013,8 @@
|
|
|
16801
17013
|
transformResponse: types.func,
|
|
16802
17014
|
as: VueTypes.string.def('div'),
|
|
16803
17015
|
getSearchParams: types.func,
|
|
16804
|
-
setSearchParams: types.func
|
|
17016
|
+
setSearchParams: types.func,
|
|
17017
|
+
mongodb: types.mongodb
|
|
16805
17018
|
},
|
|
16806
17019
|
provide: function provide() {
|
|
16807
17020
|
return {
|
|
@@ -16841,6 +17054,9 @@
|
|
|
16841
17054
|
this.store.dispatch(analytics_3$1(newVal));
|
|
16842
17055
|
}
|
|
16843
17056
|
}
|
|
17057
|
+
},
|
|
17058
|
+
mongodb: function mongodb() {
|
|
17059
|
+
this.updateState(this.$props);
|
|
16844
17060
|
}
|
|
16845
17061
|
},
|
|
16846
17062
|
computed: {
|
|
@@ -16848,12 +17064,13 @@
|
|
|
16848
17064
|
var _this$$props = this.$props,
|
|
16849
17065
|
enableAppbase = _this$$props.enableAppbase,
|
|
16850
17066
|
headers = _this$$props.headers,
|
|
16851
|
-
appbaseConfig = _this$$props.appbaseConfig
|
|
17067
|
+
appbaseConfig = _this$$props.appbaseConfig,
|
|
17068
|
+
mongodb = _this$$props.mongodb;
|
|
16852
17069
|
|
|
16853
17070
|
var _ref = appbaseConfig || {},
|
|
16854
17071
|
enableTelemetry = _ref.enableTelemetry;
|
|
16855
17072
|
|
|
16856
|
-
return _extends({}, enableAppbase && _extends({
|
|
17073
|
+
return _extends({}, enableAppbase && !mongodb && _extends({
|
|
16857
17074
|
'X-Search-Client': X_SEARCH_CLIENT
|
|
16858
17075
|
}, enableTelemetry === false && {
|
|
16859
17076
|
'X-Enable-Telemetry': false
|
|
@@ -16871,7 +17088,7 @@
|
|
|
16871
17088
|
var appbaseConfig = _extends({}, props.analyticsConfig, props.appbaseConfig);
|
|
16872
17089
|
|
|
16873
17090
|
var config = {
|
|
16874
|
-
url: props.url && props.url.trim() !== '' ? props.url : '
|
|
17091
|
+
url: props.url && props.url.trim() !== '' ? props.url : '',
|
|
16875
17092
|
app: props.app,
|
|
16876
17093
|
credentials: credentials,
|
|
16877
17094
|
type: props.type ? props.type : '*',
|
|
@@ -16879,7 +17096,8 @@
|
|
|
16879
17096
|
transformResponse: props.transformResponse,
|
|
16880
17097
|
enableAppbase: props.enableAppbase,
|
|
16881
17098
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
16882
|
-
analyticsConfig: appbaseConfig
|
|
17099
|
+
analyticsConfig: appbaseConfig,
|
|
17100
|
+
mongodb: props.mongodb
|
|
16883
17101
|
};
|
|
16884
17102
|
var queryParams = '';
|
|
16885
17103
|
|
|
@@ -23495,7 +23713,7 @@
|
|
|
23495
23713
|
this.internalComponent = null;
|
|
23496
23714
|
this.$defaultQuery = null; // Set custom query in store
|
|
23497
23715
|
|
|
23498
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
23716
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23499
23717
|
var customQuery = props.customQuery,
|
|
23500
23718
|
componentId = props.componentId,
|
|
23501
23719
|
filterLabel = props.filterLabel,
|
|
@@ -23518,7 +23736,7 @@
|
|
|
23518
23736
|
}
|
|
23519
23737
|
|
|
23520
23738
|
if (customQuery) {
|
|
23521
|
-
var calcCustomQuery = customQuery(props);
|
|
23739
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
23522
23740
|
|
|
23523
23741
|
var _ref = calcCustomQuery || {},
|
|
23524
23742
|
query = _ref.query;
|
|
@@ -23537,7 +23755,7 @@
|
|
|
23537
23755
|
|
|
23538
23756
|
this.updateQuery({
|
|
23539
23757
|
componentId: componentId,
|
|
23540
|
-
|
|
23758
|
+
query: queryToSet,
|
|
23541
23759
|
value: this.selectedValue || null,
|
|
23542
23760
|
label: filterLabel,
|
|
23543
23761
|
showFilter: showFilter,
|
|
@@ -23588,8 +23806,8 @@
|
|
|
23588
23806
|
},
|
|
23589
23807
|
beforeMount: function beforeMount() {
|
|
23590
23808
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
23591
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
23592
|
-
this.$defaultQuery = this.$props.defaultQuery();
|
|
23809
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23810
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
23593
23811
|
|
|
23594
23812
|
var _ref3 = this.$defaultQuery || {},
|
|
23595
23813
|
query = _ref3.query,
|
|
@@ -23653,8 +23871,8 @@
|
|
|
23653
23871
|
}
|
|
23654
23872
|
},
|
|
23655
23873
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
23656
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
23657
|
-
this.$defaultQuery = newVal();
|
|
23874
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23875
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
23658
23876
|
|
|
23659
23877
|
var _ref4 = this.$defaultQuery || {},
|
|
23660
23878
|
query = _ref4.query,
|
|
@@ -23665,7 +23883,7 @@
|
|
|
23665
23883
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
|
|
23666
23884
|
|
|
23667
23885
|
|
|
23668
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
23886
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23669
23887
|
var queryToSet = query || null;
|
|
23670
23888
|
|
|
23671
23889
|
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
@@ -23679,9 +23897,9 @@
|
|
|
23679
23897
|
}
|
|
23680
23898
|
},
|
|
23681
23899
|
customQuery: function customQuery(newVal, oldVal) {
|
|
23682
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
23900
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23683
23901
|
var componentId = this.$props.componentId;
|
|
23684
|
-
this.$customQuery = newVal(this.$props);
|
|
23902
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
23685
23903
|
|
|
23686
23904
|
var _ref5 = this.$customQuery || {},
|
|
23687
23905
|
query = _ref5.query,
|
|
@@ -23692,7 +23910,7 @@
|
|
|
23692
23910
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
|
|
23693
23911
|
|
|
23694
23912
|
|
|
23695
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
23913
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23696
23914
|
var queryToSet = query || null;
|
|
23697
23915
|
|
|
23698
23916
|
if (this.$customQuery && this.$customQuery.id) {
|
|
@@ -32566,16 +32784,7 @@
|
|
|
32566
32784
|
compProps[key] = component[key];
|
|
32567
32785
|
}
|
|
32568
32786
|
});
|
|
32569
|
-
var isInternalComponentPresent = false;
|
|
32570
|
-
|
|
32571
|
-
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
32572
|
-
customQueries[component.componentId] = component.customQuery(component.value, compProps);
|
|
32573
|
-
}
|
|
32574
|
-
|
|
32575
|
-
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
32576
|
-
defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
|
|
32577
|
-
}
|
|
32578
|
-
|
|
32787
|
+
var isInternalComponentPresent = false;
|
|
32579
32788
|
var isResultComponent = resultComponents.includes(componentType);
|
|
32580
32789
|
var internalComponent = component.componentId + "__internal";
|
|
32581
32790
|
var label = component.filterLabel || component.componentId;
|
|
@@ -32599,7 +32808,16 @@
|
|
|
32599
32808
|
reference: reference,
|
|
32600
32809
|
showFilter: showFilter,
|
|
32601
32810
|
URLParams: component.URLParams || false
|
|
32602
|
-
}); //
|
|
32811
|
+
}); // Set custom and default queries
|
|
32812
|
+
|
|
32813
|
+
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
32814
|
+
customQueries[component.componentId] = component.customQuery(value, compProps);
|
|
32815
|
+
}
|
|
32816
|
+
|
|
32817
|
+
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
32818
|
+
defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
|
|
32819
|
+
} // [2] set query options - main component query (valid for result components)
|
|
32820
|
+
|
|
32603
32821
|
|
|
32604
32822
|
if (componentsWithOptions.includes(componentType)) {
|
|
32605
32823
|
var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
|
|
@@ -32686,7 +32904,7 @@
|
|
|
32686
32904
|
|
|
32687
32905
|
|
|
32688
32906
|
if (isResultComponent) {
|
|
32689
|
-
var _getQuery = getQuery(component,
|
|
32907
|
+
var _getQuery = getQuery(component, value, componentType),
|
|
32690
32908
|
query = _getQuery.query;
|
|
32691
32909
|
|
|
32692
32910
|
queryList = queryReducer(queryList, {
|
|
@@ -32913,7 +33131,7 @@
|
|
|
32913
33131
|
});
|
|
32914
33132
|
}
|
|
32915
33133
|
|
|
32916
|
-
var version = "1.16.0-alpha.
|
|
33134
|
+
var version = "1.16.0-alpha.26";
|
|
32917
33135
|
|
|
32918
33136
|
var _templateObject$o, _templateObject2$b;
|
|
32919
33137
|
|