@constructor-io/constructorio-node 4.4.1 → 4.4.3
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/package.json +1 -1
- package/src/modules/browse.js +7 -0
- package/src/modules/search.js +7 -0
package/package.json
CHANGED
package/src/modules/browse.js
CHANGED
|
@@ -36,6 +36,7 @@ function createQueryParams(parameters, userParameters, options) {
|
|
|
36
36
|
hiddenFields,
|
|
37
37
|
hiddenFacets,
|
|
38
38
|
variationsMap,
|
|
39
|
+
preFilterExpression,
|
|
39
40
|
} = parameters;
|
|
40
41
|
|
|
41
42
|
// Pull page from parameters
|
|
@@ -99,6 +100,11 @@ function createQueryParams(parameters, userParameters, options) {
|
|
|
99
100
|
if (variationsMap) {
|
|
100
101
|
queryParams.variations_map = JSON.stringify(variationsMap);
|
|
101
102
|
}
|
|
103
|
+
|
|
104
|
+
// Pull filter expression from parameters
|
|
105
|
+
if (preFilterExpression) {
|
|
106
|
+
queryParams.pre_filter_expression = JSON.stringify(preFilterExpression);
|
|
107
|
+
}
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
// Pull test cells from options
|
|
@@ -245,6 +251,7 @@ class Browse {
|
|
|
245
251
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
246
252
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facet fields to return
|
|
247
253
|
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
|
|
254
|
+
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.io/rest_api/collections/#add-items-dynamically for details
|
|
248
255
|
* @param {object} [userParameters] - Parameters relevant to the user request
|
|
249
256
|
* @param {number} [userParameters.sessionId] - Session ID, utilized to personalize results
|
|
250
257
|
* @param {number} [userParameters.clientId] - Client ID, utilized to personalize results
|
package/src/modules/search.js
CHANGED
|
@@ -60,6 +60,7 @@ function createSearchUrl(query, parameters, userParameters, options) {
|
|
|
60
60
|
hiddenFields,
|
|
61
61
|
hiddenFacets,
|
|
62
62
|
variationsMap,
|
|
63
|
+
preFilterExpression,
|
|
63
64
|
} = parameters;
|
|
64
65
|
|
|
65
66
|
// Pull page from parameters
|
|
@@ -124,6 +125,11 @@ function createSearchUrl(query, parameters, userParameters, options) {
|
|
|
124
125
|
if (variationsMap) {
|
|
125
126
|
queryParams.variations_map = JSON.stringify(variationsMap);
|
|
126
127
|
}
|
|
128
|
+
|
|
129
|
+
// Pull filter expression from parameters
|
|
130
|
+
if (preFilterExpression) {
|
|
131
|
+
queryParams.pre_filter_expression = JSON.stringify(preFilterExpression);
|
|
132
|
+
}
|
|
127
133
|
}
|
|
128
134
|
|
|
129
135
|
queryParams._dt = Date.now();
|
|
@@ -163,6 +169,7 @@ class Search {
|
|
|
163
169
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
164
170
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facet fields to return
|
|
165
171
|
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
|
|
172
|
+
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.io/rest_api/collections/#add-items-dynamically for details
|
|
166
173
|
* @param {object} [userParameters] - Parameters relevant to the user request
|
|
167
174
|
* @param {number} [userParameters.sessionId] - Session ID, utilized to personalize results
|
|
168
175
|
* @param {number} [userParameters.clientId] - Client ID, utilized to personalize results
|