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

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 (30) hide show
  1. package/dist/generated/schemas.d.ts +304 -201
  2. package/dist/generated/schemas.js +176 -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/{search-box.schema.json → commerce-search.schema.json} +22 -24
  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/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,36 @@ 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 SubmitQueryPayloadSchema = z.strictObject({
196
+ query: z.string(),
197
+ });
198
+ export const CommerceSearchStateSchema = z.strictObject({});
199
+ export const LayoutStackActionsSchema = z.strictObject({});
200
+ export const LayoutStackStateSchema = z.strictObject({});
201
+ export const QuerySummaryActionsSchema = z.strictObject({});
202
+ export const QuerySummaryStateSchema = z.strictObject({
203
+ firstIndex: z.number().int().min(0),
204
+ lastIndex: z.number().int().min(0),
205
+ query: z.string(),
206
+ totalEntries: z.number().int().min(0),
207
+ });
208
+ export const SetPageSizePayloadSchema = z.strictObject({
209
+ pageSize: z.number().int().min(1),
210
+ });
211
+ export const PageSizeStateSchema = z.strictObject({
212
+ pageSize: z.number().int().min(1),
209
213
  });
210
214
  export const ProductCarouselSchema = z.strictObject({
211
215
  actions: ProductCarouselActionsSchema,
216
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
217
+ children: z
218
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
219
+ .max(1000)
220
+ .optional(),
212
221
  componentType: z.literal('product-carousel'),
213
222
  state: ProductCarouselStateSchema,
214
223
  });
215
- export const SetItemsPayloadSchema = z.strictObject({
216
- items: z.array(CartItemSchema),
217
- });
218
- export const UpdateItemQuantitySchema = z.strictObject({
219
- payload: UpdateItemQuantityPayloadSchema,
220
- });
221
224
  export const SelectActionSchema = z.strictObject({
222
225
  payload: SelectActionPayloadSchema,
223
226
  });
@@ -231,18 +234,35 @@ export const BundleTierSchema = z.strictObject({
231
234
  });
232
235
  export const ComparisonTableStateSchema = z.strictObject({
233
236
  attributes: z.array(ComparisonAttributeSchema),
237
+ heading: z.string(),
234
238
  products: z.array(ComparisonProductSchema),
239
+ summary: z.string(),
235
240
  });
236
241
  export const ProductListSchema = z.strictObject({
237
242
  actions: ProductListActionsSchema,
243
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
244
+ children: z
245
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
246
+ .max(1000)
247
+ .optional(),
238
248
  componentType: z.literal('product-list'),
239
249
  state: ProductListStateSchema,
240
250
  });
251
+ export const ProductSummarySchema = z.strictObject({
252
+ actions: ProductSummaryActionsSchema,
253
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
254
+ children: z
255
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
256
+ .max(1000)
257
+ .optional(),
258
+ componentType: z.literal('product-summary'),
259
+ state: ProductSummaryStateSchema,
260
+ });
241
261
  export const SelectPageSchema = z.strictObject({
242
262
  payload: SelectPagePayloadSchema,
243
263
  });
244
- export const SetPageSizeSchema = z.strictObject({
245
- payload: SetPageSizePayloadSchema,
264
+ export const PurpleSetPageSizeSchema = z.strictObject({
265
+ payload: PayloadSchema,
246
266
  });
247
267
  export const SelectSortSchema = z.strictObject({
248
268
  payload: SelectSortPayloadSchema,
@@ -251,9 +271,6 @@ export const SortStateSchema = z.strictObject({
251
271
  appliedSort: SortCriterionSchema,
252
272
  availableSorts: z.array(SortCriterionSchema),
253
273
  });
254
- export const SubmitQuerySchema = z.strictObject({
255
- payload: SubmitQueryPayloadSchema,
256
- });
257
274
  export const SearchSchema = z.strictObject({
258
275
  payload: SearchPayloadSchema,
259
276
  });
@@ -324,11 +341,39 @@ export const FacetSearchClassSchema = z.strictObject({
324
341
  });
325
342
  export const FacetManagerSchema = z.strictObject({
326
343
  actions: FacetManagerActionsSchema,
344
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
345
+ children: z
346
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
347
+ .max(1000)
348
+ .optional(),
327
349
  componentType: z.literal('facet-manager'),
328
350
  state: FacetManagerStateSchema,
329
351
  });
330
- export const SetItemsSchema = z.strictObject({
331
- payload: SetItemsPayloadSchema,
352
+ export const SubmitQuerySchema = z.strictObject({
353
+ payload: SubmitQueryPayloadSchema,
354
+ });
355
+ export const LayoutStackSchema = z.strictObject({
356
+ actions: LayoutStackActionsSchema,
357
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
358
+ children: z
359
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
360
+ .max(1000)
361
+ .optional(),
362
+ componentType: z.literal('layout-stack'),
363
+ state: LayoutStackStateSchema,
364
+ });
365
+ export const QuerySummarySchema = z.strictObject({
366
+ actions: QuerySummaryActionsSchema,
367
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
368
+ children: z
369
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
370
+ .max(1000)
371
+ .optional(),
372
+ componentType: z.literal('query-summary'),
373
+ state: QuerySummaryStateSchema,
374
+ });
375
+ export const FluffySetPageSizeSchema = z.strictObject({
376
+ payload: SetPageSizePayloadSchema,
332
377
  });
333
378
  export const NextActionsBarActionsSchema = z.strictObject({
334
379
  selectAction: SelectActionSchema,
@@ -338,19 +383,21 @@ export const BundleDisplayStateSchema = z.strictObject({
338
383
  });
339
384
  export const ComparisonTableSchema = z.strictObject({
340
385
  actions: ComparisonTableActionsSchema,
386
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
387
+ children: z
388
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
389
+ .max(1000)
390
+ .optional(),
341
391
  componentType: z.literal('comparison-table'),
342
392
  state: ComparisonTableStateSchema,
343
393
  });
344
394
  export const PaginationActionsSchema = z.strictObject({
345
395
  selectPage: SelectPageSchema,
346
- setPageSize: SetPageSizeSchema,
396
+ setPageSize: PurpleSetPageSizeSchema,
347
397
  });
348
398
  export const SortActionsSchema = z.strictObject({
349
399
  selectSort: SelectSortSchema,
350
400
  });
351
- export const SearchBoxActionsSchema = z.strictObject({
352
- submitQuery: SubmitQuerySchema,
353
- });
354
401
  export const RegularFacetActionsSchema = z.strictObject({
355
402
  clearAllActiveValues: ActionSchema,
356
403
  clearSearch: ActionSchema,
@@ -405,75 +452,130 @@ export const CategoryFacetStateSchema = z.strictObject({
405
452
  field: z.string(),
406
453
  values: CategoryFacetValuesSchema,
407
454
  });
408
- export const CartActionsSchema = z.strictObject({
409
- setItems: SetItemsSchema,
410
- updateItemQuantity: UpdateItemQuantitySchema,
455
+ export const CommerceSearchActionsSchema = z.strictObject({
456
+ submitQuery: SubmitQuerySchema,
457
+ });
458
+ export const PageSizeActionsSchema = z.strictObject({
459
+ setPageSize: FluffySetPageSizeSchema,
411
460
  });
412
461
  export const NextActionsBarSchema = z.strictObject({
413
462
  actions: NextActionsBarActionsSchema,
463
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
464
+ children: z
465
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
466
+ .max(1000)
467
+ .optional(),
414
468
  componentType: z.literal('next-actions-bar'),
415
469
  state: NextActionsStateSchema,
416
470
  });
417
471
  export const BundleDisplaySchema = z.strictObject({
418
472
  actions: BundleDisplayActionsSchema,
473
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
474
+ children: z
475
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
476
+ .max(1000)
477
+ .optional(),
419
478
  componentType: z.literal('bundle-display'),
420
479
  state: BundleDisplayStateSchema,
421
480
  });
422
481
  export const PaginationSchema = z.strictObject({
423
482
  actions: PaginationActionsSchema,
483
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
484
+ children: z
485
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
486
+ .max(1000)
487
+ .optional(),
424
488
  componentType: z.literal('pagination'),
425
489
  state: PaginationStateSchema,
426
490
  });
427
491
  export const SortSchema = z.strictObject({
428
492
  actions: SortActionsSchema,
493
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
494
+ children: z
495
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
496
+ .max(1000)
497
+ .optional(),
429
498
  componentType: z.literal('sort'),
430
499
  state: SortStateSchema,
431
500
  });
432
- export const SearchBoxSchema = z.strictObject({
433
- actions: SearchBoxActionsSchema,
434
- componentType: z.literal('search-box'),
435
- state: SearchBoxStateSchema,
436
- });
437
501
  export const RegularFacetSchema = z.strictObject({
438
502
  actions: RegularFacetActionsSchema,
503
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
504
+ children: z
505
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
506
+ .max(1000)
507
+ .optional(),
439
508
  componentType: z.literal('regular-facet'),
440
509
  state: RegularFacetStateSchema,
441
510
  });
442
511
  export const NumericFacetSchema = z.strictObject({
443
512
  actions: NumericFacetActionsSchema,
513
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
514
+ children: z
515
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
516
+ .max(1000)
517
+ .optional(),
444
518
  componentType: z.literal('numeric-facet'),
445
519
  state: NumericFacetStateSchema,
446
520
  });
447
521
  export const DateFacetSchema = z.strictObject({
448
522
  actions: DateFacetActionsSchema,
523
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
524
+ children: z
525
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
526
+ .max(1000)
527
+ .optional(),
449
528
  componentType: z.literal('date-facet'),
450
529
  state: DateFacetStateSchema,
451
530
  });
452
531
  export const CategoryFacetSchema = z.strictObject({
453
532
  actions: CategoryFacetActionsSchema,
533
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
534
+ children: z
535
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
536
+ .max(1000)
537
+ .optional(),
454
538
  componentType: z.literal('category-facet'),
455
539
  state: CategoryFacetStateSchema,
456
540
  });
457
- export const CartSchema = z.strictObject({
458
- actions: CartActionsSchema,
459
- componentType: z.literal('cart'),
460
- state: CartStateSchema,
541
+ export const CommerceSearchSchema = z.strictObject({
542
+ actions: CommerceSearchActionsSchema,
543
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
544
+ children: z
545
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
546
+ .max(1000)
547
+ .optional(),
548
+ componentType: z.literal('commerce-search'),
549
+ state: CommerceSearchStateSchema,
550
+ });
551
+ export const PageSizeSchema = z.strictObject({
552
+ actions: PageSizeActionsSchema,
553
+ child: z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')).optional(),
554
+ children: z
555
+ .array(z.string().regex(new RegExp('^[a-z][a-z0-9-]*$')))
556
+ .max(1000)
557
+ .optional(),
558
+ componentType: z.literal('page-size'),
559
+ state: PageSizeStateSchema,
461
560
  });
462
561
  export const ComponentContractsSchema = z.discriminatedUnion('componentType', [
463
562
  ProductCarouselSchema,
464
- CartSchema,
465
563
  NextActionsBarSchema,
466
564
  BundleDisplaySchema,
467
565
  ComparisonTableSchema,
468
566
  ProductListSchema,
567
+ ProductSummarySchema,
469
568
  PaginationSchema,
470
569
  SortSchema,
471
- SearchBoxSchema,
472
570
  RegularFacetSchema,
473
571
  NumericFacetSchema,
474
572
  DateFacetSchema,
475
573
  CategoryFacetSchema,
476
574
  FacetManagerSchema,
575
+ CommerceSearchSchema,
576
+ LayoutStackSchema,
577
+ QuerySummarySchema,
578
+ PageSizeSchema,
477
579
  ]);
478
580
  /**
479
581
  * Component props schemas.
@@ -485,14 +587,14 @@ export const BundleDisplayPropsSchema = z.object({
485
587
  componentId: z.string(),
486
588
  componentType: z.literal('bundle-display'),
487
589
  });
488
- export const CartPropsSchema = z.object({
489
- componentId: z.string(),
490
- componentType: z.literal('cart'),
491
- });
492
590
  export const CategoryFacetPropsSchema = z.object({
493
591
  componentId: z.string(),
494
592
  componentType: z.literal('category-facet'),
495
593
  });
594
+ export const CommerceSearchPropsSchema = z.object({
595
+ componentId: z.string(),
596
+ componentType: z.literal('commerce-search'),
597
+ });
496
598
  export const ComparisonTablePropsSchema = z.object({
497
599
  componentId: z.string(),
498
600
  componentType: z.literal('comparison-table'),
@@ -505,6 +607,10 @@ export const FacetManagerPropsSchema = z.object({
505
607
  componentId: z.string(),
506
608
  componentType: z.literal('facet-manager'),
507
609
  });
610
+ export const LayoutStackPropsSchema = z.object({
611
+ componentId: z.string(),
612
+ componentType: z.literal('layout-stack'),
613
+ });
508
614
  export const NextActionsBarPropsSchema = z.object({
509
615
  componentId: z.string(),
510
616
  componentType: z.literal('next-actions-bar'),
@@ -513,6 +619,10 @@ export const NumericFacetPropsSchema = z.object({
513
619
  componentId: z.string(),
514
620
  componentType: z.literal('numeric-facet'),
515
621
  });
622
+ export const PageSizePropsSchema = z.object({
623
+ componentId: z.string(),
624
+ componentType: z.literal('page-size'),
625
+ });
516
626
  export const PaginationPropsSchema = z.object({
517
627
  componentId: z.string(),
518
628
  componentType: z.literal('pagination'),
@@ -525,13 +635,17 @@ export const ProductListPropsSchema = z.object({
525
635
  componentId: z.string(),
526
636
  componentType: z.literal('product-list'),
527
637
  });
528
- export const RegularFacetPropsSchema = z.object({
638
+ export const ProductSummaryPropsSchema = z.object({
529
639
  componentId: z.string(),
530
- componentType: z.literal('regular-facet'),
640
+ componentType: z.literal('product-summary'),
641
+ });
642
+ export const QuerySummaryPropsSchema = z.object({
643
+ componentId: z.string(),
644
+ componentType: z.literal('query-summary'),
531
645
  });
532
- export const SearchBoxPropsSchema = z.object({
646
+ export const RegularFacetPropsSchema = z.object({
533
647
  componentId: z.string(),
534
- componentType: z.literal('search-box'),
648
+ componentType: z.literal('regular-facet'),
535
649
  });
536
650
  export const SortPropsSchema = z.object({
537
651
  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, CommerceSearchActionsSchema, CommerceSearchStateSchema, SubmitQuerySchema, SubmitQueryPayloadSchema, 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, CommerceSearchActions, CommerceSearchState, SubmitQuery, SubmitQueryPayload, 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, CommerceSearchActionsSchema, CommerceSearchStateSchema, SubmitQuerySchema, SubmitQueryPayloadSchema, 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.4",
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
+ }