@ackplus/nest-crud-request 0.0.15 → 0.0.16
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 +1 -1
- package/src/lib/query-builder.d.ts +6 -0
- package/src/lib/query-builder.js +12 -0
- package/src/lib/types.d.ts +3 -0
package/package.json
CHANGED
|
@@ -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
|
}
|
package/src/lib/query-builder.js
CHANGED
|
@@ -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()) {
|
package/src/lib/types.d.ts
CHANGED
|
@@ -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",
|