@sdflc/backend-helpers 1.0.73 → 1.0.75

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.
@@ -28,7 +28,7 @@ declare class BaseGateway {
28
28
  getIdField(): string;
29
29
  get(id: any): Promise<any>;
30
30
  getMany(ids: any[]): Promise<any>;
31
- buildListQuery(args?: BuildListQueryArgsInterface): any;
31
+ buildListQuery(args?: BuildListQueryArgsInterface): Promise<any>;
32
32
  list(args?: ListArgsInterface): Promise<any>;
33
33
  create(args: any): Promise<any[]>;
34
34
  update(where: any, params: any): Promise<any>;
@@ -294,10 +294,12 @@ class BaseGateway {
294
294
  });
295
295
  }
296
296
  buildListQuery(args) {
297
- const { fieldsToUse } = args || {};
298
- const query = this.getBuilder();
299
- query.select(fieldsToUse);
300
- return query;
297
+ return __awaiter(this, void 0, void 0, function* () {
298
+ const { fieldsToUse } = args || {};
299
+ const query = this.getBuilder();
300
+ query.select(fieldsToUse);
301
+ return { query };
302
+ });
301
303
  }
302
304
  list(args) {
303
305
  return __awaiter(this, void 0, void 0, function* () {
@@ -308,7 +310,7 @@ class BaseGateway {
308
310
  }
309
311
  const shouldUseCache = useCache != null ? useCache : !this.config.noCache;
310
312
  const fieldsToUse = !shouldUseCache && Array.isArray(this.config.selectFields) ? this.config.selectFields : this.getIdField();
311
- const query = this.buildListQuery({ filter, params, fieldsToUse, useCache: shouldUseCache });
313
+ const { query } = yield this.buildListQuery({ filter, params, fieldsToUse, useCache: shouldUseCache });
312
314
  yield this.onListFilter(query, filter);
313
315
  if (limit && !isNaN(limit) && limit > 0) {
314
316
  query.offset(offset).limit(limit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdflc/backend-helpers",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "description": "Set of helper functions and classes to simplify building backend apps within @sdflc ecosystem",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",