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

cmbf-hapi-restmodel

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmbf-hapi-restmodel - npm Package Compare versions

Comparing version 0.6.9 to 0.6.10

54

lib/base-model.js

@@ -199,9 +199,3 @@ var Joi = require('joi'),

var service = _this.handlers[key];
if(service) {
service.Model = _this;
service.data = result;
service.credentials = options.credentials;
return server.cmbf.service(service);
}
else if(_.isFunction(service)) {
if(_.isFunction(service)) {
return service({

@@ -214,2 +208,8 @@ Model: _this,

}
else if(_.isObject(service)) {
service.Model = _this;
service.data = result;
service.credentials = options.credentials;
return server.cmbf.service(service);
}
else {

@@ -226,10 +226,3 @@ return result

var service = _this.constructor.handlers[key];
if(_.isObject(service)) {
service.model = _this;
service.Model = _this.constructor;
service.data = result;
service.credentials = options.credentials;
return server.cmbf.service(service);
}
else if(_.isFunction(service)) {
if(_.isFunction(service)) {
return service({

@@ -243,2 +236,9 @@ model: _this,

}
else if(_.isObject(service)) {
service.model = _this;
service.Model = _this.constructor;
service.data = result;
service.credentials = options.credentials;
return server.cmbf.service(service);
}
else {

@@ -293,2 +293,26 @@ return result

static createValidateSpec(op) {
if(this.validation[op]) {
return this.validation[op];
}
else {
var rules = {};
if(this.schema) {
var schema = this.schema.describe();
// Create validation for query
// Create validation for params
// Create validation for payload
// Add header validation
}
return rules;
}
};
}

@@ -295,0 +319,0 @@

@@ -38,3 +38,3 @@ var P = require('bluebird'),

cache: Model.cache,
validate: Model.validation.list
validate: Model.createValidateSpec('list')
}

@@ -52,3 +52,3 @@ });

description: "Get a single "+Model.name+" instance",
validate: Model.validation.show
validate: Model.createValidateSpec('show')
}

@@ -65,3 +65,3 @@ });

description: "Create a "+Model.name+" instance",
validate: Model.validation.create
validate: Model.createValidateSpec('create')
}

@@ -78,3 +78,3 @@ });

description: "Upsert a "+Model.name+" instance",
validate: Model.validation.upsert
validate: Model.createValidateSpec('upsert')
}

@@ -91,3 +91,3 @@ });

description: "Update a "+Model.name+" instance",
validate: Model.validation.update
validate: Model.createValidateSpec('update')
}

@@ -104,3 +104,3 @@ });

description: "Remove a "+Model.name+" instance",
validate: Model.validation.remove
validate: Model.createValidateSpec('remove')
}

@@ -107,0 +107,0 @@ });

{
"name": "cmbf-hapi-restmodel",
"version": "0.6.9",
"version": "0.6.10",
"author": "Joel Grenon <joelgrenon@covistra.com>",

@@ -5,0 +5,0 @@ "description": "Hapi plugin building a REST Api from Joi schema, backed by covistra-mongo plugin",

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