Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/the-software-compagny/nestjs_module_restools

Simple tools for NestJS framework and REST APIs
https://github.com/the-software-compagny/nestjs_module_restools

abstract async auth-public decorators library nestjs node nodejs npm promise request-context rest search-filter-schema spaces tools

Last synced: 28 days ago
JSON representation

Simple tools for NestJS framework and REST APIs

Awesome Lists containing this project

README

        



Nest Logo


Restools - Simple tools for NestJS framework and REST APIs


NPM Version
Package License
Publish Package to npmjs



# NestJS Restools Module
Simple tools for NestJS framework and REST APIs

## Install dependencies
```bash
yarn add @the-software-compagny/nestjs_module_restools
```

## Usages
### Filters
#### Syntax
`filters[PREFIX + FIELD]=SEARCH`
#### Example
`filters[=subject]=53`
subject field equal to 53
#### Usage
```bash
curl --request GET \
--url 'http://localhost/search?limit=9999&filters%5B%5Esequence%5D=%2F53%2F&sort%5Bmetadata.createdAt%5D=-1&sort%5Bsubject%5D=1'

# limit=9999
# filters[^sequence]=/53/
# sort[metadata.createdAt]=-1
# sort[subject]=1
```
#### List
| Filter | Description |
|--------|-----------------------|
| : | Equal |
| # | Number Equal |
| !# | Number Not Equal |
| !: | Not Equal |
| \> | Greater Than |
| \>| | Greater Than or Equal |
| \< | Less Than |
| \<| | Less Than or Equal |
| @ | in |
| !@ | not in |
| @# | number in |
| !@# | number not in |
| \^ | regex |