@rushdb/javascript-sdk 1.15.3 → 1.17.0

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.
@@ -51,34 +51,42 @@ export type AggregateCollectNestedFn = Omit<AggregateCollectFn, 'field'> & {
51
51
  [field: string]: AggregateCollectNestedFn;
52
52
  };
53
53
  };
54
+ export type AggregateCountFn = {
55
+ field?: string;
56
+ fn: 'count';
57
+ unique?: boolean;
58
+ alias?: string;
59
+ };
60
+ export type AggregateTimeBucketFn = {
61
+ field: string;
62
+ fn: 'timeBucket';
63
+ alias?: string;
64
+ granularity: 'day' | 'week' | 'month' | 'quarter' | 'year' | 'months';
65
+ size?: number;
66
+ };
54
67
  export type AggregateFn<S extends Schema = Schema> = {
55
- alias: string;
56
68
  field: string;
57
69
  fn: 'avg';
70
+ alias?: string;
58
71
  precision?: number;
59
- } | {
60
- alias: string;
72
+ } | AggregateCountFn | {
61
73
  field: string;
62
74
  fn: 'max';
75
+ alias?: string;
63
76
  } | {
64
- alias: string;
65
77
  field: string;
66
78
  fn: 'min';
79
+ alias?: string;
67
80
  } | {
68
- alias: string;
69
81
  field: string;
70
82
  fn: 'sum';
71
- } | {
72
- alias: string;
73
- field?: string;
74
- fn: 'count';
75
- unique?: boolean;
83
+ alias?: string;
76
84
  } | {
77
85
  field: string;
78
86
  fn: `gds.similarity.${VectorSearchFn}`;
79
- alias: string;
87
+ alias?: string;
80
88
  query: number[];
81
- } | AggregateCollectFn;
89
+ } | AggregateTimeBucketFn | AggregateCollectFn;
82
90
  export type Aggregate = {
83
91
  [field: string]: AggregateCollectNestedFn;
84
92
  } | {
package/package.json CHANGED
@@ -33,7 +33,7 @@
33
33
  "rushdb"
34
34
  ],
35
35
  "license": "Apache-2.0",
36
- "version": "1.15.3",
36
+ "version": "1.17.0",
37
37
  "type": "module",
38
38
  "files": [
39
39
  "dist"