Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crude

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crude - npm Package Compare versions

Comparing version 0.9.1 to 1.0.0

.nvmrc

5

lib/crud-ops/pagination.js

@@ -68,2 +68,7 @@ /**

if (this.opts.maxPaginateLimit !== 0 && limit > this.opts.maxPaginateLimit) {
limit = this.opts.maxPaginateLimit;
}
return {

@@ -70,0 +75,0 @@ limit: limit,

2

lib/crude.js

@@ -139,2 +139,4 @@ /*jshint camelcase:false */

this.opts.paginateLimit = 6;
// Maximum pagination record fetching limit.
this.opts.maxPaginateLimit = 100;
// Set Multiple items query Separator key.

@@ -141,0 +143,0 @@ this.opts.multiSepKey = ',';

39

package.json
{
"name": "crude",
"description": "Creates CRUD RESTfull endpoints for a given route",
"version": "0.9.1",
"version": "1.0.0",
"homepage": "https://github.com/thanpolas/crude",

@@ -17,8 +17,3 @@ "author": {

},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/thanpolas/crude/blob/master/LICENSE-MIT"
}
],
"license": "MIT",
"contributors": [

@@ -28,3 +23,3 @@ {}

"engines": {
"node": ">= 0.8.0"
"node": ">= 0.10.0"
},

@@ -36,7 +31,7 @@ "main": "./lib/bootstrap",

"dependencies": {
"pagination": "~0.4.3",
"lodash": "~3.10.1",
"pagination": "~0.4.4",
"lodash": "~4.16.6",
"middlewarify": "~1.0.0",
"cip": "~1.0.0",
"bluebird": "~2.9.34",
"bluebird": "~3.4.6",
"httplink": "0.0.1",

@@ -48,14 +43,14 @@ "nodeon-error": "^0.2.1"

"crude-test-case": "^0.0.6",
"sinon": "~1.15.4",
"mocha": "~2.3.0",
"chai": "~3.2.0",
"grunt": "~0.4.5",
"grunt-release": "~0.13.0",
"mongoose": "^4.1.5",
"supertest": "^1.1.0",
"sinon": "~1.17.6",
"mocha": "~3.1.2",
"chai": "~3.5.0",
"grunt": "~1.0.1",
"grunt-release": "~0.14.0",
"mongoose": "^4.6.5",
"supertest": "^2.0.1",
"sinon-chai": "^2.8.0",
"grunt-contrib-jshint": "^0.11.2",
"load-grunt-tasks": "^3.2.0",
"grunt-cli": "^0.1.13",
"chai-as-promised": "^5.1.0"
"grunt-contrib-jshint": "^1.0.0",
"load-grunt-tasks": "^3.5.2",
"grunt-cli": "^1.2.0",
"chai-as-promised": "^6.0.0"
},

@@ -62,0 +57,0 @@ "peerDependencies": {},

@@ -56,2 +56,4 @@ # Crude

- **v1.0.0**, *03 Nov 2016*
- Added the `maxPaginateLimit` option to cap allowed items per pagination.
- **v0.9.1**, *07 Sep 2015*

@@ -100,3 +102,3 @@ - Added the `multiQueryAnd` option to allow for use of the `AND` operator in multiple items filter queries vs the default `OR`.

Copyright 2014 [Thanasis Polychronakis][thanpolas]
Copyright [Thanasis Polychronakis][thanpolas]

@@ -103,0 +105,0 @@ Licensed under the [MIT License](LICENSE-MIT)

@@ -42,11 +42,10 @@ /**

it('should work on pagination', function (done) {
it('should work on pagination', function () {
this.ctrl.readLimit.throws(this.err);
return this.crude._readList(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('paginate'))
.then(done, done);
.then(runAssert('paginate'));
});
it('should work on read all', function (done) {
it('should work on read all', function () {
this.ctrl.read.throws(this.err);

@@ -56,6 +55,5 @@ this.crude.config({pagination: false});

.bind(this)
.then(runAssert('read'))
.then(done, done);
.then(runAssert('read'));
});
it('should work on read one', function (done) {
it('should work on read one', function () {
this.ctrl.readOne.throws(this.err);

@@ -65,6 +63,5 @@ this.reqres.req.params.id = 'one';

.bind(this)
.then(runAssert('readOne'))
.then(done, done);
.then(runAssert('readOne'));
});
it('should work on update', function (done) {
it('should work on update', function () {
this.ctrl.update.throws(this.err);

@@ -74,6 +71,5 @@ this.reqres.req.params.id = 'one';

.bind(this)
.then(runAssert('update'))
.then(done, done);
.then(runAssert('update'));
});
it('should work on delete', function (done) {
it('should work on delete', function () {
this.ctrl.delete.throws(this.err);

@@ -83,11 +79,9 @@ this.reqres.req.params.id = 'one';

.bind(this)
.then(runAssert('delete'))
.then(done, done);
.then(runAssert('delete'));
});
it('should work on create', function (done) {
it('should work on create', function () {
this.ctrl.create.throws(this.err);
return this.crude._create(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('create'))
.then(done, done);
.then(runAssert('create'));
});

@@ -110,11 +104,10 @@

it('should work on pagination', function (done) {
it('should work on pagination', function () {
this.ctrl.readLimit.throws(this.err);
return this.crude._readList(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('paginate'))
.then(done, done);
.then(runAssert('paginate'));
});
it('should work on read all', function (done) {
it('should work on read all', function () {
this.ctrl.read.throws(this.err);

@@ -124,6 +117,5 @@ this.crude.config({pagination: false});

.bind(this)
.then(runAssert('read'))
.then(done, done);
.then(runAssert('read'));
});
it('should work on read one', function (done) {
it('should work on read one', function () {
this.ctrl.readOne.throws(this.err);

@@ -133,6 +125,5 @@ this.reqres.req.params.id = 'one';

.bind(this)
.then(runAssert('readOne'))
.then(done, done);
.then(runAssert('readOne'));
});
it('should work on update', function (done) {
it('should work on update', function () {
this.ctrl.update.throws(this.err);

@@ -142,6 +133,5 @@ this.reqres.req.params.id = 'one';

.bind(this)
.then(runAssert('update'))
.then(done, done);
.then(runAssert('update'));
});
it('should work on delete', function (done) {
it('should work on delete', function () {
this.ctrl.delete.throws(this.err);

@@ -151,11 +141,9 @@ this.reqres.req.params.id = 'one';

.bind(this)
.then(runAssert('delete'))
.then(done, done);
.then(runAssert('delete'));
});
it('should work on create', function (done) {
it('should work on create', function () {
this.ctrl.create.throws(this.err);
return this.crude._create(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('create'))
.then(done, done);
.then(runAssert('create'));
});

@@ -190,42 +178,36 @@ });

it('should work on pagination', function (done) {
it('should work on pagination', function () {
return this.crude._readList(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('paginate', null, true))
.then(done, done);
.then(runAssert('paginate', null, true));
});
it('should work on read all', function (done) {
it('should work on read all', function () {
this.crude.config({pagination: false});
return this.crude._readList(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('read', null, true))
.then(done, done);
.then(runAssert('read', null, true));
});
it('should work on read one', function (done) {
it('should work on read one', function () {
this.reqres.req.params.id = 'one';
return this.crude._readOne(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('readOne'))
.then(done, done);
.then(runAssert('readOne'));
});
it('should work on update', function (done) {
it('should work on update', function () {
this.reqres.req.params.id = 'one';
return this.crude._update(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('update'))
.then(done, done);
.then(runAssert('update'));
});
it('should work on delete', function (done) {
it('should work on delete', function () {
this.reqres.req.params.id = 'one';
return this.crude._delete(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('delete'))
.then(done, done);
.then(runAssert('delete'));
});
it('should work on create', function (done) {
it('should work on create', function () {
return this.crude._create(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('create', 201))
.then(done, done);
.then(runAssert('create', 201));
});

@@ -241,42 +223,36 @@

it('should work on pagination', function (done) {
it('should work on pagination', function () {
return this.crude._readList(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('paginate', null, true))
.then(done, done);
.then(runAssert('paginate', null, true));
});
it('should work on read all', function (done) {
it('should work on read all', function () {
this.crude.config({pagination: false});
return this.crude._readList(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('read', null, true))
.then(done, done);
.then(runAssert('read', null, true));
});
it('should work on read one', function (done) {
it('should work on read one', function () {
this.reqres.req.params.id = 'one';
return this.crude._readOne(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('readOne'))
.then(done, done);
.then(runAssert('readOne'));
});
it('should work on update', function (done) {
it('should work on update', function () {
this.reqres.req.params.id = 'one';
return this.crude._update(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('update'))
.then(done, done);
.then(runAssert('update'));
});
it('should work on delete', function (done) {
it('should work on delete', function () {
this.reqres.req.params.id = 'one';
return this.crude._delete(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('delete'))
.then(done, done);
.then(runAssert('delete'));
});
it('should work on create', function (done) {
it('should work on create', function () {
return this.crude._create(this.reqres.req, this.reqres.res)
.bind(this)
.then(runAssert('create', 201))
.then(done, done);
.then(runAssert('create', 201));
});

@@ -283,0 +259,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc