mit einem Klick
nestjs-filter
nestjs-filter enthält 6 gesammelte Skills von DavideCarvalho, mit Repository-Berufsabdeckung und Skill-Detailseiten auf SkillsMP.
Skills in diesem Repository
Lock down and test a public @dudousxd/nestjs-filter endpoint. Covers the @Filterable allowed whitelist (including per-field operator restriction { field, operators }), the blocked blacklist, throwOnInvalid (reject vs silently drop bad sort/distinct/where columns), onUnknownKey ('ignore' | 'warn' | 'throw'), validation ('auto' | 'off') with class-validator, @TenantScoped(field) auto-scoping plus this.tenantId() / this.currentUserRef(), defaultSort for stable ordering, FilterExceptionFilter for 400 responses, and unit testing with FilterTestingModule + makeMockQueryBuilder. Use when exposing a filter to untrusted clients, preventing arbitrary-column probing, scoping rows per tenant/user, or writing filter tests.
Build filter requests on the browser/Node client with @dudousxd/nestjs-filter-client. Covers filterQuery() chaining — where(field, op, value), the where(field, value) shorthand (scalar auto-equals, array auto-in), convenience methods (equals/contains/in/between/gte/ isNull...), accumulating add() for ranges, or()/and() groups, set()/include()/search()/ sort()/page() envelope keys, and the .build() result { filter: { where: [...] }, ... } plus .toQueryString() / .toFlatObject(). Also covers filterQueryTyped<Fields, Types>() for compile-time field/operator/value checking. Use when constructing a filter payload from a frontend, serializing to a GET query string, or typing a query against known entity fields.
Build and wire a NestJS filter class with @dudousxd/nestjs-filter. Covers @Filterable({ entity }), @FilterFor(key) methods, the BaseFilter request-scoped getters this.$query / this.$input / this.$context, FilterModule.forRoot and FilterModule.forFeature wiring with an ORM adapter module, the @ApplyFilter() controller param decorator (auto query/body source), and programmatic FilterRunner.apply(). Use when defining a filter, registering FilterModule, injecting a built query builder, or fixing FilterStateUnavailableException / FilterNotRegisteredException / FilterMissingAdapterException.
Use the structured request envelope and dynamic API of @dudousxd/nestjs-filter. Covers the one-request shape { filter, where, sort, include, search, distinct, select, paginate }, ColumnFilter[] operator trees (equals/contains/gte/in/between with AND/OR), auto-fields (input keys matching real entity columns applied without @FilterFor), and the class-less FilterRunner API: applyDynamic(entity, input, qb), findAndCount(entity, input) for pagination-safe to-many loading, findPage(entity, input) for keyset cursor pagination, and describe(entity) for a metadata field/relation map. Use when building admin/generic list endpoints, sorting, paginating, eager-loading relations, or full-text search.
Wire @dudousxd/nestjs-filter to MikroORM 7 with @dudousxd/nestjs-filter-mikro-orm. Covers extending MikroOrmFilter<E> (a BaseFilter whose this.$query is a MikroORM QueryBuilder<E>), registering MikroOrmFilterModule.forRoot() after MikroOrmModule, writing @FilterFor methods with object-syntax andWhere ({ field: { $like, $gte, $in } }), the escaped whereLike / whereBeginsWith / whereEndsWith helpers, and JSON dotted-path filtering (column.key and MySQL array paths column.arr[].key). Use when building filters on a MikroORM backend, choosing the andWhere object shape, escaping LIKE input, or fixing a missing-EntityManager wiring error.
Wire @dudousxd/nestjs-filter to TypeORM with @dudousxd/nestjs-filter-typeorm. Covers extending TypeOrmFilter<E> (a BaseFilter whose this.$query is a TypeORM SelectQueryBuilder<E>), registering TypeOrmFilterModule.forRoot(dataSourceName?) after TypeOrmModule, the this.entityAlias getter, parameterized andWhere('alias.col >= :p', { p }), the escaped whereLike / whereBeginsWith / whereEndsWith helpers, and Postgres websearch_to_tsquery full-text search. Use when building filters on a TypeORM backend, qualifying columns with the alias, parameterizing SQL safely, avoiding parameter-name collisions, or fixing a missing-DataSource wiring error.