@baasix/types 1.0.6 → 1.0.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.
package/dist/index.d.mts CHANGED
@@ -309,6 +309,8 @@ interface FieldValues {
309
309
  values?: string[];
310
310
  /** Spatial reference system identifier (for geometry types) */
311
311
  srid?: number;
312
+ /** Vector dimensions (for pgvector types: Vector, HalfVec, SparseVec) */
313
+ dimensions?: number;
312
314
  }
313
315
  /**
314
316
  * Field definition
@@ -727,6 +729,19 @@ interface QueryParams<T = unknown> {
727
729
  * Filter conditions for related items (O2M/M2M)
728
730
  */
729
731
  relConditions?: Record<string, Filter>;
732
+ /**
733
+ * Whether to compute the total record count for the result.
734
+ *
735
+ * When omitted (`undefined`), the server falls back to the deployment
736
+ * default (env `COUNT_BY_DEFAULT`, which itself defaults to `true`).
737
+ * Passing `false` skips the COUNT query even when the default is on;
738
+ * passing `true` forces it even when the default is off.
739
+ *
740
+ * When the count is skipped, `totalCount` is returned as `null`.
741
+ * When `limit` is `-1` (return all) with no offset, the count is taken
742
+ * from the result length instead of running a separate query.
743
+ */
744
+ count?: boolean;
730
745
  /**
731
746
  * Additional metadata
732
747
  */
@@ -815,7 +830,12 @@ interface StatsResult {
815
830
  */
816
831
  interface PaginatedResponse<T> {
817
832
  data: T[];
818
- totalCount?: number;
833
+ /**
834
+ * Total number of records matching the query.
835
+ * `null` when the count was intentionally skipped via `count: false`
836
+ * (or the deployment default `COUNT_BY_DEFAULT=false`).
837
+ */
838
+ totalCount?: number | null;
819
839
  page?: number;
820
840
  limit?: number;
821
841
  totalPages?: number;
@@ -859,7 +879,11 @@ interface BulkResponse<T = string[]> {
859
879
  */
860
880
  interface ReadResult<T = any> {
861
881
  data: T[];
862
- totalCount: number;
882
+ /**
883
+ * Total number of records matching the query.
884
+ * `null` when the count was intentionally skipped (see `QueryParams.count`).
885
+ */
886
+ totalCount: number | null;
863
887
  page?: number;
864
888
  limit?: number;
865
889
  }
package/dist/index.d.ts CHANGED
@@ -309,6 +309,8 @@ interface FieldValues {
309
309
  values?: string[];
310
310
  /** Spatial reference system identifier (for geometry types) */
311
311
  srid?: number;
312
+ /** Vector dimensions (for pgvector types: Vector, HalfVec, SparseVec) */
313
+ dimensions?: number;
312
314
  }
313
315
  /**
314
316
  * Field definition
@@ -727,6 +729,19 @@ interface QueryParams<T = unknown> {
727
729
  * Filter conditions for related items (O2M/M2M)
728
730
  */
729
731
  relConditions?: Record<string, Filter>;
732
+ /**
733
+ * Whether to compute the total record count for the result.
734
+ *
735
+ * When omitted (`undefined`), the server falls back to the deployment
736
+ * default (env `COUNT_BY_DEFAULT`, which itself defaults to `true`).
737
+ * Passing `false` skips the COUNT query even when the default is on;
738
+ * passing `true` forces it even when the default is off.
739
+ *
740
+ * When the count is skipped, `totalCount` is returned as `null`.
741
+ * When `limit` is `-1` (return all) with no offset, the count is taken
742
+ * from the result length instead of running a separate query.
743
+ */
744
+ count?: boolean;
730
745
  /**
731
746
  * Additional metadata
732
747
  */
@@ -815,7 +830,12 @@ interface StatsResult {
815
830
  */
816
831
  interface PaginatedResponse<T> {
817
832
  data: T[];
818
- totalCount?: number;
833
+ /**
834
+ * Total number of records matching the query.
835
+ * `null` when the count was intentionally skipped via `count: false`
836
+ * (or the deployment default `COUNT_BY_DEFAULT=false`).
837
+ */
838
+ totalCount?: number | null;
819
839
  page?: number;
820
840
  limit?: number;
821
841
  totalPages?: number;
@@ -859,7 +879,11 @@ interface BulkResponse<T = string[]> {
859
879
  */
860
880
  interface ReadResult<T = any> {
861
881
  data: T[];
862
- totalCount: number;
882
+ /**
883
+ * Total number of records matching the query.
884
+ * `null` when the count was intentionally skipped (see `QueryParams.count`).
885
+ */
886
+ totalCount: number | null;
863
887
  page?: number;
864
888
  limit?: number;
865
889
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baasix/types",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Shared TypeScript types for Baasix packages",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/src/query.ts CHANGED
@@ -353,6 +353,20 @@ export interface QueryParams<T = unknown> {
353
353
  */
354
354
  relConditions?: Record<string, Filter>;
355
355
 
356
+ /**
357
+ * Whether to compute the total record count for the result.
358
+ *
359
+ * When omitted (`undefined`), the server falls back to the deployment
360
+ * default (env `COUNT_BY_DEFAULT`, which itself defaults to `true`).
361
+ * Passing `false` skips the COUNT query even when the default is on;
362
+ * passing `true` forces it even when the default is off.
363
+ *
364
+ * When the count is skipped, `totalCount` is returned as `null`.
365
+ * When `limit` is `-1` (return all) with no offset, the count is taken
366
+ * from the result length instead of running a separate query.
367
+ */
368
+ count?: boolean;
369
+
356
370
  /**
357
371
  * Additional metadata
358
372
  */
package/src/response.ts CHANGED
@@ -12,7 +12,12 @@
12
12
  */
13
13
  export interface PaginatedResponse<T> {
14
14
  data: T[];
15
- totalCount?: number;
15
+ /**
16
+ * Total number of records matching the query.
17
+ * `null` when the count was intentionally skipped via `count: false`
18
+ * (or the deployment default `COUNT_BY_DEFAULT=false`).
19
+ */
20
+ totalCount?: number | null;
16
21
  page?: number;
17
22
  limit?: number;
18
23
  totalPages?: number;
@@ -55,7 +60,11 @@ export interface BulkResponse<T = string[]> {
55
60
  */
56
61
  export interface ReadResult<T = any> {
57
62
  data: T[];
58
- totalCount: number;
63
+ /**
64
+ * Total number of records matching the query.
65
+ * `null` when the count was intentionally skipped (see `QueryParams.count`).
66
+ */
67
+ totalCount: number | null;
59
68
  page?: number;
60
69
  limit?: number;
61
70
  }
package/src/schema.ts CHANGED
@@ -95,6 +95,8 @@ export interface FieldValues {
95
95
  values?: string[];
96
96
  /** Spatial reference system identifier (for geometry types) */
97
97
  srid?: number;
98
+ /** Vector dimensions (for pgvector types: Vector, HalfVec, SparseVec) */
99
+ dimensions?: number;
98
100
  }
99
101
 
100
102
  /**