@constructor-io/constructorio-client-javascript 2.35.12 → 2.35.13

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.
@@ -4,6 +4,7 @@ import {
4
4
  NetworkParameters,
5
5
  RequestFeature,
6
6
  RequestFeatureVariant,
7
+ VariationsMap,
7
8
  } from '.';
8
9
  import EventDispatcher from './event-dispatcher';
9
10
 
@@ -14,7 +15,7 @@ export interface IAutocompleteParameters {
14
15
  filters?: Record<string, any>;
15
16
  resultsPerSection?: Record<string, number>;
16
17
  hiddenFields?: string[];
17
- variationsMap?: Record<string, any>;
18
+ variationsMap?: VariationsMap;
18
19
  }
19
20
 
20
21
  declare class Autocomplete {
@@ -11,6 +11,7 @@ import {
11
11
  RequestFeatureVariant,
12
12
  ResultSources,
13
13
  SortOption,
14
+ VariationsMap,
14
15
  } from '.';
15
16
  import EventDispatcher from './event-dispatcher';
16
17
 
@@ -28,7 +29,7 @@ export interface IBrowseParameters {
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
 
@@ -121,6 +122,7 @@ export interface BrowseResultData extends Record<string, any> {
121
122
  is_slotted: false;
122
123
  labels: Record<string, any>;
123
124
  variations: Record<string, any>[];
125
+ variations_map: Record<string, any> | Record<string, any>[];
124
126
  }
125
127
 
126
128
  export interface BrowseRequestType extends Record<string, any> {
@@ -204,3 +204,17 @@ export interface SearchSuggestion extends Item {
204
204
  total_num_results?: number
205
205
  } & ItemData;
206
206
  }
207
+
208
+ export interface VariationsMap {
209
+ group_by: Array<{
210
+ name: string,
211
+ field: string
212
+ }>;
213
+ values: {
214
+ [key: string]: {
215
+ aggregation: 'first' | 'min' | 'max' | 'all',
216
+ field: string
217
+ },
218
+ },
219
+ dtype: 'array' | 'object'
220
+ }
@@ -114,7 +114,7 @@ export interface SelectQuestion extends BaseQuestion {
114
114
 
115
115
  export interface OpenQuestion extends BaseQuestion {
116
116
  type: 'open'
117
- inputPlaceholder?: Nullable<string>;
117
+ input_placeholder?: Nullable<string>;
118
118
  }
119
119
 
120
120
  export interface CoverQuestion extends BaseQuestion {
@@ -1,4 +1,4 @@
1
- import { ConstructorClientOptions, NetworkParameters } from '.';
1
+ import { ConstructorClientOptions, NetworkParameters, VariationsMap } from '.';
2
2
  import EventDispatcher from './event-dispatcher';
3
3
 
4
4
  export default Recommendations;
@@ -9,7 +9,7 @@ export interface RecommendationsParameters {
9
9
  section?: string;
10
10
  term?: string;
11
11
  filters?: Record<string, any>;
12
- variationsMap?: Record<string, any>;
12
+ variationsMap?: VariationsMap;
13
13
  hiddenFields?: string[];
14
14
  }
15
15
 
@@ -10,6 +10,7 @@ import {
10
10
  RequestFeatureVariant,
11
11
  ResultSources,
12
12
  SortOption,
13
+ VariationsMap,
13
14
  } from '.';
14
15
  import EventDispatcher from './event-dispatcher';
15
16
 
@@ -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
  declare class Search {
@@ -95,6 +96,7 @@ export interface Result extends Record<string, any> {
95
96
  is_slotted: false;
96
97
  labels: Record<string, any>;
97
98
  variations: Record<string, any>[];
99
+ variations_map: Record<string, any> | Record<string, any>[];
98
100
  }
99
101
 
100
102
  export interface Redirect extends Record<string, any> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-client-javascript",
3
- "version": "2.35.12",
3
+ "version": "2.35.13",
4
4
  "description": "Constructor.io JavaScript client",
5
5
  "main": "lib/constructorio.js",
6
6
  "types": "lib/types/constructorio.d.ts",