@punks/backend-entity-manager 0.0.400 → 0.0.401
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/cjs/index.js +5 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/integrations/repository/typeorm/repository.d.ts +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/integrations/repository/typeorm/repository.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ export declare class TypeOrmRepository<TEntity extends ObjectLiteral, TEntityId>
|
|
|
18
18
|
all(): Promise<TEntity[]>;
|
|
19
19
|
count(condition: FindManyOptions<TEntity>): Promise<number>;
|
|
20
20
|
find(condition: FindManyOptions<TEntity>): Promise<TEntity[]>;
|
|
21
|
+
findOne(condition: FindManyOptions<TEntity>): Promise<TEntity>;
|
|
21
22
|
findById(id: TEntityId[]): Promise<TEntity[]>;
|
|
22
23
|
delete(id: TEntityId): Promise<void>;
|
|
23
24
|
deleteBy(condition: DeleteCriteria<TEntity>): Promise<IEntitiesDeleteResult>;
|
package/dist/esm/index.js
CHANGED
|
@@ -4035,6 +4035,11 @@ class TypeOrmRepository {
|
|
|
4035
4035
|
this.logger.debug("Finding entities by condition", { condition });
|
|
4036
4036
|
return await this.innerRepository.find(condition);
|
|
4037
4037
|
}
|
|
4038
|
+
async findOne(condition) {
|
|
4039
|
+
this.logger.debug("Finding entity by condition", { condition });
|
|
4040
|
+
const items = await this.innerRepository.find(condition);
|
|
4041
|
+
return items[0];
|
|
4042
|
+
}
|
|
4038
4043
|
async findById(id) {
|
|
4039
4044
|
this.logger.debug("Finding entities by id", { id });
|
|
4040
4045
|
return await this.innerRepository.findBy({
|