@wix/sdk-types 1.13.21 → 1.13.22

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.
@@ -640,6 +640,23 @@ interface ScalarAggregation {
640
640
  interface DateHistogramAggregation {
641
641
  interval?: DateHistogramInterval;
642
642
  }
643
+ /**
644
+ * Nested aggregation item
645
+ */
646
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
647
+ /**
648
+ * Nested aggregation configuration
649
+ */
650
+ interface NestedAggregation<Spec extends SearchSpec> {
651
+ nestedAggregations?: NestedAggregationItem<Spec>[];
652
+ }
653
+ /**
654
+ * Extracts all aggregatable field paths from a search spec
655
+ * @template Spec The search specification type
656
+ */
657
+ type AggregatableFields<Spec extends SearchSpec> = Spec extends {
658
+ aggregatable: readonly string[];
659
+ } ? Spec['aggregatable'][number] : string;
643
660
  /**
644
661
  * Base aggregation type that can be used for both top-level and nested aggregations
645
662
  */
@@ -659,30 +676,18 @@ type BaseAggregation<Spec extends SearchSpec> = {
659
676
  type?: 'DATE_HISTOGRAM';
660
677
  dateHistogram?: DateHistogramAggregation;
661
678
  });
662
- /**
663
- * Nested aggregation item
664
- */
665
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
666
- /**
667
- * Nested aggregation configuration
668
- */
669
- interface NestedAggregation<Spec extends SearchSpec> {
670
- nestedAggregations?: NestedAggregationItem<Spec>[];
671
- }
672
- /**
673
- * Extracts all aggregatable field paths from a search spec
674
- * @template Spec The search specification type
675
- */
676
- type AggregatableFields<Spec extends SearchSpec> = Spec extends {
677
- aggregatable: readonly string[];
678
- } ? Spec['aggregatable'][number] : string;
679
679
  /**
680
680
  * Base aggregation interface
681
681
  * @template Spec The search specification type
682
682
  */
683
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
684
- type?: 'NESTED';
683
+ type Aggregation<Spec extends SearchSpec> = {
684
+ type?: 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE' | 'NESTED';
685
+ name?: string | null;
685
686
  fieldPath?: AggregatableFields<Spec>;
687
+ dateHistogram?: DateHistogramAggregation;
688
+ range?: RangeAggregation;
689
+ scalar?: ScalarAggregation;
690
+ value?: ValueAggregation;
686
691
  nested?: NestedAggregation<Spec>;
687
692
  };
688
693
 
package/build/index.d.mts CHANGED
@@ -640,6 +640,23 @@ interface ScalarAggregation {
640
640
  interface DateHistogramAggregation {
641
641
  interval?: DateHistogramInterval;
642
642
  }
643
+ /**
644
+ * Nested aggregation item
645
+ */
646
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
647
+ /**
648
+ * Nested aggregation configuration
649
+ */
650
+ interface NestedAggregation<Spec extends SearchSpec> {
651
+ nestedAggregations?: NestedAggregationItem<Spec>[];
652
+ }
653
+ /**
654
+ * Extracts all aggregatable field paths from a search spec
655
+ * @template Spec The search specification type
656
+ */
657
+ type AggregatableFields<Spec extends SearchSpec> = Spec extends {
658
+ aggregatable: readonly string[];
659
+ } ? Spec['aggregatable'][number] : string;
643
660
  /**
644
661
  * Base aggregation type that can be used for both top-level and nested aggregations
645
662
  */
@@ -659,30 +676,18 @@ type BaseAggregation<Spec extends SearchSpec> = {
659
676
  type?: 'DATE_HISTOGRAM';
660
677
  dateHistogram?: DateHistogramAggregation;
661
678
  });
662
- /**
663
- * Nested aggregation item
664
- */
665
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
666
- /**
667
- * Nested aggregation configuration
668
- */
669
- interface NestedAggregation<Spec extends SearchSpec> {
670
- nestedAggregations?: NestedAggregationItem<Spec>[];
671
- }
672
- /**
673
- * Extracts all aggregatable field paths from a search spec
674
- * @template Spec The search specification type
675
- */
676
- type AggregatableFields<Spec extends SearchSpec> = Spec extends {
677
- aggregatable: readonly string[];
678
- } ? Spec['aggregatable'][number] : string;
679
679
  /**
680
680
  * Base aggregation interface
681
681
  * @template Spec The search specification type
682
682
  */
683
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
684
- type?: 'NESTED';
683
+ type Aggregation<Spec extends SearchSpec> = {
684
+ type?: 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE' | 'NESTED';
685
+ name?: string | null;
685
686
  fieldPath?: AggregatableFields<Spec>;
687
+ dateHistogram?: DateHistogramAggregation;
688
+ range?: RangeAggregation;
689
+ scalar?: ScalarAggregation;
690
+ value?: ValueAggregation;
686
691
  nested?: NestedAggregation<Spec>;
687
692
  };
688
693
 
package/build/index.d.ts CHANGED
@@ -640,6 +640,23 @@ interface ScalarAggregation {
640
640
  interface DateHistogramAggregation {
641
641
  interval?: DateHistogramInterval;
642
642
  }
643
+ /**
644
+ * Nested aggregation item
645
+ */
646
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
647
+ /**
648
+ * Nested aggregation configuration
649
+ */
650
+ interface NestedAggregation<Spec extends SearchSpec> {
651
+ nestedAggregations?: NestedAggregationItem<Spec>[];
652
+ }
653
+ /**
654
+ * Extracts all aggregatable field paths from a search spec
655
+ * @template Spec The search specification type
656
+ */
657
+ type AggregatableFields<Spec extends SearchSpec> = Spec extends {
658
+ aggregatable: readonly string[];
659
+ } ? Spec['aggregatable'][number] : string;
643
660
  /**
644
661
  * Base aggregation type that can be used for both top-level and nested aggregations
645
662
  */
@@ -659,30 +676,18 @@ type BaseAggregation<Spec extends SearchSpec> = {
659
676
  type?: 'DATE_HISTOGRAM';
660
677
  dateHistogram?: DateHistogramAggregation;
661
678
  });
662
- /**
663
- * Nested aggregation item
664
- */
665
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
666
- /**
667
- * Nested aggregation configuration
668
- */
669
- interface NestedAggregation<Spec extends SearchSpec> {
670
- nestedAggregations?: NestedAggregationItem<Spec>[];
671
- }
672
- /**
673
- * Extracts all aggregatable field paths from a search spec
674
- * @template Spec The search specification type
675
- */
676
- type AggregatableFields<Spec extends SearchSpec> = Spec extends {
677
- aggregatable: readonly string[];
678
- } ? Spec['aggregatable'][number] : string;
679
679
  /**
680
680
  * Base aggregation interface
681
681
  * @template Spec The search specification type
682
682
  */
683
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
684
- type?: 'NESTED';
683
+ type Aggregation<Spec extends SearchSpec> = {
684
+ type?: 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE' | 'NESTED';
685
+ name?: string | null;
685
686
  fieldPath?: AggregatableFields<Spec>;
687
+ dateHistogram?: DateHistogramAggregation;
688
+ range?: RangeAggregation;
689
+ scalar?: ScalarAggregation;
690
+ value?: ValueAggregation;
686
691
  nested?: NestedAggregation<Spec>;
687
692
  };
688
693
 
@@ -703,6 +703,23 @@ interface ScalarAggregation {
703
703
  interface DateHistogramAggregation {
704
704
  interval?: DateHistogramInterval;
705
705
  }
706
+ /**
707
+ * Nested aggregation item
708
+ */
709
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
710
+ /**
711
+ * Nested aggregation configuration
712
+ */
713
+ interface NestedAggregation<Spec extends SearchSpec> {
714
+ nestedAggregations?: NestedAggregationItem<Spec>[];
715
+ }
716
+ /**
717
+ * Extracts all aggregatable field paths from a search spec
718
+ * @template Spec The search specification type
719
+ */
720
+ type AggregatableFields<Spec extends SearchSpec> = Spec extends {
721
+ aggregatable: readonly string[];
722
+ } ? Spec['aggregatable'][number] : string;
706
723
  /**
707
724
  * Base aggregation type that can be used for both top-level and nested aggregations
708
725
  */
@@ -722,30 +739,18 @@ type BaseAggregation<Spec extends SearchSpec> = {
722
739
  type?: 'DATE_HISTOGRAM';
723
740
  dateHistogram?: DateHistogramAggregation;
724
741
  });
725
- /**
726
- * Nested aggregation item
727
- */
728
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
729
- /**
730
- * Nested aggregation configuration
731
- */
732
- interface NestedAggregation<Spec extends SearchSpec> {
733
- nestedAggregations?: NestedAggregationItem<Spec>[];
734
- }
735
- /**
736
- * Extracts all aggregatable field paths from a search spec
737
- * @template Spec The search specification type
738
- */
739
- type AggregatableFields<Spec extends SearchSpec> = Spec extends {
740
- aggregatable: readonly string[];
741
- } ? Spec['aggregatable'][number] : string;
742
742
  /**
743
743
  * Base aggregation interface
744
744
  * @template Spec The search specification type
745
745
  */
746
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
747
- type?: 'NESTED';
746
+ type Aggregation<Spec extends SearchSpec> = {
747
+ type?: 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE' | 'NESTED';
748
+ name?: string | null;
748
749
  fieldPath?: AggregatableFields<Spec>;
750
+ dateHistogram?: DateHistogramAggregation;
751
+ range?: RangeAggregation;
752
+ scalar?: ScalarAggregation;
753
+ value?: ValueAggregation;
749
754
  nested?: NestedAggregation<Spec>;
750
755
  };
751
756
 
@@ -703,6 +703,23 @@ interface ScalarAggregation {
703
703
  interface DateHistogramAggregation {
704
704
  interval?: DateHistogramInterval;
705
705
  }
706
+ /**
707
+ * Nested aggregation item
708
+ */
709
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
710
+ /**
711
+ * Nested aggregation configuration
712
+ */
713
+ interface NestedAggregation<Spec extends SearchSpec> {
714
+ nestedAggregations?: NestedAggregationItem<Spec>[];
715
+ }
716
+ /**
717
+ * Extracts all aggregatable field paths from a search spec
718
+ * @template Spec The search specification type
719
+ */
720
+ type AggregatableFields<Spec extends SearchSpec> = Spec extends {
721
+ aggregatable: readonly string[];
722
+ } ? Spec['aggregatable'][number] : string;
706
723
  /**
707
724
  * Base aggregation type that can be used for both top-level and nested aggregations
708
725
  */
@@ -722,30 +739,18 @@ type BaseAggregation<Spec extends SearchSpec> = {
722
739
  type?: 'DATE_HISTOGRAM';
723
740
  dateHistogram?: DateHistogramAggregation;
724
741
  });
725
- /**
726
- * Nested aggregation item
727
- */
728
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
729
- /**
730
- * Nested aggregation configuration
731
- */
732
- interface NestedAggregation<Spec extends SearchSpec> {
733
- nestedAggregations?: NestedAggregationItem<Spec>[];
734
- }
735
- /**
736
- * Extracts all aggregatable field paths from a search spec
737
- * @template Spec The search specification type
738
- */
739
- type AggregatableFields<Spec extends SearchSpec> = Spec extends {
740
- aggregatable: readonly string[];
741
- } ? Spec['aggregatable'][number] : string;
742
742
  /**
743
743
  * Base aggregation interface
744
744
  * @template Spec The search specification type
745
745
  */
746
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
747
- type?: 'NESTED';
746
+ type Aggregation<Spec extends SearchSpec> = {
747
+ type?: 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE' | 'NESTED';
748
+ name?: string | null;
748
749
  fieldPath?: AggregatableFields<Spec>;
750
+ dateHistogram?: DateHistogramAggregation;
751
+ range?: RangeAggregation;
752
+ scalar?: ScalarAggregation;
753
+ value?: ValueAggregation;
749
754
  nested?: NestedAggregation<Spec>;
750
755
  };
751
756
 
@@ -703,6 +703,23 @@ interface ScalarAggregation {
703
703
  interface DateHistogramAggregation {
704
704
  interval?: DateHistogramInterval;
705
705
  }
706
+ /**
707
+ * Nested aggregation item
708
+ */
709
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
710
+ /**
711
+ * Nested aggregation configuration
712
+ */
713
+ interface NestedAggregation<Spec extends SearchSpec> {
714
+ nestedAggregations?: NestedAggregationItem<Spec>[];
715
+ }
716
+ /**
717
+ * Extracts all aggregatable field paths from a search spec
718
+ * @template Spec The search specification type
719
+ */
720
+ type AggregatableFields<Spec extends SearchSpec> = Spec extends {
721
+ aggregatable: readonly string[];
722
+ } ? Spec['aggregatable'][number] : string;
706
723
  /**
707
724
  * Base aggregation type that can be used for both top-level and nested aggregations
708
725
  */
@@ -722,30 +739,18 @@ type BaseAggregation<Spec extends SearchSpec> = {
722
739
  type?: 'DATE_HISTOGRAM';
723
740
  dateHistogram?: DateHistogramAggregation;
724
741
  });
725
- /**
726
- * Nested aggregation item
727
- */
728
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
729
- /**
730
- * Nested aggregation configuration
731
- */
732
- interface NestedAggregation<Spec extends SearchSpec> {
733
- nestedAggregations?: NestedAggregationItem<Spec>[];
734
- }
735
- /**
736
- * Extracts all aggregatable field paths from a search spec
737
- * @template Spec The search specification type
738
- */
739
- type AggregatableFields<Spec extends SearchSpec> = Spec extends {
740
- aggregatable: readonly string[];
741
- } ? Spec['aggregatable'][number] : string;
742
742
  /**
743
743
  * Base aggregation interface
744
744
  * @template Spec The search specification type
745
745
  */
746
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
747
- type?: 'NESTED';
746
+ type Aggregation<Spec extends SearchSpec> = {
747
+ type?: 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE' | 'NESTED';
748
+ name?: string | null;
748
749
  fieldPath?: AggregatableFields<Spec>;
750
+ dateHistogram?: DateHistogramAggregation;
751
+ range?: RangeAggregation;
752
+ scalar?: ScalarAggregation;
753
+ value?: ValueAggregation;
749
754
  nested?: NestedAggregation<Spec>;
750
755
  };
751
756
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.13.21",
3
+ "version": "1.13.22",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -34,7 +34,7 @@
34
34
  "type-fest": "^4.41.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/node": "^20.17.46",
37
+ "@types/node": "^20.17.47",
38
38
  "eslint": "^8.57.1",
39
39
  "eslint-config-sdk": "0.0.0",
40
40
  "tsup": "^7.3.0",
@@ -61,5 +61,5 @@
61
61
  "wallaby": {
62
62
  "autoDetect": true
63
63
  },
64
- "falconPackageHash": "694788ef9dc33a22b172466ce303ac8bf4f7538d4f9175e592c02b63"
64
+ "falconPackageHash": "892f0dbe6ccf91945553cc4ce0d7036251c70222bbcc4d63869100d4"
65
65
  }