Socket
Book a DemoInstallSign in
Socket

@domain.js/rest

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@domain.js/rest

domain.js rest 通用模块

latest
Source
npmnpm
Version
0.6.1
Version published
Maintainers
1
Created
Source

@domain.js/rest

Domain.js 项目通用增删改查模块

Build status codecov

Installation

npm i @domain.js/rest --save

cnf

专属配置名称 rest

名称类型必填默认值描述样例
relativeMaxRangeDaysInteger100相对时间过滤,日期最大跨度,天数

deps

名称类型描述
errors.resourceDuplicateAddFunctionrest.add 方法遇到资源重复是会调用改函数返回错误
errors.notAllowedFunctionrest.list 方法相对时间过滤超过最大天数跨度调用该函数返回错误
_Objectlodash 库包,之所以通过注入的方式是为把版本控制的主动权交给项目
Sequelize_Objectsequelize 库包,之所以通过注入的方式是为把版本控制的主动权交给项目
momentObjectmoment 库包,之所以通过注入的方式是为把版本控制的主动权交给项目
mysqlObjectmysql2 库包,之所以通过注入的方式是为把版本控制的主动权交给项目

Usage

功能描述样例
rest.list列表方法rest.list(Model, params)
rest.remove删除某个资源rest.remove(model, userId)
rest.modify修改某个资源rest.modify(Model, model, params, isAdmin, cols)
rest.add添加一个资源rest.add(Model, params, isAdmin, cols, { userId, clientIp })
rest.stats统计接口rest.stats(Model, params, isAdmin, cols, { userId, clientIp })

Keywords

rest

FAQs

Package last updated on 08 Sep 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