@ackplus/nest-crud-request 0.0.15 → 0.0.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ackplus/nest-crud-request",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -18,13 +18,19 @@ export declare class QueryBuilder {
18
18
  removeOrder(orderBy: string): this;
19
19
  setSkip(skip: number): this;
20
20
  setTake(take: number): this;
21
+ setWithDeleted(withDeleted: boolean): this;
22
+ setOnlyDeleted(onlyDeleted: boolean): this;
23
+ set(key: string, value: any): this;
21
24
  toObject(): {
25
+ [x: string]: any;
22
26
  select?: string[];
23
27
  relations?: string[] | import("./types").Relation[];
24
28
  where?: Record<string, any>;
25
29
  order?: Record<string, OrderDirectionEnum>;
26
30
  skip?: number;
27
31
  take?: number;
32
+ withDeleted?: boolean;
33
+ onlyDeleted?: boolean;
28
34
  };
29
35
  toJson(): string;
30
36
  }
@@ -93,6 +93,18 @@ class QueryBuilder {
93
93
  this.options.take = take;
94
94
  return this;
95
95
  }
96
+ setWithDeleted(withDeleted) {
97
+ this.options.withDeleted = withDeleted;
98
+ return this;
99
+ }
100
+ setOnlyDeleted(onlyDeleted) {
101
+ this.options.onlyDeleted = onlyDeleted;
102
+ return this;
103
+ }
104
+ set(key, value) {
105
+ this.options[key] = value;
106
+ return this;
107
+ }
96
108
  toObject() {
97
109
  const options = Object.assign({}, this.options);
98
110
  if (this.whereBuilder.hasConditions()) {
@@ -24,7 +24,7 @@ class RelationBuilder {
24
24
  this.add(relations);
25
25
  }
26
26
  else {
27
- this.relations = relations || {};
27
+ this.relations = relations;
28
28
  }
29
29
  }
30
30
  return this;
@@ -1,10 +1,13 @@
1
1
  export interface QueryBuilderOptions {
2
+ [key: string]: any;
2
3
  select?: string[];
3
4
  relations?: string[] | Relation[];
4
5
  where?: Record<string, any>;
5
6
  order?: Record<string, OrderDirectionEnum>;
6
7
  skip?: number;
7
8
  take?: number;
9
+ withDeleted?: boolean;
10
+ onlyDeleted?: boolean;
8
11
  }
9
12
  export declare enum WhereLogicalOperatorEnum {
10
13
  AND = "$and",