@baasix/sdk 0.1.16 → 0.1.18

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/README.md CHANGED
@@ -558,6 +558,7 @@ await baasix.schemas.create({
558
558
  name: 'Product',
559
559
  timestamps: true,
560
560
  paranoid: true, // Soft deletes
561
+ tenantScoped: true, // Tenant-scoped by default; set false for global/shared collections
561
562
  fields: {
562
563
  id: {
563
564
  type: 'UUID',
package/dist/index.cjs CHANGED
@@ -1223,6 +1223,25 @@ var QueryBuilder = class {
1223
1223
  }
1224
1224
  return this;
1225
1225
  }
1226
+ /**
1227
+ * Control whether the total record count is computed for this query.
1228
+ *
1229
+ * Pass `false` to skip the COUNT query (the response `totalCount` will be
1230
+ * `null`) — useful for read-heavy or infinite-scroll lists where the total
1231
+ * isn't needed. Pass `true` to force the count even when the deployment
1232
+ * default (env `COUNT_BY_DEFAULT`) is off. When omitted, the server default
1233
+ * applies.
1234
+ *
1235
+ * @example
1236
+ * ```typescript
1237
+ * // Skip the count for a faster list query
1238
+ * const { data } = await items.filter({ status: { eq: 'active' } }).withCount(false).get();
1239
+ * ```
1240
+ */
1241
+ withCount(enabled = true) {
1242
+ this.queryParams.count = enabled;
1243
+ return this;
1244
+ }
1226
1245
  /**
1227
1246
  * Include soft-deleted items
1228
1247
  *
@@ -1348,6 +1367,9 @@ var QueryBuilder = class {
1348
1367
  if (this.queryParams.groupBy) {
1349
1368
  params.groupBy = this.queryParams.groupBy;
1350
1369
  }
1370
+ if (this.queryParams.count !== void 0) {
1371
+ params.count = this.queryParams.count;
1372
+ }
1351
1373
  return params;
1352
1374
  }
1353
1375
  };
@@ -2091,6 +2113,7 @@ var SchemasModule = class {
2091
2113
  * name: 'Order',
2092
2114
  * timestamps: true,
2093
2115
  * paranoid: true,
2116
+ * tenantScoped: true,
2094
2117
  * fields: {
2095
2118
  * id: {
2096
2119
  * type: 'UUID',