🌜
🌞
@nestjsx/crud-request

@nestjsx/crud-request

v5.0.0-alpha.3

NestJs CRUD for RESTful APIs - request query builder

npm install @nestjsx/crud-request

README

CRUD (@nestjsx/crud-request)

for RESTful APIs built with NestJs


We believe that everyone who's working with NestJs and building some RESTful services and especially some CRUD functionality will find @nestjsx/crud microframework very useful.

Features

CRUD usage
  • Super easy to install and start using the full-featured controllers and services :point_right:

  • DB and service agnostic extendable CRUD controllers

  • Reach query parsing with filtering, pagination, sorting, relations, nested relations, cache, etc.

  • Framework agnostic package with query builder for a frontend usage

  • Query, path params and DTOs validation included

  • Overriding controller methods with ease

  • Tiny config (including globally)

  • Additional helper decorators

  • Swagger documentation

Install

npm i @nestjsx/crud-request

Packages

  • @nestjsx/crud - core package which provides @Crud() decorator for endpoints generation, global configuration, validation, helper decorators (docs)
  • @nestjsx/crud-request - request builder/parser package which provides RequestQueryBuilder class for a frontend usage and RequestQueryParser that is being used internally for handling and validating query/path params on a backend side (docs)
  • @nestjsx/crud-typeorm - TypeORM package which provides base TypeOrmCrudService with methods for CRUD database operations (docs)

Documentation

Support

Any support is welcome. At least you can give us a star.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute]. code contributor

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

individual

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

organization organization organization organization organization organization organization organization organization organization

License

MIT

Release Notes

4.6.2
By Mykhaylo Yali • Published on May 14, 2020

4.6.2 - 2020-05-14

Bug Fixes

  • typeorm - fixed selected fields on joins (#510). Kudos to @jbrousseau for finding this bug
4.6.1
By Mykhaylo Yali • Published on May 8, 2020

4.6.1 - 2020-05-08

Bug Fixes

  • typeorm - fixed query generation when a column display name differs from its name in db #401). Kudos to @farhad2161 for finding this bug
4.6.0
By Mykhaylo Yali • Published on May 7, 2020

4.6.0 - 2020-05-07

Features

  • crud/typeorm - added select (boolean) to join options which allows to join relation but not select it (#218)

Bug Fixes

  • typeorm - fixed column identifier for MySQL (#401)
  • typeorm - fixed nested relations aliases, filtering, sorting (#419, #450, #267, #385)
4.5.0
By Mykhaylo Yali • Published on May 1, 2020

4.5.0 - 2020-05-01

Improvements

  • crud - added enum support for params Swagger. Kudos to @tbrannam

Bug Fixes

  • crud - fixed auth property definition. Kudos to @lafeuil
  • typeorm - fixed request generation with aliases (#321, #401). Kudos to @joennlae
4.4.2
By Mykhaylo Yali • Published on March 17, 2020

4.4.2 - 2020-03-17

Bug Fixes

  • crud fixed custom routes params caused by NestJs v7 breaking changes (#443)
4.4.1
By Mykhaylo Yali • Published on December 28, 2019

4.4.1 - 2019-12-28

Bug Fixes

  • crud fixed CrudRequestInterceptor validation status code from 500 to 400 (#374, #247)
4.4.0
By Mykhaylo Yali • Published on December 27, 2019

4.4.0 - 2019-12-27

Features

  • crud added serialize to the global options
4.3.0
By Mykhaylo Yali • Published on December 21, 2019

4.3.0 - 2019-12-21

Features

  • crud added dto to the CrudOptions (#132)
  • crud added serialize to the CrudOptions
  • crud added search query param and a new search condition api
  • crud added new condition operators: $eqL, $neL, $startsL, $endsL, $contL, $exclL, $inL, $notinL for case insensitive queries (#77)
  • crud added @crudAuth() class decorator for authorized requests

Improvements

  • crud CrudRequestInterceptor can be used for both crud and non-crud controllers or for custom routes within crud controller
  • crud support @nestjs/swagger major versions: v3 and v4 (#340)
  • crud added returnShallow option to the CrudOptions.routes createOneBase, updateOneBase, replaceOneBase methods (#158)
  • crud added alias to the CrudOptions.join (#350)
  • crud added alwaysPaginate to the CrudOptions.query, can be used globally as well (#213)
  • crud CrudOptions.query.filter can be a function that returns transformed search object
  • crud added disabled for an objects withing CrudOptions.params
  • request query builder: now uses qs package
  • request query builder: filter and or methods can accept array of filter objects
  • typeorm changed visibility of all methods (#226)
  • typeorm use ILIKE for PostgreSQL (#212)

Bug Fixes

  • crud swagger: fixed response models (#350)
  • crud swagger: fixed query params (#196)
  • crud swagger: fixed renamed params (#283)
  • crud swagger: fixed swagger method decoration on overridden methods
  • crud query parser: fixed parsing integers when it's a big int
  • typeorm fixed load embedded entities (#138)
  • typeorm fixed left join issues (#31, #98)
  • typeorm fixed composite key joins (#238)
  • typeorm fixed entity events (#51)
  • typeorm all methods return entity instances (#259)
4.2.0
By Mykhaylo Yali • Published on July 26, 2019

4.2.0 - 2019-07-26

Features

  • crud added support for older versions of UUID (#186)

Bug Fixes

  • crud fixed BulkDto swagger description (#159)
  • crud fixed CrudRequestInterceptor request parsing
  • requests added @nestjsx/util as a dependency (#184)
  • requests fixed condition operators mapping (#148)
  • requests fixed ISO date string validation (#161)
  • typeorm fixed filtering and sorting by nested fields (#105)
  • typeorm fixed too many nested levels exception (#87)
  • typeorm fixed pagination pageCount (#179)

Deps

  • dev updated deps
4.1.0
By Mykhaylo Yali • Published on June 27, 2019

4.1.0 - 2019-06-27

Features

  • crud added PUT request handling (#107 )
  • requests added creating request builder with params (#131 )
  • requests improved query params naming parsing (#101 )

Bug Fixes

  • crud set decorators after Swagger so metadata can be overwritten
  • requests added support for ISO-8610 date strings

General

License
MIT
Typescript Types
None found
Tree-shakeable
No

Popularity

GitHub Stargazers
3,231
Community Interest
2,900
Number of Forks
400

Maintenance

Commits
11/2110/22010
Last Commit
Open Issues
239
Closed Issues
307
Open Pull Requests
33
Closed Pull Requests
86

Versions

Versions Released
11/2110/2201
Latest Version Released
Feb 11, 2021
Current Tags
latest5.0.0-alpha.3

Dependencies

Dependencies (2)
Dev Dependencies (0)

Contributors

zMotivat0r
zMotivat0r
Commits: 257
Diluka
Diluka
Commits: 43
renovate-bot
renovate-bot
Commits: 25
greenkeeper[bot]
greenkeeper[bot]
Commits: 6
RobotScribe
RobotScribe
Commits: 5
0xflotus
0xflotus
Commits: 5
klalex
klalex
Commits: 4
bestori
bestori
Commits: 3
tbrannam
tbrannam
Commits: 3
salomaosnff
salomaosnff
Commits: 3
jdguzman
jdguzman
Commits: 3
roland-chernov-akvelon
roland-chernov-akvelon
Commits: 3
debagger
debagger
Commits: 2
fwoelffel
fwoelffel
Commits: 2
SamiSammour
SamiSammour
Commits: 2