@baasix/sdk 0.1.17 → 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.cjs +22 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/items.cjs +22 -0
- package/dist/modules/items.cjs.map +1 -1
- package/dist/modules/items.d.cts +16 -0
- package/dist/modules/items.d.ts +16 -0
- package/dist/modules/items.js +22 -0
- package/dist/modules/items.js.map +1 -1
- package/package.json +2 -2
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
|
};
|