@constructor-io/constructorio-client-javascript 2.35.10 → 2.35.11

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.
@@ -47,7 +47,8 @@ function createRecommendationsUrl(podId, parameters, options) {
47
47
  section = parameters.section,
48
48
  term = parameters.term,
49
49
  filters = parameters.filters,
50
- variationsMap = parameters.variationsMap; // Pull num results number from parameters
50
+ variationsMap = parameters.variationsMap,
51
+ hiddenFields = parameters.hiddenFields; // Pull num results number from parameters
51
52
 
52
53
  if (!helpers.isNil(numResults)) {
53
54
  queryParams.num_results = numResults;
@@ -71,6 +72,17 @@ function createRecommendationsUrl(podId, parameters, options) {
71
72
 
72
73
  if (filters) {
73
74
  queryParams.filters = filters;
75
+ } // Pull hidden fields from parameters
76
+
77
+
78
+ if (hiddenFields) {
79
+ if (queryParams.fmt_options) {
80
+ queryParams.fmt_options.hidden_fields = hiddenFields;
81
+ } else {
82
+ queryParams.fmt_options = {
83
+ hidden_fields: hiddenFields
84
+ };
85
+ }
74
86
  } // Pull variations map from parameters
75
87
 
76
88
 
@@ -111,6 +123,7 @@ var Recommendations = /*#__PURE__*/function () {
111
123
  * @param {string} [parameters.term] - The term to use to refine results (strategy specific)
112
124
  * @param {object} [parameters.filters] - Key / value mapping of filters used to refine results
113
125
  * @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
126
+ * @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
114
127
  * @param {object} [networkParameters] - Parameters relevant to the network request
115
128
  * @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
116
129
  * @returns {Promise}
@@ -10,6 +10,7 @@ export interface RecommendationsParameters {
10
10
  term?: string;
11
11
  filters?: Record<string, any>;
12
12
  variationsMap?: Record<string, any>;
13
+ hiddenFields?: string[];
13
14
  }
14
15
 
15
16
  declare class Recommendations {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-client-javascript",
3
- "version": "2.35.10",
3
+ "version": "2.35.11",
4
4
  "description": "Constructor.io JavaScript client",
5
5
  "main": "lib/constructorio.js",
6
6
  "types": "lib/types/constructorio.d.ts",