@coveo/thermidor-schema 1.0.0-beta.2 → 1.0.0-beta.3

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 (31) hide show
  1. package/dist/generated/schemas.d.ts +282 -207
  2. package/dist/generated/schemas.js +168 -62
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.js +1 -1
  5. package/package.json +1 -1
  6. package/schema/base/component.schema.json +14 -1
  7. package/schema/components/bundle-display.schema.json +13 -4
  8. package/schema/components/category-facet.schema.json +17 -22
  9. package/schema/components/commerce-search.schema.json +45 -0
  10. package/schema/components/comparison-table.schema.json +25 -9
  11. package/schema/components/component-contracts.schema.json +15 -6
  12. package/schema/components/date-facet.schema.json +17 -24
  13. package/schema/components/facet-manager.schema.json +15 -15
  14. package/schema/components/layout-stack.schema.json +47 -0
  15. package/schema/components/next-actions-bar.schema.json +16 -15
  16. package/schema/components/numeric-facet.schema.json +17 -24
  17. package/schema/components/page-size.schema.json +81 -0
  18. package/schema/components/pagination.schema.json +16 -17
  19. package/schema/components/product-carousel.schema.json +13 -5
  20. package/schema/components/product-list.schema.json +13 -4
  21. package/schema/components/product-summary.schema.json +63 -0
  22. package/schema/components/query-summary.schema.json +67 -0
  23. package/schema/components/regular-facet.schema.json +20 -30
  24. package/schema/components/sort.schema.json +16 -16
  25. package/schema/definitions/bundle-tier.schema.json +3 -3
  26. package/schema/definitions/child-ref.schema.json +8 -0
  27. package/schema/definitions/comparison-attribute.schema.json +2 -2
  28. package/schema/definitions/comparison-product.schema.json +2 -2
  29. package/schema/components/cart.schema.json +0 -108
  30. package/schema/components/search-box.schema.json +0 -74
  31. package/schema/definitions/cart-item.schema.json +0 -29
@@ -42,18 +42,6 @@ export const ProductCarouselStateSchema = z.strictObject({
42
42
  heading: z.string(),
43
43
  products: z.array(ProductSchema),
44
44
  });
45
- export const CartItemSchema = z.strictObject({
46
- name: z.string(),
47
- price: z.number().min(0),
48
- productId: z.string(),
49
- quantity: z.number().int().min(1),
50
- });
51
- export const UpdateItemQuantityPayloadSchema = z.strictObject({
52
- item: CartItemSchema,
53
- });
54
- export const CartStateSchema = z.strictObject({
55
- items: z.array(CartItemSchema),
56
- });
57
45
  export const SelectActionPayloadSchema = z.strictObject({
58
46
  text: z.string(),
59
47
  type: z.enum(['followup', 'search']),
@@ -65,7 +53,7 @@ export const ActionItemSchema = z.strictObject({
65
53
  export const BundleDisplayActionsSchema = z.strictObject({});
66
54
  export const BundleSlotSchema = z.strictObject({
67
55
  categoryLabel: z.string(),
68
- surfaceRef: z.string(),
56
+ childId: z.string(),
69
57
  });
70
58
  export const ComparisonTableActionsSchema = z.strictObject({});
71
59
  export const ComparisonAttributeSchema = z.strictObject({
@@ -78,16 +66,21 @@ export const ComparisonProductSchema = z.strictObject({
78
66
  price: z.number().optional(),
79
67
  productId: z.string(),
80
68
  rating: z.number().min(0).max(5).optional(),
81
- values: z.record(z.string(), z.string()),
69
+ values: z.record(z.string(), z.string()).optional(),
82
70
  });
83
71
  export const ProductListActionsSchema = z.strictObject({});
84
72
  export const ProductListStateSchema = z.strictObject({
85
73
  products: z.array(ProductSchema),
86
74
  });
75
+ export const ProductSummaryActionsSchema = z.strictObject({});
76
+ export const ProductSummaryStateSchema = z.strictObject({
77
+ categoryLabel: z.string(),
78
+ product: z.union([ProductSchema, z.null()]),
79
+ });
87
80
  export const SelectPagePayloadSchema = z.strictObject({
88
81
  page: z.number().int().min(0),
89
82
  });
90
- export const SetPageSizePayloadSchema = z.strictObject({
83
+ export const PayloadSchema = z.strictObject({
91
84
  pageSize: z.number().int().min(1),
92
85
  });
93
86
  export const PaginationStateSchema = z.strictObject({
@@ -104,12 +97,6 @@ export const SortCriterionSchema = z.strictObject({
104
97
  fields: z.array(z.unknown()),
105
98
  sortCriteria: z.string(),
106
99
  });
107
- export const SubmitQueryPayloadSchema = z.strictObject({
108
- query: z.string(),
109
- });
110
- export const SearchBoxStateSchema = z.strictObject({
111
- query: z.string(),
112
- });
113
100
  export const ActionSchema = z.strictObject({
114
101
  payload: z.unknown(),
115
102
  });
@@ -204,20 +191,34 @@ export const CategoryFacetValuesSchema = z.strictObject({
204
191
  selected: z.union([CategoryFacetValueSchema, z.null()]),
205
192
  });
206
193
  export const FacetManagerActionsSchema = z.strictObject({});
207
- export const FacetManagerStateSchema = z.strictObject({
208
- facetIds: z.array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$'))),
194
+ export const FacetManagerStateSchema = z.strictObject({});
195
+ export const CommerceSearchActionsSchema = z.strictObject({});
196
+ export const CommerceSearchStateSchema = z.strictObject({});
197
+ export const LayoutStackActionsSchema = z.strictObject({});
198
+ export const LayoutStackStateSchema = z.strictObject({});
199
+ export const QuerySummaryActionsSchema = z.strictObject({});
200
+ export const QuerySummaryStateSchema = z.strictObject({
201
+ firstIndex: z.number().int().min(0),
202
+ lastIndex: z.number().int().min(0),
203
+ query: z.string(),
204
+ totalEntries: z.number().int().min(0),
205
+ });
206
+ export const SetPageSizePayloadSchema = z.strictObject({
207
+ pageSize: z.number().int().min(1),
208
+ });
209
+ export const PageSizeStateSchema = z.strictObject({
210
+ pageSize: z.number().int().min(1),
209
211
  });
210
212
  export const ProductCarouselSchema = z.strictObject({
211
213
  actions: ProductCarouselActionsSchema,
214
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
215
+ children: z
216
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
217
+ .max(1000)
218
+ .optional(),
212
219
  componentType: z.literal('product-carousel'),
213
220
  state: ProductCarouselStateSchema,
214
221
  });
215
- export const SetItemsPayloadSchema = z.strictObject({
216
- items: z.array(CartItemSchema),
217
- });
218
- export const UpdateItemQuantitySchema = z.strictObject({
219
- payload: UpdateItemQuantityPayloadSchema,
220
- });
221
222
  export const SelectActionSchema = z.strictObject({
222
223
  payload: SelectActionPayloadSchema,
223
224
  });
@@ -231,18 +232,35 @@ export const BundleTierSchema = z.strictObject({
231
232
  });
232
233
  export const ComparisonTableStateSchema = z.strictObject({
233
234
  attributes: z.array(ComparisonAttributeSchema),
235
+ heading: z.string(),
234
236
  products: z.array(ComparisonProductSchema),
237
+ summary: z.string(),
235
238
  });
236
239
  export const ProductListSchema = z.strictObject({
237
240
  actions: ProductListActionsSchema,
241
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
242
+ children: z
243
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
244
+ .max(1000)
245
+ .optional(),
238
246
  componentType: z.literal('product-list'),
239
247
  state: ProductListStateSchema,
240
248
  });
249
+ export const ProductSummarySchema = z.strictObject({
250
+ actions: ProductSummaryActionsSchema,
251
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
252
+ children: z
253
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
254
+ .max(1000)
255
+ .optional(),
256
+ componentType: z.literal('product-summary'),
257
+ state: ProductSummaryStateSchema,
258
+ });
241
259
  export const SelectPageSchema = z.strictObject({
242
260
  payload: SelectPagePayloadSchema,
243
261
  });
244
- export const SetPageSizeSchema = z.strictObject({
245
- payload: SetPageSizePayloadSchema,
262
+ export const PurpleSetPageSizeSchema = z.strictObject({
263
+ payload: PayloadSchema,
246
264
  });
247
265
  export const SelectSortSchema = z.strictObject({
248
266
  payload: SelectSortPayloadSchema,
@@ -251,9 +269,6 @@ export const SortStateSchema = z.strictObject({
251
269
  appliedSort: SortCriterionSchema,
252
270
  availableSorts: z.array(SortCriterionSchema),
253
271
  });
254
- export const SubmitQuerySchema = z.strictObject({
255
- payload: SubmitQueryPayloadSchema,
256
- });
257
272
  export const SearchSchema = z.strictObject({
258
273
  payload: SearchPayloadSchema,
259
274
  });
@@ -324,11 +339,46 @@ export const FacetSearchClassSchema = z.strictObject({
324
339
  });
325
340
  export const FacetManagerSchema = z.strictObject({
326
341
  actions: FacetManagerActionsSchema,
342
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
343
+ children: z
344
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
345
+ .max(1000)
346
+ .optional(),
327
347
  componentType: z.literal('facet-manager'),
328
348
  state: FacetManagerStateSchema,
329
349
  });
330
- export const SetItemsSchema = z.strictObject({
331
- payload: SetItemsPayloadSchema,
350
+ export const CommerceSearchSchema = z.strictObject({
351
+ actions: CommerceSearchActionsSchema,
352
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
353
+ children: z
354
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
355
+ .max(1000)
356
+ .optional(),
357
+ componentType: z.literal('commerce-search'),
358
+ state: CommerceSearchStateSchema,
359
+ });
360
+ export const LayoutStackSchema = z.strictObject({
361
+ actions: LayoutStackActionsSchema,
362
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
363
+ children: z
364
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
365
+ .max(1000)
366
+ .optional(),
367
+ componentType: z.literal('layout-stack'),
368
+ state: LayoutStackStateSchema,
369
+ });
370
+ export const QuerySummarySchema = z.strictObject({
371
+ actions: QuerySummaryActionsSchema,
372
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
373
+ children: z
374
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
375
+ .max(1000)
376
+ .optional(),
377
+ componentType: z.literal('query-summary'),
378
+ state: QuerySummaryStateSchema,
379
+ });
380
+ export const FluffySetPageSizeSchema = z.strictObject({
381
+ payload: SetPageSizePayloadSchema,
332
382
  });
333
383
  export const NextActionsBarActionsSchema = z.strictObject({
334
384
  selectAction: SelectActionSchema,
@@ -338,19 +388,21 @@ export const BundleDisplayStateSchema = z.strictObject({
338
388
  });
339
389
  export const ComparisonTableSchema = z.strictObject({
340
390
  actions: ComparisonTableActionsSchema,
391
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
392
+ children: z
393
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
394
+ .max(1000)
395
+ .optional(),
341
396
  componentType: z.literal('comparison-table'),
342
397
  state: ComparisonTableStateSchema,
343
398
  });
344
399
  export const PaginationActionsSchema = z.strictObject({
345
400
  selectPage: SelectPageSchema,
346
- setPageSize: SetPageSizeSchema,
401
+ setPageSize: PurpleSetPageSizeSchema,
347
402
  });
348
403
  export const SortActionsSchema = z.strictObject({
349
404
  selectSort: SelectSortSchema,
350
405
  });
351
- export const SearchBoxActionsSchema = z.strictObject({
352
- submitQuery: SubmitQuerySchema,
353
- });
354
406
  export const RegularFacetActionsSchema = z.strictObject({
355
407
  clearAllActiveValues: ActionSchema,
356
408
  clearSearch: ActionSchema,
@@ -405,75 +457,117 @@ export const CategoryFacetStateSchema = z.strictObject({
405
457
  field: z.string(),
406
458
  values: CategoryFacetValuesSchema,
407
459
  });
408
- export const CartActionsSchema = z.strictObject({
409
- setItems: SetItemsSchema,
410
- updateItemQuantity: UpdateItemQuantitySchema,
460
+ export const PageSizeActionsSchema = z.strictObject({
461
+ setPageSize: FluffySetPageSizeSchema,
411
462
  });
412
463
  export const NextActionsBarSchema = z.strictObject({
413
464
  actions: NextActionsBarActionsSchema,
465
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
466
+ children: z
467
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
468
+ .max(1000)
469
+ .optional(),
414
470
  componentType: z.literal('next-actions-bar'),
415
471
  state: NextActionsStateSchema,
416
472
  });
417
473
  export const BundleDisplaySchema = z.strictObject({
418
474
  actions: BundleDisplayActionsSchema,
475
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
476
+ children: z
477
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
478
+ .max(1000)
479
+ .optional(),
419
480
  componentType: z.literal('bundle-display'),
420
481
  state: BundleDisplayStateSchema,
421
482
  });
422
483
  export const PaginationSchema = z.strictObject({
423
484
  actions: PaginationActionsSchema,
485
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
486
+ children: z
487
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
488
+ .max(1000)
489
+ .optional(),
424
490
  componentType: z.literal('pagination'),
425
491
  state: PaginationStateSchema,
426
492
  });
427
493
  export const SortSchema = z.strictObject({
428
494
  actions: SortActionsSchema,
495
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
496
+ children: z
497
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
498
+ .max(1000)
499
+ .optional(),
429
500
  componentType: z.literal('sort'),
430
501
  state: SortStateSchema,
431
502
  });
432
- export const SearchBoxSchema = z.strictObject({
433
- actions: SearchBoxActionsSchema,
434
- componentType: z.literal('search-box'),
435
- state: SearchBoxStateSchema,
436
- });
437
503
  export const RegularFacetSchema = z.strictObject({
438
504
  actions: RegularFacetActionsSchema,
505
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
506
+ children: z
507
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
508
+ .max(1000)
509
+ .optional(),
439
510
  componentType: z.literal('regular-facet'),
440
511
  state: RegularFacetStateSchema,
441
512
  });
442
513
  export const NumericFacetSchema = z.strictObject({
443
514
  actions: NumericFacetActionsSchema,
515
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
516
+ children: z
517
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
518
+ .max(1000)
519
+ .optional(),
444
520
  componentType: z.literal('numeric-facet'),
445
521
  state: NumericFacetStateSchema,
446
522
  });
447
523
  export const DateFacetSchema = z.strictObject({
448
524
  actions: DateFacetActionsSchema,
525
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
526
+ children: z
527
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
528
+ .max(1000)
529
+ .optional(),
449
530
  componentType: z.literal('date-facet'),
450
531
  state: DateFacetStateSchema,
451
532
  });
452
533
  export const CategoryFacetSchema = z.strictObject({
453
534
  actions: CategoryFacetActionsSchema,
535
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
536
+ children: z
537
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
538
+ .max(1000)
539
+ .optional(),
454
540
  componentType: z.literal('category-facet'),
455
541
  state: CategoryFacetStateSchema,
456
542
  });
457
- export const CartSchema = z.strictObject({
458
- actions: CartActionsSchema,
459
- componentType: z.literal('cart'),
460
- state: CartStateSchema,
543
+ export const PageSizeSchema = z.strictObject({
544
+ actions: PageSizeActionsSchema,
545
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
546
+ children: z
547
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
548
+ .max(1000)
549
+ .optional(),
550
+ componentType: z.literal('page-size'),
551
+ state: PageSizeStateSchema,
461
552
  });
462
553
  export const ComponentContractsSchema = z.discriminatedUnion('componentType', [
463
554
  ProductCarouselSchema,
464
- CartSchema,
465
555
  NextActionsBarSchema,
466
556
  BundleDisplaySchema,
467
557
  ComparisonTableSchema,
468
558
  ProductListSchema,
559
+ ProductSummarySchema,
469
560
  PaginationSchema,
470
561
  SortSchema,
471
- SearchBoxSchema,
472
562
  RegularFacetSchema,
473
563
  NumericFacetSchema,
474
564
  DateFacetSchema,
475
565
  CategoryFacetSchema,
476
566
  FacetManagerSchema,
567
+ CommerceSearchSchema,
568
+ LayoutStackSchema,
569
+ QuerySummarySchema,
570
+ PageSizeSchema,
477
571
  ]);
478
572
  /**
479
573
  * Component props schemas.
@@ -485,14 +579,14 @@ export const BundleDisplayPropsSchema = z.object({
485
579
  componentId: z.string(),
486
580
  componentType: z.literal('bundle-display'),
487
581
  });
488
- export const CartPropsSchema = z.object({
489
- componentId: z.string(),
490
- componentType: z.literal('cart'),
491
- });
492
582
  export const CategoryFacetPropsSchema = z.object({
493
583
  componentId: z.string(),
494
584
  componentType: z.literal('category-facet'),
495
585
  });
586
+ export const CommerceSearchPropsSchema = z.object({
587
+ componentId: z.string(),
588
+ componentType: z.literal('commerce-search'),
589
+ });
496
590
  export const ComparisonTablePropsSchema = z.object({
497
591
  componentId: z.string(),
498
592
  componentType: z.literal('comparison-table'),
@@ -505,6 +599,10 @@ export const FacetManagerPropsSchema = z.object({
505
599
  componentId: z.string(),
506
600
  componentType: z.literal('facet-manager'),
507
601
  });
602
+ export const LayoutStackPropsSchema = z.object({
603
+ componentId: z.string(),
604
+ componentType: z.literal('layout-stack'),
605
+ });
508
606
  export const NextActionsBarPropsSchema = z.object({
509
607
  componentId: z.string(),
510
608
  componentType: z.literal('next-actions-bar'),
@@ -513,6 +611,10 @@ export const NumericFacetPropsSchema = z.object({
513
611
  componentId: z.string(),
514
612
  componentType: z.literal('numeric-facet'),
515
613
  });
614
+ export const PageSizePropsSchema = z.object({
615
+ componentId: z.string(),
616
+ componentType: z.literal('page-size'),
617
+ });
516
618
  export const PaginationPropsSchema = z.object({
517
619
  componentId: z.string(),
518
620
  componentType: z.literal('pagination'),
@@ -525,13 +627,17 @@ export const ProductListPropsSchema = z.object({
525
627
  componentId: z.string(),
526
628
  componentType: z.literal('product-list'),
527
629
  });
528
- export const RegularFacetPropsSchema = z.object({
630
+ export const ProductSummaryPropsSchema = z.object({
529
631
  componentId: z.string(),
530
- componentType: z.literal('regular-facet'),
632
+ componentType: z.literal('product-summary'),
531
633
  });
532
- export const SearchBoxPropsSchema = z.object({
634
+ export const QuerySummaryPropsSchema = z.object({
533
635
  componentId: z.string(),
534
- componentType: z.literal('search-box'),
636
+ componentType: z.literal('query-summary'),
637
+ });
638
+ export const RegularFacetPropsSchema = z.object({
639
+ componentId: z.string(),
640
+ componentType: z.literal('regular-facet'),
535
641
  });
536
642
  export const SortPropsSchema = z.object({
537
643
  componentId: z.string(),
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const THERMIDOR_CATALOG_ID = "https://schema.thermidor.coveo.com/a2-ui/catalog.json";
2
- export { ActionItemSchema, BundleDisplaySchema, BundleDisplayStateSchema, BundleSlotSchema, BundleTierSchema, CartSchema, CartItemSchema, CartStateSchema, CategoryFacetSchema, CategoryFacetActionsSchema, CategoryFacetValueSchema, CategoryFacetSearchSchema, CategoryFacetSearchPayloadSchema, CategoryFacetSelectPathPayloadSchema, CategoryFacetStateSchema, CategoryFacetValuesSchema, ComparisonAttributeSchema, ComparisonProductSchema, ComparisonTableSchema, ComparisonTableStateSchema, ComponentContractsSchema, DateFacetSchema, DateFacetActionsSchema, DateFacetApplyCustomRangePayloadSchema, DateFacetCustomRangeSchema, DateFacetStateSchema, DateFacetToggleSelectPayloadSchema, DateFacetToggleSingleSelectPayloadSchema, DateFacetValueSchema, FacetManagerSchema, FacetManagerActionsSchema, FacetManagerStateSchema, FacetValueStateSchema, SelectableFacetValueStateSchema, NextActionsBarSchema, NextActionsStateSchema, NumericFacetSchema, NumericFacetActionsSchema, NumericFacetCustomRangeSchema, NumericFacetDomainSchema, NumericFacetApplyCustomRangePayloadSchema, NumericFacetStateSchema, NumericFacetToggleSelectPayloadSchema, NumericFacetToggleSingleSelectPayloadSchema, NumericFacetValueSchema, PaginationSchema, PaginationActionsSchema, PaginationStateSchema, ProductCarouselSchema, ProductCarouselStateSchema, ProductListSchema, ProductListActionsSchema, ProductListStateSchema, ProductSchema, RegularFacetSchema, RegularFacetActionsSchema, RegularFacetSearchSchema, RegularFacetSearchResultSchema, RegularFacetStateSchema, RegularFacetToggleExcludePayloadSchema, RegularFacetToggleSelectPayloadSchema, RegularFacetToggleSingleExcludePayloadSchema, RegularFacetToggleSingleSelectPayloadSchema, RegularFacetValueSchema, SearchBoxSchema, SearchBoxActionsSchema, SearchBoxStateSchema, SelectActionPayloadSchema, SelectPagePayloadSchema, SelectSortPayloadSchema, SetItemsPayloadSchema, SetPageSizePayloadSchema, SortSchema, SortActionsSchema, SortCriterionSchema, SortStateSchema, SubmitQueryPayloadSchema, UpdateItemQuantityPayloadSchema, BundleDisplayPropsSchema, CartPropsSchema, CategoryFacetPropsSchema, ComparisonTablePropsSchema, DateFacetPropsSchema, FacetManagerPropsSchema, NextActionsBarPropsSchema, NumericFacetPropsSchema, PaginationPropsSchema, ProductCarouselPropsSchema, ProductListPropsSchema, RegularFacetPropsSchema, SearchBoxPropsSchema, SortPropsSchema, } from './generated/schemas.js';
3
- export type { ActionItem, BundleDisplay, BundleDisplayState, BundleSlot, BundleTier, Cart, CartItem, CartState, CategoryFacet, CategoryFacetActions, CategoryFacetValue, CategoryFacetSearch, CategoryFacetSearchPayload, CategoryFacetSelectPathPayload, CategoryFacetState, CategoryFacetValues, ComparisonAttribute, ComparisonProduct, ComparisonTable, ComparisonTableState, ComponentContracts, DateFacet, DateFacetActions, DateFacetApplyCustomRangePayload, DateFacetCustomRange, DateFacetState, DateFacetToggleSelectPayload, DateFacetToggleSingleSelectPayload, DateFacetValue, FacetManager, FacetManagerActions, FacetManagerState, FacetValueState, SelectableFacetValueState, NextActionsBar, NextActionsState, NumericFacet, NumericFacetActions, NumericFacetCustomRange, NumericFacetDomain, NumericFacetApplyCustomRangePayload, NumericFacetState, NumericFacetToggleSelectPayload, NumericFacetToggleSingleSelectPayload, NumericFacetValue, Pagination, PaginationActions, PaginationState, Product, ProductCarousel, ProductCarouselState, ProductList, ProductListActions, ProductListState, RegularFacet, RegularFacetActions, RegularFacetSearch, RegularFacetSearchResult, RegularFacetState, RegularFacetToggleExcludePayload, RegularFacetToggleSelectPayload, RegularFacetToggleSingleExcludePayload, RegularFacetToggleSingleSelectPayload, RegularFacetValue, SearchBox, SearchBoxActions, SearchBoxState, SelectActionPayload, SelectPagePayload, SelectSortPayload, SetItemsPayload, SetPageSizePayload, Sort, SortActions, SortCriterion, SortState, SubmitQueryPayload, UpdateItemQuantityPayload, BundleDisplayProps, CartProps, CategoryFacetProps, ComparisonTableProps, DateFacetProps, FacetManagerProps, NextActionsBarProps, NumericFacetProps, PaginationProps, ProductCarouselProps, ProductListProps, RegularFacetProps, SearchBoxProps, SortProps, } from './generated/schemas.js';
2
+ export { ActionItemSchema, BundleDisplaySchema, BundleDisplayStateSchema, BundleSlotSchema, BundleTierSchema, CategoryFacetSchema, CategoryFacetActionsSchema, CategoryFacetValueSchema, CategoryFacetSearchSchema, CategoryFacetSearchPayloadSchema, CategoryFacetSelectPathPayloadSchema, CategoryFacetStateSchema, CategoryFacetValuesSchema, CommerceSearchSchema, CommerceSearchStateSchema, ComparisonAttributeSchema, ComparisonProductSchema, ComparisonTableSchema, ComparisonTableStateSchema, ComponentContractsSchema, DateFacetSchema, DateFacetActionsSchema, DateFacetApplyCustomRangePayloadSchema, DateFacetCustomRangeSchema, DateFacetStateSchema, DateFacetToggleSelectPayloadSchema, DateFacetToggleSingleSelectPayloadSchema, DateFacetValueSchema, FacetManagerSchema, FacetManagerActionsSchema, FacetManagerStateSchema, FacetValueStateSchema, SelectableFacetValueStateSchema, LayoutStackSchema, LayoutStackStateSchema, NextActionsBarSchema, NextActionsStateSchema, NumericFacetSchema, NumericFacetActionsSchema, NumericFacetCustomRangeSchema, NumericFacetDomainSchema, NumericFacetApplyCustomRangePayloadSchema, NumericFacetStateSchema, NumericFacetToggleSelectPayloadSchema, NumericFacetToggleSingleSelectPayloadSchema, NumericFacetValueSchema, PageSizeSchema, PageSizeActionsSchema, PageSizeStateSchema, PaginationSchema, PaginationActionsSchema, PaginationStateSchema, ProductCarouselSchema, ProductCarouselStateSchema, ProductListSchema, ProductListActionsSchema, ProductListStateSchema, ProductSummarySchema, ProductSummaryActionsSchema, ProductSummaryStateSchema, QuerySummarySchema, QuerySummaryStateSchema, ProductSchema, RegularFacetSchema, RegularFacetActionsSchema, RegularFacetSearchSchema, RegularFacetSearchResultSchema, RegularFacetStateSchema, RegularFacetToggleExcludePayloadSchema, RegularFacetToggleSelectPayloadSchema, RegularFacetToggleSingleExcludePayloadSchema, RegularFacetToggleSingleSelectPayloadSchema, RegularFacetValueSchema, SelectActionPayloadSchema, SelectPagePayloadSchema, SelectSortPayloadSchema, SetPageSizePayloadSchema, SortSchema, SortActionsSchema, SortCriterionSchema, SortStateSchema, BundleDisplayPropsSchema, CategoryFacetPropsSchema, CommerceSearchPropsSchema, ComparisonTablePropsSchema, DateFacetPropsSchema, FacetManagerPropsSchema, LayoutStackPropsSchema, NextActionsBarPropsSchema, NumericFacetPropsSchema, PageSizePropsSchema, PaginationPropsSchema, ProductCarouselPropsSchema, ProductListPropsSchema, ProductSummaryPropsSchema, QuerySummaryPropsSchema, RegularFacetPropsSchema, SortPropsSchema, } from './generated/schemas.js';
3
+ export type { ActionItem, BundleDisplay, BundleDisplayState, BundleSlot, BundleTier, CategoryFacet, CategoryFacetActions, CategoryFacetValue, CategoryFacetSearch, CategoryFacetSearchPayload, CategoryFacetSelectPathPayload, CategoryFacetState, CategoryFacetValues, CommerceSearch, CommerceSearchState, ComparisonAttribute, ComparisonProduct, ComparisonTable, ComparisonTableState, ComponentContracts, DateFacet, DateFacetActions, DateFacetApplyCustomRangePayload, DateFacetCustomRange, DateFacetState, DateFacetToggleSelectPayload, DateFacetToggleSingleSelectPayload, DateFacetValue, FacetManager, FacetManagerActions, FacetManagerState, FacetValueState, SelectableFacetValueState, LayoutStack, LayoutStackState, NextActionsBar, NextActionsState, NumericFacet, NumericFacetActions, NumericFacetCustomRange, NumericFacetDomain, NumericFacetApplyCustomRangePayload, NumericFacetState, NumericFacetToggleSelectPayload, NumericFacetToggleSingleSelectPayload, NumericFacetValue, PageSize, PageSizeActions, PageSizeState, Pagination, PaginationActions, PaginationState, Product, ProductCarousel, ProductCarouselState, ProductList, ProductListActions, ProductListState, ProductSummary, ProductSummaryActions, ProductSummaryState, QuerySummary, QuerySummaryState, RegularFacet, RegularFacetActions, RegularFacetSearch, RegularFacetSearchResult, RegularFacetState, RegularFacetToggleExcludePayload, RegularFacetToggleSelectPayload, RegularFacetToggleSingleExcludePayload, RegularFacetToggleSingleSelectPayload, RegularFacetValue, SelectActionPayload, SelectPagePayload, SelectSortPayload, SetPageSizePayload, Sort, SortActions, SortCriterion, SortState, BundleDisplayProps, CategoryFacetProps, CommerceSearchProps, ComparisonTableProps, DateFacetProps, FacetManagerProps, LayoutStackProps, NextActionsBarProps, NumericFacetProps, PageSizeProps, PaginationProps, ProductCarouselProps, ProductListProps, ProductSummaryProps, QuerySummaryProps, RegularFacetProps, SortProps, } from './generated/schemas.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const THERMIDOR_CATALOG_ID = 'https://schema.thermidor.coveo.com/a2-ui/catalog.json';
2
- export { ActionItemSchema, BundleDisplaySchema, BundleDisplayStateSchema, BundleSlotSchema, BundleTierSchema, CartSchema, CartItemSchema, CartStateSchema, CategoryFacetSchema, CategoryFacetActionsSchema, CategoryFacetValueSchema, CategoryFacetSearchSchema, CategoryFacetSearchPayloadSchema, CategoryFacetSelectPathPayloadSchema, CategoryFacetStateSchema, CategoryFacetValuesSchema, ComparisonAttributeSchema, ComparisonProductSchema, ComparisonTableSchema, ComparisonTableStateSchema, ComponentContractsSchema, DateFacetSchema, DateFacetActionsSchema, DateFacetApplyCustomRangePayloadSchema, DateFacetCustomRangeSchema, DateFacetStateSchema, DateFacetToggleSelectPayloadSchema, DateFacetToggleSingleSelectPayloadSchema, DateFacetValueSchema, FacetManagerSchema, FacetManagerActionsSchema, FacetManagerStateSchema, FacetValueStateSchema, SelectableFacetValueStateSchema, NextActionsBarSchema, NextActionsStateSchema, NumericFacetSchema, NumericFacetActionsSchema, NumericFacetCustomRangeSchema, NumericFacetDomainSchema, NumericFacetApplyCustomRangePayloadSchema, NumericFacetStateSchema, NumericFacetToggleSelectPayloadSchema, NumericFacetToggleSingleSelectPayloadSchema, NumericFacetValueSchema, PaginationSchema, PaginationActionsSchema, PaginationStateSchema, ProductCarouselSchema, ProductCarouselStateSchema, ProductListSchema, ProductListActionsSchema, ProductListStateSchema, ProductSchema, RegularFacetSchema, RegularFacetActionsSchema, RegularFacetSearchSchema, RegularFacetSearchResultSchema, RegularFacetStateSchema, RegularFacetToggleExcludePayloadSchema, RegularFacetToggleSelectPayloadSchema, RegularFacetToggleSingleExcludePayloadSchema, RegularFacetToggleSingleSelectPayloadSchema, RegularFacetValueSchema, SearchBoxSchema, SearchBoxActionsSchema, SearchBoxStateSchema, SelectActionPayloadSchema, SelectPagePayloadSchema, SelectSortPayloadSchema, SetItemsPayloadSchema, SetPageSizePayloadSchema, SortSchema, SortActionsSchema, SortCriterionSchema, SortStateSchema, SubmitQueryPayloadSchema, UpdateItemQuantityPayloadSchema, BundleDisplayPropsSchema, CartPropsSchema, CategoryFacetPropsSchema, ComparisonTablePropsSchema, DateFacetPropsSchema, FacetManagerPropsSchema, NextActionsBarPropsSchema, NumericFacetPropsSchema, PaginationPropsSchema, ProductCarouselPropsSchema, ProductListPropsSchema, RegularFacetPropsSchema, SearchBoxPropsSchema, SortPropsSchema, } from './generated/schemas.js';
2
+ export { ActionItemSchema, BundleDisplaySchema, BundleDisplayStateSchema, BundleSlotSchema, BundleTierSchema, CategoryFacetSchema, CategoryFacetActionsSchema, CategoryFacetValueSchema, CategoryFacetSearchSchema, CategoryFacetSearchPayloadSchema, CategoryFacetSelectPathPayloadSchema, CategoryFacetStateSchema, CategoryFacetValuesSchema, CommerceSearchSchema, CommerceSearchStateSchema, ComparisonAttributeSchema, ComparisonProductSchema, ComparisonTableSchema, ComparisonTableStateSchema, ComponentContractsSchema, DateFacetSchema, DateFacetActionsSchema, DateFacetApplyCustomRangePayloadSchema, DateFacetCustomRangeSchema, DateFacetStateSchema, DateFacetToggleSelectPayloadSchema, DateFacetToggleSingleSelectPayloadSchema, DateFacetValueSchema, FacetManagerSchema, FacetManagerActionsSchema, FacetManagerStateSchema, FacetValueStateSchema, SelectableFacetValueStateSchema, LayoutStackSchema, LayoutStackStateSchema, NextActionsBarSchema, NextActionsStateSchema, NumericFacetSchema, NumericFacetActionsSchema, NumericFacetCustomRangeSchema, NumericFacetDomainSchema, NumericFacetApplyCustomRangePayloadSchema, NumericFacetStateSchema, NumericFacetToggleSelectPayloadSchema, NumericFacetToggleSingleSelectPayloadSchema, NumericFacetValueSchema, PageSizeSchema, PageSizeActionsSchema, PageSizeStateSchema, PaginationSchema, PaginationActionsSchema, PaginationStateSchema, ProductCarouselSchema, ProductCarouselStateSchema, ProductListSchema, ProductListActionsSchema, ProductListStateSchema, ProductSummarySchema, ProductSummaryActionsSchema, ProductSummaryStateSchema, QuerySummarySchema, QuerySummaryStateSchema, ProductSchema, RegularFacetSchema, RegularFacetActionsSchema, RegularFacetSearchSchema, RegularFacetSearchResultSchema, RegularFacetStateSchema, RegularFacetToggleExcludePayloadSchema, RegularFacetToggleSelectPayloadSchema, RegularFacetToggleSingleExcludePayloadSchema, RegularFacetToggleSingleSelectPayloadSchema, RegularFacetValueSchema, SelectActionPayloadSchema, SelectPagePayloadSchema, SelectSortPayloadSchema, SetPageSizePayloadSchema, SortSchema, SortActionsSchema, SortCriterionSchema, SortStateSchema, BundleDisplayPropsSchema, CategoryFacetPropsSchema, CommerceSearchPropsSchema, ComparisonTablePropsSchema, DateFacetPropsSchema, FacetManagerPropsSchema, LayoutStackPropsSchema, NextActionsBarPropsSchema, NumericFacetPropsSchema, PageSizePropsSchema, PaginationPropsSchema, ProductCarouselPropsSchema, ProductListPropsSchema, ProductSummaryPropsSchema, QuerySummaryPropsSchema, RegularFacetPropsSchema, SortPropsSchema, } from './generated/schemas.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/thermidor-schema",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "Zod and TypeScript projections of the Thermidor JSON Schema contract.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "type": "string",
24
24
  "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
25
25
  "maxLength": 128,
26
- "description": "Stable kebab-case type identifier (e.g. 'cart'). Used as discriminant for contract resolution."
26
+ "description": "Stable kebab-case type identifier (e.g. 'product-carousel'). Used as discriminant for contract resolution."
27
27
  },
28
28
  "state": {
29
29
  "type": "object",
@@ -35,6 +35,19 @@
35
35
  "additionalProperties": {
36
36
  "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
37
37
  }
38
+ },
39
+ "children": {
40
+ "type": "array",
41
+ "items": {
42
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
43
+ },
44
+ "maxItems": 1000,
45
+ "default": [],
46
+ "description": "Ordered list of child component ids referencing other components in the same flat map. Order is backend-owned and meaningful for container components; referential integrity and uniqueness are owned by the backend and not enforced at parse time."
47
+ },
48
+ "child": {
49
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json",
50
+ "description": "A single child component id following the A2-UI single-child convention."
38
51
  }
39
52
  },
40
53
  "additionalProperties": false
@@ -20,6 +20,17 @@
20
20
  "type": "object",
21
21
  "properties": {},
22
22
  "additionalProperties": false
23
+ },
24
+ "children": {
25
+ "type": "array",
26
+ "items": {
27
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
28
+ },
29
+ "maxItems": 1000,
30
+ "default": []
31
+ },
32
+ "child": {
33
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
23
34
  }
24
35
  },
25
36
  "additionalProperties": false,
@@ -29,9 +40,7 @@
29
40
  "description": "The tiered product bundle layout. Owned exclusively by the backend; the frontend must not mutate this directly.",
30
41
  "$comment": "This schema validates the runtime state value the backend pushes to the frontend.",
31
42
  "type": "object",
32
- "required": [
33
- "tiers"
34
- ],
43
+ "required": ["tiers"],
35
44
  "properties": {
36
45
  "tiers": {
37
46
  "type": "array",
@@ -44,4 +53,4 @@
44
53
  "additionalProperties": false
45
54
  }
46
55
  }
47
- }
56
+ }
@@ -51,6 +51,17 @@
51
51
  }
52
52
  },
53
53
  "additionalProperties": false
54
+ },
55
+ "children": {
56
+ "type": "array",
57
+ "items": {
58
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
59
+ },
60
+ "maxItems": 1000,
61
+ "default": []
62
+ },
63
+ "child": {
64
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
54
65
  }
55
66
  },
56
67
  "additionalProperties": false,
@@ -99,11 +110,7 @@
99
110
  "title": "CategoryFacetValues",
100
111
  "description": "Flat representation of the category hierarchy. When no category is selected, ancestry and selected are null and children contains the top-level categories.",
101
112
  "type": "object",
102
- "required": [
103
- "ancestry",
104
- "selected",
105
- "children"
106
- ],
113
+ "required": ["ancestry", "selected", "children"],
107
114
  "properties": {
108
115
  "ancestry": {
109
116
  "type": "array",
@@ -137,11 +144,7 @@
137
144
  "title": "CategoryFacetSearch",
138
145
  "description": "The current category facet search state.",
139
146
  "type": "object",
140
- "required": [
141
- "query",
142
- "canShowMoreResults",
143
- "results"
144
- ],
147
+ "required": ["query", "canShowMoreResults", "results"],
145
148
  "properties": {
146
149
  "query": {
147
150
  "type": "string",
@@ -173,9 +176,7 @@
173
176
  "properties": {
174
177
  "payload": {
175
178
  "type": "object",
176
- "required": [
177
- "path"
178
- ],
179
+ "required": ["path"],
179
180
  "properties": {
180
181
  "path": {
181
182
  "type": "array",
@@ -209,9 +210,7 @@
209
210
  "properties": {
210
211
  "payload": {
211
212
  "type": "object",
212
- "required": [
213
- "query"
214
- ],
213
+ "required": ["query"],
215
214
  "properties": {
216
215
  "query": {
217
216
  "type": "string",
@@ -263,11 +262,7 @@
263
262
  "title": "CategoryFacetValue",
264
263
  "description": "A single category value. Used throughout the category facet state (ancestry, selected value, children) and as facet search results.",
265
264
  "type": "object",
266
- "required": [
267
- "path",
268
- "value",
269
- "numberOfResults"
270
- ],
265
+ "required": ["path", "value", "numberOfResults"],
271
266
  "properties": {
272
267
  "path": {
273
268
  "type": "array",
@@ -289,4 +284,4 @@
289
284
  "additionalProperties": false
290
285
  }
291
286
  }
292
- }
287
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/commerce-search.schema.json",
4
+ "title": "CommerceSearch",
5
+ "description": "Surface-root component for a commerce search surface. Its componentType carries the surface intent; it owns the surface's top-level components via children.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "componentType": {
13
+ "type": "string",
14
+ "const": "commerce-search"
15
+ },
16
+ "state": {
17
+ "$ref": "#/$defs/CommerceSearchState"
18
+ },
19
+ "actions": {
20
+ "type": "object",
21
+ "properties": {},
22
+ "additionalProperties": false
23
+ },
24
+ "children": {
25
+ "type": "array",
26
+ "items": {
27
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
28
+ },
29
+ "maxItems": 1000,
30
+ "default": []
31
+ },
32
+ "child": {
33
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
34
+ }
35
+ },
36
+ "additionalProperties": false,
37
+ "$defs": {
38
+ "CommerceSearchState": {
39
+ "title": "CommerceSearchState",
40
+ "description": "The commerce search surface state. Owned exclusively by the backend.",
41
+ "type": "object",
42
+ "additionalProperties": false
43
+ }
44
+ }
45
+ }