search-client
Version:
Javascript library for executing searches in the Haive search-index via the SearchManager REST interface.
41 lines • 1.87 kB
JavaScript
import { __assign } from "tslib";
import { AuthenticationSettings, } from './Authentication';
import { AutocompleteSettings } from './Autocomplete';
import { CategorizeSettings } from './Categorize';
import { Query } from './Common';
import { FindSettings } from './Find';
/**
* Settings as used by the SearchClient.
*
* Please see the data-type description for each property in question.
*/
var Settings = /** @class */ (function () {
/**
* Creates a Settings object for you, based on Settings defaults and the overrides provided as a param.
* @param settings - The settings defined here will override the default Settings.
*/
function Settings(settings) {
if (typeof settings === 'string') {
settings = { baseUrl: settings };
}
this.baseUrl = settings.baseUrl;
this.basePath =
typeof settings.basePath !== 'undefined'
? settings.basePath
: 'RestService/v4';
// The baseUrl is to be used by all services, unless they have a specified baseUrl themselves.
var common = { basePath: this.basePath, baseUrl: this.baseUrl };
if (settings.authentication &&
typeof settings.authentication.basePath === 'undefined') {
settings.authentication.basePath = '';
}
this.authentication = new AuthenticationSettings(__assign(__assign({}, common), settings.authentication));
this.autocomplete = new AutocompleteSettings(__assign(__assign({}, common), settings.autocomplete));
this.categorize = new CategorizeSettings(__assign(__assign({}, common), settings.categorize));
this.find = new FindSettings(__assign(__assign({}, common), settings.find));
this.query = new Query(settings.query);
}
return Settings;
}());
export { Settings };
//# sourceMappingURL=Settings.js.map