c2-mongoose 2.1.38 → 2.1.39

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.
@@ -15,7 +15,7 @@ declare class CrudFlow<D> {
15
15
  getOne(model: D, params?: any): Promise<D>;
16
16
  get(id: string, pop?: string, sel?: string, session?: ClientSession): Promise<D>;
17
17
  getById(id: string, session?: ClientSession): Promise<Partial<D>>;
18
- sumBy(fieldToSum: any, fieldToGroup: any, addToSet?: any): Promise<any>;
18
+ sumBy(fieldToSum: any, fieldToGroup: any, addToSet?: any, session?: ClientSession): Promise<any>;
19
19
  sumByAndPaging(fieldToSum: any, fieldToGroup: any, addToSet?: any): Promise<SearchResponse<any>>;
20
20
  }
21
21
  export default CrudFlow;
@@ -169,11 +169,11 @@ var CrudFlow = /** @class */ (function () {
169
169
  });
170
170
  });
171
171
  };
172
- CrudFlow.prototype.sumBy = function (fieldToSum, fieldToGroup, addToSet) {
172
+ CrudFlow.prototype.sumBy = function (fieldToSum, fieldToGroup, addToSet, session) {
173
173
  return __awaiter(this, void 0, void 0, function () {
174
174
  return __generator(this, function (_a) {
175
175
  switch (_a.label) {
176
- case 0: return [4 /*yield*/, this.search.sumBy(this.repository, fieldToSum, fieldToGroup, addToSet)];
176
+ case 0: return [4 /*yield*/, this.search.sumBy(this.repository, fieldToSum, fieldToGroup, addToSet, session)];
177
177
  case 1: return [2 /*return*/, _a.sent()];
178
178
  }
179
179
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.38",
3
+ "version": "2.1.39",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -65,8 +65,8 @@ class CrudFlow<D> {
65
65
  return data as D
66
66
  }
67
67
 
68
- public async sumBy(fieldToSum: any, fieldToGroup: any, addToSet?: any): Promise<any> {
69
- return await this.search.sumBy(this.repository, fieldToSum, fieldToGroup, addToSet)
68
+ public async sumBy(fieldToSum: any, fieldToGroup: any, addToSet?: any, session?: ClientSession): Promise<any> {
69
+ return await this.search.sumBy(this.repository, fieldToSum, fieldToGroup, addToSet, session)
70
70
  }
71
71
 
72
72
  public async sumByAndPaging(fieldToSum: any, fieldToGroup: any, addToSet?: any): Promise<SearchResponse<any>> {