@punks/backend-entity-manager 0.0.493 → 0.0.495

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 CHANGED
@@ -3714,6 +3714,12 @@ class QueryClauseBuilder {
3714
3714
  if (filter?.isNull === false) {
3715
3715
  clauses.push(typeorm.Not(typeorm.IsNull()));
3716
3716
  }
3717
+ if (filter?.isEmpty === true) {
3718
+ clauses.push(typeorm.Raw((alias) => `TRIM(${alias}) IS NULL OR TRIM(${alias}) = ''`));
3719
+ }
3720
+ if (filter?.isEmpty === false) {
3721
+ clauses.push(typeorm.Raw((alias) => `TRIM(${alias}) IS NOT NULL AND TRIM(${alias}) <> ''`));
3722
+ }
3717
3723
  return typeorm.And(...clauses);
3718
3724
  }
3719
3725
  stringListFilter(filter) {
@@ -41156,6 +41162,14 @@ const fieldRequiredValidator = (item, selector) => {
41156
41162
  validationErrors: value ? [] : [{ errorCode: "required" }],
41157
41163
  };
41158
41164
  };
41165
+ const fieldNumericValidator = (item, selector, params) => {
41166
+ const value = selector(item);
41167
+ const isInvalid = value && !isNaN(value);
41168
+ return {
41169
+ isValid: !isInvalid,
41170
+ validationErrors: isInvalid ? [{ errorCode: "notNumeric" }] : [],
41171
+ };
41172
+ };
41159
41173
  const fieldTextValidator = (item, selector, params) => {
41160
41174
  const value = selector(item);
41161
41175
  const values = Array.isArray(value)
@@ -45527,6 +45541,7 @@ exports.buildRolesGuard = buildRolesGuard;
45527
45541
  exports.createContainer = createContainer;
45528
45542
  exports.createExpressFileResponse = createExpressFileResponse;
45529
45543
  exports.fieldEmailValidator = fieldEmailValidator;
45544
+ exports.fieldNumericValidator = fieldNumericValidator;
45530
45545
  exports.fieldOptionValidator = fieldOptionValidator;
45531
45546
  exports.fieldOptionsValidator = fieldOptionsValidator;
45532
45547
  exports.fieldRequiredValidator = fieldRequiredValidator;