@coveo/thermidor-schema 1.0.0-beta.7 → 1.0.0-beta.8

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.
@@ -647,8 +647,11 @@ export const ComponentContractsSchema = z.discriminatedUnion('component', [
647
647
  * ComponentId / ChildList), so it is not re-declared here; the unions below reference it.
648
648
  */
649
649
  export const FunctionCallSchema = z.object({
650
- functionName: z.string(),
651
- args: z.array(z.unknown()).optional(),
650
+ call: z.string(),
651
+ args: z.record(z.string(), z.any()),
652
+ returnType: z
653
+ .enum(['string', 'number', 'boolean', 'array', 'object', 'any', 'void'])
654
+ .default('boolean'),
652
655
  });
653
656
  export const DynamicNumberSchema = z.union([z.number(), DataBindingSchema, FunctionCallSchema]);
654
657
  export const DynamicStringSchema = z.union([z.string(), DataBindingSchema, FunctionCallSchema]);
@@ -678,16 +681,24 @@ export const DynamicActionSchema = z.object({
678
681
  * untouched. The resolved shape a renderer actually reads is the `XxxProps` type.
679
682
  */
680
683
  export const BundleDisplayPropsSchema = z.object({
681
- tiers: DynamicValueSchema,
684
+ tiers: z.union([BundleDisplayStateSchema.shape['tiers'], DataBindingSchema, FunctionCallSchema]),
682
685
  });
683
686
  export const CartPropsSchema = z.object({});
684
687
  export const CategoryFacetPropsSchema = z.object({
685
688
  field: DynamicStringSchema,
686
689
  displayName: DynamicStringSchema,
687
- values: DynamicValueSchema,
690
+ values: z.union([
691
+ CategoryFacetStateSchema.shape['values'],
692
+ DataBindingSchema,
693
+ FunctionCallSchema,
694
+ ]),
688
695
  canShowMoreValues: DynamicBooleanSchema,
689
696
  canShowLessValues: DynamicBooleanSchema,
690
- facetSearch: DynamicValueSchema,
697
+ facetSearch: z.union([
698
+ CategoryFacetStateSchema.shape['facetSearch'],
699
+ DataBindingSchema,
700
+ FunctionCallSchema,
701
+ ]),
691
702
  });
692
703
  export const CommerceSearchPropsSchema = z.object({
693
704
  sidebarChild: z.string().optional(),
@@ -696,14 +707,26 @@ export const CommerceSearchPropsSchema = z.object({
696
707
  export const ComparisonTablePropsSchema = z.object({
697
708
  heading: DynamicStringSchema,
698
709
  summary: DynamicStringSchema,
699
- products: DynamicValueSchema,
700
- attributes: DynamicValueSchema,
710
+ products: z.union([
711
+ ComparisonTableStateSchema.shape['products'],
712
+ DataBindingSchema,
713
+ FunctionCallSchema,
714
+ ]),
715
+ attributes: z.union([
716
+ ComparisonTableStateSchema.shape['attributes'],
717
+ DataBindingSchema,
718
+ FunctionCallSchema,
719
+ ]),
701
720
  });
702
721
  export const DateFacetPropsSchema = z.object({
703
722
  field: DynamicStringSchema,
704
723
  displayName: DynamicStringSchema,
705
- values: DynamicValueSchema,
706
- customRange: DynamicValueSchema,
724
+ values: z.union([DateFacetStateSchema.shape['values'], DataBindingSchema, FunctionCallSchema]),
725
+ customRange: z.union([
726
+ DateFacetStateSchema.shape['customRange'],
727
+ DataBindingSchema,
728
+ FunctionCallSchema,
729
+ ]),
707
730
  hasActiveValues: DynamicBooleanSchema,
708
731
  canShowMoreValues: DynamicBooleanSchema,
709
732
  canShowLessValues: DynamicBooleanSchema,
@@ -716,17 +739,25 @@ export const LayoutStackPropsSchema = z.object({
716
739
  children: z.array(z.string()).optional(),
717
740
  });
718
741
  export const NextActionsBarPropsSchema = z.object({
719
- suggestedActions: DynamicValueSchema,
742
+ suggestedActions: z.union([
743
+ NextActionsStateSchema.shape['suggestedActions'],
744
+ DataBindingSchema,
745
+ FunctionCallSchema,
746
+ ]),
720
747
  });
721
748
  export const NumericFacetPropsSchema = z.object({
722
749
  field: DynamicStringSchema,
723
750
  displayName: DynamicStringSchema,
724
- values: DynamicValueSchema,
725
- customRange: DynamicValueSchema,
751
+ values: z.union([NumericFacetStateSchema.shape['values'], DataBindingSchema, FunctionCallSchema]),
752
+ customRange: z.union([
753
+ NumericFacetStateSchema.shape['customRange'],
754
+ DataBindingSchema,
755
+ FunctionCallSchema,
756
+ ]),
726
757
  hasActiveValues: DynamicBooleanSchema,
727
758
  canShowMoreValues: DynamicBooleanSchema,
728
759
  canShowLessValues: DynamicBooleanSchema,
729
- domain: DynamicValueSchema,
760
+ domain: z.union([NumericFacetStateSchema.shape['domain'], DataBindingSchema, FunctionCallSchema]),
730
761
  });
731
762
  export const PageSizePropsSchema = z.object({
732
763
  pageSize: DynamicNumberSchema,
@@ -739,19 +770,39 @@ export const PaginationPropsSchema = z.object({
739
770
  });
740
771
  export const ProductCarouselPropsSchema = z.object({
741
772
  heading: DynamicStringSchema,
742
- products: DynamicValueSchema,
773
+ products: z.union([
774
+ ProductCarouselStateSchema.shape['products'],
775
+ DataBindingSchema,
776
+ FunctionCallSchema,
777
+ ]),
743
778
  });
744
779
  export const ProductListPropsSchema = z.object({
745
- products: DynamicValueSchema,
780
+ products: z.union([
781
+ ProductListStateSchema.shape['products'],
782
+ DataBindingSchema,
783
+ FunctionCallSchema,
784
+ ]),
746
785
  });
747
786
  export const ProductSummaryPropsSchema = z.object({
748
787
  categoryLabel: DynamicStringSchema,
749
- product: DynamicValueSchema,
788
+ product: z.union([
789
+ ProductSummaryStateSchema.shape['product'],
790
+ DataBindingSchema,
791
+ FunctionCallSchema,
792
+ ]),
750
793
  });
751
794
  export const QuerySuggestionsPropsSchema = z.object({
752
795
  query: DynamicStringSchema,
753
- completions: DynamicValueSchema,
754
- products: DynamicValueSchema,
796
+ completions: z.union([
797
+ QuerySuggestionsStateSchema.shape['completions'],
798
+ DataBindingSchema,
799
+ FunctionCallSchema,
800
+ ]),
801
+ products: z.union([
802
+ QuerySuggestionsStateSchema.shape['products'],
803
+ DataBindingSchema,
804
+ FunctionCallSchema,
805
+ ]),
755
806
  });
756
807
  export const QuerySummaryPropsSchema = z.object({
757
808
  query: DynamicStringSchema,
@@ -762,15 +813,27 @@ export const QuerySummaryPropsSchema = z.object({
762
813
  export const RegularFacetPropsSchema = z.object({
763
814
  field: DynamicStringSchema,
764
815
  displayName: DynamicStringSchema,
765
- values: DynamicValueSchema,
816
+ values: z.union([RegularFacetStateSchema.shape['values'], DataBindingSchema, FunctionCallSchema]),
766
817
  hasActiveValues: DynamicBooleanSchema,
767
818
  canShowMoreValues: DynamicBooleanSchema,
768
819
  canShowLessValues: DynamicBooleanSchema,
769
- facetSearch: DynamicValueSchema,
820
+ facetSearch: z.union([
821
+ RegularFacetStateSchema.shape['facetSearch'],
822
+ DataBindingSchema,
823
+ FunctionCallSchema,
824
+ ]),
770
825
  });
771
826
  export const SortPropsSchema = z.object({
772
- appliedSort: DynamicValueSchema,
773
- availableSorts: DynamicValueSchema,
827
+ appliedSort: z.union([
828
+ SortStateSchema.shape['appliedSort'],
829
+ DataBindingSchema,
830
+ FunctionCallSchema,
831
+ ]),
832
+ availableSorts: z.union([
833
+ SortStateSchema.shape['availableSorts'],
834
+ DataBindingSchema,
835
+ FunctionCallSchema,
836
+ ]),
774
837
  });
775
838
  /**
776
839
  * Per-component action unions in the standard A2-UI event shape
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/thermidor-schema",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.8",
4
4
  "description": "Zod and TypeScript projections of the Thermidor JSON Schema contract.",
5
5
  "homepage": "https://github.com/coveo-platform/thermidor-schema#readme",
6
6
  "bugs": {
@@ -36,6 +36,7 @@
36
36
  "access": "public"
37
37
  },
38
38
  "devDependencies": {
39
+ "@types/node": "24.13.6",
39
40
  "fast-check": "4.9.0",
40
41
  "typescript": "7.0.2",
41
42
  "vitest": "4.1.11",
@@ -50,6 +51,6 @@
50
51
  "scripts": {
51
52
  "build": "node scripts/clean-build.mjs && tsc --project tsconfig.json",
52
53
  "test": "vitest run",
53
- "typecheck": "tsc --noEmit --project tsconfig.json"
54
+ "typecheck": "tsc --noEmit --project tsconfig.json && tsc --noEmit --project tsconfig.typecheck.json"
54
55
  }
55
56
  }