@coveo/thermidor-schema 1.0.0-beta.4 → 1.0.0-beta.41
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/README.md +32 -5
- package/dist/generated/schemas.d.ts +3668 -560
- package/dist/generated/schemas.js +912 -285
- package/dist/generated/zod3/index.d.ts +3 -0
- package/dist/generated/zod3/index.js +5 -0
- package/dist/generated/zod3/schemas.d.ts +32331 -0
- package/dist/generated/zod3/schemas.js +1282 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/zod3-compat.d.ts +79 -0
- package/dist/zod3-compat.js +82 -0
- package/package.json +28 -22
- package/schema/base/catalog.schema.json +5 -4
- package/schema/base/component.schema.json +22 -33
- package/schema/{components/component-contracts.schema.json → component-contracts.schema.json} +23 -2
- package/schema/components/breadbox.schema.json +82 -0
- package/schema/components/bundle-display.schema.json +17 -13
- package/schema/components/cart.schema.json +147 -0
- package/schema/components/category-facet.schema.json +30 -16
- package/schema/components/commerce-search.schema.json +111 -15
- package/schema/components/comparison-table.schema.json +21 -13
- package/schema/components/date-facet.schema.json +35 -15
- package/schema/components/facet-manager.schema.json +12 -14
- package/schema/components/instant-products.schema.json +85 -0
- package/schema/components/layout-stack.schema.json +19 -15
- package/schema/components/next-actions-bar.schema.json +44 -17
- package/schema/components/numeric-facet.schema.json +39 -17
- package/schema/components/page-size.schema.json +13 -15
- package/schema/components/pagination.schema.json +28 -27
- package/schema/components/product-carousel.schema.json +13 -13
- package/schema/components/product-list.schema.json +75 -14
- package/schema/components/product-research-card.schema.json +107 -0
- package/schema/components/product-summary.schema.json +15 -14
- package/schema/components/query-suggestions.schema.json +102 -0
- package/schema/components/query-summary.schema.json +70 -16
- package/schema/components/regular-facet.schema.json +40 -93
- package/schema/components/search-box.schema.json +47 -0
- package/schema/components/session-shell.schema.json +65 -0
- package/schema/components/sort.schema.json +22 -16
- package/schema/definitions/action-item.schema.json +10 -13
- package/schema/definitions/badge-placement.schema.json +22 -0
- package/schema/definitions/badge.schema.json +27 -0
- package/schema/definitions/breadbox-date-range-facet.schema.json +56 -0
- package/schema/definitions/breadbox-deselect-date-range.schema.json +28 -0
- package/schema/definitions/breadbox-deselect-hierarchical-path.schema.json +28 -0
- package/schema/definitions/breadbox-deselect-numerical-range.schema.json +28 -0
- package/schema/definitions/breadbox-deselect-payload.schema.json +20 -0
- package/schema/definitions/breadbox-deselect-regular-value.schema.json +25 -0
- package/schema/definitions/breadbox-facet.schema.json +20 -0
- package/schema/definitions/breadbox-hierarchical-facet.schema.json +37 -0
- package/schema/definitions/breadbox-numerical-range-facet.schema.json +56 -0
- package/schema/definitions/breadbox-regular-facet.schema.json +59 -0
- package/schema/definitions/bundle-tier.schema.json +6 -1
- package/schema/definitions/child-list.schema.json +32 -0
- package/schema/definitions/comparison-product.schema.json +7 -2
- package/schema/definitions/component-id.schema.json +9 -0
- package/schema/definitions/data-binding.schema.json +16 -0
- package/schema/definitions/facet-value-state.schema.json +1 -1
- package/schema/definitions/followup-action-item.schema.json +20 -0
- package/schema/definitions/product.schema.json +10 -6
- package/schema/definitions/search-action-item.schema.json +20 -0
- package/schema/definitions/search-option-action-item.schema.json +25 -0
- package/schema/definitions/sort-field.schema.json +26 -0
- package/schema/definitions/child-ref.schema.json +0 -8
- package/schema/definitions/selectable-facet-value-state.schema.json +0 -8
|
@@ -0,0 +1,1282 @@
|
|
|
1
|
+
// This file is generated from the canonical JSON Schema documents.
|
|
2
|
+
// Do not edit it directly; run `mise run generate` from the repository root.
|
|
3
|
+
// The Zod 3 dialect of this file. Generated from the same canonical JSON Schema
|
|
4
|
+
// documents as ../schemas.ts; see ../../zod3-compat.ts.
|
|
5
|
+
import * as z from '../../zod3-compat.js';
|
|
6
|
+
export const CartUpdateOperationSchema = z.enum(['add', 'remove', 'setQuantity']);
|
|
7
|
+
// The kind of action selected: "followup" or "search".
|
|
8
|
+
export const SelectActionPayloadTypeSchema = z.enum(['followup', 'search']);
|
|
9
|
+
export const ActionItemTypeSchema = z.enum(['followup', 'search', 'searchOption']);
|
|
10
|
+
// The sort direction: ascending or descending.
|
|
11
|
+
export const SortDirectionSchema = z.enum(['asc', 'desc']);
|
|
12
|
+
// The selection state of a facet value, shared across all commerce facet components.
|
|
13
|
+
//
|
|
14
|
+
// The selection state of this facet value.
|
|
15
|
+
export const FacetValueStateSchema = z.enum(['idle', 'selected']);
|
|
16
|
+
export const BreadboxFacetTypeSchema = z.enum([
|
|
17
|
+
'dateRange',
|
|
18
|
+
'hierarchical',
|
|
19
|
+
'numericalRange',
|
|
20
|
+
'regular',
|
|
21
|
+
]);
|
|
22
|
+
// What replaced the shopper's query: an automatic query correction, or a query trigger.
|
|
23
|
+
export const QueryCorrectionCauseSchema = z.enum(['correction', 'trigger']);
|
|
24
|
+
export const ProductSchema = z.strictObject({
|
|
25
|
+
additionalFields: z.record(z.string(), z.unknown()),
|
|
26
|
+
get badgePlacements() {
|
|
27
|
+
return z.array(BadgePlacementSchema).optional();
|
|
28
|
+
},
|
|
29
|
+
get children() {
|
|
30
|
+
return z.array(ProductSchema).optional();
|
|
31
|
+
},
|
|
32
|
+
clickUri: z.string().optional(),
|
|
33
|
+
ec_brand: z.string().optional(),
|
|
34
|
+
ec_category: z.array(z.string()).optional(),
|
|
35
|
+
ec_color: z.string().optional(),
|
|
36
|
+
ec_description: z.string().optional(),
|
|
37
|
+
ec_images: z.array(z.string()).optional(),
|
|
38
|
+
ec_in_stock: z.boolean().optional(),
|
|
39
|
+
ec_item_group_id: z.string().optional(),
|
|
40
|
+
ec_item_group_name: z.string().optional(),
|
|
41
|
+
ec_name: z.string(),
|
|
42
|
+
ec_price: z.number().optional(),
|
|
43
|
+
ec_promo_price: z.number().optional(),
|
|
44
|
+
ec_rating: z.union([z.number().min(0), z.null()]).optional(),
|
|
45
|
+
ec_shortdesc: z.string().optional(),
|
|
46
|
+
ec_thumbnails: z.array(z.string()).optional(),
|
|
47
|
+
permanentid: z.string(),
|
|
48
|
+
});
|
|
49
|
+
export const DataBindingSchema = z.strictObject({
|
|
50
|
+
path: z.string(),
|
|
51
|
+
});
|
|
52
|
+
export const FollowupActionItemSchema = z.strictObject({
|
|
53
|
+
text: z.string(),
|
|
54
|
+
type: z.literal('followup'),
|
|
55
|
+
});
|
|
56
|
+
export const SearchActionItemSchema = z.strictObject({
|
|
57
|
+
text: z.string(),
|
|
58
|
+
type: z.literal('search'),
|
|
59
|
+
});
|
|
60
|
+
export const SearchOptionActionItemSchema = z.strictObject({
|
|
61
|
+
optionId: z.string().min(1),
|
|
62
|
+
text: z.string(),
|
|
63
|
+
type: z.literal('searchOption'),
|
|
64
|
+
});
|
|
65
|
+
export const ChildListTemplateSchema = z.strictObject({
|
|
66
|
+
componentId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
67
|
+
path: z.string(),
|
|
68
|
+
});
|
|
69
|
+
export const BreadboxRegularFacetValueSchema = z.strictObject({
|
|
70
|
+
state: z.literal('selected'),
|
|
71
|
+
value: z.string().min(1),
|
|
72
|
+
});
|
|
73
|
+
export const BreadboxNumericalRangeFacetValueSchema = z.strictObject({
|
|
74
|
+
end: z.number(),
|
|
75
|
+
start: z.number(),
|
|
76
|
+
});
|
|
77
|
+
export const BreadboxDateRangeFacetValueSchema = z.strictObject({
|
|
78
|
+
end: z.string(),
|
|
79
|
+
start: z.string(),
|
|
80
|
+
});
|
|
81
|
+
export const BreadboxHierarchicalFacetSchema = z.strictObject({
|
|
82
|
+
displayName: z.string(),
|
|
83
|
+
facetId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
84
|
+
field: z.string().min(1),
|
|
85
|
+
path: z.array(z.string()).min(1),
|
|
86
|
+
type: z.literal('hierarchical'),
|
|
87
|
+
});
|
|
88
|
+
export const BreadboxDeselectRegularValueSchema = z.strictObject({
|
|
89
|
+
facetId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
90
|
+
type: z.literal('regular'),
|
|
91
|
+
value: z.string().min(1),
|
|
92
|
+
});
|
|
93
|
+
export const BreadboxDeselectNumericalRangeSchema = z.strictObject({
|
|
94
|
+
end: z.number(),
|
|
95
|
+
facetId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
96
|
+
start: z.number(),
|
|
97
|
+
type: z.literal('numericalRange'),
|
|
98
|
+
});
|
|
99
|
+
export const BreadboxDeselectDateRangeSchema = z.strictObject({
|
|
100
|
+
end: z.string(),
|
|
101
|
+
facetId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
102
|
+
start: z.string(),
|
|
103
|
+
type: z.literal('dateRange'),
|
|
104
|
+
});
|
|
105
|
+
export const BreadboxDeselectHierarchicalPathSchema = z.strictObject({
|
|
106
|
+
facetId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
107
|
+
path: z.array(z.string()).min(1),
|
|
108
|
+
type: z.literal('hierarchical'),
|
|
109
|
+
});
|
|
110
|
+
export const ProductCarouselActionsSchema = z.strictObject({});
|
|
111
|
+
export const ProductCarouselStateSchema = z.strictObject({
|
|
112
|
+
heading: z.string(),
|
|
113
|
+
products: z.array(ProductSchema),
|
|
114
|
+
});
|
|
115
|
+
export const BadgeSchema = z.strictObject({
|
|
116
|
+
backgroundColor: z.string().optional(),
|
|
117
|
+
iconUrl: z.string().optional(),
|
|
118
|
+
text: z.string(),
|
|
119
|
+
textColor: z.string().optional(),
|
|
120
|
+
});
|
|
121
|
+
export const PurchaseProductSchema = z.strictObject({
|
|
122
|
+
name: z.string().optional(),
|
|
123
|
+
price: z.union([z.number(), z.null()]).optional(),
|
|
124
|
+
productId: z.string().min(1),
|
|
125
|
+
quantity: z.number().int().min(1),
|
|
126
|
+
});
|
|
127
|
+
export const TransactionSchema = z.strictObject({
|
|
128
|
+
id: z.string().min(1),
|
|
129
|
+
revenue: z.number(),
|
|
130
|
+
});
|
|
131
|
+
export const UpdateCartPayloadSchema = z.strictObject({
|
|
132
|
+
name: z.string().optional(),
|
|
133
|
+
operation: z.enum(['add', 'remove', 'setQuantity']),
|
|
134
|
+
price: z.union([z.number(), z.null()]).optional(),
|
|
135
|
+
productId: z.string().min(1),
|
|
136
|
+
quantity: z.number().int().min(1),
|
|
137
|
+
});
|
|
138
|
+
export const CartStateSchema = z.strictObject({});
|
|
139
|
+
export const SearchBoxActionsSchema = z.strictObject({});
|
|
140
|
+
export const SearchBoxStateSchema = z.strictObject({});
|
|
141
|
+
export const FetchSuggestionsPayloadSchema = z.strictObject({
|
|
142
|
+
query: z.string(),
|
|
143
|
+
});
|
|
144
|
+
export const QueryCompletionSchema = z.strictObject({
|
|
145
|
+
expression: z.string(),
|
|
146
|
+
score: z.number().optional(),
|
|
147
|
+
});
|
|
148
|
+
export const FetchInstantProductsPayloadSchema = z.strictObject({
|
|
149
|
+
query: z.string(),
|
|
150
|
+
});
|
|
151
|
+
export const InstantProductsStateSchema = z.strictObject({
|
|
152
|
+
products: z.array(ProductSchema),
|
|
153
|
+
query: z.string(),
|
|
154
|
+
});
|
|
155
|
+
export const SelectActionPayloadSchema = z.strictObject({
|
|
156
|
+
text: z.string(),
|
|
157
|
+
type: z.enum(['followup', 'search']),
|
|
158
|
+
});
|
|
159
|
+
export const SelectSearchOptionPayloadSchema = z.strictObject({
|
|
160
|
+
optionId: z.string().min(1),
|
|
161
|
+
text: z.string(),
|
|
162
|
+
});
|
|
163
|
+
export const ActionItemSchema = z.discriminatedUnion('type', [
|
|
164
|
+
FollowupActionItemSchema,
|
|
165
|
+
SearchActionItemSchema,
|
|
166
|
+
SearchOptionActionItemSchema,
|
|
167
|
+
]);
|
|
168
|
+
export const BundleDisplayActionsSchema = z.strictObject({});
|
|
169
|
+
export const BundleSlotSchema = z.strictObject({
|
|
170
|
+
categoryLabel: z.string(),
|
|
171
|
+
childId: z.string(),
|
|
172
|
+
});
|
|
173
|
+
export const ProductResearchCardActionsSchema = z.strictObject({});
|
|
174
|
+
export const ProductResearchRelatedDocumentSchema = z.strictObject({
|
|
175
|
+
clickUri: z.string().optional(),
|
|
176
|
+
filetype: z.string().optional(),
|
|
177
|
+
size: z.number().int().min(0).optional(),
|
|
178
|
+
title: z.string(),
|
|
179
|
+
});
|
|
180
|
+
export const ComparisonTableActionsSchema = z.strictObject({});
|
|
181
|
+
export const ComparisonAttributeSchema = z.strictObject({
|
|
182
|
+
key: z.string(),
|
|
183
|
+
label: z.string(),
|
|
184
|
+
});
|
|
185
|
+
export const ComparisonProductSchema = z.strictObject({
|
|
186
|
+
imageUrl: z.string().optional(),
|
|
187
|
+
name: z.string(),
|
|
188
|
+
price: z.number().optional(),
|
|
189
|
+
productId: z.string(),
|
|
190
|
+
rating: z.number().min(0).optional(),
|
|
191
|
+
relatedDocuments: z.array(ProductResearchRelatedDocumentSchema).optional(),
|
|
192
|
+
values: z.record(z.string(), z.string()).optional(),
|
|
193
|
+
});
|
|
194
|
+
export const ProductClickPayloadSchema = z.strictObject({
|
|
195
|
+
name: z.string().optional(),
|
|
196
|
+
position: z.number().int().min(0),
|
|
197
|
+
price: z.union([z.number(), z.null()]).optional(),
|
|
198
|
+
productId: z.string().min(1),
|
|
199
|
+
});
|
|
200
|
+
export const SelectProductsPayloadSchema = z.strictObject({
|
|
201
|
+
productIds: z.array(z.string().min(1)),
|
|
202
|
+
});
|
|
203
|
+
export const ProductListStateSchema = z.strictObject({
|
|
204
|
+
products: z.array(ProductSchema),
|
|
205
|
+
});
|
|
206
|
+
export const ProductSummaryActionsSchema = z.strictObject({});
|
|
207
|
+
export const ProductSummaryStateSchema = z.strictObject({
|
|
208
|
+
categoryLabel: z.string(),
|
|
209
|
+
product: z.union([ProductSchema, z.null()]),
|
|
210
|
+
});
|
|
211
|
+
export const SelectPagePayloadSchema = z.strictObject({
|
|
212
|
+
page: z.number().int().min(0),
|
|
213
|
+
});
|
|
214
|
+
export const ShowMorePayloadSchema = z.strictObject({});
|
|
215
|
+
export const PaginationStateSchema = z.strictObject({
|
|
216
|
+
page: z.number().int().min(0),
|
|
217
|
+
pageSize: z.number().int().min(1),
|
|
218
|
+
totalEntries: z.number().int().min(0),
|
|
219
|
+
totalPages: z.number().int().min(0),
|
|
220
|
+
});
|
|
221
|
+
export const SortFieldSchema = z.strictObject({
|
|
222
|
+
direction: z.enum(['asc', 'desc']),
|
|
223
|
+
displayName: z.string().optional(),
|
|
224
|
+
field: z.string().min(1),
|
|
225
|
+
});
|
|
226
|
+
export const SortCriterionSchema = z.strictObject({
|
|
227
|
+
fields: z.array(SortFieldSchema),
|
|
228
|
+
sortCriteria: z.string(),
|
|
229
|
+
});
|
|
230
|
+
export const ActionSchema = z.strictObject({
|
|
231
|
+
payload: z.unknown(),
|
|
232
|
+
});
|
|
233
|
+
export const RegularFacetSearchPayloadSchema = z.strictObject({
|
|
234
|
+
query: z.string(),
|
|
235
|
+
});
|
|
236
|
+
export const RegularFacetToggleSelectPayloadSchema = z.strictObject({
|
|
237
|
+
value: z.string().min(1),
|
|
238
|
+
});
|
|
239
|
+
export const RegularFacetToggleSingleSelectPayloadSchema = z.strictObject({
|
|
240
|
+
value: z.string().min(1),
|
|
241
|
+
});
|
|
242
|
+
export const RegularFacetSearchResultSchema = z.strictObject({
|
|
243
|
+
numberOfResults: z.number().int().min(0),
|
|
244
|
+
value: z.string().min(1),
|
|
245
|
+
});
|
|
246
|
+
export const RegularFacetValueSchema = z.strictObject({
|
|
247
|
+
numberOfResults: z.number().int().min(0),
|
|
248
|
+
state: z.enum(['idle', 'selected']),
|
|
249
|
+
value: z.string().min(1),
|
|
250
|
+
});
|
|
251
|
+
export const NumericFacetApplyCustomRangePayloadSchema = z.strictObject({
|
|
252
|
+
end: z.number(),
|
|
253
|
+
start: z.number(),
|
|
254
|
+
});
|
|
255
|
+
export const NumericFacetToggleSelectPayloadSchema = z.strictObject({
|
|
256
|
+
end: z.number(),
|
|
257
|
+
start: z.number(),
|
|
258
|
+
});
|
|
259
|
+
export const NumericFacetToggleSingleSelectPayloadSchema = z.strictObject({
|
|
260
|
+
end: z.number(),
|
|
261
|
+
start: z.number(),
|
|
262
|
+
});
|
|
263
|
+
export const NumericFacetCustomRangeSchema = z.strictObject({
|
|
264
|
+
end: z.number(),
|
|
265
|
+
numberOfResults: z.number().int().min(0),
|
|
266
|
+
start: z.number(),
|
|
267
|
+
});
|
|
268
|
+
export const NumericFacetDomainSchema = z.strictObject({
|
|
269
|
+
max: z.number().optional(),
|
|
270
|
+
min: z.number().optional(),
|
|
271
|
+
});
|
|
272
|
+
export const NumericFacetValueSchema = z.strictObject({
|
|
273
|
+
end: z.number(),
|
|
274
|
+
numberOfResults: z.number().int().min(0),
|
|
275
|
+
start: z.number(),
|
|
276
|
+
state: z.enum(['idle', 'selected']),
|
|
277
|
+
});
|
|
278
|
+
export const DateFacetApplyCustomRangePayloadSchema = z.strictObject({
|
|
279
|
+
end: z.string(),
|
|
280
|
+
start: z.string(),
|
|
281
|
+
});
|
|
282
|
+
export const DateFacetToggleSelectPayloadSchema = z.strictObject({
|
|
283
|
+
end: z.string(),
|
|
284
|
+
start: z.string(),
|
|
285
|
+
});
|
|
286
|
+
export const DateFacetToggleSingleSelectPayloadSchema = z.strictObject({
|
|
287
|
+
end: z.string(),
|
|
288
|
+
start: z.string(),
|
|
289
|
+
});
|
|
290
|
+
export const DateFacetCustomRangeSchema = z.strictObject({
|
|
291
|
+
end: z.string(),
|
|
292
|
+
numberOfResults: z.number().int().min(0),
|
|
293
|
+
start: z.string(),
|
|
294
|
+
});
|
|
295
|
+
export const DateFacetValueSchema = z.strictObject({
|
|
296
|
+
end: z.string(),
|
|
297
|
+
numberOfResults: z.number().int().min(0),
|
|
298
|
+
start: z.string(),
|
|
299
|
+
state: z.enum(['idle', 'selected']),
|
|
300
|
+
});
|
|
301
|
+
export const CategoryFacetSearchPayloadSchema = z.strictObject({
|
|
302
|
+
query: z.string(),
|
|
303
|
+
});
|
|
304
|
+
export const CategoryFacetSelectPathPayloadSchema = z.strictObject({
|
|
305
|
+
path: z.array(z.string()),
|
|
306
|
+
});
|
|
307
|
+
export const CategoryFacetValueSchema = z.strictObject({
|
|
308
|
+
numberOfResults: z.number().int().min(0),
|
|
309
|
+
path: z.array(z.string()),
|
|
310
|
+
value: z.string(),
|
|
311
|
+
});
|
|
312
|
+
export const CategoryFacetValuesSchema = z.strictObject({
|
|
313
|
+
ancestry: z.array(CategoryFacetValueSchema),
|
|
314
|
+
children: z.array(CategoryFacetValueSchema),
|
|
315
|
+
selected: z.union([CategoryFacetValueSchema, z.null()]),
|
|
316
|
+
});
|
|
317
|
+
export const FacetManagerActionsSchema = z.strictObject({});
|
|
318
|
+
export const FacetManagerStateSchema = z.strictObject({});
|
|
319
|
+
export const BreadboxDeselectPayloadSchema = z.discriminatedUnion('type', [
|
|
320
|
+
BreadboxDeselectRegularValueSchema,
|
|
321
|
+
BreadboxDeselectNumericalRangeSchema,
|
|
322
|
+
BreadboxDeselectDateRangeSchema,
|
|
323
|
+
BreadboxDeselectHierarchicalPathSchema,
|
|
324
|
+
]);
|
|
325
|
+
export const BreadboxFacetValueSchema = z.strictObject({
|
|
326
|
+
state: z.literal('selected').optional(),
|
|
327
|
+
value: z.string().min(1).optional(),
|
|
328
|
+
end: z.union([z.number(), z.string()]).optional(),
|
|
329
|
+
start: z.union([z.number(), z.string()]).optional(),
|
|
330
|
+
});
|
|
331
|
+
export const InitializePayloadSchema = z.strictObject({});
|
|
332
|
+
export const SessionShellStateSchema = z.strictObject({});
|
|
333
|
+
export const NumericRangeRestoreSchema = z.strictObject({
|
|
334
|
+
end: z.number(),
|
|
335
|
+
endInclusive: z.boolean().optional(),
|
|
336
|
+
start: z.number(),
|
|
337
|
+
});
|
|
338
|
+
export const SubmitQueryPayloadSchema = z.strictObject({
|
|
339
|
+
query: z.string(),
|
|
340
|
+
});
|
|
341
|
+
export const CommerceSearchStateSchema = z.strictObject({});
|
|
342
|
+
export const LayoutStackActionsSchema = z.strictObject({});
|
|
343
|
+
export const LayoutStackStateSchema = z.strictObject({});
|
|
344
|
+
export const QuerySummaryActionsSchema = z.strictObject({
|
|
345
|
+
overrideCorrection: ActionSchema,
|
|
346
|
+
});
|
|
347
|
+
export const QueryCorrectionSchema = z.strictObject({
|
|
348
|
+
canOverride: z.boolean(),
|
|
349
|
+
cause: z.enum(['correction', 'trigger']),
|
|
350
|
+
originalQuery: z.string().min(1),
|
|
351
|
+
});
|
|
352
|
+
export const SetPageSizePayloadSchema = z.strictObject({
|
|
353
|
+
pageSize: z.number().int().min(1),
|
|
354
|
+
});
|
|
355
|
+
export const PageSizeStateSchema = z.strictObject({
|
|
356
|
+
pageSize: z.number().int().min(1),
|
|
357
|
+
});
|
|
358
|
+
export const BreadboxRegularFacetSchema = z.strictObject({
|
|
359
|
+
displayName: z.string(),
|
|
360
|
+
facetId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
361
|
+
field: z.string().min(1),
|
|
362
|
+
type: z.literal('regular'),
|
|
363
|
+
values: z.array(BreadboxRegularFacetValueSchema).min(1),
|
|
364
|
+
});
|
|
365
|
+
export const BreadboxNumericalRangeFacetSchema = z.strictObject({
|
|
366
|
+
displayName: z.string(),
|
|
367
|
+
facetId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
368
|
+
field: z.string().min(1),
|
|
369
|
+
type: z.literal('numericalRange'),
|
|
370
|
+
values: z.array(BreadboxNumericalRangeFacetValueSchema).min(1),
|
|
371
|
+
});
|
|
372
|
+
export const BreadboxDateRangeFacetSchema = z.strictObject({
|
|
373
|
+
displayName: z.string(),
|
|
374
|
+
facetId: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
375
|
+
field: z.string().min(1),
|
|
376
|
+
type: z.literal('dateRange'),
|
|
377
|
+
values: z.array(BreadboxDateRangeFacetValueSchema).min(1),
|
|
378
|
+
});
|
|
379
|
+
export const ProductCarouselSchema = z.looseObject({
|
|
380
|
+
actions: ProductCarouselActionsSchema.optional(),
|
|
381
|
+
component: z.literal('ProductCarousel'),
|
|
382
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
383
|
+
state: ProductCarouselStateSchema.optional(),
|
|
384
|
+
});
|
|
385
|
+
export const BadgePlacementSchema = z.strictObject({
|
|
386
|
+
badges: z.array(BadgeSchema),
|
|
387
|
+
placementId: z.string(),
|
|
388
|
+
});
|
|
389
|
+
export const PurchasePayloadSchema = z.strictObject({
|
|
390
|
+
products: z.array(PurchaseProductSchema),
|
|
391
|
+
transaction: TransactionSchema,
|
|
392
|
+
});
|
|
393
|
+
export const UpdateCartSchema = z.strictObject({
|
|
394
|
+
payload: UpdateCartPayloadSchema,
|
|
395
|
+
});
|
|
396
|
+
export const SearchBoxSchema = z.looseObject({
|
|
397
|
+
actions: SearchBoxActionsSchema.optional(),
|
|
398
|
+
component: z.literal('SearchBox'),
|
|
399
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
400
|
+
state: SearchBoxStateSchema.optional(),
|
|
401
|
+
});
|
|
402
|
+
export const FetchSuggestionsSchema = z.strictObject({
|
|
403
|
+
payload: FetchSuggestionsPayloadSchema,
|
|
404
|
+
});
|
|
405
|
+
export const QuerySuggestionsStateSchema = z.strictObject({
|
|
406
|
+
completions: z.array(QueryCompletionSchema),
|
|
407
|
+
query: z.string(),
|
|
408
|
+
});
|
|
409
|
+
export const FetchInstantProductsSchema = z.strictObject({
|
|
410
|
+
payload: FetchInstantProductsPayloadSchema,
|
|
411
|
+
});
|
|
412
|
+
export const SelectActionSchema = z.strictObject({
|
|
413
|
+
payload: SelectActionPayloadSchema,
|
|
414
|
+
});
|
|
415
|
+
export const SelectSearchOptionSchema = z.strictObject({
|
|
416
|
+
payload: SelectSearchOptionPayloadSchema,
|
|
417
|
+
});
|
|
418
|
+
export const NextActionsStateSchema = z.strictObject({
|
|
419
|
+
suggestedActions: z.array(ActionItemSchema),
|
|
420
|
+
});
|
|
421
|
+
export const BundleTierSchema = z.strictObject({
|
|
422
|
+
description: z.string(),
|
|
423
|
+
label: z.string(),
|
|
424
|
+
slots: z.array(BundleSlotSchema),
|
|
425
|
+
total: z.number().min(0),
|
|
426
|
+
});
|
|
427
|
+
export const ProductResearchCardStateSchema = z.strictObject({
|
|
428
|
+
bullets: z.array(z.string().min(1)).min(1),
|
|
429
|
+
product: ProductSchema,
|
|
430
|
+
relatedDocuments: z.array(ProductResearchRelatedDocumentSchema).optional(),
|
|
431
|
+
summary: z.string().min(1),
|
|
432
|
+
});
|
|
433
|
+
export const ComparisonTableStateSchema = z.strictObject({
|
|
434
|
+
attributes: z.array(ComparisonAttributeSchema),
|
|
435
|
+
heading: z.string(),
|
|
436
|
+
products: z.array(ComparisonProductSchema),
|
|
437
|
+
summary: z.string(),
|
|
438
|
+
});
|
|
439
|
+
export const ProductClickSchema = z.strictObject({
|
|
440
|
+
payload: ProductClickPayloadSchema,
|
|
441
|
+
});
|
|
442
|
+
export const SelectProductsSchema = z.strictObject({
|
|
443
|
+
payload: SelectProductsPayloadSchema,
|
|
444
|
+
});
|
|
445
|
+
export const ProductSummarySchema = z.looseObject({
|
|
446
|
+
actions: ProductSummaryActionsSchema.optional(),
|
|
447
|
+
component: z.literal('ProductSummary'),
|
|
448
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
449
|
+
state: ProductSummaryStateSchema.optional(),
|
|
450
|
+
});
|
|
451
|
+
export const SelectPageSchema = z.strictObject({
|
|
452
|
+
payload: SelectPagePayloadSchema,
|
|
453
|
+
});
|
|
454
|
+
export const ShowMoreSchema = z.strictObject({
|
|
455
|
+
payload: ShowMorePayloadSchema,
|
|
456
|
+
});
|
|
457
|
+
export const SelectSortPayloadSchema = z.strictObject({
|
|
458
|
+
fields: z.array(SortFieldSchema),
|
|
459
|
+
sortCriteria: z.string(),
|
|
460
|
+
});
|
|
461
|
+
export const SortStateSchema = z.strictObject({
|
|
462
|
+
appliedSort: SortCriterionSchema,
|
|
463
|
+
availableSorts: z.array(SortCriterionSchema),
|
|
464
|
+
});
|
|
465
|
+
export const RegularFacetSearchSchema = z.strictObject({
|
|
466
|
+
payload: RegularFacetSearchPayloadSchema,
|
|
467
|
+
});
|
|
468
|
+
export const RegularFacetToggleSelectSchema = z.strictObject({
|
|
469
|
+
payload: RegularFacetToggleSelectPayloadSchema,
|
|
470
|
+
});
|
|
471
|
+
export const RegularFacetToggleSingleSelectSchema = z.strictObject({
|
|
472
|
+
payload: RegularFacetToggleSingleSelectPayloadSchema,
|
|
473
|
+
});
|
|
474
|
+
export const RegularFacetSearchStateSchema = z.strictObject({
|
|
475
|
+
canShowMoreResults: z.boolean(),
|
|
476
|
+
query: z.string(),
|
|
477
|
+
results: z.array(RegularFacetSearchResultSchema),
|
|
478
|
+
});
|
|
479
|
+
export const NumericFacetApplyCustomRangeSchema = z.strictObject({
|
|
480
|
+
payload: NumericFacetApplyCustomRangePayloadSchema,
|
|
481
|
+
});
|
|
482
|
+
export const NumericFacetToggleSelectSchema = z.strictObject({
|
|
483
|
+
payload: NumericFacetToggleSelectPayloadSchema,
|
|
484
|
+
});
|
|
485
|
+
export const NumericFacetToggleSingleSelectSchema = z.strictObject({
|
|
486
|
+
payload: NumericFacetToggleSingleSelectPayloadSchema,
|
|
487
|
+
});
|
|
488
|
+
export const NumericFacetStateSchema = z.strictObject({
|
|
489
|
+
canShowLessValues: z.boolean(),
|
|
490
|
+
canShowMoreValues: z.boolean(),
|
|
491
|
+
customRange: z.union([NumericFacetCustomRangeSchema, z.null()]),
|
|
492
|
+
displayName: z.string(),
|
|
493
|
+
domain: NumericFacetDomainSchema.optional(),
|
|
494
|
+
field: z.string(),
|
|
495
|
+
hasActiveValues: z.boolean(),
|
|
496
|
+
values: z.array(NumericFacetValueSchema),
|
|
497
|
+
});
|
|
498
|
+
export const DateFacetApplyCustomRangeSchema = z.strictObject({
|
|
499
|
+
payload: DateFacetApplyCustomRangePayloadSchema,
|
|
500
|
+
});
|
|
501
|
+
export const DateFacetToggleSelectSchema = z.strictObject({
|
|
502
|
+
payload: DateFacetToggleSelectPayloadSchema,
|
|
503
|
+
});
|
|
504
|
+
export const DateFacetToggleSingleSelectSchema = z.strictObject({
|
|
505
|
+
payload: DateFacetToggleSingleSelectPayloadSchema,
|
|
506
|
+
});
|
|
507
|
+
export const DateFacetStateSchema = z.strictObject({
|
|
508
|
+
canShowLessValues: z.boolean(),
|
|
509
|
+
canShowMoreValues: z.boolean(),
|
|
510
|
+
customRange: z.union([DateFacetCustomRangeSchema, z.null()]),
|
|
511
|
+
displayName: z.string(),
|
|
512
|
+
field: z.string(),
|
|
513
|
+
hasActiveValues: z.boolean(),
|
|
514
|
+
values: z.array(DateFacetValueSchema),
|
|
515
|
+
});
|
|
516
|
+
export const CategoryFacetSearchSchema = z.strictObject({
|
|
517
|
+
payload: CategoryFacetSearchPayloadSchema,
|
|
518
|
+
});
|
|
519
|
+
export const CategoryFacetSelectPathSchema = z.strictObject({
|
|
520
|
+
payload: CategoryFacetSelectPathPayloadSchema,
|
|
521
|
+
});
|
|
522
|
+
export const CategoryFacetSearchStateSchema = z.strictObject({
|
|
523
|
+
canShowMoreResults: z.boolean(),
|
|
524
|
+
query: z.string(),
|
|
525
|
+
results: z.array(CategoryFacetValueSchema),
|
|
526
|
+
});
|
|
527
|
+
export const FacetManagerSchema = z.looseObject({
|
|
528
|
+
actions: FacetManagerActionsSchema.optional(),
|
|
529
|
+
component: z.literal('FacetManager'),
|
|
530
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
531
|
+
state: FacetManagerStateSchema.optional(),
|
|
532
|
+
});
|
|
533
|
+
export const BreadboxDeselectSchema = z.strictObject({
|
|
534
|
+
payload: BreadboxDeselectPayloadSchema,
|
|
535
|
+
});
|
|
536
|
+
export const BreadboxFacetSchema = z.discriminatedUnion('type', [
|
|
537
|
+
BreadboxRegularFacetSchema,
|
|
538
|
+
BreadboxNumericalRangeFacetSchema,
|
|
539
|
+
BreadboxDateRangeFacetSchema,
|
|
540
|
+
BreadboxHierarchicalFacetSchema,
|
|
541
|
+
]);
|
|
542
|
+
export const InitializeSchema = z.strictObject({
|
|
543
|
+
payload: InitializePayloadSchema,
|
|
544
|
+
});
|
|
545
|
+
export const FacetRestoreSchema = z.strictObject({
|
|
546
|
+
facetId: z.string().min(1),
|
|
547
|
+
numericRanges: z.array(NumericRangeRestoreSchema).optional(),
|
|
548
|
+
path: z.array(z.string()).optional(),
|
|
549
|
+
values: z.array(z.string()).optional(),
|
|
550
|
+
});
|
|
551
|
+
export const SubmitQuerySchema = z.strictObject({
|
|
552
|
+
payload: SubmitQueryPayloadSchema,
|
|
553
|
+
});
|
|
554
|
+
export const LayoutStackSchema = z.looseObject({
|
|
555
|
+
actions: LayoutStackActionsSchema.optional(),
|
|
556
|
+
component: z.literal('LayoutStack'),
|
|
557
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
558
|
+
state: LayoutStackStateSchema.optional(),
|
|
559
|
+
});
|
|
560
|
+
export const QuerySummaryStateSchema = z.strictObject({
|
|
561
|
+
correction: QueryCorrectionSchema.optional(),
|
|
562
|
+
firstIndex: z.number().int().min(0),
|
|
563
|
+
lastIndex: z.number().int().min(0),
|
|
564
|
+
query: z.string(),
|
|
565
|
+
totalEntries: z.number().int().min(0),
|
|
566
|
+
});
|
|
567
|
+
export const SetPageSizeSchema = z.strictObject({
|
|
568
|
+
payload: SetPageSizePayloadSchema,
|
|
569
|
+
});
|
|
570
|
+
export const PurchaseSchema = z.strictObject({
|
|
571
|
+
payload: PurchasePayloadSchema,
|
|
572
|
+
});
|
|
573
|
+
export const QuerySuggestionsActionsSchema = z.strictObject({
|
|
574
|
+
fetchSuggestions: FetchSuggestionsSchema,
|
|
575
|
+
});
|
|
576
|
+
export const InstantProductsActionsSchema = z.strictObject({
|
|
577
|
+
fetchInstantProducts: FetchInstantProductsSchema,
|
|
578
|
+
});
|
|
579
|
+
export const NextActionsBarActionsSchema = z.strictObject({
|
|
580
|
+
selectAction: SelectActionSchema,
|
|
581
|
+
selectSearchOption: SelectSearchOptionSchema,
|
|
582
|
+
});
|
|
583
|
+
export const BundleDisplayStateSchema = z.strictObject({
|
|
584
|
+
heading: z.string().optional(),
|
|
585
|
+
tiers: z.array(BundleTierSchema),
|
|
586
|
+
});
|
|
587
|
+
export const ProductResearchCardSchema = z.looseObject({
|
|
588
|
+
actions: ProductResearchCardActionsSchema.optional(),
|
|
589
|
+
component: z.literal('ProductResearchCard'),
|
|
590
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
591
|
+
state: ProductResearchCardStateSchema.optional(),
|
|
592
|
+
});
|
|
593
|
+
export const ComparisonTableSchema = z.looseObject({
|
|
594
|
+
actions: ComparisonTableActionsSchema.optional(),
|
|
595
|
+
component: z.literal('ComparisonTable'),
|
|
596
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
597
|
+
state: ComparisonTableStateSchema.optional(),
|
|
598
|
+
});
|
|
599
|
+
export const ProductListActionsSchema = z.strictObject({
|
|
600
|
+
productClick: ProductClickSchema,
|
|
601
|
+
selectProducts: SelectProductsSchema,
|
|
602
|
+
});
|
|
603
|
+
export const PaginationActionsSchema = z.strictObject({
|
|
604
|
+
selectPage: SelectPageSchema,
|
|
605
|
+
showMore: ShowMoreSchema,
|
|
606
|
+
});
|
|
607
|
+
export const SelectSortSchema = z.strictObject({
|
|
608
|
+
payload: SelectSortPayloadSchema,
|
|
609
|
+
});
|
|
610
|
+
export const RegularFacetActionsSchema = z.strictObject({
|
|
611
|
+
clearAllActiveValues: ActionSchema,
|
|
612
|
+
clearSearch: ActionSchema,
|
|
613
|
+
search: RegularFacetSearchSchema,
|
|
614
|
+
showLessValues: ActionSchema,
|
|
615
|
+
showMoreSearchResults: ActionSchema,
|
|
616
|
+
showMoreValues: ActionSchema,
|
|
617
|
+
toggleSelect: RegularFacetToggleSelectSchema,
|
|
618
|
+
toggleSingleSelect: RegularFacetToggleSingleSelectSchema,
|
|
619
|
+
});
|
|
620
|
+
export const RegularFacetStateSchema = z.strictObject({
|
|
621
|
+
canShowLessValues: z.boolean(),
|
|
622
|
+
canShowMoreValues: z.boolean(),
|
|
623
|
+
displayName: z.string(),
|
|
624
|
+
facetSearch: RegularFacetSearchStateSchema,
|
|
625
|
+
field: z.string().min(1),
|
|
626
|
+
hasActiveValues: z.boolean(),
|
|
627
|
+
values: z.array(RegularFacetValueSchema),
|
|
628
|
+
});
|
|
629
|
+
export const NumericFacetActionsSchema = z.strictObject({
|
|
630
|
+
applyCustomRange: NumericFacetApplyCustomRangeSchema,
|
|
631
|
+
clearAllActiveValues: ActionSchema,
|
|
632
|
+
showLessValues: ActionSchema,
|
|
633
|
+
showMoreValues: ActionSchema,
|
|
634
|
+
toggleSelect: NumericFacetToggleSelectSchema,
|
|
635
|
+
toggleSingleSelect: NumericFacetToggleSingleSelectSchema,
|
|
636
|
+
});
|
|
637
|
+
export const DateFacetActionsSchema = z.strictObject({
|
|
638
|
+
applyCustomRange: DateFacetApplyCustomRangeSchema,
|
|
639
|
+
clearAllActiveValues: ActionSchema,
|
|
640
|
+
showLessValues: ActionSchema,
|
|
641
|
+
showMoreValues: ActionSchema,
|
|
642
|
+
toggleSelect: DateFacetToggleSelectSchema,
|
|
643
|
+
toggleSingleSelect: DateFacetToggleSingleSelectSchema,
|
|
644
|
+
});
|
|
645
|
+
export const CategoryFacetActionsSchema = z.strictObject({
|
|
646
|
+
clearSearch: ActionSchema,
|
|
647
|
+
clearSelectedPath: ActionSchema,
|
|
648
|
+
search: CategoryFacetSearchSchema,
|
|
649
|
+
selectPath: CategoryFacetSelectPathSchema,
|
|
650
|
+
showLessValues: ActionSchema,
|
|
651
|
+
showMoreSearchResults: ActionSchema,
|
|
652
|
+
showMoreValues: ActionSchema,
|
|
653
|
+
});
|
|
654
|
+
export const CategoryFacetStateSchema = z.strictObject({
|
|
655
|
+
canShowLessValues: z.boolean(),
|
|
656
|
+
canShowMoreValues: z.boolean(),
|
|
657
|
+
displayName: z.string(),
|
|
658
|
+
facetSearch: CategoryFacetSearchStateSchema,
|
|
659
|
+
field: z.string(),
|
|
660
|
+
values: CategoryFacetValuesSchema,
|
|
661
|
+
});
|
|
662
|
+
export const BreadboxActionsSchema = z.strictObject({
|
|
663
|
+
clearAll: ActionSchema,
|
|
664
|
+
deselect: BreadboxDeselectSchema,
|
|
665
|
+
});
|
|
666
|
+
export const BreadboxStateSchema = z.strictObject({
|
|
667
|
+
facets: z.array(BreadboxFacetSchema),
|
|
668
|
+
});
|
|
669
|
+
export const SessionShellActionsSchema = z.strictObject({
|
|
670
|
+
initialize: InitializeSchema,
|
|
671
|
+
});
|
|
672
|
+
export const RestoreStatePayloadSchema = z.strictObject({
|
|
673
|
+
facets: z.array(FacetRestoreSchema).optional(),
|
|
674
|
+
page: z.number().int().min(0),
|
|
675
|
+
pageSize: z.number().int().min(1),
|
|
676
|
+
pinnedProducts: z.array(z.string()).optional(),
|
|
677
|
+
query: z.string(),
|
|
678
|
+
sortCriteria: z.string().optional(),
|
|
679
|
+
});
|
|
680
|
+
export const QuerySummarySchema = z.looseObject({
|
|
681
|
+
actions: QuerySummaryActionsSchema.optional(),
|
|
682
|
+
component: z.literal('QuerySummary'),
|
|
683
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
684
|
+
state: QuerySummaryStateSchema.optional(),
|
|
685
|
+
});
|
|
686
|
+
export const PageSizeActionsSchema = z.strictObject({
|
|
687
|
+
setPageSize: SetPageSizeSchema,
|
|
688
|
+
});
|
|
689
|
+
export const CartActionsSchema = z.strictObject({
|
|
690
|
+
purchase: PurchaseSchema,
|
|
691
|
+
updateCart: UpdateCartSchema,
|
|
692
|
+
});
|
|
693
|
+
export const QuerySuggestionsSchema = z.looseObject({
|
|
694
|
+
actions: QuerySuggestionsActionsSchema.optional(),
|
|
695
|
+
component: z.literal('QuerySuggestions'),
|
|
696
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
697
|
+
state: QuerySuggestionsStateSchema.optional(),
|
|
698
|
+
});
|
|
699
|
+
export const InstantProductsSchema = z.looseObject({
|
|
700
|
+
actions: InstantProductsActionsSchema.optional(),
|
|
701
|
+
component: z.literal('InstantProducts'),
|
|
702
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
703
|
+
state: InstantProductsStateSchema.optional(),
|
|
704
|
+
});
|
|
705
|
+
export const NextActionsBarSchema = z.looseObject({
|
|
706
|
+
actions: NextActionsBarActionsSchema.optional(),
|
|
707
|
+
component: z.literal('NextActionsBar'),
|
|
708
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
709
|
+
state: NextActionsStateSchema.optional(),
|
|
710
|
+
});
|
|
711
|
+
export const BundleDisplaySchema = z.looseObject({
|
|
712
|
+
actions: BundleDisplayActionsSchema.optional(),
|
|
713
|
+
component: z.literal('BundleDisplay'),
|
|
714
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
715
|
+
state: BundleDisplayStateSchema.optional(),
|
|
716
|
+
});
|
|
717
|
+
export const ProductListSchema = z.looseObject({
|
|
718
|
+
actions: ProductListActionsSchema.optional(),
|
|
719
|
+
component: z.literal('ProductList'),
|
|
720
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
721
|
+
state: ProductListStateSchema.optional(),
|
|
722
|
+
});
|
|
723
|
+
export const PaginationSchema = z.looseObject({
|
|
724
|
+
actions: PaginationActionsSchema.optional(),
|
|
725
|
+
component: z.literal('Pagination'),
|
|
726
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
727
|
+
state: PaginationStateSchema.optional(),
|
|
728
|
+
});
|
|
729
|
+
export const SortActionsSchema = z.strictObject({
|
|
730
|
+
selectSort: SelectSortSchema,
|
|
731
|
+
});
|
|
732
|
+
export const RegularFacetSchema = z.looseObject({
|
|
733
|
+
actions: RegularFacetActionsSchema.optional(),
|
|
734
|
+
component: z.literal('RegularFacet'),
|
|
735
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
736
|
+
state: RegularFacetStateSchema.optional(),
|
|
737
|
+
});
|
|
738
|
+
export const NumericFacetSchema = z.looseObject({
|
|
739
|
+
actions: NumericFacetActionsSchema.optional(),
|
|
740
|
+
component: z.literal('NumericFacet'),
|
|
741
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
742
|
+
state: NumericFacetStateSchema.optional(),
|
|
743
|
+
});
|
|
744
|
+
export const DateFacetSchema = z.looseObject({
|
|
745
|
+
actions: DateFacetActionsSchema.optional(),
|
|
746
|
+
component: z.literal('DateFacet'),
|
|
747
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
748
|
+
state: DateFacetStateSchema.optional(),
|
|
749
|
+
});
|
|
750
|
+
export const CategoryFacetSchema = z.looseObject({
|
|
751
|
+
actions: CategoryFacetActionsSchema.optional(),
|
|
752
|
+
component: z.literal('CategoryFacet'),
|
|
753
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
754
|
+
state: CategoryFacetStateSchema.optional(),
|
|
755
|
+
});
|
|
756
|
+
export const BreadboxSchema = z.looseObject({
|
|
757
|
+
actions: BreadboxActionsSchema.optional(),
|
|
758
|
+
component: z.literal('Breadbox'),
|
|
759
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
760
|
+
state: BreadboxStateSchema.optional(),
|
|
761
|
+
});
|
|
762
|
+
export const SessionShellSchema = z.looseObject({
|
|
763
|
+
actions: SessionShellActionsSchema.optional(),
|
|
764
|
+
component: z.literal('SessionShell'),
|
|
765
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
766
|
+
state: SessionShellStateSchema.optional(),
|
|
767
|
+
});
|
|
768
|
+
export const RestoreStateSchema = z.strictObject({
|
|
769
|
+
payload: RestoreStatePayloadSchema,
|
|
770
|
+
});
|
|
771
|
+
export const PageSizeSchema = z.looseObject({
|
|
772
|
+
actions: PageSizeActionsSchema.optional(),
|
|
773
|
+
component: z.literal('PageSize'),
|
|
774
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
775
|
+
state: PageSizeStateSchema.optional(),
|
|
776
|
+
});
|
|
777
|
+
export const CartSchema = z.looseObject({
|
|
778
|
+
actions: CartActionsSchema.optional(),
|
|
779
|
+
component: z.literal('Cart'),
|
|
780
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
781
|
+
state: CartStateSchema.optional(),
|
|
782
|
+
});
|
|
783
|
+
export const SortSchema = z.looseObject({
|
|
784
|
+
actions: SortActionsSchema.optional(),
|
|
785
|
+
component: z.literal('Sort'),
|
|
786
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
787
|
+
state: SortStateSchema.optional(),
|
|
788
|
+
});
|
|
789
|
+
export const CommerceSearchActionsSchema = z.strictObject({
|
|
790
|
+
restoreState: RestoreStateSchema,
|
|
791
|
+
submitQuery: SubmitQuerySchema,
|
|
792
|
+
});
|
|
793
|
+
export const CommerceSearchSchema = z.looseObject({
|
|
794
|
+
actions: CommerceSearchActionsSchema.optional(),
|
|
795
|
+
component: z.literal('CommerceSearch'),
|
|
796
|
+
id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
|
|
797
|
+
state: CommerceSearchStateSchema.optional(),
|
|
798
|
+
});
|
|
799
|
+
export const ComponentContractsSchema = z.discriminatedUnion('component', [
|
|
800
|
+
ProductCarouselSchema,
|
|
801
|
+
CartSchema,
|
|
802
|
+
SearchBoxSchema,
|
|
803
|
+
QuerySuggestionsSchema,
|
|
804
|
+
InstantProductsSchema,
|
|
805
|
+
NextActionsBarSchema,
|
|
806
|
+
BundleDisplaySchema,
|
|
807
|
+
ProductResearchCardSchema,
|
|
808
|
+
ComparisonTableSchema,
|
|
809
|
+
ProductListSchema,
|
|
810
|
+
ProductSummarySchema,
|
|
811
|
+
PaginationSchema,
|
|
812
|
+
SortSchema,
|
|
813
|
+
RegularFacetSchema,
|
|
814
|
+
NumericFacetSchema,
|
|
815
|
+
DateFacetSchema,
|
|
816
|
+
CategoryFacetSchema,
|
|
817
|
+
FacetManagerSchema,
|
|
818
|
+
BreadboxSchema,
|
|
819
|
+
SessionShellSchema,
|
|
820
|
+
CommerceSearchSchema,
|
|
821
|
+
LayoutStackSchema,
|
|
822
|
+
QuerySummarySchema,
|
|
823
|
+
PageSizeSchema,
|
|
824
|
+
]);
|
|
825
|
+
/**
|
|
826
|
+
* A2-UI dynamic-value building blocks (self-contained; no renderer / @a2ui/web_core dependency).
|
|
827
|
+
* A bindable prop is an A2-UI Dynamic_Value: a union admitting a literal resolved value, an
|
|
828
|
+
* A2-UI Data_Binding object { path }, or a function-call form. The frozen renderer's binder
|
|
829
|
+
* classifies a field as resolvable only when its schema is such a union including DataBinding,
|
|
830
|
+
* so it dereferences the { path } against the data model before the renderer sees it.
|
|
831
|
+
*
|
|
832
|
+
* `DataBindingSchema` is projected from the shared definitions/data-binding.schema.json (like
|
|
833
|
+
* ComponentId / ChildList), so it is not re-declared here; the unions below reference it.
|
|
834
|
+
*/
|
|
835
|
+
export const FunctionCallSchema = z.object({
|
|
836
|
+
call: z.string(),
|
|
837
|
+
args: z.record(z.string(), z.any()),
|
|
838
|
+
returnType: z
|
|
839
|
+
.enum(['string', 'number', 'boolean', 'array', 'object', 'any', 'void'])
|
|
840
|
+
.default('boolean'),
|
|
841
|
+
});
|
|
842
|
+
export const DynamicNumberSchema = z.union([z.number(), DataBindingSchema, FunctionCallSchema]);
|
|
843
|
+
export const DynamicStringSchema = z.union([z.string(), DataBindingSchema, FunctionCallSchema]);
|
|
844
|
+
export const DynamicBooleanSchema = z.union([z.boolean(), DataBindingSchema, FunctionCallSchema]);
|
|
845
|
+
export const DynamicStringListSchema = z.union([
|
|
846
|
+
z.array(z.string()),
|
|
847
|
+
DataBindingSchema,
|
|
848
|
+
FunctionCallSchema,
|
|
849
|
+
]);
|
|
850
|
+
export const DynamicValueSchema = z.union([z.unknown(), DataBindingSchema, FunctionCallSchema]);
|
|
851
|
+
/**
|
|
852
|
+
* The A2-UI Action schema for an action-typed prop: the standard A2-UI event shape
|
|
853
|
+
* { event: { name; context } }. Named DynamicAction to stay distinct from the generated base
|
|
854
|
+
* action-contract ActionSchema and from a component's dispatchable *Actions contract.
|
|
855
|
+
*/
|
|
856
|
+
export const DynamicActionSchema = z.object({
|
|
857
|
+
event: z.object({
|
|
858
|
+
name: z.string(),
|
|
859
|
+
context: z.unknown().optional(),
|
|
860
|
+
}),
|
|
861
|
+
});
|
|
862
|
+
/**
|
|
863
|
+
* Per-component props schemas for the renderer catalog (one per component), passed to
|
|
864
|
+
* `createCatalog` as each component's `{ props }` schema. Each bindable prop is an A2-UI
|
|
865
|
+
* Dynamic_Value, so the renderer's binder resolves its `{ path }` binding against the A2-UI
|
|
866
|
+
* data model; composition child-ref props stay static so child ids reach the renderer
|
|
867
|
+
* untouched. The resolved shape a renderer actually reads is the `XxxProps` type.
|
|
868
|
+
*/
|
|
869
|
+
export const BreadboxPropsSchema = z.object({
|
|
870
|
+
facets: z.union([BreadboxStateSchema.shape['facets'], DataBindingSchema, FunctionCallSchema]),
|
|
871
|
+
});
|
|
872
|
+
export const BundleDisplayPropsSchema = z.object({
|
|
873
|
+
heading: DynamicStringSchema.optional(),
|
|
874
|
+
tiers: z.union([BundleDisplayStateSchema.shape['tiers'], DataBindingSchema, FunctionCallSchema]),
|
|
875
|
+
});
|
|
876
|
+
export const CartPropsSchema = z.object({});
|
|
877
|
+
export const CategoryFacetPropsSchema = z.object({
|
|
878
|
+
field: DynamicStringSchema,
|
|
879
|
+
displayName: DynamicStringSchema,
|
|
880
|
+
values: z.union([
|
|
881
|
+
CategoryFacetStateSchema.shape['values'],
|
|
882
|
+
DataBindingSchema,
|
|
883
|
+
FunctionCallSchema,
|
|
884
|
+
]),
|
|
885
|
+
canShowMoreValues: DynamicBooleanSchema,
|
|
886
|
+
canShowLessValues: DynamicBooleanSchema,
|
|
887
|
+
facetSearch: z.union([
|
|
888
|
+
CategoryFacetStateSchema.shape['facetSearch'],
|
|
889
|
+
DataBindingSchema,
|
|
890
|
+
FunctionCallSchema,
|
|
891
|
+
]),
|
|
892
|
+
});
|
|
893
|
+
export const CommerceSearchPropsSchema = z.object({
|
|
894
|
+
sidebarChild: z.string().optional(),
|
|
895
|
+
mainChild: z.string().optional(),
|
|
896
|
+
});
|
|
897
|
+
export const ComparisonTablePropsSchema = z.object({
|
|
898
|
+
heading: DynamicStringSchema,
|
|
899
|
+
summary: DynamicStringSchema,
|
|
900
|
+
products: z.union([
|
|
901
|
+
ComparisonTableStateSchema.shape['products'],
|
|
902
|
+
DataBindingSchema,
|
|
903
|
+
FunctionCallSchema,
|
|
904
|
+
]),
|
|
905
|
+
attributes: z.union([
|
|
906
|
+
ComparisonTableStateSchema.shape['attributes'],
|
|
907
|
+
DataBindingSchema,
|
|
908
|
+
FunctionCallSchema,
|
|
909
|
+
]),
|
|
910
|
+
});
|
|
911
|
+
export const DateFacetPropsSchema = z.object({
|
|
912
|
+
field: DynamicStringSchema,
|
|
913
|
+
displayName: DynamicStringSchema,
|
|
914
|
+
values: z.union([DateFacetStateSchema.shape['values'], DataBindingSchema, FunctionCallSchema]),
|
|
915
|
+
customRange: z.union([
|
|
916
|
+
DateFacetStateSchema.shape['customRange'],
|
|
917
|
+
DataBindingSchema,
|
|
918
|
+
FunctionCallSchema,
|
|
919
|
+
]),
|
|
920
|
+
hasActiveValues: DynamicBooleanSchema,
|
|
921
|
+
canShowMoreValues: DynamicBooleanSchema,
|
|
922
|
+
canShowLessValues: DynamicBooleanSchema,
|
|
923
|
+
});
|
|
924
|
+
export const FacetManagerPropsSchema = z.object({
|
|
925
|
+
children: z.array(z.string()).optional(),
|
|
926
|
+
});
|
|
927
|
+
export const InstantProductsPropsSchema = z.object({
|
|
928
|
+
query: DynamicStringSchema,
|
|
929
|
+
products: z.union([
|
|
930
|
+
InstantProductsStateSchema.shape['products'],
|
|
931
|
+
DataBindingSchema,
|
|
932
|
+
FunctionCallSchema,
|
|
933
|
+
]),
|
|
934
|
+
});
|
|
935
|
+
export const LayoutStackPropsSchema = z.object({
|
|
936
|
+
direction: z.string().optional(),
|
|
937
|
+
children: z.array(z.string()).optional(),
|
|
938
|
+
});
|
|
939
|
+
export const NextActionsBarPropsSchema = z.object({
|
|
940
|
+
suggestedActions: z.union([
|
|
941
|
+
NextActionsStateSchema.shape['suggestedActions'],
|
|
942
|
+
DataBindingSchema,
|
|
943
|
+
FunctionCallSchema,
|
|
944
|
+
]),
|
|
945
|
+
});
|
|
946
|
+
export const NumericFacetPropsSchema = z.object({
|
|
947
|
+
field: DynamicStringSchema,
|
|
948
|
+
displayName: DynamicStringSchema,
|
|
949
|
+
values: z.union([NumericFacetStateSchema.shape['values'], DataBindingSchema, FunctionCallSchema]),
|
|
950
|
+
customRange: z.union([
|
|
951
|
+
NumericFacetStateSchema.shape['customRange'],
|
|
952
|
+
DataBindingSchema,
|
|
953
|
+
FunctionCallSchema,
|
|
954
|
+
]),
|
|
955
|
+
hasActiveValues: DynamicBooleanSchema,
|
|
956
|
+
canShowMoreValues: DynamicBooleanSchema,
|
|
957
|
+
canShowLessValues: DynamicBooleanSchema,
|
|
958
|
+
domain: z
|
|
959
|
+
.union([NumericFacetStateSchema.shape['domain'], DataBindingSchema, FunctionCallSchema])
|
|
960
|
+
.optional(),
|
|
961
|
+
});
|
|
962
|
+
export const PageSizePropsSchema = z.object({
|
|
963
|
+
pageSize: DynamicNumberSchema,
|
|
964
|
+
});
|
|
965
|
+
export const PaginationPropsSchema = z.object({
|
|
966
|
+
page: DynamicNumberSchema,
|
|
967
|
+
pageSize: DynamicNumberSchema,
|
|
968
|
+
totalEntries: DynamicNumberSchema,
|
|
969
|
+
totalPages: DynamicNumberSchema,
|
|
970
|
+
});
|
|
971
|
+
export const ProductCarouselPropsSchema = z.object({
|
|
972
|
+
heading: DynamicStringSchema,
|
|
973
|
+
products: z.union([
|
|
974
|
+
ProductCarouselStateSchema.shape['products'],
|
|
975
|
+
DataBindingSchema,
|
|
976
|
+
FunctionCallSchema,
|
|
977
|
+
]),
|
|
978
|
+
});
|
|
979
|
+
export const ProductListPropsSchema = z.object({
|
|
980
|
+
products: z.union([
|
|
981
|
+
ProductListStateSchema.shape['products'],
|
|
982
|
+
DataBindingSchema,
|
|
983
|
+
FunctionCallSchema,
|
|
984
|
+
]),
|
|
985
|
+
});
|
|
986
|
+
export const ProductResearchCardPropsSchema = z.object({
|
|
987
|
+
product: z.union([
|
|
988
|
+
ProductResearchCardStateSchema.shape['product'],
|
|
989
|
+
DataBindingSchema,
|
|
990
|
+
FunctionCallSchema,
|
|
991
|
+
]),
|
|
992
|
+
summary: DynamicStringSchema,
|
|
993
|
+
bullets: DynamicStringListSchema,
|
|
994
|
+
relatedDocuments: z
|
|
995
|
+
.union([
|
|
996
|
+
ProductResearchCardStateSchema.shape['relatedDocuments'],
|
|
997
|
+
DataBindingSchema,
|
|
998
|
+
FunctionCallSchema,
|
|
999
|
+
])
|
|
1000
|
+
.optional(),
|
|
1001
|
+
});
|
|
1002
|
+
export const ProductSummaryPropsSchema = z.object({
|
|
1003
|
+
categoryLabel: DynamicStringSchema,
|
|
1004
|
+
product: z.union([
|
|
1005
|
+
ProductSummaryStateSchema.shape['product'],
|
|
1006
|
+
DataBindingSchema,
|
|
1007
|
+
FunctionCallSchema,
|
|
1008
|
+
]),
|
|
1009
|
+
});
|
|
1010
|
+
export const QuerySuggestionsPropsSchema = z.object({
|
|
1011
|
+
query: DynamicStringSchema,
|
|
1012
|
+
completions: z.union([
|
|
1013
|
+
QuerySuggestionsStateSchema.shape['completions'],
|
|
1014
|
+
DataBindingSchema,
|
|
1015
|
+
FunctionCallSchema,
|
|
1016
|
+
]),
|
|
1017
|
+
});
|
|
1018
|
+
export const QuerySummaryPropsSchema = z.object({
|
|
1019
|
+
query: DynamicStringSchema,
|
|
1020
|
+
firstIndex: DynamicNumberSchema,
|
|
1021
|
+
lastIndex: DynamicNumberSchema,
|
|
1022
|
+
totalEntries: DynamicNumberSchema,
|
|
1023
|
+
correction: z
|
|
1024
|
+
.union([QuerySummaryStateSchema.shape['correction'], DataBindingSchema, FunctionCallSchema])
|
|
1025
|
+
.optional(),
|
|
1026
|
+
});
|
|
1027
|
+
export const RegularFacetPropsSchema = z.object({
|
|
1028
|
+
field: DynamicStringSchema,
|
|
1029
|
+
displayName: DynamicStringSchema,
|
|
1030
|
+
values: z.union([RegularFacetStateSchema.shape['values'], DataBindingSchema, FunctionCallSchema]),
|
|
1031
|
+
hasActiveValues: DynamicBooleanSchema,
|
|
1032
|
+
canShowMoreValues: DynamicBooleanSchema,
|
|
1033
|
+
canShowLessValues: DynamicBooleanSchema,
|
|
1034
|
+
facetSearch: z.union([
|
|
1035
|
+
RegularFacetStateSchema.shape['facetSearch'],
|
|
1036
|
+
DataBindingSchema,
|
|
1037
|
+
FunctionCallSchema,
|
|
1038
|
+
]),
|
|
1039
|
+
});
|
|
1040
|
+
export const SearchBoxPropsSchema = z.object({
|
|
1041
|
+
suggestionsChild: z.string().optional(),
|
|
1042
|
+
instantProductsChild: z.string().optional(),
|
|
1043
|
+
});
|
|
1044
|
+
export const SessionShellPropsSchema = z.object({
|
|
1045
|
+
children: z.array(z.string()).optional(),
|
|
1046
|
+
});
|
|
1047
|
+
export const SortPropsSchema = z.object({
|
|
1048
|
+
appliedSort: z.union([
|
|
1049
|
+
SortStateSchema.shape['appliedSort'],
|
|
1050
|
+
DataBindingSchema,
|
|
1051
|
+
FunctionCallSchema,
|
|
1052
|
+
]),
|
|
1053
|
+
availableSorts: z.union([
|
|
1054
|
+
SortStateSchema.shape['availableSorts'],
|
|
1055
|
+
DataBindingSchema,
|
|
1056
|
+
FunctionCallSchema,
|
|
1057
|
+
]),
|
|
1058
|
+
});
|
|
1059
|
+
/**
|
|
1060
|
+
* Per-component action unions in the standard A2-UI event shape
|
|
1061
|
+
* { event: { name: <literal>; context: <typed payload> } }, one member per declared action.
|
|
1062
|
+
* Derived from each component's *Actions contract (action-map key -> payload), NOT from
|
|
1063
|
+
* quicktype's auto-named payload wrappers. A component with no actions has `type XxxAction =
|
|
1064
|
+
* never`. The wire field is `context`; the internal validation layer calls the same data
|
|
1065
|
+
* `payload` (see design: Action typing).
|
|
1066
|
+
*/
|
|
1067
|
+
export const BreadboxActionSchema = z.union([
|
|
1068
|
+
z.object({
|
|
1069
|
+
event: z.object({ name: z.literal('deselect'), context: BreadboxDeselectPayloadSchema }),
|
|
1070
|
+
}),
|
|
1071
|
+
z.object({ event: z.object({ name: z.literal('clearAll'), context: z.unknown() }) }),
|
|
1072
|
+
]);
|
|
1073
|
+
export const BundleDisplayActionSchema = z.never();
|
|
1074
|
+
export const CartActionSchema = z.union([
|
|
1075
|
+
z.object({
|
|
1076
|
+
event: z.object({
|
|
1077
|
+
name: z.literal('updateCart'),
|
|
1078
|
+
context: z.strictObject({
|
|
1079
|
+
productId: z.string(),
|
|
1080
|
+
name: z.string().optional(),
|
|
1081
|
+
price: z.unknown().optional(),
|
|
1082
|
+
quantity: z.number().int().min(1),
|
|
1083
|
+
operation: z.enum(['add', 'remove', 'setQuantity']),
|
|
1084
|
+
}),
|
|
1085
|
+
}),
|
|
1086
|
+
}),
|
|
1087
|
+
z.object({
|
|
1088
|
+
event: z.object({
|
|
1089
|
+
name: z.literal('purchase'),
|
|
1090
|
+
context: z.strictObject({ products: z.array(z.unknown()), transaction: z.unknown() }),
|
|
1091
|
+
}),
|
|
1092
|
+
}),
|
|
1093
|
+
]);
|
|
1094
|
+
export const CategoryFacetActionSchema = z.union([
|
|
1095
|
+
z.object({
|
|
1096
|
+
event: z.object({
|
|
1097
|
+
name: z.literal('selectPath'),
|
|
1098
|
+
context: z.strictObject({ path: z.array(z.string()) }),
|
|
1099
|
+
}),
|
|
1100
|
+
}),
|
|
1101
|
+
z.object({ event: z.object({ name: z.literal('clearSelectedPath'), context: z.unknown() }) }),
|
|
1102
|
+
z.object({
|
|
1103
|
+
event: z.object({ name: z.literal('search'), context: z.strictObject({ query: z.string() }) }),
|
|
1104
|
+
}),
|
|
1105
|
+
z.object({ event: z.object({ name: z.literal('showMoreSearchResults'), context: z.unknown() }) }),
|
|
1106
|
+
z.object({ event: z.object({ name: z.literal('clearSearch'), context: z.unknown() }) }),
|
|
1107
|
+
z.object({ event: z.object({ name: z.literal('showMoreValues'), context: z.unknown() }) }),
|
|
1108
|
+
z.object({ event: z.object({ name: z.literal('showLessValues'), context: z.unknown() }) }),
|
|
1109
|
+
]);
|
|
1110
|
+
export const CommerceSearchActionSchema = z.union([
|
|
1111
|
+
z.object({
|
|
1112
|
+
event: z.object({ name: z.literal('submitQuery'), context: z.strictObject({ query: z.string() }) }),
|
|
1113
|
+
}),
|
|
1114
|
+
z.object({
|
|
1115
|
+
event: z.object({
|
|
1116
|
+
name: z.literal('restoreState'),
|
|
1117
|
+
context: z.strictObject({
|
|
1118
|
+
query: z.string(),
|
|
1119
|
+
page: z.number().int().min(0),
|
|
1120
|
+
pageSize: z.number().int().min(1),
|
|
1121
|
+
sortCriteria: z.string().optional(),
|
|
1122
|
+
facets: z.array(z.unknown()).optional(),
|
|
1123
|
+
pinnedProducts: z.array(z.string()).optional(),
|
|
1124
|
+
}),
|
|
1125
|
+
}),
|
|
1126
|
+
}),
|
|
1127
|
+
]);
|
|
1128
|
+
export const ComparisonTableActionSchema = z.never();
|
|
1129
|
+
export const DateFacetActionSchema = z.union([
|
|
1130
|
+
z.object({
|
|
1131
|
+
event: z.object({
|
|
1132
|
+
name: z.literal('toggleSelect'),
|
|
1133
|
+
context: z.strictObject({ start: z.string(), end: z.string() }),
|
|
1134
|
+
}),
|
|
1135
|
+
}),
|
|
1136
|
+
z.object({
|
|
1137
|
+
event: z.object({
|
|
1138
|
+
name: z.literal('toggleSingleSelect'),
|
|
1139
|
+
context: z.strictObject({ start: z.string(), end: z.string() }),
|
|
1140
|
+
}),
|
|
1141
|
+
}),
|
|
1142
|
+
z.object({ event: z.object({ name: z.literal('clearAllActiveValues'), context: z.unknown() }) }),
|
|
1143
|
+
z.object({
|
|
1144
|
+
event: z.object({
|
|
1145
|
+
name: z.literal('applyCustomRange'),
|
|
1146
|
+
context: z.strictObject({ start: z.string(), end: z.string() }),
|
|
1147
|
+
}),
|
|
1148
|
+
}),
|
|
1149
|
+
z.object({ event: z.object({ name: z.literal('showMoreValues'), context: z.unknown() }) }),
|
|
1150
|
+
z.object({ event: z.object({ name: z.literal('showLessValues'), context: z.unknown() }) }),
|
|
1151
|
+
]);
|
|
1152
|
+
export const FacetManagerActionSchema = z.never();
|
|
1153
|
+
export const InstantProductsActionSchema = z.union([
|
|
1154
|
+
z.object({
|
|
1155
|
+
event: z.object({
|
|
1156
|
+
name: z.literal('fetchInstantProducts'),
|
|
1157
|
+
context: z.strictObject({ query: z.string() }),
|
|
1158
|
+
}),
|
|
1159
|
+
}),
|
|
1160
|
+
]);
|
|
1161
|
+
export const LayoutStackActionSchema = z.never();
|
|
1162
|
+
export const NextActionsBarActionSchema = z.union([
|
|
1163
|
+
z.object({
|
|
1164
|
+
event: z.object({
|
|
1165
|
+
name: z.literal('selectAction'),
|
|
1166
|
+
context: z.strictObject({ text: z.string(), type: z.enum(['followup', 'search']) }),
|
|
1167
|
+
}),
|
|
1168
|
+
}),
|
|
1169
|
+
z.object({
|
|
1170
|
+
event: z.object({
|
|
1171
|
+
name: z.literal('selectSearchOption'),
|
|
1172
|
+
context: z.strictObject({ optionId: z.string(), text: z.string() }),
|
|
1173
|
+
}),
|
|
1174
|
+
}),
|
|
1175
|
+
]);
|
|
1176
|
+
export const NumericFacetActionSchema = z.union([
|
|
1177
|
+
z.object({
|
|
1178
|
+
event: z.object({
|
|
1179
|
+
name: z.literal('toggleSelect'),
|
|
1180
|
+
context: z.strictObject({ start: z.number(), end: z.number() }),
|
|
1181
|
+
}),
|
|
1182
|
+
}),
|
|
1183
|
+
z.object({
|
|
1184
|
+
event: z.object({
|
|
1185
|
+
name: z.literal('toggleSingleSelect'),
|
|
1186
|
+
context: z.strictObject({ start: z.number(), end: z.number() }),
|
|
1187
|
+
}),
|
|
1188
|
+
}),
|
|
1189
|
+
z.object({ event: z.object({ name: z.literal('clearAllActiveValues'), context: z.unknown() }) }),
|
|
1190
|
+
z.object({
|
|
1191
|
+
event: z.object({
|
|
1192
|
+
name: z.literal('applyCustomRange'),
|
|
1193
|
+
context: z.strictObject({ start: z.number(), end: z.number() }),
|
|
1194
|
+
}),
|
|
1195
|
+
}),
|
|
1196
|
+
z.object({ event: z.object({ name: z.literal('showMoreValues'), context: z.unknown() }) }),
|
|
1197
|
+
z.object({ event: z.object({ name: z.literal('showLessValues'), context: z.unknown() }) }),
|
|
1198
|
+
]);
|
|
1199
|
+
export const PageSizeActionSchema = z.union([
|
|
1200
|
+
z.object({
|
|
1201
|
+
event: z.object({
|
|
1202
|
+
name: z.literal('setPageSize'),
|
|
1203
|
+
context: z.strictObject({ pageSize: z.number().int().min(1) }),
|
|
1204
|
+
}),
|
|
1205
|
+
}),
|
|
1206
|
+
]);
|
|
1207
|
+
export const PaginationActionSchema = z.union([
|
|
1208
|
+
z.object({
|
|
1209
|
+
event: z.object({
|
|
1210
|
+
name: z.literal('selectPage'),
|
|
1211
|
+
context: z.strictObject({ page: z.number().int().min(0) }),
|
|
1212
|
+
}),
|
|
1213
|
+
}),
|
|
1214
|
+
z.object({ event: z.object({ name: z.literal('showMore'), context: z.strictObject({}) }) }),
|
|
1215
|
+
]);
|
|
1216
|
+
export const ProductCarouselActionSchema = z.never();
|
|
1217
|
+
export const ProductListActionSchema = z.union([
|
|
1218
|
+
z.object({
|
|
1219
|
+
event: z.object({
|
|
1220
|
+
name: z.literal('selectProducts'),
|
|
1221
|
+
context: z.strictObject({ productIds: z.array(z.string()) }),
|
|
1222
|
+
}),
|
|
1223
|
+
}),
|
|
1224
|
+
z.object({
|
|
1225
|
+
event: z.object({
|
|
1226
|
+
name: z.literal('productClick'),
|
|
1227
|
+
context: z.strictObject({
|
|
1228
|
+
productId: z.string(),
|
|
1229
|
+
name: z.string().optional(),
|
|
1230
|
+
price: z.unknown().optional(),
|
|
1231
|
+
position: z.number().int().min(0),
|
|
1232
|
+
}),
|
|
1233
|
+
}),
|
|
1234
|
+
}),
|
|
1235
|
+
]);
|
|
1236
|
+
export const ProductResearchCardActionSchema = z.never();
|
|
1237
|
+
export const ProductSummaryActionSchema = z.never();
|
|
1238
|
+
export const QuerySuggestionsActionSchema = z.union([
|
|
1239
|
+
z.object({
|
|
1240
|
+
event: z.object({
|
|
1241
|
+
name: z.literal('fetchSuggestions'),
|
|
1242
|
+
context: z.strictObject({ query: z.string() }),
|
|
1243
|
+
}),
|
|
1244
|
+
}),
|
|
1245
|
+
]);
|
|
1246
|
+
export const QuerySummaryActionSchema = z.union([
|
|
1247
|
+
z.object({ event: z.object({ name: z.literal('overrideCorrection'), context: z.unknown() }) }),
|
|
1248
|
+
]);
|
|
1249
|
+
export const RegularFacetActionSchema = z.union([
|
|
1250
|
+
z.object({
|
|
1251
|
+
event: z.object({
|
|
1252
|
+
name: z.literal('toggleSelect'),
|
|
1253
|
+
context: z.strictObject({ value: z.string() }),
|
|
1254
|
+
}),
|
|
1255
|
+
}),
|
|
1256
|
+
z.object({
|
|
1257
|
+
event: z.object({
|
|
1258
|
+
name: z.literal('toggleSingleSelect'),
|
|
1259
|
+
context: z.strictObject({ value: z.string() }),
|
|
1260
|
+
}),
|
|
1261
|
+
}),
|
|
1262
|
+
z.object({ event: z.object({ name: z.literal('clearAllActiveValues'), context: z.unknown() }) }),
|
|
1263
|
+
z.object({
|
|
1264
|
+
event: z.object({ name: z.literal('search'), context: z.strictObject({ query: z.string() }) }),
|
|
1265
|
+
}),
|
|
1266
|
+
z.object({ event: z.object({ name: z.literal('showMoreSearchResults'), context: z.unknown() }) }),
|
|
1267
|
+
z.object({ event: z.object({ name: z.literal('clearSearch'), context: z.unknown() }) }),
|
|
1268
|
+
z.object({ event: z.object({ name: z.literal('showMoreValues'), context: z.unknown() }) }),
|
|
1269
|
+
z.object({ event: z.object({ name: z.literal('showLessValues'), context: z.unknown() }) }),
|
|
1270
|
+
]);
|
|
1271
|
+
export const SearchBoxActionSchema = z.never();
|
|
1272
|
+
export const SessionShellActionSchema = z.union([
|
|
1273
|
+
z.object({ event: z.object({ name: z.literal('initialize'), context: z.strictObject({}) }) }),
|
|
1274
|
+
]);
|
|
1275
|
+
export const SortActionSchema = z.union([
|
|
1276
|
+
z.object({
|
|
1277
|
+
event: z.object({
|
|
1278
|
+
name: z.literal('selectSort'),
|
|
1279
|
+
context: z.strictObject({ sortCriteria: z.string(), fields: z.array(SortFieldSchema) }),
|
|
1280
|
+
}),
|
|
1281
|
+
}),
|
|
1282
|
+
]);
|