@onivoro/server-typeorm-postgres 0.1.25 → 0.1.26
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/lib/classes/type-orm-repository.class.d.ts +1 -0
- package/dist/cjs/lib/classes/type-orm-repository.class.js +4 -0
- package/dist/esm/lib/classes/type-orm-repository.class.d.ts +1 -0
- package/dist/esm/lib/classes/type-orm-repository.class.js +4 -0
- package/dist/types/lib/classes/type-orm-repository.class.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
|
|
|
5
5
|
private entityType;
|
|
6
6
|
entityManager: EntityManager;
|
|
7
7
|
constructor(entityType: any, entityManager: EntityManager);
|
|
8
|
+
withEntityManager(entityManager: EntityManager): TypeOrmRepository<TEntity>;
|
|
8
9
|
getMany(options: FindManyOptions<TEntity>): Promise<TEntity[]>;
|
|
9
10
|
getManyAndCount(options: FindManyOptions<TEntity>): Promise<[TEntity[], number]>;
|
|
10
11
|
getOne(options: FindOneOptions<TEntity>): Promise<TEntity>;
|
|
@@ -8,6 +8,9 @@ class TypeOrmRepository {
|
|
|
8
8
|
this.entityType = entityType;
|
|
9
9
|
this.entityManager = entityManager;
|
|
10
10
|
}
|
|
11
|
+
withEntityManager(entityManager) {
|
|
12
|
+
return { ...this, entityManager };
|
|
13
|
+
}
|
|
11
14
|
async getMany(options) {
|
|
12
15
|
return await this.repo.find(options);
|
|
13
16
|
}
|
|
@@ -33,6 +36,7 @@ class TypeOrmRepository {
|
|
|
33
36
|
async put(options, body) {
|
|
34
37
|
// await this.repo.save(options, body); <= this doesn't do what i expected,
|
|
35
38
|
// so just call patch instead
|
|
39
|
+
// ... buuuuuuuut we should actually change this and adhere more closely to http verb semantics so that PUT is a wholesale replacment of everything but the primary key and PATCH is this current behavior
|
|
36
40
|
await this.patch(options, body);
|
|
37
41
|
}
|
|
38
42
|
async patch(options, body) {
|
|
@@ -5,6 +5,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
|
|
|
5
5
|
private entityType;
|
|
6
6
|
entityManager: EntityManager;
|
|
7
7
|
constructor(entityType: any, entityManager: EntityManager);
|
|
8
|
+
withEntityManager(entityManager: EntityManager): TypeOrmRepository<TEntity>;
|
|
8
9
|
getMany(options: FindManyOptions<TEntity>): Promise<TEntity[]>;
|
|
9
10
|
getManyAndCount(options: FindManyOptions<TEntity>): Promise<[TEntity[], number]>;
|
|
10
11
|
getOne(options: FindOneOptions<TEntity>): Promise<TEntity>;
|
|
@@ -8,6 +8,9 @@ class TypeOrmRepository {
|
|
|
8
8
|
this.entityType = entityType;
|
|
9
9
|
this.entityManager = entityManager;
|
|
10
10
|
}
|
|
11
|
+
withEntityManager(entityManager) {
|
|
12
|
+
return { ...this, entityManager };
|
|
13
|
+
}
|
|
11
14
|
async getMany(options) {
|
|
12
15
|
return await this.repo.find(options);
|
|
13
16
|
}
|
|
@@ -33,6 +36,7 @@ class TypeOrmRepository {
|
|
|
33
36
|
async put(options, body) {
|
|
34
37
|
// await this.repo.save(options, body); <= this doesn't do what i expected,
|
|
35
38
|
// so just call patch instead
|
|
39
|
+
// ... buuuuuuuut we should actually change this and adhere more closely to http verb semantics so that PUT is a wholesale replacment of everything but the primary key and PATCH is this current behavior
|
|
36
40
|
await this.patch(options, body);
|
|
37
41
|
}
|
|
38
42
|
async patch(options, body) {
|
|
@@ -5,6 +5,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
|
|
|
5
5
|
private entityType;
|
|
6
6
|
entityManager: EntityManager;
|
|
7
7
|
constructor(entityType: any, entityManager: EntityManager);
|
|
8
|
+
withEntityManager(entityManager: EntityManager): TypeOrmRepository<TEntity>;
|
|
8
9
|
getMany(options: FindManyOptions<TEntity>): Promise<TEntity[]>;
|
|
9
10
|
getManyAndCount(options: FindManyOptions<TEntity>): Promise<[TEntity[], number]>;
|
|
10
11
|
getOne(options: FindOneOptions<TEntity>): Promise<TEntity>;
|