@vasrefil/api-toolkit 1.0.57 → 1.0.58

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,6 +15,7 @@ export declare class RootController {
15
15
  fetchAllWithPagination: (conditon: object, query?: FetchAllQuery, select?: string | object, populate?: ModelPopulateI[]) => Promise<FetchWithPaginationDataI>;
16
16
  getOneP: (condition: object, select?: any) => Promise<any>;
17
17
  getOne(condition: any, select?: any, populate?: any): import("mongoose").Query<any, any, {}, any>;
18
+ getOneSes(condition: any, session: ClientSession, select?: any, populate?: any): import("mongoose").Query<any, any, {}, any>;
18
19
  getOnePSes: (condition: object, session: ClientSession, select?: string) => Promise<any>;
19
20
  getById: (id: string, select?: string | object) => Promise<any>;
20
21
  getByIdSes: (id: string, session: ClientSession, select?: object | string) => Promise<any>;
@@ -152,6 +152,14 @@ class RootController {
152
152
  }
153
153
  return (this.model.findOne(cond).select(select).populate(populate).lean());
154
154
  }
155
+ getOneSes(condition, session, select, populate) {
156
+ select = select ? select : '';
157
+ let cond = condition;
158
+ if (this.modelName === 'User') {
159
+ cond = { is_deleted: false, ...condition };
160
+ }
161
+ return (this.model.findOne(cond).select(select).populate(populate).session(session).lean());
162
+ }
155
163
  updateOne(condition, updateValues) {
156
164
  return this.model.updateOne({ ...condition }, { ...updateValues }, { new: true });
157
165
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vasrefil/api-toolkit",
3
3
  "description": "This is Vasrefil API toolkit",
4
- "version": "1.0.57",
4
+ "version": "1.0.58",
5
5
  "author": "Sodiq Alabi",
6
6
  "main": "dist/public-api.js",
7
7
  "types": "dist/public-api.d.ts",