@depict-ai/ui 0.0.83 → 1.0.2
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/dist/index.d.ts +25 -4
- package/dist/main.js +247 -232
- package/dist/module.js +249 -234
- package/dist/typescript_schema/BaseSearchRequest.d.ts +197 -0
- package/dist/typescript_schema/ProductListingQueriesRequest.d.ts +14 -0
- package/dist/typescript_schema/ProductListingQueriesResponse.d.ts +10 -0
- package/dist/typescript_schema/ProductListingRequest.d.ts +221 -0
- package/dist/typescript_schema/ProductListingResponse.d.ts +232 -0
- package/dist/typescript_schema/RecommendResponse.d.ts +15 -0
- package/dist/typescript_schema/SearchRequest.d.ts +213 -0
- package/dist/typescript_schema/SearchResponse.d.ts +192 -0
- package/dist/typescript_schema/SearchSuggestionsRequest.d.ts +18 -0
- package/dist/typescript_schema/SearchSuggestionsResponse.d.ts +182 -0
- package/dist/typescript_schema/TrackV2Request.d.ts +115 -0
- package/package.json +4 -5
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* An enumeration.
|
|
10
|
+
*/
|
|
11
|
+
export type SortingOrder = "asc" | "desc";
|
|
12
|
+
|
|
13
|
+
export interface BaseSearchRequest {
|
|
14
|
+
tenant: string;
|
|
15
|
+
market: string;
|
|
16
|
+
/**
|
|
17
|
+
* List of filters to apply to the results.
|
|
18
|
+
*/
|
|
19
|
+
filters?: SearchFilter[];
|
|
20
|
+
/**
|
|
21
|
+
* Specifies the sorting method. By default, the results are ordered by relevance. To find the possible values for this field, query the endpoint and look at the `sorts` field.
|
|
22
|
+
*/
|
|
23
|
+
sort?: SortModel;
|
|
24
|
+
/**
|
|
25
|
+
* User identifier
|
|
26
|
+
*/
|
|
27
|
+
user_id?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Session identifier
|
|
30
|
+
*/
|
|
31
|
+
session_id?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Populated for integrations performed by Depict.ai only. Depict.ai Session Id
|
|
34
|
+
*/
|
|
35
|
+
dsid?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Metadata that can be used to modify the behaviour of the search.
|
|
38
|
+
*/
|
|
39
|
+
metadata?: {
|
|
40
|
+
[k: string]: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The search query.
|
|
44
|
+
*/
|
|
45
|
+
query?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface SearchFilter {
|
|
48
|
+
/**
|
|
49
|
+
* The field to filter by.
|
|
50
|
+
*/
|
|
51
|
+
field: string;
|
|
52
|
+
/**
|
|
53
|
+
* The operation used for filtering. The filtering should be read as `field op data`, for example `brand in ["Nike", "Adidas"]`.
|
|
54
|
+
*/
|
|
55
|
+
op: "eq" | "neq" | "in" | "nin" | "leq" | "geq" | "inrange";
|
|
56
|
+
/**
|
|
57
|
+
* Data for the filter.
|
|
58
|
+
*/
|
|
59
|
+
data?:
|
|
60
|
+
| ("true" | "false")
|
|
61
|
+
| number
|
|
62
|
+
| number
|
|
63
|
+
| string
|
|
64
|
+
| [number, number]
|
|
65
|
+
| [number, number]
|
|
66
|
+
| [number, number]
|
|
67
|
+
| [number, number]
|
|
68
|
+
| (
|
|
69
|
+
| ("true" | "false")
|
|
70
|
+
| number
|
|
71
|
+
| number
|
|
72
|
+
| string
|
|
73
|
+
| [number, number]
|
|
74
|
+
| [number, number]
|
|
75
|
+
| [number, number]
|
|
76
|
+
| [number, number]
|
|
77
|
+
)[]
|
|
78
|
+
| (("true" | "false") | number | number | string)[][];
|
|
79
|
+
/**
|
|
80
|
+
* Metadata about the filter that can be used for rendering. For example, this could contain the possible values to filter by and their counts in the results.
|
|
81
|
+
*/
|
|
82
|
+
meta?: RangeFilterMeta | ValuesFilterMeta | HierarchicalValuesFilterMeta;
|
|
83
|
+
/**
|
|
84
|
+
* ID of the filter. If multiple filters share the same ID, they should be grouped together in the UI.
|
|
85
|
+
*/
|
|
86
|
+
id?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface RangeFilterMeta {
|
|
89
|
+
/**
|
|
90
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
91
|
+
*/
|
|
92
|
+
group_title?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the filter group should be expanded by default or not.
|
|
95
|
+
*/
|
|
96
|
+
group_expanded?: boolean;
|
|
97
|
+
type?: "range";
|
|
98
|
+
/**
|
|
99
|
+
* The minimum value that can be selected in the range.
|
|
100
|
+
*/
|
|
101
|
+
min: number;
|
|
102
|
+
/**
|
|
103
|
+
* The maximum value that can be selected in the range.
|
|
104
|
+
*/
|
|
105
|
+
max: number;
|
|
106
|
+
/**
|
|
107
|
+
* The unit of the range values.
|
|
108
|
+
*/
|
|
109
|
+
unit?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The currency of the range values.
|
|
112
|
+
*/
|
|
113
|
+
currency?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ValuesFilterMeta {
|
|
116
|
+
/**
|
|
117
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
118
|
+
*/
|
|
119
|
+
group_title?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Whether the filter group should be expanded by default or not.
|
|
122
|
+
*/
|
|
123
|
+
group_expanded?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Type of filter.
|
|
126
|
+
*/
|
|
127
|
+
type?: "radio" | "checkbox" | "checkbox-grid";
|
|
128
|
+
/**
|
|
129
|
+
* Selectable values
|
|
130
|
+
*/
|
|
131
|
+
values: (
|
|
132
|
+
| ("true" | "false")
|
|
133
|
+
| number
|
|
134
|
+
| number
|
|
135
|
+
| string
|
|
136
|
+
| [number, number]
|
|
137
|
+
| [number, number]
|
|
138
|
+
| [number, number]
|
|
139
|
+
| [number, number]
|
|
140
|
+
)[];
|
|
141
|
+
/**
|
|
142
|
+
* Counts for values
|
|
143
|
+
*/
|
|
144
|
+
counts?: number[];
|
|
145
|
+
/**
|
|
146
|
+
* Names for values
|
|
147
|
+
*/
|
|
148
|
+
names?: string[];
|
|
149
|
+
}
|
|
150
|
+
export interface HierarchicalValuesFilterMeta {
|
|
151
|
+
/**
|
|
152
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
153
|
+
*/
|
|
154
|
+
group_title?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Whether the filter group should be expanded by default or not.
|
|
157
|
+
*/
|
|
158
|
+
group_expanded?: boolean;
|
|
159
|
+
type?: "checkbox-hierarchical";
|
|
160
|
+
/**
|
|
161
|
+
* Selectable hierarchical values
|
|
162
|
+
*/
|
|
163
|
+
values: (("true" | "false") | number | number | string)[][];
|
|
164
|
+
/**
|
|
165
|
+
* Counts for values
|
|
166
|
+
*/
|
|
167
|
+
counts?: number[];
|
|
168
|
+
/**
|
|
169
|
+
* Names for hierarchical values
|
|
170
|
+
*/
|
|
171
|
+
names?: string[];
|
|
172
|
+
}
|
|
173
|
+
export interface SortModel {
|
|
174
|
+
/**
|
|
175
|
+
* The field to sort by.
|
|
176
|
+
*/
|
|
177
|
+
field: string;
|
|
178
|
+
/**
|
|
179
|
+
* The order to sort by.
|
|
180
|
+
*/
|
|
181
|
+
order: SortingOrder;
|
|
182
|
+
/**
|
|
183
|
+
* Metadata about the sort that can be used for rendering.
|
|
184
|
+
*/
|
|
185
|
+
meta?: SortMeta;
|
|
186
|
+
}
|
|
187
|
+
export interface SortMeta {
|
|
188
|
+
title: string;
|
|
189
|
+
/**
|
|
190
|
+
* Selectable values
|
|
191
|
+
*/
|
|
192
|
+
values?: SortingOrder[];
|
|
193
|
+
/**
|
|
194
|
+
* Names for orders
|
|
195
|
+
*/
|
|
196
|
+
names?: string[];
|
|
197
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface ProductListingQueriesRequest {
|
|
9
|
+
tenant: string;
|
|
10
|
+
market: string;
|
|
11
|
+
metadata?: {
|
|
12
|
+
[k: string]: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface ProductListingQueriesResponse {
|
|
9
|
+
query_ids?: string[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* An enumeration.
|
|
10
|
+
*/
|
|
11
|
+
export type SortingOrder = "asc" | "desc";
|
|
12
|
+
|
|
13
|
+
export interface ProductListingRequest {
|
|
14
|
+
/**
|
|
15
|
+
* Deprecated, do not use. Will be removed.
|
|
16
|
+
*/
|
|
17
|
+
page?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Deprecated, do not use. Will be removed.
|
|
20
|
+
*/
|
|
21
|
+
hits_per_page?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Used for cursor-based pagination. Set it to the cursor from the last response. If not set, will return the first results.
|
|
24
|
+
*/
|
|
25
|
+
cursor?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Maximum number of results per response.
|
|
28
|
+
*/
|
|
29
|
+
limit?: number;
|
|
30
|
+
tenant: string;
|
|
31
|
+
market: string;
|
|
32
|
+
/**
|
|
33
|
+
* List of filters to apply to the results.
|
|
34
|
+
*/
|
|
35
|
+
filters?: SearchFilter[];
|
|
36
|
+
/**
|
|
37
|
+
* Specifies the sorting method. By default, the results are ordered by relevance. To find the possible values for this field, query the endpoint and look at the `sorts` field.
|
|
38
|
+
*/
|
|
39
|
+
sort?: SortModel;
|
|
40
|
+
/**
|
|
41
|
+
* User identifier
|
|
42
|
+
*/
|
|
43
|
+
user_id?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Session identifier
|
|
46
|
+
*/
|
|
47
|
+
session_id?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Populated for integrations performed by Depict.ai only. Depict.ai Session Id
|
|
50
|
+
*/
|
|
51
|
+
dsid?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Metadata that can be used to modify the behaviour of the search.
|
|
54
|
+
*/
|
|
55
|
+
metadata?: {
|
|
56
|
+
[k: string]: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* ID of the page to get products for. This is typically the slug, for example `hoodies-and-sweaters`.
|
|
60
|
+
*/
|
|
61
|
+
query_id: string;
|
|
62
|
+
/**
|
|
63
|
+
* Disables rules to hide products.
|
|
64
|
+
*/
|
|
65
|
+
show_hidden_products?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Whether to return grouping IDs or not.
|
|
68
|
+
*/
|
|
69
|
+
return_grouping_ids?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface SearchFilter {
|
|
72
|
+
/**
|
|
73
|
+
* The field to filter by.
|
|
74
|
+
*/
|
|
75
|
+
field: string;
|
|
76
|
+
/**
|
|
77
|
+
* The operation used for filtering. The filtering should be read as `field op data`, for example `brand in ["Nike", "Adidas"]`.
|
|
78
|
+
*/
|
|
79
|
+
op: "eq" | "neq" | "in" | "nin" | "leq" | "geq" | "inrange";
|
|
80
|
+
/**
|
|
81
|
+
* Data for the filter.
|
|
82
|
+
*/
|
|
83
|
+
data?:
|
|
84
|
+
| ("true" | "false")
|
|
85
|
+
| number
|
|
86
|
+
| number
|
|
87
|
+
| string
|
|
88
|
+
| [number, number]
|
|
89
|
+
| [number, number]
|
|
90
|
+
| [number, number]
|
|
91
|
+
| [number, number]
|
|
92
|
+
| (
|
|
93
|
+
| ("true" | "false")
|
|
94
|
+
| number
|
|
95
|
+
| number
|
|
96
|
+
| string
|
|
97
|
+
| [number, number]
|
|
98
|
+
| [number, number]
|
|
99
|
+
| [number, number]
|
|
100
|
+
| [number, number]
|
|
101
|
+
)[]
|
|
102
|
+
| (("true" | "false") | number | number | string)[][];
|
|
103
|
+
/**
|
|
104
|
+
* Metadata about the filter that can be used for rendering. For example, this could contain the possible values to filter by and their counts in the results.
|
|
105
|
+
*/
|
|
106
|
+
meta?: RangeFilterMeta | ValuesFilterMeta | HierarchicalValuesFilterMeta;
|
|
107
|
+
/**
|
|
108
|
+
* ID of the filter. If multiple filters share the same ID, they should be grouped together in the UI.
|
|
109
|
+
*/
|
|
110
|
+
id?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface RangeFilterMeta {
|
|
113
|
+
/**
|
|
114
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
115
|
+
*/
|
|
116
|
+
group_title?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Whether the filter group should be expanded by default or not.
|
|
119
|
+
*/
|
|
120
|
+
group_expanded?: boolean;
|
|
121
|
+
type?: "range";
|
|
122
|
+
/**
|
|
123
|
+
* The minimum value that can be selected in the range.
|
|
124
|
+
*/
|
|
125
|
+
min: number;
|
|
126
|
+
/**
|
|
127
|
+
* The maximum value that can be selected in the range.
|
|
128
|
+
*/
|
|
129
|
+
max: number;
|
|
130
|
+
/**
|
|
131
|
+
* The unit of the range values.
|
|
132
|
+
*/
|
|
133
|
+
unit?: string;
|
|
134
|
+
/**
|
|
135
|
+
* The currency of the range values.
|
|
136
|
+
*/
|
|
137
|
+
currency?: string;
|
|
138
|
+
}
|
|
139
|
+
export interface ValuesFilterMeta {
|
|
140
|
+
/**
|
|
141
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
142
|
+
*/
|
|
143
|
+
group_title?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the filter group should be expanded by default or not.
|
|
146
|
+
*/
|
|
147
|
+
group_expanded?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Type of filter.
|
|
150
|
+
*/
|
|
151
|
+
type?: "radio" | "checkbox" | "checkbox-grid";
|
|
152
|
+
/**
|
|
153
|
+
* Selectable values
|
|
154
|
+
*/
|
|
155
|
+
values: (
|
|
156
|
+
| ("true" | "false")
|
|
157
|
+
| number
|
|
158
|
+
| number
|
|
159
|
+
| string
|
|
160
|
+
| [number, number]
|
|
161
|
+
| [number, number]
|
|
162
|
+
| [number, number]
|
|
163
|
+
| [number, number]
|
|
164
|
+
)[];
|
|
165
|
+
/**
|
|
166
|
+
* Counts for values
|
|
167
|
+
*/
|
|
168
|
+
counts?: number[];
|
|
169
|
+
/**
|
|
170
|
+
* Names for values
|
|
171
|
+
*/
|
|
172
|
+
names?: string[];
|
|
173
|
+
}
|
|
174
|
+
export interface HierarchicalValuesFilterMeta {
|
|
175
|
+
/**
|
|
176
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
177
|
+
*/
|
|
178
|
+
group_title?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Whether the filter group should be expanded by default or not.
|
|
181
|
+
*/
|
|
182
|
+
group_expanded?: boolean;
|
|
183
|
+
type?: "checkbox-hierarchical";
|
|
184
|
+
/**
|
|
185
|
+
* Selectable hierarchical values
|
|
186
|
+
*/
|
|
187
|
+
values: (("true" | "false") | number | number | string)[][];
|
|
188
|
+
/**
|
|
189
|
+
* Counts for values
|
|
190
|
+
*/
|
|
191
|
+
counts?: number[];
|
|
192
|
+
/**
|
|
193
|
+
* Names for hierarchical values
|
|
194
|
+
*/
|
|
195
|
+
names?: string[];
|
|
196
|
+
}
|
|
197
|
+
export interface SortModel {
|
|
198
|
+
/**
|
|
199
|
+
* The field to sort by.
|
|
200
|
+
*/
|
|
201
|
+
field: string;
|
|
202
|
+
/**
|
|
203
|
+
* The order to sort by.
|
|
204
|
+
*/
|
|
205
|
+
order: SortingOrder;
|
|
206
|
+
/**
|
|
207
|
+
* Metadata about the sort that can be used for rendering.
|
|
208
|
+
*/
|
|
209
|
+
meta?: SortMeta;
|
|
210
|
+
}
|
|
211
|
+
export interface SortMeta {
|
|
212
|
+
title: string;
|
|
213
|
+
/**
|
|
214
|
+
* Selectable values
|
|
215
|
+
*/
|
|
216
|
+
values?: SortingOrder[];
|
|
217
|
+
/**
|
|
218
|
+
* Names for orders
|
|
219
|
+
*/
|
|
220
|
+
names?: string[];
|
|
221
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* An enumeration.
|
|
10
|
+
*/
|
|
11
|
+
export type SortingOrder = "asc" | "desc";
|
|
12
|
+
/**
|
|
13
|
+
* An enumeration.
|
|
14
|
+
*/
|
|
15
|
+
export type ECategoryType = "TAG" | "CATEGORY" | "TENANT_CATEGORY" | "TENANT_SECONDARY_CATEGORY" | "CAMPAIGN";
|
|
16
|
+
|
|
17
|
+
export interface ProductListingResponse {
|
|
18
|
+
/**
|
|
19
|
+
* Total number of results for this query. Not necessarily exact.
|
|
20
|
+
*/
|
|
21
|
+
n_hits: number;
|
|
22
|
+
/**
|
|
23
|
+
* Deprecated, do not use.
|
|
24
|
+
*/
|
|
25
|
+
page?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The products to be shown on the product listing page.
|
|
28
|
+
*/
|
|
29
|
+
displays: {
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* Available methods for sorting the response. Any element from this list can be sent as `sort` in subsequent requests.
|
|
34
|
+
*/
|
|
35
|
+
sorts?: SortModel[];
|
|
36
|
+
/**
|
|
37
|
+
* Available filters that can be used for filtering in the subsequent request.
|
|
38
|
+
*/
|
|
39
|
+
filters?: SearchFilter[];
|
|
40
|
+
product_listing_request_id: string;
|
|
41
|
+
/**
|
|
42
|
+
* Breadcrumb for the current page. Ordered from less to more specific, where the last element is the current page.
|
|
43
|
+
*/
|
|
44
|
+
breadcrumb?: BaseCategoryDisplay[];
|
|
45
|
+
/**
|
|
46
|
+
* List of pages that can be used as quick links. Will return child pages if they exist, otherwise sibling pages.
|
|
47
|
+
*/
|
|
48
|
+
quick_links?: BaseCategoryDisplay[];
|
|
49
|
+
/**
|
|
50
|
+
* Cursor that can be used in the next request to get subsequent results. If this is not set, there are no more results.
|
|
51
|
+
*/
|
|
52
|
+
cursor?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Maps product ID to grouping ID. Only returned if `return_grouping_ids` is True.
|
|
55
|
+
*/
|
|
56
|
+
grouping_ids?: {
|
|
57
|
+
[k: string]: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface SortModel {
|
|
61
|
+
/**
|
|
62
|
+
* The field to sort by.
|
|
63
|
+
*/
|
|
64
|
+
field: string;
|
|
65
|
+
/**
|
|
66
|
+
* The order to sort by.
|
|
67
|
+
*/
|
|
68
|
+
order: SortingOrder;
|
|
69
|
+
/**
|
|
70
|
+
* Metadata about the sort that can be used for rendering.
|
|
71
|
+
*/
|
|
72
|
+
meta?: SortMeta;
|
|
73
|
+
}
|
|
74
|
+
export interface SortMeta {
|
|
75
|
+
title: string;
|
|
76
|
+
/**
|
|
77
|
+
* Selectable values
|
|
78
|
+
*/
|
|
79
|
+
values?: SortingOrder[];
|
|
80
|
+
/**
|
|
81
|
+
* Names for orders
|
|
82
|
+
*/
|
|
83
|
+
names?: string[];
|
|
84
|
+
}
|
|
85
|
+
export interface SearchFilter {
|
|
86
|
+
/**
|
|
87
|
+
* The field to filter by.
|
|
88
|
+
*/
|
|
89
|
+
field: string;
|
|
90
|
+
/**
|
|
91
|
+
* The operation used for filtering. The filtering should be read as `field op data`, for example `brand in ["Nike", "Adidas"]`.
|
|
92
|
+
*/
|
|
93
|
+
op: "eq" | "neq" | "in" | "nin" | "leq" | "geq" | "inrange";
|
|
94
|
+
/**
|
|
95
|
+
* Data for the filter.
|
|
96
|
+
*/
|
|
97
|
+
data?:
|
|
98
|
+
| ("true" | "false")
|
|
99
|
+
| number
|
|
100
|
+
| number
|
|
101
|
+
| string
|
|
102
|
+
| [number, number]
|
|
103
|
+
| [number, number]
|
|
104
|
+
| [number, number]
|
|
105
|
+
| [number, number]
|
|
106
|
+
| (
|
|
107
|
+
| ("true" | "false")
|
|
108
|
+
| number
|
|
109
|
+
| number
|
|
110
|
+
| string
|
|
111
|
+
| [number, number]
|
|
112
|
+
| [number, number]
|
|
113
|
+
| [number, number]
|
|
114
|
+
| [number, number]
|
|
115
|
+
)[]
|
|
116
|
+
| (("true" | "false") | number | number | string)[][];
|
|
117
|
+
/**
|
|
118
|
+
* Metadata about the filter that can be used for rendering. For example, this could contain the possible values to filter by and their counts in the results.
|
|
119
|
+
*/
|
|
120
|
+
meta?: RangeFilterMeta | ValuesFilterMeta | HierarchicalValuesFilterMeta;
|
|
121
|
+
/**
|
|
122
|
+
* ID of the filter. If multiple filters share the same ID, they should be grouped together in the UI.
|
|
123
|
+
*/
|
|
124
|
+
id?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface RangeFilterMeta {
|
|
127
|
+
/**
|
|
128
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
129
|
+
*/
|
|
130
|
+
group_title?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Whether the filter group should be expanded by default or not.
|
|
133
|
+
*/
|
|
134
|
+
group_expanded?: boolean;
|
|
135
|
+
type?: "range";
|
|
136
|
+
/**
|
|
137
|
+
* The minimum value that can be selected in the range.
|
|
138
|
+
*/
|
|
139
|
+
min: number;
|
|
140
|
+
/**
|
|
141
|
+
* The maximum value that can be selected in the range.
|
|
142
|
+
*/
|
|
143
|
+
max: number;
|
|
144
|
+
/**
|
|
145
|
+
* The unit of the range values.
|
|
146
|
+
*/
|
|
147
|
+
unit?: string;
|
|
148
|
+
/**
|
|
149
|
+
* The currency of the range values.
|
|
150
|
+
*/
|
|
151
|
+
currency?: string;
|
|
152
|
+
}
|
|
153
|
+
export interface ValuesFilterMeta {
|
|
154
|
+
/**
|
|
155
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
156
|
+
*/
|
|
157
|
+
group_title?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Whether the filter group should be expanded by default or not.
|
|
160
|
+
*/
|
|
161
|
+
group_expanded?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Type of filter.
|
|
164
|
+
*/
|
|
165
|
+
type?: "radio" | "checkbox" | "checkbox-grid";
|
|
166
|
+
/**
|
|
167
|
+
* Selectable values
|
|
168
|
+
*/
|
|
169
|
+
values: (
|
|
170
|
+
| ("true" | "false")
|
|
171
|
+
| number
|
|
172
|
+
| number
|
|
173
|
+
| string
|
|
174
|
+
| [number, number]
|
|
175
|
+
| [number, number]
|
|
176
|
+
| [number, number]
|
|
177
|
+
| [number, number]
|
|
178
|
+
)[];
|
|
179
|
+
/**
|
|
180
|
+
* Counts for values
|
|
181
|
+
*/
|
|
182
|
+
counts?: number[];
|
|
183
|
+
/**
|
|
184
|
+
* Names for values
|
|
185
|
+
*/
|
|
186
|
+
names?: string[];
|
|
187
|
+
}
|
|
188
|
+
export interface HierarchicalValuesFilterMeta {
|
|
189
|
+
/**
|
|
190
|
+
* Title of the group, where a group consists of all the filters that share an ID.
|
|
191
|
+
*/
|
|
192
|
+
group_title?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Whether the filter group should be expanded by default or not.
|
|
195
|
+
*/
|
|
196
|
+
group_expanded?: boolean;
|
|
197
|
+
type?: "checkbox-hierarchical";
|
|
198
|
+
/**
|
|
199
|
+
* Selectable hierarchical values
|
|
200
|
+
*/
|
|
201
|
+
values: (("true" | "false") | number | number | string)[][];
|
|
202
|
+
/**
|
|
203
|
+
* Counts for values
|
|
204
|
+
*/
|
|
205
|
+
counts?: number[];
|
|
206
|
+
/**
|
|
207
|
+
* Names for hierarchical values
|
|
208
|
+
*/
|
|
209
|
+
names?: string[];
|
|
210
|
+
}
|
|
211
|
+
export interface BaseCategoryDisplay {
|
|
212
|
+
/**
|
|
213
|
+
* Unique identifier of the category.
|
|
214
|
+
*/
|
|
215
|
+
category_id: string;
|
|
216
|
+
/**
|
|
217
|
+
* The title of the category
|
|
218
|
+
*/
|
|
219
|
+
title: string;
|
|
220
|
+
/**
|
|
221
|
+
* The full URL to the category page
|
|
222
|
+
*/
|
|
223
|
+
page_url: string;
|
|
224
|
+
/**
|
|
225
|
+
* Optionally a unique query ID for the category
|
|
226
|
+
*/
|
|
227
|
+
query_id?: string;
|
|
228
|
+
/**
|
|
229
|
+
* The type of category, for example CAMPAIGN, TAG, or CATEGORY
|
|
230
|
+
*/
|
|
231
|
+
category_type?: ECategoryType & string;
|
|
232
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface RecommendResponse {
|
|
9
|
+
displays: {
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
}[];
|
|
12
|
+
error?: string;
|
|
13
|
+
variant?: number;
|
|
14
|
+
experiment_id?: string;
|
|
15
|
+
}
|