connectfy-shared 0.0.76 → 0.0.78

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 CHANGED
@@ -11485,7 +11485,16 @@ var BaseRepository = class {
11485
11485
  skip = 0,
11486
11486
  limit = 10
11487
11487
  } = params;
11488
- return await this.model.findOne(query).select(fields).skip(skip).limit(limit).sort(sort).populate(populate).lean().exec();
11488
+ return await this.model.find(query).select(fields).skip(skip).limit(limit).sort(sort).populate(populate).lean().exec();
11489
+ }
11490
+ async findAll(params = {}) {
11491
+ const {
11492
+ query = {},
11493
+ fields = "",
11494
+ sort = { createdAt: -1 },
11495
+ populate = []
11496
+ } = params;
11497
+ return await this.model.find(query).select(fields).sort(sort).populate(populate).lean().exec();
11489
11498
  }
11490
11499
  // ================================================
11491
11500
  // EXIST AND COUNT FUNCTIONS
package/dist/index.d.cts CHANGED
@@ -783,6 +783,7 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
783
783
  findOneById(_id: string, params?: BaseFindDto): Promise<TInterface | null>;
784
784
  findOneByUserId(userId: string, params?: BaseFindDto): Promise<TInterface | null>;
785
785
  findMany(params?: BaseFindDto): Promise<TInterface[]>;
786
+ findAll(params?: BaseFindDto): Promise<TInterface[]>;
786
787
  existsByField(query: Record<string, any>): Promise<boolean>;
787
788
  count(query: Record<string, any>): Promise<number>;
788
789
  }
package/dist/index.d.ts CHANGED
@@ -783,6 +783,7 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
783
783
  findOneById(_id: string, params?: BaseFindDto): Promise<TInterface | null>;
784
784
  findOneByUserId(userId: string, params?: BaseFindDto): Promise<TInterface | null>;
785
785
  findMany(params?: BaseFindDto): Promise<TInterface[]>;
786
+ findAll(params?: BaseFindDto): Promise<TInterface[]>;
786
787
  existsByField(query: Record<string, any>): Promise<boolean>;
787
788
  count(query: Record<string, any>): Promise<number>;
788
789
  }
package/dist/index.mjs CHANGED
@@ -11443,7 +11443,16 @@ var BaseRepository = class {
11443
11443
  skip = 0,
11444
11444
  limit = 10
11445
11445
  } = params;
11446
- return await this.model.findOne(query).select(fields).skip(skip).limit(limit).sort(sort).populate(populate).lean().exec();
11446
+ return await this.model.find(query).select(fields).skip(skip).limit(limit).sort(sort).populate(populate).lean().exec();
11447
+ }
11448
+ async findAll(params = {}) {
11449
+ const {
11450
+ query = {},
11451
+ fields = "",
11452
+ sort = { createdAt: -1 },
11453
+ populate = []
11454
+ } = params;
11455
+ return await this.model.find(query).select(fields).sort(sort).populate(populate).lean().exec();
11447
11456
  }
11448
11457
  // ================================================
11449
11458
  // EXIST AND COUNT FUNCTIONS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectfy-shared",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {