@coveo/thermidor-schema 0.0.0 → 1.0.0-beta.10

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