@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.
- package/build/BaseGateway.d.ts +1 -1
- package/build/BaseGateway.js +7 -5
- package/package.json +1 -1
package/build/BaseGateway.d.ts
CHANGED
|
@@ -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>;
|
package/build/BaseGateway.js
CHANGED
|
@@ -294,10 +294,12 @@ class BaseGateway {
|
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
buildListQuery(args) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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