@rebasepro/types 0.14.1-canary.g7e666eb → 0.14.1

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.
@@ -421,6 +421,31 @@ export interface RestFetchService {
421
421
  databaseId?: string;
422
422
  vectorSearch?: VectorSearchParams;
423
423
  }, include?: string[]): Promise<Record<string, unknown>[]>;
424
+ /**
425
+ * `count`/`sum`/`avg`/`min`/`max` over the rows a filter selects,
426
+ * optionally grouped.
427
+ *
428
+ * Optional, and the REST route answers 501 where a driver does not
429
+ * implement it — an aggregate is not a thing to approximate, and an empty
430
+ * result set would read as "nothing matched".
431
+ *
432
+ * Any implementation **must apply the same row-level authorization as a
433
+ * read**. An aggregate is an efficient way to learn about rows you cannot
434
+ * select, and `count(*)` over a table whose policies would return nothing
435
+ * has to be zero.
436
+ */
437
+ aggregate?(collectionPath: string, options: {
438
+ aggregates: {
439
+ fn: "count" | "sum" | "avg" | "min" | "max";
440
+ field?: string;
441
+ alias: string;
442
+ }[];
443
+ groupBy?: string[];
444
+ filter?: FilterValues<string>;
445
+ logical?: LogicalCondition;
446
+ searchString?: string;
447
+ limit?: number;
448
+ }): Promise<Record<string, unknown>[]>;
424
449
  /**
425
450
  * Fetch a single flattened entity with optional relation includes.
426
451
  */