@appbaseio/reactivesearch-vue 1.23.3 → 1.23.4-alpha
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 +266 -69
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/DataSearch.js +2 -2
- package/dist/cjs/{DropDown-59a7971b.js → DropDown-6815b9b6.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/RangeInput.js +1 -1
- package/dist/cjs/RangeSlider.js +1 -1
- package/dist/cjs/ReactiveBase.js +14 -8
- package/dist/cjs/ReactiveComponent.js +1 -1
- package/dist/cjs/ReactiveList.js +34 -36
- 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 +1 -1
- package/dist/cjs/install.js +3 -3
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-22b4fd3a.js → vueTypes-4c19b4c8.js} +5 -1
- package/dist/es/DataSearch.js +2 -2
- package/dist/es/{DropDown-db7fe433.js → DropDown-035c804f.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/RangeInput.js +1 -1
- package/dist/es/RangeSlider.js +1 -1
- package/dist/es/ReactiveBase.js +14 -8
- package/dist/es/ReactiveComponent.js +1 -1
- package/dist/es/ReactiveList.js +34 -36
- 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 +1 -1
- package/dist/es/install.js +3 -3
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-e89c8a3c.js → vueTypes-fb61bb7b.js} +5 -1
- package/package.json +3 -3
|
@@ -12780,7 +12780,11 @@
|
|
|
12780
12780
|
userId: VueTypes.string,
|
|
12781
12781
|
customEvents: VueTypes.object,
|
|
12782
12782
|
enableTelemetry: VueTypes.bool.def(true)
|
|
12783
|
-
}).def({})
|
|
12783
|
+
}).def({}),
|
|
12784
|
+
mongodb: VueTypes.shape({
|
|
12785
|
+
db: VueTypes.string,
|
|
12786
|
+
collection: VueTypes.string
|
|
12787
|
+
})
|
|
12784
12788
|
};
|
|
12785
12789
|
|
|
12786
12790
|
var getClassName = lib_8.getClassName,
|
|
@@ -13993,12 +13997,9 @@
|
|
|
13993
13997
|
return this.$listeners && this.$listeners.resultStats;
|
|
13994
13998
|
},
|
|
13995
13999
|
stats: function stats() {
|
|
13996
|
-
var _this$getAllData = this.getAllData(),
|
|
13997
|
-
filteredResults = _this$getAllData.filteredResults;
|
|
13998
|
-
|
|
13999
14000
|
return _extends({}, getResultStats(this), {
|
|
14000
14001
|
currentPage: this.currentPageState,
|
|
14001
|
-
displayedResults:
|
|
14002
|
+
displayedResults: this.data.length
|
|
14002
14003
|
});
|
|
14003
14004
|
},
|
|
14004
14005
|
hasCustomRender: function hasCustomRender() {
|
|
@@ -14007,6 +14008,27 @@
|
|
|
14007
14008
|
showInfiniteScroll: function showInfiniteScroll() {
|
|
14008
14009
|
// Pagination has higher priority then infinite scroll
|
|
14009
14010
|
return this.infiniteScroll && !this.shouldRenderPagination;
|
|
14011
|
+
},
|
|
14012
|
+
data: function data() {
|
|
14013
|
+
var results = parseHits(this.hits) || [];
|
|
14014
|
+
var parsedPromotedResults = parseHits(this.promotedResults) || [];
|
|
14015
|
+
var filteredResults = results;
|
|
14016
|
+
|
|
14017
|
+
if (parsedPromotedResults.length) {
|
|
14018
|
+
var ids = parsedPromotedResults.map(function (item) {
|
|
14019
|
+
return item._id;
|
|
14020
|
+
}).filter(Boolean);
|
|
14021
|
+
|
|
14022
|
+
if (ids) {
|
|
14023
|
+
filteredResults = filteredResults.filter(function (item) {
|
|
14024
|
+
return !ids.includes(item._id);
|
|
14025
|
+
});
|
|
14026
|
+
}
|
|
14027
|
+
|
|
14028
|
+
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
14029
|
+
}
|
|
14030
|
+
|
|
14031
|
+
return helper_2(filteredResults);
|
|
14010
14032
|
}
|
|
14011
14033
|
},
|
|
14012
14034
|
watch: {
|
|
@@ -14088,7 +14110,7 @@
|
|
|
14088
14110
|
}
|
|
14089
14111
|
},
|
|
14090
14112
|
hits: function hits(newVal, oldVal) {
|
|
14091
|
-
this.$emit('data', this.
|
|
14113
|
+
this.$emit('data', this.getData());
|
|
14092
14114
|
|
|
14093
14115
|
if (this.shouldRenderPagination) {
|
|
14094
14116
|
// called when page is changed
|
|
@@ -14273,13 +14295,10 @@
|
|
|
14273
14295
|
|
|
14274
14296
|
var h = this.$createElement;
|
|
14275
14297
|
var size = this.$props.size;
|
|
14276
|
-
var hits = this.$data.hits;
|
|
14277
|
-
var results = parseHits(hits) || [];
|
|
14278
|
-
var filteredResults = results;
|
|
14279
14298
|
var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
|
|
14280
14299
|
var element = this.hasCustomRender ? this.getComponent() : h("div", {
|
|
14281
14300
|
"class": this.$props.listClass + " " + getClassName$1(this.$props.innerClass, 'list')
|
|
14282
|
-
}, [
|
|
14301
|
+
}, [this.data.map(function (item, index) {
|
|
14283
14302
|
return renderItem({
|
|
14284
14303
|
item: item,
|
|
14285
14304
|
triggerClickAnalytics: function triggerClickAnalytics() {
|
|
@@ -14290,7 +14309,7 @@
|
|
|
14290
14309
|
|
|
14291
14310
|
return this.analytics ? h(ImpressionTracker$1, {
|
|
14292
14311
|
"attrs": {
|
|
14293
|
-
"hits":
|
|
14312
|
+
"hits": this.data
|
|
14294
14313
|
}
|
|
14295
14314
|
}, [element]) : element;
|
|
14296
14315
|
},
|
|
@@ -14470,8 +14489,8 @@
|
|
|
14470
14489
|
})]);
|
|
14471
14490
|
},
|
|
14472
14491
|
withClickIds: function withClickIds(results) {
|
|
14473
|
-
var _this$
|
|
14474
|
-
base = _this$
|
|
14492
|
+
var _this$getAllData = this.getAllData(),
|
|
14493
|
+
base = _this$getAllData.base;
|
|
14475
14494
|
|
|
14476
14495
|
return results.map(function (result, index) {
|
|
14477
14496
|
return _extends({}, result, {
|
|
@@ -14489,26 +14508,9 @@
|
|
|
14489
14508
|
hits = this.hits;
|
|
14490
14509
|
var results = parseHits(hits) || [];
|
|
14491
14510
|
var parsedPromotedResults = parseHits(promotedResults) || [];
|
|
14492
|
-
var filteredResults = results;
|
|
14493
14511
|
var base = currentPage * size;
|
|
14494
|
-
|
|
14495
|
-
if (parsedPromotedResults.length) {
|
|
14496
|
-
var ids = parsedPromotedResults.map(function (item) {
|
|
14497
|
-
return item._id;
|
|
14498
|
-
}).filter(Boolean);
|
|
14499
|
-
|
|
14500
|
-
if (ids) {
|
|
14501
|
-
filteredResults = filteredResults.filter(function (item) {
|
|
14502
|
-
return !ids.includes(item._id);
|
|
14503
|
-
});
|
|
14504
|
-
}
|
|
14505
|
-
|
|
14506
|
-
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
14507
|
-
}
|
|
14508
|
-
|
|
14509
14512
|
return {
|
|
14510
14513
|
results: results,
|
|
14511
|
-
filteredResults: filteredResults,
|
|
14512
14514
|
customData: customData || {},
|
|
14513
14515
|
promotedResults: parsedPromotedResults,
|
|
14514
14516
|
aggregationData: aggregationData,
|
|
@@ -14518,14 +14520,13 @@
|
|
|
14518
14520
|
};
|
|
14519
14521
|
},
|
|
14520
14522
|
getData: function getData() {
|
|
14521
|
-
var _this$
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
customData = _this$getAllData3.customData;
|
|
14523
|
+
var _this$getAllData2 = this.getAllData(),
|
|
14524
|
+
promotedResults = _this$getAllData2.promotedResults,
|
|
14525
|
+
aggregationData = _this$getAllData2.aggregationData,
|
|
14526
|
+
customData = _this$getAllData2.customData;
|
|
14526
14527
|
|
|
14527
14528
|
return {
|
|
14528
|
-
data: this.
|
|
14529
|
+
data: this.data,
|
|
14529
14530
|
aggregationData: this.withClickIds(aggregationData || []),
|
|
14530
14531
|
promotedData: this.withClickIds(promotedResults || []),
|
|
14531
14532
|
rawData: this.rawData,
|
|
@@ -15408,8 +15409,33 @@
|
|
|
15408
15409
|
return encodedHeaders;
|
|
15409
15410
|
}
|
|
15410
15411
|
|
|
15411
|
-
function
|
|
15412
|
+
function getMongoRequest(app, mongo) {
|
|
15413
|
+
var mongodb = {};
|
|
15414
|
+
|
|
15415
|
+
if (app) {
|
|
15416
|
+
mongodb.index = app;
|
|
15417
|
+
}
|
|
15418
|
+
|
|
15419
|
+
if (mongo) {
|
|
15420
|
+
if (mongo.db) {
|
|
15421
|
+
mongodb.db = mongo.db;
|
|
15422
|
+
}
|
|
15423
|
+
|
|
15424
|
+
if (mongo.collection) {
|
|
15425
|
+
mongodb.collection = mongo.collection;
|
|
15426
|
+
}
|
|
15427
|
+
}
|
|
15428
|
+
|
|
15429
|
+
return mongodb;
|
|
15430
|
+
}
|
|
15431
|
+
|
|
15432
|
+
function getTelemetryHeaders(enableTelemetry, shouldSetHeaders) {
|
|
15412
15433
|
var headers = {};
|
|
15434
|
+
|
|
15435
|
+
if (!shouldSetHeaders) {
|
|
15436
|
+
return headers;
|
|
15437
|
+
}
|
|
15438
|
+
|
|
15413
15439
|
Object.assign(headers, {
|
|
15414
15440
|
'X-Search-Client': 'Appbase JS'
|
|
15415
15441
|
});
|
|
@@ -15422,6 +15448,133 @@
|
|
|
15422
15448
|
|
|
15423
15449
|
return headers;
|
|
15424
15450
|
}
|
|
15451
|
+
|
|
15452
|
+
var backendAlias = {
|
|
15453
|
+
MONGODB: 'mongodb',
|
|
15454
|
+
// mongodb
|
|
15455
|
+
ELASTICSEARCH: 'elasticsearch' // elasticsearch
|
|
15456
|
+
|
|
15457
|
+
};
|
|
15458
|
+
var dataTypes = {
|
|
15459
|
+
ARRAY: 'array',
|
|
15460
|
+
FUNCTION: 'function',
|
|
15461
|
+
OBJECT: 'object',
|
|
15462
|
+
NUMBER: 'number',
|
|
15463
|
+
BOOLEAN: 'boolean',
|
|
15464
|
+
STRING: 'string'
|
|
15465
|
+
};
|
|
15466
|
+
|
|
15467
|
+
var checkDataType = function checkDataType(temp) {
|
|
15468
|
+
// eslint-disable-next-line
|
|
15469
|
+
if ((typeof temp === 'undefined' ? 'undefined' : _typeof$1(temp)) === dataTypes.OBJECT) {
|
|
15470
|
+
if (Array.isArray(temp)) {
|
|
15471
|
+
return dataTypes.ARRAY;
|
|
15472
|
+
}
|
|
15473
|
+
|
|
15474
|
+
return dataTypes.OBJECT;
|
|
15475
|
+
}
|
|
15476
|
+
|
|
15477
|
+
return typeof temp === 'undefined' ? 'undefined' : _typeof$1(temp);
|
|
15478
|
+
};
|
|
15479
|
+
|
|
15480
|
+
function validateSchema() {
|
|
15481
|
+
var passedProperties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15482
|
+
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15483
|
+
var backendName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
15484
|
+
var passedPropertiesKeys = Object.keys(passedProperties).filter(function (propertyKey) {
|
|
15485
|
+
return !!passedProperties[propertyKey];
|
|
15486
|
+
});
|
|
15487
|
+
var acceptedProperties = Object.keys(schema);
|
|
15488
|
+
var requiredProperties = []; // fetch required properties
|
|
15489
|
+
|
|
15490
|
+
acceptedProperties.forEach(function (propName) {
|
|
15491
|
+
var currentProperty = schema[propName];
|
|
15492
|
+
|
|
15493
|
+
if (currentProperty.required) {
|
|
15494
|
+
requiredProperties.push(propName);
|
|
15495
|
+
}
|
|
15496
|
+
}); // check for required properties
|
|
15497
|
+
|
|
15498
|
+
requiredProperties.forEach(function (requiredProperty) {
|
|
15499
|
+
if (!passedPropertiesKeys.includes(requiredProperty)) {
|
|
15500
|
+
throw new Error(requiredProperty + ' is required when using the ' + backendName + ' Search backend.');
|
|
15501
|
+
}
|
|
15502
|
+
}); // check for accepted properties
|
|
15503
|
+
|
|
15504
|
+
passedPropertiesKeys.forEach(function (passedPropertyKey) {
|
|
15505
|
+
if (!acceptedProperties.includes(passedPropertyKey)) {
|
|
15506
|
+
throw new Error(passedPropertyKey + ' property isn\'t accepted property by ' + backendName + ' backend.');
|
|
15507
|
+
}
|
|
15508
|
+
|
|
15509
|
+
var acceptedTypes = Array.isArray(schema[passedPropertyKey].type) ? schema[passedPropertyKey].type : [].concat(schema[passedPropertyKey].type);
|
|
15510
|
+
var receivedPropertyType = checkDataType(passedProperties[passedPropertyKey]);
|
|
15511
|
+
|
|
15512
|
+
if (!acceptedTypes.includes(receivedPropertyType)) {
|
|
15513
|
+
throw new Error('The property ' + passedPropertyKey + ' is expected with type(s) [' + acceptedTypes.join(', ') + '], but type was set as ' + receivedPropertyType + '.');
|
|
15514
|
+
}
|
|
15515
|
+
});
|
|
15516
|
+
}
|
|
15517
|
+
|
|
15518
|
+
var mongodb = {
|
|
15519
|
+
url: {
|
|
15520
|
+
type: dataTypes.STRING,
|
|
15521
|
+
required: true
|
|
15522
|
+
},
|
|
15523
|
+
app: {
|
|
15524
|
+
type: dataTypes.STRING,
|
|
15525
|
+
required: false
|
|
15526
|
+
},
|
|
15527
|
+
credentials: {
|
|
15528
|
+
type: dataTypes.STRING,
|
|
15529
|
+
required: false
|
|
15530
|
+
},
|
|
15531
|
+
enableTelemetry: {
|
|
15532
|
+
type: dataTypes.BOOLEAN,
|
|
15533
|
+
required: false
|
|
15534
|
+
},
|
|
15535
|
+
mongodb: {
|
|
15536
|
+
type: dataTypes.OBJECT,
|
|
15537
|
+
required: true
|
|
15538
|
+
},
|
|
15539
|
+
username: {
|
|
15540
|
+
type: dataTypes.STRING,
|
|
15541
|
+
required: false
|
|
15542
|
+
},
|
|
15543
|
+
password: {
|
|
15544
|
+
type: dataTypes.STRING,
|
|
15545
|
+
required: false
|
|
15546
|
+
}
|
|
15547
|
+
};
|
|
15548
|
+
var elasticsearch = {
|
|
15549
|
+
url: {
|
|
15550
|
+
type: dataTypes.STRING,
|
|
15551
|
+
required: true
|
|
15552
|
+
},
|
|
15553
|
+
app: {
|
|
15554
|
+
type: dataTypes.STRING,
|
|
15555
|
+
required: true
|
|
15556
|
+
},
|
|
15557
|
+
credentials: {
|
|
15558
|
+
type: dataTypes.STRING,
|
|
15559
|
+
required: false
|
|
15560
|
+
},
|
|
15561
|
+
enableTelemetry: {
|
|
15562
|
+
type: dataTypes.BOOLEAN,
|
|
15563
|
+
required: false
|
|
15564
|
+
},
|
|
15565
|
+
username: {
|
|
15566
|
+
type: dataTypes.STRING,
|
|
15567
|
+
required: false
|
|
15568
|
+
},
|
|
15569
|
+
password: {
|
|
15570
|
+
type: dataTypes.STRING,
|
|
15571
|
+
required: false
|
|
15572
|
+
}
|
|
15573
|
+
};
|
|
15574
|
+
var SCHEMA = {
|
|
15575
|
+
mongodb: mongodb,
|
|
15576
|
+
elasticsearch: elasticsearch
|
|
15577
|
+
};
|
|
15425
15578
|
/**
|
|
15426
15579
|
* Returns an instance of Appbase client
|
|
15427
15580
|
* @param {Object} config To configure properties
|
|
@@ -15431,10 +15584,10 @@
|
|
|
15431
15584
|
* @param {String} config.username
|
|
15432
15585
|
* @param {String} config.password
|
|
15433
15586
|
* @param {Boolean} config.enableTelemetry
|
|
15587
|
+
* @param {Object} config.mongodb
|
|
15434
15588
|
* A callback function which will be invoked before a fetch request made
|
|
15435
15589
|
*/
|
|
15436
15590
|
|
|
15437
|
-
|
|
15438
15591
|
function AppBase(config) {
|
|
15439
15592
|
var _URL = urlParserLite(config.url || ''),
|
|
15440
15593
|
_URL$auth = _URL.auth,
|
|
@@ -15446,30 +15599,42 @@
|
|
|
15446
15599
|
_URL$protocol = _URL.protocol,
|
|
15447
15600
|
protocol = _URL$protocol === undefined ? '' : _URL$protocol;
|
|
15448
15601
|
|
|
15449
|
-
var url =
|
|
15602
|
+
var url = config.url;
|
|
15603
|
+
url = host + path; // Parse url
|
|
15450
15604
|
|
|
15451
|
-
if (
|
|
15452
|
-
|
|
15605
|
+
if (url.slice(-1) === '/') {
|
|
15606
|
+
url = url.slice(0, -1);
|
|
15453
15607
|
}
|
|
15454
15608
|
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15609
|
+
var backendName = backendAlias[config.mongodb ? 'MONGODB' : 'ELASTICSEARCH']; // eslint-disable-next-line
|
|
15610
|
+
|
|
15611
|
+
var schema = SCHEMA[backendName];
|
|
15612
|
+
validateSchema({
|
|
15613
|
+
url: config.url,
|
|
15614
|
+
app: config.app,
|
|
15615
|
+
credentials: config.credentials,
|
|
15616
|
+
username: config.username,
|
|
15617
|
+
password: config.password,
|
|
15618
|
+
enableTelemetry: config.enableTelemetry,
|
|
15619
|
+
mongodb: config.mongodb
|
|
15620
|
+
}, schema, backendName);
|
|
15458
15621
|
|
|
15459
15622
|
if (typeof protocol !== 'string' || protocol === '') {
|
|
15460
15623
|
throw new Error('Protocol is not present in url. URL should be of the form https://appbase-demo-ansible-abxiydt-arc.searchbase.io');
|
|
15461
|
-
} // Parse url
|
|
15462
|
-
|
|
15463
|
-
|
|
15464
|
-
if (url.slice(-1) === '/') {
|
|
15465
|
-
url = url.slice(0, -1);
|
|
15466
15624
|
}
|
|
15467
15625
|
|
|
15468
15626
|
var credentials = auth || null;
|
|
15627
|
+
|
|
15628
|
+
if (!config.mongodb) {
|
|
15629
|
+
if (isAppbase(url) && credentials === null) {
|
|
15630
|
+
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15631
|
+
}
|
|
15632
|
+
}
|
|
15469
15633
|
/**
|
|
15470
15634
|
* Credentials can be provided as a part of the URL,
|
|
15471
15635
|
* as username, password args or as a credentials argument directly */
|
|
15472
15636
|
|
|
15637
|
+
|
|
15473
15638
|
if (typeof config.credentials === 'string' && config.credentials !== '') {
|
|
15474
15639
|
// eslint-disable-next-line
|
|
15475
15640
|
credentials = config.credentials;
|
|
@@ -15477,15 +15642,15 @@
|
|
|
15477
15642
|
credentials = config.username + ':' + config.password;
|
|
15478
15643
|
}
|
|
15479
15644
|
|
|
15480
|
-
if (isAppbase(url) && credentials === null) {
|
|
15481
|
-
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15482
|
-
}
|
|
15483
|
-
|
|
15484
15645
|
this.url = url;
|
|
15485
15646
|
this.protocol = protocol;
|
|
15486
15647
|
this.app = config.app;
|
|
15487
15648
|
this.credentials = credentials;
|
|
15488
15649
|
|
|
15650
|
+
if (config.mongodb) {
|
|
15651
|
+
this.mongodb = config.mongodb;
|
|
15652
|
+
}
|
|
15653
|
+
|
|
15489
15654
|
if (typeof config.enableTelemetry === 'boolean') {
|
|
15490
15655
|
this.enableTelemetry = config.enableTelemetry;
|
|
15491
15656
|
}
|
|
@@ -15514,7 +15679,9 @@
|
|
|
15514
15679
|
params = parsedArgs.params,
|
|
15515
15680
|
body = parsedArgs.body,
|
|
15516
15681
|
isRSAPI = parsedArgs.isRSAPI,
|
|
15517
|
-
isSuggestionsAPI = parsedArgs.isSuggestionsAPI
|
|
15682
|
+
isSuggestionsAPI = parsedArgs.isSuggestionsAPI,
|
|
15683
|
+
_parsedArgs$isMongoRe = parsedArgs.isMongoRequest,
|
|
15684
|
+
isMongoRequest = _parsedArgs$isMongoRe === undefined ? false : _parsedArgs$isMongoRe;
|
|
15518
15685
|
var app = isSuggestionsAPI ? '.suggestions' : _this.app;
|
|
15519
15686
|
var bodyCopy = body;
|
|
15520
15687
|
var contentType = path.endsWith('msearch') || path.endsWith('bulk') ? 'application/x-ndjson' : 'application/json';
|
|
@@ -15565,7 +15732,7 @@
|
|
|
15565
15732
|
paramsString = '?' + querystring.stringify(params);
|
|
15566
15733
|
}
|
|
15567
15734
|
|
|
15568
|
-
var finalURL = _this.protocol + '://' + _this.url + '/' + app + '/' + path + paramsString;
|
|
15735
|
+
var finalURL = isMongoRequest ? _this.protocol + '://' + _this.url : _this.protocol + '://' + _this.url + '/' + app + '/' + path + paramsString;
|
|
15569
15736
|
return handleTransformRequest(Object.assign({}, {
|
|
15570
15737
|
url: finalURL
|
|
15571
15738
|
}, requestOptions)).then(function (ts) {
|
|
@@ -15574,7 +15741,7 @@
|
|
|
15574
15741
|
delete transformedRequest.url;
|
|
15575
15742
|
return browserPonyfill$1(url || finalURL, Object.assign({}, transformedRequest, {
|
|
15576
15743
|
// apply timestamp header for RS API
|
|
15577
|
-
headers: isRSAPI ? Object.assign({}, transformedRequest.headers, {
|
|
15744
|
+
headers: isRSAPI && !isMongoRequest ? Object.assign({}, transformedRequest.headers, {
|
|
15578
15745
|
'x-timestamp': new Date().getTime()
|
|
15579
15746
|
}) : transformedRequest.headers
|
|
15580
15747
|
})).then(function (res) {
|
|
@@ -15609,7 +15776,7 @@
|
|
|
15609
15776
|
} // reject only when all responses has error
|
|
15610
15777
|
|
|
15611
15778
|
|
|
15612
|
-
if (errorResponses > 0 && allResponses === errorResponses) {
|
|
15779
|
+
if (errorResponses > 0 && allResponses === errorResponses && !isMongoRequest) {
|
|
15613
15780
|
return reject(data);
|
|
15614
15781
|
}
|
|
15615
15782
|
}
|
|
@@ -15939,12 +16106,20 @@
|
|
|
15939
16106
|
settings: parsedSettings,
|
|
15940
16107
|
query: query
|
|
15941
16108
|
};
|
|
16109
|
+
|
|
16110
|
+
if (this.mongodb) {
|
|
16111
|
+
Object.assign(body, {
|
|
16112
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16113
|
+
});
|
|
16114
|
+
}
|
|
16115
|
+
|
|
15942
16116
|
return this.performFetchRequest({
|
|
15943
16117
|
method: 'POST',
|
|
15944
16118
|
path: '_reactivesearch',
|
|
15945
16119
|
body: body,
|
|
15946
|
-
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
15947
|
-
isRSAPI: true
|
|
16120
|
+
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
16121
|
+
isRSAPI: true,
|
|
16122
|
+
isMongoRequest: !!this.mongodb
|
|
15948
16123
|
});
|
|
15949
16124
|
}
|
|
15950
16125
|
/**
|
|
@@ -15971,12 +16146,20 @@
|
|
|
15971
16146
|
settings: parsedSettings,
|
|
15972
16147
|
query: query
|
|
15973
16148
|
};
|
|
16149
|
+
|
|
16150
|
+
if (this.mongodb) {
|
|
16151
|
+
Object.assign(body, {
|
|
16152
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16153
|
+
});
|
|
16154
|
+
}
|
|
16155
|
+
|
|
15974
16156
|
return this.performFetchRequest({
|
|
15975
16157
|
method: 'POST',
|
|
15976
16158
|
path: '_reactivesearch.v3',
|
|
15977
16159
|
body: body,
|
|
15978
|
-
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
15979
|
-
isRSAPI: true
|
|
16160
|
+
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
16161
|
+
isRSAPI: true,
|
|
16162
|
+
isMongoRequest: !!this.mongodb
|
|
15980
16163
|
});
|
|
15981
16164
|
}
|
|
15982
16165
|
/**
|
|
@@ -16014,13 +16197,21 @@
|
|
|
16014
16197
|
settings: parsedSettings,
|
|
16015
16198
|
query: query
|
|
16016
16199
|
};
|
|
16200
|
+
|
|
16201
|
+
if (this.mongodb) {
|
|
16202
|
+
Object.assign(body, {
|
|
16203
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16204
|
+
});
|
|
16205
|
+
}
|
|
16206
|
+
|
|
16017
16207
|
return this.performFetchRequest({
|
|
16018
16208
|
method: 'POST',
|
|
16019
16209
|
path: '_reactivesearch.v3',
|
|
16020
16210
|
body: body,
|
|
16021
16211
|
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
16022
16212
|
isRSAPI: true,
|
|
16023
|
-
isSuggestionsAPI: true
|
|
16213
|
+
isSuggestionsAPI: true,
|
|
16214
|
+
isMongoRequest: !!this.mongodb
|
|
16024
16215
|
});
|
|
16025
16216
|
}
|
|
16026
16217
|
|
|
@@ -16752,7 +16943,7 @@
|
|
|
16752
16943
|
}
|
|
16753
16944
|
},
|
|
16754
16945
|
props: {
|
|
16755
|
-
app: types.
|
|
16946
|
+
app: types.string,
|
|
16756
16947
|
analytics: VueTypes.bool,
|
|
16757
16948
|
analyticsConfig: types.analyticsConfig,
|
|
16758
16949
|
appbaseConfig: types.appbaseConfig,
|
|
@@ -16772,7 +16963,8 @@
|
|
|
16772
16963
|
transformResponse: types.func,
|
|
16773
16964
|
as: VueTypes.string.def('div'),
|
|
16774
16965
|
getSearchParams: types.func,
|
|
16775
|
-
setSearchParams: types.func
|
|
16966
|
+
setSearchParams: types.func,
|
|
16967
|
+
mongodb: types.mongodb
|
|
16776
16968
|
},
|
|
16777
16969
|
provide: function provide() {
|
|
16778
16970
|
return {
|
|
@@ -16812,6 +17004,9 @@
|
|
|
16812
17004
|
this.store.dispatch(analytics_3$1(newVal));
|
|
16813
17005
|
}
|
|
16814
17006
|
}
|
|
17007
|
+
},
|
|
17008
|
+
mongodb: function mongodb() {
|
|
17009
|
+
this.updateState(this.$props);
|
|
16815
17010
|
}
|
|
16816
17011
|
},
|
|
16817
17012
|
computed: {
|
|
@@ -16819,12 +17014,13 @@
|
|
|
16819
17014
|
var _this$$props = this.$props,
|
|
16820
17015
|
enableAppbase = _this$$props.enableAppbase,
|
|
16821
17016
|
headers = _this$$props.headers,
|
|
16822
|
-
appbaseConfig = _this$$props.appbaseConfig
|
|
17017
|
+
appbaseConfig = _this$$props.appbaseConfig,
|
|
17018
|
+
mongodb = _this$$props.mongodb;
|
|
16823
17019
|
|
|
16824
17020
|
var _ref = appbaseConfig || {},
|
|
16825
17021
|
enableTelemetry = _ref.enableTelemetry;
|
|
16826
17022
|
|
|
16827
|
-
return _extends({}, enableAppbase && _extends({
|
|
17023
|
+
return _extends({}, enableAppbase && !mongodb && _extends({
|
|
16828
17024
|
'X-Search-Client': X_SEARCH_CLIENT
|
|
16829
17025
|
}, enableTelemetry === false && {
|
|
16830
17026
|
'X-Enable-Telemetry': false
|
|
@@ -16842,7 +17038,7 @@
|
|
|
16842
17038
|
var appbaseConfig = _extends({}, props.analyticsConfig, props.appbaseConfig);
|
|
16843
17039
|
|
|
16844
17040
|
var config = {
|
|
16845
|
-
url: props.url && props.url.trim() !== '' ? props.url : '
|
|
17041
|
+
url: props.url && props.url.trim() !== '' ? props.url : '',
|
|
16846
17042
|
app: props.app,
|
|
16847
17043
|
credentials: credentials,
|
|
16848
17044
|
type: props.type ? props.type : '*',
|
|
@@ -16850,7 +17046,8 @@
|
|
|
16850
17046
|
transformResponse: props.transformResponse,
|
|
16851
17047
|
enableAppbase: props.enableAppbase,
|
|
16852
17048
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
16853
|
-
analyticsConfig: appbaseConfig
|
|
17049
|
+
analyticsConfig: appbaseConfig,
|
|
17050
|
+
mongodb: props.mongodb
|
|
16854
17051
|
};
|
|
16855
17052
|
var queryParams = '';
|
|
16856
17053
|
|
|
@@ -26098,7 +26295,7 @@
|
|
|
26098
26295
|
});
|
|
26099
26296
|
}
|
|
26100
26297
|
|
|
26101
|
-
var version = "1.23.
|
|
26298
|
+
var version = "1.23.4-alpha";
|
|
26102
26299
|
|
|
26103
26300
|
var _templateObject$n, _templateObject2$a;
|
|
26104
26301
|
|