@constructor-io/constructorio-node 4.6.5 → 4.6.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-node",
3
- "version": "4.6.5",
3
+ "version": "4.6.7",
4
4
  "description": "Constructor.io Node.js client",
5
5
  "main": "src/constructorio.js",
6
6
  "types": "src/types/constructorio.d.ts",
@@ -133,10 +133,6 @@ class Autocomplete {
133
133
  * filters: {
134
134
  * size: 'medium'
135
135
  * },
136
- * }, {
137
- * testCells: {
138
- * testName: 'cellName',
139
- * },
140
136
  * });
141
137
  */
142
138
  getAutocompleteResults(query, parameters = {}, userParameters = {}, networkParameters = {}) {
@@ -277,10 +277,6 @@ class Browse {
277
277
  * filters: {
278
278
  * size: 'medium'
279
279
  * },
280
- * }, {
281
- * testCells: {
282
- * testName: 'cellName',
283
- * },
284
280
  * });
285
281
  */
286
282
  getBrowseResults(filterName, filterValue, parameters = {}, userParameters = {}, networkParameters = {}) {
@@ -361,10 +357,6 @@ class Browse {
361
357
  * filters: {
362
358
  * size: 'medium'
363
359
  * },
364
- * }, {
365
- * testCells: {
366
- * 'testName': 'cellName',
367
- * },
368
360
  * });
369
361
  */
370
362
  getBrowseResultsForItemIds(itemIds, parameters = {}, userParameters = {}, networkParameters = {}) {
@@ -433,10 +425,6 @@ class Browse {
433
425
  * fmtOptions: {
434
426
  * groups_max_depth: 2
435
427
  * }
436
- * }, {
437
- * testCells: {
438
- * 'testName': 'cellName',
439
- * },
440
428
  * });
441
429
  */
442
430
  getBrowseGroups(parameters = {}, userParameters = {}, networkParameters = {}) {
@@ -492,10 +480,6 @@ class Browse {
492
480
  * constructorio.browse.getBrowseFacets({
493
481
  * page: 1,
494
482
  * resultsPerPage: 10,
495
- * }, {
496
- * testCells: {
497
- * 'testName': 'cellName',
498
- * },
499
483
  * });
500
484
  */
501
485
  getBrowseFacets(parameters = {}, userParameters = {}, networkParameters = {}) {
@@ -120,10 +120,6 @@ class Recommendations {
120
120
  * filters: {
121
121
  * size: 'medium'
122
122
  * },
123
- * }, {
124
- * testCells: {
125
- * testName: 'cellName',
126
- * },
127
123
  * });
128
124
  */
129
125
  getRecommendations(podId, parameters = {}, userParameters = {}, networkParameters = {}) {
@@ -197,10 +197,6 @@ class Search {
197
197
  * filters: {
198
198
  * size: 'medium'
199
199
  * },
200
- * }, {
201
- * testCells: {
202
- * testName: 'cellName',
203
- * },
204
200
  * });
205
201
  */
206
202
 
@@ -548,7 +548,7 @@ class Tracker {
548
548
  * @param {string} term - Search results query term
549
549
  * @param {object} parameters - Additional parameters to be sent with request
550
550
  * @param {number} parameters.numResults - Total number of results
551
- * @param {string[]} [parameters.itemIds] - List of product item unique identifiers in search results listing
551
+ * @param {string[]} parameters.itemIds - List of product item unique identifiers in search results listing
552
552
  * @param {object} userParameters - Parameters relevant to the user request
553
553
  * @param {number} userParameters.sessionId - Session ID, utilized to personalize results
554
554
  * @param {string} userParameters.clientId - Client ID, utilized to personalize results
@@ -1237,6 +1237,7 @@ class Tracker {
1237
1237
  * @param {string} parameters.url - Current page URL
1238
1238
  * @param {string} parameters.filterName - Filter name
1239
1239
  * @param {string} parameters.filterValue - Filter value
1240
+ * @param {object[]} parameters.items - List of product item objects
1240
1241
  * @param {string} [parameters.section="Products"] - Index section
1241
1242
  * @param {number} [parameters.resultCount] - Total number of results
1242
1243
  * @param {number} [parameters.resultPage] - Page number of results
@@ -1244,7 +1245,6 @@ class Tracker {
1244
1245
  * @param {object} [parameters.selectedFilters] - Selected filters
1245
1246
  * @param {string} [parameters.sortOrder] - Sort order ('ascending' or 'descending')
1246
1247
  * @param {string} [parameters.sortBy] - Sorting method
1247
- * @param {object[]} [parameters.items] - List of product item objects
1248
1248
  * @param {object} userParameters - Parameters relevant to the user request
1249
1249
  * @param {number} userParameters.sessionId - Session ID, utilized to personalize results
1250
1250
  * @param {string} userParameters.clientId - Client ID, utilized to personalize results
@@ -4,6 +4,7 @@ import {
4
4
  RequestFeature,
5
5
  RequestFeatureVariant,
6
6
  UserParameters,
7
+ VariationsMap,
7
8
  } from '.';
8
9
 
9
10
  export default Autocomplete;
@@ -13,7 +14,7 @@ export interface AutocompleteParameters {
13
14
  filters?: Record<string, any>;
14
15
  resultsPerSection?: Record<string, number>;
15
16
  hiddenFields?: string[];
16
- variationsMap?: Record<string, any>;
17
+ variationsMap?: VariationsMap;
17
18
  }
18
19
 
19
20
  declare class Autocomplete {
@@ -12,6 +12,7 @@ import {
12
12
  SortOption,
13
13
  FmtOptions,
14
14
  FilterExpression,
15
+ VariationsMap,
15
16
  } from '.';
16
17
 
17
18
  export default Browse;
@@ -28,7 +29,7 @@ export interface BrowseParameters {
28
29
  preFilterExpression?: FilterExpression;
29
30
  hiddenFields?: string[];
30
31
  hiddenFacets?: string[];
31
- variationsMap?: Record<string, any>;
32
+ variationsMap?: VariationsMap;
32
33
  qsParam?: Record<string, any>;
33
34
  }
34
35
 
@@ -122,6 +123,7 @@ export interface BrowseResultData extends Record<string, any> {
122
123
  is_slotted: false;
123
124
  labels: Record<string, any>;
124
125
  variations: Record<string, any>[];
126
+ variations_map: Record<string, any> | Record<string, any>[];
125
127
  }
126
128
 
127
129
  export interface BrowseRequestType extends Record<string, any> {
@@ -145,6 +145,20 @@ export interface Variation extends Record<string, any> {
145
145
  data?: ItemData;
146
146
  }
147
147
 
148
+ export interface VariationsMap {
149
+ group_by: Array<{
150
+ name: string,
151
+ field: string
152
+ }>;
153
+ values: {
154
+ [key: string]: {
155
+ aggregation: 'first' | 'min' | 'max' | 'all',
156
+ field: string
157
+ },
158
+ },
159
+ dtype: 'array' | 'object'
160
+ }
161
+
148
162
  export interface ItemData extends Record<string, any> {
149
163
  keywords?: string[];
150
164
  url?: string;
@@ -318,3 +332,9 @@ export interface SearchabilityConfiguration {
318
332
  displayable?: boolean,
319
333
  hidden?: boolean,
320
334
  }
335
+
336
+ export interface ItemTracked {
337
+ itemName?: string;
338
+ itemId?: string;
339
+ variationId?: string;
340
+ }
@@ -1,4 +1,4 @@
1
- import { ConstructorClientOptions, NetworkParameters, UserParameters } from '.';
1
+ import { ConstructorClientOptions, NetworkParameters, UserParameters, VariationsMap } from '.';
2
2
 
3
3
  export default Recommendations;
4
4
 
@@ -8,7 +8,7 @@ interface RecommendationsParameters {
8
8
  section?: string;
9
9
  term?: string;
10
10
  filters?: Record<string, any>;
11
- variationsMap?: Record<string, any>;
11
+ variationsMap?: VariationsMap;
12
12
  }
13
13
 
14
14
  declare class Recommendations {
@@ -11,6 +11,7 @@ import {
11
11
  ResultSources,
12
12
  SortOption,
13
13
  UserParameters,
14
+ VariationsMap,
14
15
  } from '.';
15
16
 
16
17
  export default Search;
@@ -27,7 +28,7 @@ export interface SearchParameters {
27
28
  preFilterExpression?: FilterExpression;
28
29
  hiddenFields?: string[];
29
30
  hiddenFacets?: string[];
30
- variationsMap?: Record<string, any>;
31
+ variationsMap?: VariationsMap;
31
32
  qsParam?: Record<string, any>;
32
33
  }
33
34
 
@@ -94,6 +95,7 @@ export interface SearchResultType extends Record<string, any> {
94
95
  is_slotted: false;
95
96
  labels: Record<string, any>;
96
97
  variations: Record<string, any>[];
98
+ variations_map: Record<string, any> | Record<string, any>[];
97
99
  }
98
100
 
99
101
  export interface Redirect extends Record<string, any> {
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from 'events';
2
- import { ConstructorClientOptions, NetworkParameters } from '.';
2
+ import { ConstructorClientOptions, NetworkParameters, ItemTracked } from '.';
3
3
 
4
4
  export default Tracker;
5
5
 
@@ -72,7 +72,7 @@ declare class Tracker {
72
72
  term: string,
73
73
  parameters: {
74
74
  numResults: number;
75
- itemIds?: string[];
75
+ itemIds: string[];
76
76
  },
77
77
  userParameters?: TrackerUserParameters,
78
78
  networkParameters?: NetworkParameters
@@ -111,7 +111,7 @@ declare class Tracker {
111
111
 
112
112
  trackPurchase(
113
113
  parameters: {
114
- items: object[];
114
+ items: ItemTracked & {quantity: number}[];
115
115
  revenue: number;
116
116
  orderId?: string;
117
117
  section?: string;
@@ -125,7 +125,6 @@ declare class Tracker {
125
125
  url: string;
126
126
  podId: string;
127
127
  numResultsViewed: number;
128
- items?: object[];
129
128
  resultCount?: number;
130
129
  resultPage?: number;
131
130
  resultId?: string;
@@ -165,7 +164,7 @@ declare class Tracker {
165
164
  selectedFilters?: object;
166
165
  sortOrder?: string;
167
166
  sortBy?: string;
168
- items?: object[];
167
+ items: ItemTracked[];
169
168
  },
170
169
  userParameters?: TrackerUserParameters,
171
170
  networkParameters?: NetworkParameters