Skip to content

Releases: chax-at/prisma-filter

4.2.0

27 Feb 13:07

Choose a tag to compare

Added

  • Added support for NestJS 11

4.1.0

14 Jun 14:55

Choose a tag to compare

Added

  • Added a new parameter to DirectFilterPipe, AllFilterPipeUnsafe and FilterParser, allowing you to define a default sort order that is always appended unless the keys are set by the request.

Changed

  • Minimum required node version increased to 18 (which should not be breaking because node 16 is EOL since 2023-09-11)

4.0.0

21 Feb 10:52

Choose a tag to compare

⚠️ Breaking Changes

Added new filter operations. Make sure that both the common-package and the prisma-filter-package in your Frontend and Backend are on version 4.

Added

  • Added ArrayContains, ArrayStartsWith, ArrayEndsWith filters (by @memicmiralem).

3.0.0

14 Oct 23:12

Choose a tag to compare

⚠️ Breaking Changes

Added new filter operations. Make sure that both the common-package and the prisma-filter-package in your Frontend and Backend are on version 3.

Added

  • Added (I)Search, (I)StartsWith, (I)EndsWith, (I)Contains, NotIn, NotInStrings filters.
  • (I)Like is now deprecated, (I)Contains should be used instead to better match the Prisma operation.

2.5.0

15 Jun 23:24

Choose a tag to compare

Added

  • Added support for NestJS 10

2.4.0

06 Jun 09:41

Choose a tag to compare

Fixed

  • Ilike filter now correctly always converts the value to a string (like Like)

Changed

  • FilterBuilder now builds value arrays in the form of filter[0][value][]=13 instead of filter[0][value][0]=13 to save some characters and fix a bug where large arrays might be parsed as objects instead of arrays.

2.3.0

20 Sep 11:27
0f46a4b

Choose a tag to compare

Added

  • Added new FilterBuilder functionality to build a filter using a builder pattern.

Changed

  • Removed source maps to reduce package size.
  • Objects are now created using Object.create(null) as additional hardening against prototype pollutions.

2.2.0

14 Sep 12:30
4177ffa

Choose a tag to compare

⚠️ Important Changes

  • The prisma-filter-common should now be installed in dependencies instead of devDependencies so that the new FilterBuilder can be used.
    • This is not a breaking change, but is important to be able to use new features.

Added

  • Added new FilterBuilder class to prisma-filter-common which provides a buildFilterQueryString method
    to transform a filter into a query string.

2.1.0

18 Jul 13:58

Choose a tag to compare

Added

  • Added support for NestJS 9

2.0.0

19 Apr 13:54

Choose a tag to compare

Breaking Changes

  • The typing of ISingleOrder.field changed from keyof T to keyof T & string.

If you use the recommended file with class-validator, then you have to adapt the SingleFilterOrder class:

export class SingleFilterOrder<T> implements ISingleOrder<T> {
  @IsString()
  field!: keyof T & string;

  @IsIn(['asc', 'desc'])
  dir!: FilterOrder;
}
  • The Like filter is now case-sensitive, use the new Ilike filter instead to keep the old behaviour.
  • The NeqNull filter has been renamed to NeNull.
  • The deprecated IPaginatedDto interface has been removed.

Added

  • New AllFilterPipeUnsafe that allows filtering all model keys without specifying them.
  • Support for booleans in Eq, Ne filters.
  • InStrings, EqString, NeString filters to explicitly filter by string instead of using auto conversion.

Changed

  • Split up Like, Ilike filters.
  • Renamed NeqNull to NeNull to be more consistent.

Removed

  • IPaginatedDto interface.