Socket
Book a DemoInstallSign in
Socket

dynamic-rest-middleware

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamic-rest-middleware

Middleware library for working with django dynamic rest

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
8
300%
Maintainers
1
Weekly downloads
 
Created
Source

Dynamic rest middleware (for Django on server side)

This is a library for generating a valid django dynamic rest request:

  • URL
  • Filters
  • Modificators
  • Include
  • Exclude
  • Sort
  • Page size
  • Page

How to install

yarn add dynamic-rest-middlewar
npm i dynamic-rest-middlewar

How to use

Library export function getUrl you should pass params

Params

NameTypeDiscriptionExample
urlstringUrl to some entityusers
filtersarray of FilterArray of Filters[ { name: 'name', value: 'John', mod: 'icontains' } ]
includearray of stringArray of includes[ 'songs.*', 'genre' } ]
excludearray of stringArray of excludes[ 'favorite.*', 'likes' } ]
sortarray of SortArray of Sort[ { field: 'views', not: true } ]
excludeAllbooleanExclude all fields trought add exclude[]=*.*true
pageSizenumberSpecify the number of records on page120
pagenumberSpecify the number of page2

Filters

NameTypeDiscriptionExample
fieldstringField of filterlikes
valuestringValue of field24
modstringModificator of filtering (icontains, in...)startswith
notbooleanReverse lookuptrue

Sort

NameTypeDiscriptionExample
fieldstringField of sortid
notbooleanReverse sortingtrue
I would be extremely happy to receive feedback, comments and other ways to improve the library and documentation :з

GitHub

Keywords

Django

FAQs

Package last updated on 19 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.