@constructor-io/constructorio-client-javascript 2.39.1 → 2.40.0
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.
|
@@ -55,6 +55,7 @@ function createAutocompleteUrl(query, parameters, options) {
|
|
|
55
55
|
var numResults = parameters.numResults,
|
|
56
56
|
resultsPerSection = parameters.resultsPerSection,
|
|
57
57
|
filters = parameters.filters,
|
|
58
|
+
filtersPerSection = parameters.filtersPerSection,
|
|
58
59
|
hiddenFields = parameters.hiddenFields,
|
|
59
60
|
variationsMap = parameters.variationsMap;
|
|
60
61
|
|
|
@@ -75,6 +76,13 @@ function createAutocompleteUrl(query, parameters, options) {
|
|
|
75
76
|
queryParams.filters = filters;
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
// Pull filtersPerSection from parameters
|
|
80
|
+
if (filtersPerSection) {
|
|
81
|
+
Object.keys(filtersPerSection).forEach(function (section) {
|
|
82
|
+
queryParams["filters[".concat(section, "]")] = filtersPerSection[section];
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
78
86
|
// Pull hidden fields from parameters
|
|
79
87
|
if (hiddenFields) {
|
|
80
88
|
if (queryParams.fmt_options) {
|
|
@@ -122,6 +130,7 @@ var Autocomplete = /*#__PURE__*/function () {
|
|
|
122
130
|
* @param {object} [parameters] - Additional parameters to refine result set
|
|
123
131
|
* @param {number} [parameters.numResults] - The total number of results to return
|
|
124
132
|
* @param {object} [parameters.filters] - Key / value mapping (dictionary) of filters used to refine results
|
|
133
|
+
* @param {object} [parameters.filtersPerSection] - Filters used to refine results per section
|
|
125
134
|
* @param {object} [parameters.resultsPerSection] - Number of results to return (value) per section (key)
|
|
126
135
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
127
136
|
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
|
|
@@ -13,6 +13,7 @@ export default Autocomplete;
|
|
|
13
13
|
export interface IAutocompleteParameters {
|
|
14
14
|
numResults?: number;
|
|
15
15
|
filters?: Record<string, any>;
|
|
16
|
+
filtersPerSection?: Record<string, Record<string, any>>;
|
|
16
17
|
resultsPerSection?: Record<string, number>;
|
|
17
18
|
hiddenFields?: string[];
|
|
18
19
|
variationsMap?: VariationsMap;
|