Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dataui/crud-typeorm

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dataui/crud-typeorm - npm Package Compare versions

Comparing version 5.2.3 to 5.2.4

2

lib/typeorm-crud.service.d.ts

@@ -54,3 +54,3 @@ import { CreateManyDto, CrudRequest, CrudRequestOptions, CrudService, CustomOperators, GetManyDefaultResponse, JoinOption, JoinOptions, QueryOptions } from '@dataui/crud';

protected setSearchCondition(builder: SelectQueryBuilder<T>, search: SCondition, customOperators: CustomOperators, condition?: SConditionKey): void;
protected builderAddBrackets(builder: SelectQueryBuilder<T>, condition: SConditionKey, brackets: Brackets): void;
protected builderAddBrackets(builder: SelectQueryBuilder<T>, condition: SConditionKey, brackets: Brackets, negated?: boolean): void;
protected builderSetWhere(builder: SelectQueryBuilder<T>, condition: SConditionKey, field: string, value: any, customOperators: CustomOperators, operator?: ComparisonOperator): void;

@@ -57,0 +57,0 @@ protected setSearchFieldObjectCondition(builder: SelectQueryBuilder<T>, condition: SConditionKey, field: string, object: any, customOperators: CustomOperators): void;

@@ -400,3 +400,10 @@ "use strict";

if (keys.length) {
if (crud_util_1.isArrayFull(search.$and)) {
if (crud_util_1.isArrayFull(search.$not)) {
this.builderAddBrackets(builder, condition, new typeorm_1.Brackets((qb) => {
search.$not.forEach((item) => {
this.setSearchCondition(qb, item, customOperators, '$and');
});
}), true);
}
else if (crud_util_1.isArrayFull(search.$and)) {
if (search.$and.length === 1) {

@@ -482,4 +489,28 @@ this.setSearchCondition(builder, search.$and[0], customOperators, condition);

}
builderAddBrackets(builder, condition, brackets) {
if (condition === '$and') {
builderAddBrackets(builder, condition, brackets, negated = false) {
if (negated) {
const whereQueryBuilder = builder.createQueryBuilder();
whereQueryBuilder.parentQueryBuilder = builder;
whereQueryBuilder.expressionMap.mainAlias = builder.expressionMap.mainAlias;
whereQueryBuilder.expressionMap.aliasNamePrefixingEnabled =
builder.expressionMap.aliasNamePrefixingEnabled;
whereQueryBuilder.expressionMap.parameters = builder.expressionMap.parameters;
whereQueryBuilder.expressionMap.nativeParameters =
builder.expressionMap.nativeParameters;
whereQueryBuilder.expressionMap.wheres = [];
brackets.whereFactory(whereQueryBuilder);
const wheres = {
operator: 'brackets',
condition: whereQueryBuilder.expressionMap.wheres,
};
const type = condition === '$and' ? 'and' : condition === '$or' ? 'or' : 'simple';
builder.expressionMap.wheres.push({
type,
condition: {
operator: 'not',
condition: wheres,
},
});
}
else if (condition === '$and') {
builder.andWhere(brackets);

@@ -486,0 +517,0 @@ }

{
"name": "@dataui/crud-typeorm",
"description": "NestJs CRUD for RESTful APIs - TypeORM",
"version": "5.2.3",
"version": "5.2.4",
"license": "MIT",

@@ -45,3 +45,3 @@ "main": "lib/index.js",

},
"gitHead": "25b0f851a96305c0dbe8cb91cb9e88ad9284e63c"
"gitHead": "6d86d565bdc1286689c7f840e37fbf38b51a29a3"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc