@onivoro/server-typeorm-postgres 0.1.29 → 0.1.31

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.
@@ -12,6 +12,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
12
12
  postOne(body: Partial<TEntity>): Promise<TEntity>;
13
13
  postMany(body: Partial<TEntity>[]): Promise<TEntity[]>;
14
14
  delete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
+ softDelete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
16
  put(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
16
17
  patch(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
17
18
  protected get repo(): import("typeorm").Repository<import("typeorm").ObjectLiteral>;
@@ -33,11 +33,11 @@ class TypeOrmRepository {
33
33
  async delete(options) {
34
34
  return await this.repo.delete(options);
35
35
  }
36
+ async softDelete(options) {
37
+ return await this.repo.softDelete(options);
38
+ }
36
39
  async put(options, body) {
37
- // await this.repo.save(options, body); <= this doesn't do what i expected,
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
40
- await this.patch(options, body);
40
+ await this.repo.save(options, body);
41
41
  }
42
42
  async patch(options, body) {
43
43
  await this.repo.update(options, body);
@@ -12,6 +12,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
12
12
  postOne(body: Partial<TEntity>): Promise<TEntity>;
13
13
  postMany(body: Partial<TEntity>[]): Promise<TEntity[]>;
14
14
  delete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
+ softDelete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
16
  put(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
16
17
  patch(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
17
18
  protected get repo(): import("typeorm").Repository<import("typeorm").ObjectLiteral>;
@@ -33,11 +33,11 @@ class TypeOrmRepository {
33
33
  async delete(options) {
34
34
  return await this.repo.delete(options);
35
35
  }
36
+ async softDelete(options) {
37
+ return await this.repo.softDelete(options);
38
+ }
36
39
  async put(options, body) {
37
- // await this.repo.save(options, body); <= this doesn't do what i expected,
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
40
- await this.patch(options, body);
40
+ await this.repo.save(options, body);
41
41
  }
42
42
  async patch(options, body) {
43
43
  await this.repo.update(options, body);
@@ -12,6 +12,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
12
12
  postOne(body: Partial<TEntity>): Promise<TEntity>;
13
13
  postMany(body: Partial<TEntity>[]): Promise<TEntity[]>;
14
14
  delete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
+ softDelete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
16
  put(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
16
17
  patch(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
17
18
  protected get repo(): import("typeorm").Repository<import("typeorm").ObjectLiteral>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/server-typeorm-postgres",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/onivoro/server-typeorm-postgres.git"
6
6
  },