@punks/backend-entity-manager 0.0.236 → 0.0.238
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 +22 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/searchParameters.d.ts +1 -0
- package/dist/cjs/types/integrations/repository/typeorm/clause.d.ts +3 -0
- package/dist/cjs/types/platforms/nest/__test__/server/entities/foos/foo.types.d.ts +1 -0
- package/dist/esm/index.js +23 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/searchParameters.d.ts +1 -0
- package/dist/esm/types/integrations/repository/typeorm/clause.d.ts +3 -0
- package/dist/esm/types/platforms/nest/__test__/server/entities/foos/foo.types.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/package.json +6 -2
package/dist/cjs/index.js
CHANGED
|
@@ -2932,7 +2932,7 @@ class QueryClauseBuilder {
|
|
|
2932
2932
|
clauses.push(typeorm.ILike(filter.eq));
|
|
2933
2933
|
}
|
|
2934
2934
|
if (!backendCore.isNullOrUndefined(filter?.like)) {
|
|
2935
|
-
clauses.push(typeorm.
|
|
2935
|
+
clauses.push(typeorm.ILike(filter.like.replaceAll("*", "%")));
|
|
2936
2936
|
}
|
|
2937
2937
|
if (!backendCore.isNullOrUndefined(filter?.ne)) {
|
|
2938
2938
|
clauses.push(typeorm.Not(typeorm.Equal(filter.ne)));
|
|
@@ -2944,7 +2944,7 @@ class QueryClauseBuilder {
|
|
|
2944
2944
|
clauses.push(typeorm.Not(typeorm.In(filter.notIn)));
|
|
2945
2945
|
}
|
|
2946
2946
|
if (!backendCore.isNullOrUndefined(filter?.notLike)) {
|
|
2947
|
-
clauses.push(typeorm.Not(typeorm.
|
|
2947
|
+
clauses.push(typeorm.Not(typeorm.ILike(filter.notLike.replaceAll("*", "%"))));
|
|
2948
2948
|
}
|
|
2949
2949
|
if (filter?.isNull === true) {
|
|
2950
2950
|
clauses.push(typeorm.IsNull());
|
|
@@ -2968,6 +2968,15 @@ class QueryClauseBuilder {
|
|
|
2968
2968
|
if (!backendCore.isNullOrUndefined(filter?.lt)) {
|
|
2969
2969
|
clauses.push(typeorm.LessThan(filter.lt));
|
|
2970
2970
|
}
|
|
2971
|
+
if (!backendCore.isNullOrUndefined(filter?.in)) {
|
|
2972
|
+
clauses.push(typeorm.In(filter.in ?? []));
|
|
2973
|
+
}
|
|
2974
|
+
if (!backendCore.isNullOrUndefined(filter?.notIn)) {
|
|
2975
|
+
clauses.push(typeorm.Not(typeorm.In(filter.notIn)));
|
|
2976
|
+
}
|
|
2977
|
+
if (!backendCore.isNullOrUndefined(filter?.eq)) {
|
|
2978
|
+
clauses.push(typeorm.Equal(filter.eq));
|
|
2979
|
+
}
|
|
2971
2980
|
if (filter?.isNull === true) {
|
|
2972
2981
|
clauses.push(typeorm.IsNull());
|
|
2973
2982
|
}
|
|
@@ -3012,6 +3021,12 @@ class QueryClauseBuilder {
|
|
|
3012
3021
|
if (filter?.isNull === false) {
|
|
3013
3022
|
clauses.push(typeorm.Not(typeorm.IsNull()));
|
|
3014
3023
|
}
|
|
3024
|
+
if (!backendCore.isNullOrUndefined(filter?.in)) {
|
|
3025
|
+
clauses.push(typeorm.In(filter.in ?? []));
|
|
3026
|
+
}
|
|
3027
|
+
if (!backendCore.isNullOrUndefined(filter?.notIn)) {
|
|
3028
|
+
clauses.push(typeorm.Not(typeorm.In(filter.notIn)));
|
|
3029
|
+
}
|
|
3015
3030
|
return typeorm.And(...clauses);
|
|
3016
3031
|
}
|
|
3017
3032
|
}
|
|
@@ -3097,7 +3112,11 @@ class TypeOrmQueryBuilder extends QueryBuilderBase {
|
|
|
3097
3112
|
const queryResults = await this.countQueryResults(request, context);
|
|
3098
3113
|
const results = await this.findPagedQueryResults(request, context);
|
|
3099
3114
|
const facets = request.options?.includeFacets
|
|
3100
|
-
?
|
|
3115
|
+
? // todo: refactor avoiding to manipulate the request object
|
|
3116
|
+
await this.calculateFacets({
|
|
3117
|
+
...request,
|
|
3118
|
+
filters: request.options.facetsFilters,
|
|
3119
|
+
}, context)
|
|
3101
3120
|
: undefined;
|
|
3102
3121
|
const childrenMap = request.options?.includeChildrenMap
|
|
3103
3122
|
? await this.calculateChildrenMap(results)
|