@constructor-io/constructorio-client-javascript 2.28.0 → 2.29.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.
|
@@ -64,7 +64,8 @@ function createAutocompleteUrl(query, parameters, options) {
|
|
|
64
64
|
var numResults = parameters.numResults,
|
|
65
65
|
resultsPerSection = parameters.resultsPerSection,
|
|
66
66
|
filters = parameters.filters,
|
|
67
|
-
hiddenFields = parameters.hiddenFields
|
|
67
|
+
hiddenFields = parameters.hiddenFields,
|
|
68
|
+
variationsMap = parameters.variationsMap; // Pull results number from parameters
|
|
68
69
|
|
|
69
70
|
if (numResults) {
|
|
70
71
|
queryParams.num_results = numResults;
|
|
@@ -91,6 +92,11 @@ function createAutocompleteUrl(query, parameters, options) {
|
|
|
91
92
|
hidden_fields: hiddenFields
|
|
92
93
|
};
|
|
93
94
|
}
|
|
95
|
+
} // Pull variations map from parameters
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
if (variationsMap) {
|
|
99
|
+
queryParams.variations_map = JSON.stringify(variationsMap);
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
102
|
|
|
@@ -129,6 +135,7 @@ var Autocomplete = /*#__PURE__*/function () {
|
|
|
129
135
|
* @param {object} [parameters.filters] - Key / value mapping (dictionary) of filters used to refine results
|
|
130
136
|
* @param {object} [parameters.resultsPerSection] - Number of results to return (value) per section (key)
|
|
131
137
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
138
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
|
|
132
139
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
133
140
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
134
141
|
* @returns {Promise}
|
package/lib/modules/browse.js
CHANGED
|
@@ -66,7 +66,8 @@ function createQueryParams(parameters, options) {
|
|
|
66
66
|
section = parameters.section,
|
|
67
67
|
fmtOptions = parameters.fmtOptions,
|
|
68
68
|
hiddenFields = parameters.hiddenFields,
|
|
69
|
-
hiddenFacets = parameters.hiddenFacets
|
|
69
|
+
hiddenFacets = parameters.hiddenFacets,
|
|
70
|
+
variationsMap = parameters.variationsMap; // Pull page from parameters
|
|
70
71
|
|
|
71
72
|
if (!helpers.isNil(page)) {
|
|
72
73
|
queryParams.page = page;
|
|
@@ -121,6 +122,11 @@ function createQueryParams(parameters, options) {
|
|
|
121
122
|
hidden_facets: hiddenFacets
|
|
122
123
|
};
|
|
123
124
|
}
|
|
125
|
+
} // Pull variations map from parameters
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if (variationsMap) {
|
|
129
|
+
queryParams.variations_map = JSON.stringify(variationsMap);
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
132
|
|
|
@@ -231,6 +237,7 @@ var Browse = /*#__PURE__*/function () {
|
|
|
231
237
|
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups
|
|
232
238
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
233
239
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
240
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
|
|
234
241
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
235
242
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
236
243
|
* @returns {Promise}
|
|
@@ -311,6 +318,7 @@ var Browse = /*#__PURE__*/function () {
|
|
|
311
318
|
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups
|
|
312
319
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
313
320
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
321
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
|
|
314
322
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
315
323
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
316
324
|
* @returns {Promise}
|
|
@@ -52,7 +52,8 @@ function createRecommendationsUrl(podId, parameters, options) {
|
|
|
52
52
|
itemIds = parameters.itemIds,
|
|
53
53
|
section = parameters.section,
|
|
54
54
|
term = parameters.term,
|
|
55
|
-
filters = parameters.filters
|
|
55
|
+
filters = parameters.filters,
|
|
56
|
+
variationsMap = parameters.variationsMap; // Pull num results number from parameters
|
|
56
57
|
|
|
57
58
|
if (!helpers.isNil(numResults)) {
|
|
58
59
|
queryParams.num_results = numResults;
|
|
@@ -76,6 +77,11 @@ function createRecommendationsUrl(podId, parameters, options) {
|
|
|
76
77
|
|
|
77
78
|
if (filters) {
|
|
78
79
|
queryParams.filters = filters;
|
|
80
|
+
} // Pull variations map from parameters
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if (variationsMap) {
|
|
84
|
+
queryParams.variations_map = JSON.stringify(variationsMap);
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
87
|
|
|
@@ -112,6 +118,7 @@ var Recommendations = /*#__PURE__*/function () {
|
|
|
112
118
|
* @param {string} [parameters.section] - The section to return results from
|
|
113
119
|
* @param {string} [parameters.term] - The term to use to refine results (strategy specific)
|
|
114
120
|
* @param {object} [parameters.filters] - Key / value mapping of filters used to refine results (strategy specific)
|
|
121
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
|
|
115
122
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
116
123
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
117
124
|
* @returns {Promise}
|
package/lib/modules/search.js
CHANGED
|
@@ -66,7 +66,8 @@ function createSearchUrl(query, parameters, options) {
|
|
|
66
66
|
section = parameters.section,
|
|
67
67
|
fmtOptions = parameters.fmtOptions,
|
|
68
68
|
hiddenFields = parameters.hiddenFields,
|
|
69
|
-
hiddenFacets = parameters.hiddenFacets
|
|
69
|
+
hiddenFacets = parameters.hiddenFacets,
|
|
70
|
+
variationsMap = parameters.variationsMap; // Pull page from parameters
|
|
70
71
|
|
|
71
72
|
if (!helpers.isNil(page)) {
|
|
72
73
|
queryParams.page = page;
|
|
@@ -122,6 +123,11 @@ function createSearchUrl(query, parameters, options) {
|
|
|
122
123
|
hidden_facets: hiddenFacets
|
|
123
124
|
};
|
|
124
125
|
}
|
|
126
|
+
} // Pull variations map from parameters
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if (variationsMap) {
|
|
130
|
+
queryParams.variations_map = JSON.stringify(variationsMap);
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
133
|
|
|
@@ -163,6 +169,7 @@ var Search = /*#__PURE__*/function () {
|
|
|
163
169
|
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups
|
|
164
170
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
165
171
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
172
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
|
|
166
173
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
167
174
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
168
175
|
* @returns {Promise}
|