@punks/backend-entity-manager 0.0.361 → 0.0.362
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 +10 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/integrations/repository/typeorm/clause.d.ts +6 -0
- package/dist/cjs/types/integrations/repository/typeorm/queryClauseBuilder.d.ts +2 -1
- package/dist/esm/index.js +11 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/integrations/repository/typeorm/clause.d.ts +6 -0
- package/dist/esm/types/integrations/repository/typeorm/queryClauseBuilder.d.ts +2 -1
- package/dist/index.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FindOperator } from "typeorm";
|
|
2
|
-
import { BooleanFilter, DateFilter, EnumFilter, IdFilter, NumericFilter, StringFilter } from "./clause";
|
|
2
|
+
import { BooleanFilter, DateFilter, EnumFilter, IdFilter, NumericFilter, StringFilter, StringListFilter } from "./clause";
|
|
3
3
|
export declare class QueryClauseBuilder {
|
|
4
4
|
enumFilter<T>(filter: EnumFilter<T>): FindOperator<T>;
|
|
5
5
|
idFilter(filter: IdFilter): FindOperator<string>;
|
|
6
6
|
stringFilter(filter: StringFilter): FindOperator<string>;
|
|
7
|
+
stringListFilter(filter: StringListFilter): FindOperator<string>;
|
|
7
8
|
numericFilter(filter: NumericFilter): FindOperator<number>;
|
|
8
9
|
dateFilter(filter: DateFilter): FindOperator<Date>;
|
|
9
10
|
boolFilter(filter: BooleanFilter): FindOperator<boolean>;
|
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Log, csvParse, excelParse, excelBuild, csvBuild, mapAsync, isNullOrUnde
|
|
|
2
2
|
import { QueryCommand, ScanCommand, GetItemCommand, PutItemCommand, DeleteItemCommand, DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
3
3
|
import { unmarshall, marshall } from '@aws-sdk/util-dynamodb';
|
|
4
4
|
import { Module, applyDecorators, Injectable, SetMetadata, createParamDecorator, Global, Scope, Inject, Logger, StreamableFile, HttpException, HttpStatus } from '@nestjs/common';
|
|
5
|
-
import { MoreThanOrEqual, Equal, Not, IsNull, And, MoreThan, LessThanOrEqual, LessThan, ILike, In, Or, Repository } from 'typeorm';
|
|
5
|
+
import { MoreThanOrEqual, Equal, Not, IsNull, And, MoreThan, LessThanOrEqual, LessThan, ILike, Like, In, Or, Repository } from 'typeorm';
|
|
6
6
|
import { Reflector } from '@nestjs/core';
|
|
7
7
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
8
8
|
import { hash } from 'bcrypt';
|
|
@@ -3566,6 +3566,16 @@ class QueryClauseBuilder {
|
|
|
3566
3566
|
}
|
|
3567
3567
|
return And(...clauses);
|
|
3568
3568
|
}
|
|
3569
|
+
stringListFilter(filter) {
|
|
3570
|
+
const clauses = [];
|
|
3571
|
+
if (!isNullOrUndefined(filter?.contains)) {
|
|
3572
|
+
clauses.push(Like(`%${filter.contains}%`));
|
|
3573
|
+
}
|
|
3574
|
+
if (!isNullOrUndefined(filter?.iContains)) {
|
|
3575
|
+
clauses.push(ILike(`%${filter.iContains}%`));
|
|
3576
|
+
}
|
|
3577
|
+
return And(...clauses);
|
|
3578
|
+
}
|
|
3569
3579
|
numericFilter(filter) {
|
|
3570
3580
|
const clauses = [];
|
|
3571
3581
|
if (!isNullOrUndefined(filter?.gte)) {
|