@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/dist/index.js CHANGED
@@ -1221,6 +1221,25 @@ var QueryBuilder = class {
1221
1221
  }
1222
1222
  return this;
1223
1223
  }
1224
+ /**
1225
+ * Control whether the total record count is computed for this query.
1226
+ *
1227
+ * Pass `false` to skip the COUNT query (the response `totalCount` will be
1228
+ * `null`) — useful for read-heavy or infinite-scroll lists where the total
1229
+ * isn't needed. Pass `true` to force the count even when the deployment
1230
+ * default (env `COUNT_BY_DEFAULT`) is off. When omitted, the server default
1231
+ * applies.
1232
+ *
1233
+ * @example
1234
+ * ```typescript
1235
+ * // Skip the count for a faster list query
1236
+ * const { data } = await items.filter({ status: { eq: 'active' } }).withCount(false).get();
1237
+ * ```
1238
+ */
1239
+ withCount(enabled = true) {
1240
+ this.queryParams.count = enabled;
1241
+ return this;
1242
+ }
1224
1243
  /**
1225
1244
  * Include soft-deleted items
1226
1245
  *
@@ -1346,6 +1365,9 @@ var QueryBuilder = class {
1346
1365
  if (this.queryParams.groupBy) {
1347
1366
  params.groupBy = this.queryParams.groupBy;
1348
1367
  }
1368
+ if (this.queryParams.count !== void 0) {
1369
+ params.count = this.queryParams.count;
1370
+ }
1349
1371
  return params;
1350
1372
  }
1351
1373
  };
@@ -2089,6 +2111,7 @@ var SchemasModule = class {
2089
2111
  * name: 'Order',
2090
2112
  * timestamps: true,
2091
2113
  * paranoid: true,
2114
+ * tenantScoped: true,
2092
2115
  * fields: {
2093
2116
  * id: {
2094
2117
  * type: 'UUID',