@punks/backend-entity-manager 0.0.492 → 0.0.494

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.
@@ -22,6 +22,7 @@ export type StringFilter = {
22
22
  notIn?: string[];
23
23
  notLike?: string;
24
24
  isNull?: boolean;
25
+ isEmpty?: boolean;
25
26
  };
26
27
  export type IdFilter = {
27
28
  in?: string[];
package/dist/esm/index.js CHANGED
@@ -2,7 +2,7 @@ import { Log, csvParse, excelParse, ExcelKeyTransform, excelBuild, csvBuild, map
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, IsNull, And, Equal, Not, MoreThan, LessThanOrEqual, LessThan, ILike, Like, Between, In, Or, Repository } from 'typeorm';
5
+ import { MoreThanOrEqual, IsNull, And, Equal, Not, MoreThan, LessThanOrEqual, LessThan, ILike, Raw, Like, Between, 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';
@@ -3457,6 +3457,7 @@ class PipelineInstance {
3457
3457
  async executeStep(step, input, state) {
3458
3458
  const preconditionResult = await this.validateStepPrecondition(step, input, state);
3459
3459
  if (!preconditionResult.hasValidPrecondition) {
3460
+ this.logger.error(`[VALIDATION ERROR] | Step ${step.name} failed for invalid precondition`);
3460
3461
  return {
3461
3462
  operationResults: [],
3462
3463
  type: "error",
@@ -3509,7 +3510,7 @@ class PipelineInstance {
3509
3510
  };
3510
3511
  }
3511
3512
  catch (error) {
3512
- this.logger.exception(`Pipeline operation error -> operation:${operation.name}`, error, {
3513
+ this.logger.exception(`[OPERATION ERROR] -> operation:${operation.name}`, error, {
3513
3514
  input,
3514
3515
  });
3515
3516
  return {
@@ -3698,6 +3699,12 @@ class QueryClauseBuilder {
3698
3699
  if (filter?.isNull === false) {
3699
3700
  clauses.push(Not(IsNull()));
3700
3701
  }
3702
+ if (filter?.isEmpty === true) {
3703
+ clauses.push(Raw((alias) => `TRIM(${alias}) IS NULL OR TRIM(${alias}) = ''`));
3704
+ }
3705
+ if (filter?.isEmpty === false) {
3706
+ clauses.push(Raw((alias) => `TRIM(${alias}) IS NOT NULL AND TRIM(${alias}) <> ''`));
3707
+ }
3701
3708
  return And(...clauses);
3702
3709
  }
3703
3710
  stringListFilter(filter) {
@@ -35678,7 +35685,7 @@ class NestPipelineTemplate {
35678
35685
  };
35679
35686
  this.logger.debug(`[START] | ${this.metadata.name}`, this.processLogMetadata(logMetadata));
35680
35687
  if (!this.isAuthorized(data.context)) {
35681
- this.logger.debug(`[ERROR] | ${this.metadata.name} -> Unauthorized`, this.processLogMetadata(logMetadata));
35688
+ this.logger.debug(`[UNAUTHORIZED] | ${this.metadata.name} -> Unauthorized`, this.processLogMetadata(logMetadata));
35682
35689
  return {
35683
35690
  type: "error",
35684
35691
  errorType: PipelineErrorType.Unauthorized,