@wix/sdk-types 1.13.21 → 1.13.23

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,29 +640,12 @@ interface ScalarAggregation {
640
640
  interface DateHistogramAggregation {
641
641
  interval?: DateHistogramInterval;
642
642
  }
643
- /**
644
- * Base aggregation type that can be used for both top-level and nested aggregations
645
- */
646
- type BaseAggregation<Spec extends SearchSpec> = {
647
- name?: string | null;
648
- fieldPath?: AggregatableFields<Spec>;
649
- } & ({
650
- type?: 'VALUE';
651
- value?: ValueAggregation;
652
- } | {
653
- type?: 'RANGE';
654
- range?: RangeAggregation;
655
- } | {
656
- type?: 'SCALAR';
657
- scalar?: ScalarAggregation;
658
- } | {
659
- type?: 'DATE_HISTOGRAM';
660
- dateHistogram?: DateHistogramAggregation;
661
- });
662
643
  /**
663
644
  * Nested aggregation item
664
645
  */
665
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
646
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
647
+ type?: NonNestedAggregationType;
648
+ };
666
649
  /**
667
650
  * Nested aggregation configuration
668
651
  */
@@ -676,13 +659,25 @@ interface NestedAggregation<Spec extends SearchSpec> {
676
659
  type AggregatableFields<Spec extends SearchSpec> = Spec extends {
677
660
  aggregatable: readonly string[];
678
661
  } ? Spec['aggregatable'][number] : string;
662
+ /**
663
+ * Base aggregation type that can be used for both top-level and nested aggregations
664
+ */
665
+ type NonNestedAggregationType = 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE';
666
+ type AggregationTypeWithNested = 'NESTED' | NonNestedAggregationType;
667
+ type BaseAggregationWithoutType<Spec extends SearchSpec> = {
668
+ name?: string | null;
669
+ fieldPath?: AggregatableFields<Spec>;
670
+ dateHistogram?: DateHistogramAggregation;
671
+ range?: RangeAggregation;
672
+ scalar?: ScalarAggregation;
673
+ value?: ValueAggregation;
674
+ };
679
675
  /**
680
676
  * Base aggregation interface
681
677
  * @template Spec The search specification type
682
678
  */
683
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
684
- type?: 'NESTED';
685
- fieldPath?: AggregatableFields<Spec>;
679
+ type Aggregation<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
680
+ type?: AggregationTypeWithNested;
686
681
  nested?: NestedAggregation<Spec>;
687
682
  };
688
683
 
package/build/index.d.mts CHANGED
@@ -640,29 +640,12 @@ interface ScalarAggregation {
640
640
  interface DateHistogramAggregation {
641
641
  interval?: DateHistogramInterval;
642
642
  }
643
- /**
644
- * Base aggregation type that can be used for both top-level and nested aggregations
645
- */
646
- type BaseAggregation<Spec extends SearchSpec> = {
647
- name?: string | null;
648
- fieldPath?: AggregatableFields<Spec>;
649
- } & ({
650
- type?: 'VALUE';
651
- value?: ValueAggregation;
652
- } | {
653
- type?: 'RANGE';
654
- range?: RangeAggregation;
655
- } | {
656
- type?: 'SCALAR';
657
- scalar?: ScalarAggregation;
658
- } | {
659
- type?: 'DATE_HISTOGRAM';
660
- dateHistogram?: DateHistogramAggregation;
661
- });
662
643
  /**
663
644
  * Nested aggregation item
664
645
  */
665
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
646
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
647
+ type?: NonNestedAggregationType;
648
+ };
666
649
  /**
667
650
  * Nested aggregation configuration
668
651
  */
@@ -676,13 +659,25 @@ interface NestedAggregation<Spec extends SearchSpec> {
676
659
  type AggregatableFields<Spec extends SearchSpec> = Spec extends {
677
660
  aggregatable: readonly string[];
678
661
  } ? Spec['aggregatable'][number] : string;
662
+ /**
663
+ * Base aggregation type that can be used for both top-level and nested aggregations
664
+ */
665
+ type NonNestedAggregationType = 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE';
666
+ type AggregationTypeWithNested = 'NESTED' | NonNestedAggregationType;
667
+ type BaseAggregationWithoutType<Spec extends SearchSpec> = {
668
+ name?: string | null;
669
+ fieldPath?: AggregatableFields<Spec>;
670
+ dateHistogram?: DateHistogramAggregation;
671
+ range?: RangeAggregation;
672
+ scalar?: ScalarAggregation;
673
+ value?: ValueAggregation;
674
+ };
679
675
  /**
680
676
  * Base aggregation interface
681
677
  * @template Spec The search specification type
682
678
  */
683
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
684
- type?: 'NESTED';
685
- fieldPath?: AggregatableFields<Spec>;
679
+ type Aggregation<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
680
+ type?: AggregationTypeWithNested;
686
681
  nested?: NestedAggregation<Spec>;
687
682
  };
688
683
 
package/build/index.d.ts CHANGED
@@ -640,29 +640,12 @@ interface ScalarAggregation {
640
640
  interface DateHistogramAggregation {
641
641
  interval?: DateHistogramInterval;
642
642
  }
643
- /**
644
- * Base aggregation type that can be used for both top-level and nested aggregations
645
- */
646
- type BaseAggregation<Spec extends SearchSpec> = {
647
- name?: string | null;
648
- fieldPath?: AggregatableFields<Spec>;
649
- } & ({
650
- type?: 'VALUE';
651
- value?: ValueAggregation;
652
- } | {
653
- type?: 'RANGE';
654
- range?: RangeAggregation;
655
- } | {
656
- type?: 'SCALAR';
657
- scalar?: ScalarAggregation;
658
- } | {
659
- type?: 'DATE_HISTOGRAM';
660
- dateHistogram?: DateHistogramAggregation;
661
- });
662
643
  /**
663
644
  * Nested aggregation item
664
645
  */
665
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
646
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
647
+ type?: NonNestedAggregationType;
648
+ };
666
649
  /**
667
650
  * Nested aggregation configuration
668
651
  */
@@ -676,13 +659,25 @@ interface NestedAggregation<Spec extends SearchSpec> {
676
659
  type AggregatableFields<Spec extends SearchSpec> = Spec extends {
677
660
  aggregatable: readonly string[];
678
661
  } ? Spec['aggregatable'][number] : string;
662
+ /**
663
+ * Base aggregation type that can be used for both top-level and nested aggregations
664
+ */
665
+ type NonNestedAggregationType = 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE';
666
+ type AggregationTypeWithNested = 'NESTED' | NonNestedAggregationType;
667
+ type BaseAggregationWithoutType<Spec extends SearchSpec> = {
668
+ name?: string | null;
669
+ fieldPath?: AggregatableFields<Spec>;
670
+ dateHistogram?: DateHistogramAggregation;
671
+ range?: RangeAggregation;
672
+ scalar?: ScalarAggregation;
673
+ value?: ValueAggregation;
674
+ };
679
675
  /**
680
676
  * Base aggregation interface
681
677
  * @template Spec The search specification type
682
678
  */
683
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
684
- type?: 'NESTED';
685
- fieldPath?: AggregatableFields<Spec>;
679
+ type Aggregation<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
680
+ type?: AggregationTypeWithNested;
686
681
  nested?: NestedAggregation<Spec>;
687
682
  };
688
683
 
@@ -703,29 +703,12 @@ interface ScalarAggregation {
703
703
  interface DateHistogramAggregation {
704
704
  interval?: DateHistogramInterval;
705
705
  }
706
- /**
707
- * Base aggregation type that can be used for both top-level and nested aggregations
708
- */
709
- type BaseAggregation<Spec extends SearchSpec> = {
710
- name?: string | null;
711
- fieldPath?: AggregatableFields<Spec>;
712
- } & ({
713
- type?: 'VALUE';
714
- value?: ValueAggregation;
715
- } | {
716
- type?: 'RANGE';
717
- range?: RangeAggregation;
718
- } | {
719
- type?: 'SCALAR';
720
- scalar?: ScalarAggregation;
721
- } | {
722
- type?: 'DATE_HISTOGRAM';
723
- dateHistogram?: DateHistogramAggregation;
724
- });
725
706
  /**
726
707
  * Nested aggregation item
727
708
  */
728
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
709
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
710
+ type?: NonNestedAggregationType;
711
+ };
729
712
  /**
730
713
  * Nested aggregation configuration
731
714
  */
@@ -739,13 +722,25 @@ interface NestedAggregation<Spec extends SearchSpec> {
739
722
  type AggregatableFields<Spec extends SearchSpec> = Spec extends {
740
723
  aggregatable: readonly string[];
741
724
  } ? Spec['aggregatable'][number] : string;
725
+ /**
726
+ * Base aggregation type that can be used for both top-level and nested aggregations
727
+ */
728
+ type NonNestedAggregationType = 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE';
729
+ type AggregationTypeWithNested = 'NESTED' | NonNestedAggregationType;
730
+ type BaseAggregationWithoutType<Spec extends SearchSpec> = {
731
+ name?: string | null;
732
+ fieldPath?: AggregatableFields<Spec>;
733
+ dateHistogram?: DateHistogramAggregation;
734
+ range?: RangeAggregation;
735
+ scalar?: ScalarAggregation;
736
+ value?: ValueAggregation;
737
+ };
742
738
  /**
743
739
  * Base aggregation interface
744
740
  * @template Spec The search specification type
745
741
  */
746
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
747
- type?: 'NESTED';
748
- fieldPath?: AggregatableFields<Spec>;
742
+ type Aggregation<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
743
+ type?: AggregationTypeWithNested;
749
744
  nested?: NestedAggregation<Spec>;
750
745
  };
751
746
 
@@ -703,29 +703,12 @@ interface ScalarAggregation {
703
703
  interface DateHistogramAggregation {
704
704
  interval?: DateHistogramInterval;
705
705
  }
706
- /**
707
- * Base aggregation type that can be used for both top-level and nested aggregations
708
- */
709
- type BaseAggregation<Spec extends SearchSpec> = {
710
- name?: string | null;
711
- fieldPath?: AggregatableFields<Spec>;
712
- } & ({
713
- type?: 'VALUE';
714
- value?: ValueAggregation;
715
- } | {
716
- type?: 'RANGE';
717
- range?: RangeAggregation;
718
- } | {
719
- type?: 'SCALAR';
720
- scalar?: ScalarAggregation;
721
- } | {
722
- type?: 'DATE_HISTOGRAM';
723
- dateHistogram?: DateHistogramAggregation;
724
- });
725
706
  /**
726
707
  * Nested aggregation item
727
708
  */
728
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
709
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
710
+ type?: NonNestedAggregationType;
711
+ };
729
712
  /**
730
713
  * Nested aggregation configuration
731
714
  */
@@ -739,13 +722,25 @@ interface NestedAggregation<Spec extends SearchSpec> {
739
722
  type AggregatableFields<Spec extends SearchSpec> = Spec extends {
740
723
  aggregatable: readonly string[];
741
724
  } ? Spec['aggregatable'][number] : string;
725
+ /**
726
+ * Base aggregation type that can be used for both top-level and nested aggregations
727
+ */
728
+ type NonNestedAggregationType = 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE';
729
+ type AggregationTypeWithNested = 'NESTED' | NonNestedAggregationType;
730
+ type BaseAggregationWithoutType<Spec extends SearchSpec> = {
731
+ name?: string | null;
732
+ fieldPath?: AggregatableFields<Spec>;
733
+ dateHistogram?: DateHistogramAggregation;
734
+ range?: RangeAggregation;
735
+ scalar?: ScalarAggregation;
736
+ value?: ValueAggregation;
737
+ };
742
738
  /**
743
739
  * Base aggregation interface
744
740
  * @template Spec The search specification type
745
741
  */
746
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
747
- type?: 'NESTED';
748
- fieldPath?: AggregatableFields<Spec>;
742
+ type Aggregation<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
743
+ type?: AggregationTypeWithNested;
749
744
  nested?: NestedAggregation<Spec>;
750
745
  };
751
746
 
@@ -703,29 +703,12 @@ interface ScalarAggregation {
703
703
  interface DateHistogramAggregation {
704
704
  interval?: DateHistogramInterval;
705
705
  }
706
- /**
707
- * Base aggregation type that can be used for both top-level and nested aggregations
708
- */
709
- type BaseAggregation<Spec extends SearchSpec> = {
710
- name?: string | null;
711
- fieldPath?: AggregatableFields<Spec>;
712
- } & ({
713
- type?: 'VALUE';
714
- value?: ValueAggregation;
715
- } | {
716
- type?: 'RANGE';
717
- range?: RangeAggregation;
718
- } | {
719
- type?: 'SCALAR';
720
- scalar?: ScalarAggregation;
721
- } | {
722
- type?: 'DATE_HISTOGRAM';
723
- dateHistogram?: DateHistogramAggregation;
724
- });
725
706
  /**
726
707
  * Nested aggregation item
727
708
  */
728
- type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregation<Spec>;
709
+ type NestedAggregationItem<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
710
+ type?: NonNestedAggregationType;
711
+ };
729
712
  /**
730
713
  * Nested aggregation configuration
731
714
  */
@@ -739,13 +722,25 @@ interface NestedAggregation<Spec extends SearchSpec> {
739
722
  type AggregatableFields<Spec extends SearchSpec> = Spec extends {
740
723
  aggregatable: readonly string[];
741
724
  } ? Spec['aggregatable'][number] : string;
725
+ /**
726
+ * Base aggregation type that can be used for both top-level and nested aggregations
727
+ */
728
+ type NonNestedAggregationType = 'DATE_HISTOGRAM' | 'RANGE' | 'SCALAR' | 'VALUE';
729
+ type AggregationTypeWithNested = 'NESTED' | NonNestedAggregationType;
730
+ type BaseAggregationWithoutType<Spec extends SearchSpec> = {
731
+ name?: string | null;
732
+ fieldPath?: AggregatableFields<Spec>;
733
+ dateHistogram?: DateHistogramAggregation;
734
+ range?: RangeAggregation;
735
+ scalar?: ScalarAggregation;
736
+ value?: ValueAggregation;
737
+ };
742
738
  /**
743
739
  * Base aggregation interface
744
740
  * @template Spec The search specification type
745
741
  */
746
- type Aggregation<Spec extends SearchSpec> = BaseAggregation<Spec> | {
747
- type?: 'NESTED';
748
- fieldPath?: AggregatableFields<Spec>;
742
+ type Aggregation<Spec extends SearchSpec> = BaseAggregationWithoutType<Spec> & {
743
+ type?: AggregationTypeWithNested;
749
744
  nested?: NestedAggregation<Spec>;
750
745
  };
751
746
 
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.23",
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": "90941886512ea0dcd74afea2c2fb42ed9c105d602dacab71dc8f38bf"
65
65
  }