@constructor-io/constructorio-node 4.6.5 → 4.6.6

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.6",
4
4
  "description": "Constructor.io Node.js client",
5
5
  "main": "src/constructorio.js",
6
6
  "types": "src/types/constructorio.d.ts",
@@ -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;
@@ -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> {