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

endpoints-model

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

endpoints-model - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

index.js

@@ -126,5 +126,5 @@ const _ = require('lodash');

if(_.isNumber(parent)) {
query = DB.knex(table).column('id').where(relation.key, parent);
query = Bookshelf.knex(table).column('id').where(relation.key, parent);
} else {
query = DB.knex(table).column('id').whereRaw(relation.key+' IN ('+parent.toString()+')');
query = Bookshelf.knex(table).column('id').whereRaw(relation.key+' IN ('+parent.toString()+')');
}

@@ -131,0 +131,0 @@ queries.push(query);

{
"name": "endpoints-model",
"description": "model layer for the endpoints framework.",
"version": "0.1.1",
"version": "0.1.2",
"homepage": "https://github.com/endpoints/model",

@@ -6,0 +6,0 @@ "author": {

@@ -7,1 +7,20 @@ # endpoints-model [![Build Status](https://secure.travis-ci.org/endpoints/model.png)](http://travis-ci.org/endpoints/model)

a quick and dirty extraction of some tools i use all the time for building rest apis.
## Example
```js
const Model = require('endpoints-model');
const Knex = require('knex')({
client: "pg",
connection: {
host: "localhost",
user: "user",
database: "db",
password: "pass"
},
});
const BaseModel = Model({
Bookshelf: require('bookshelf')(Knex),
Validator: require('checkit'),
linkPrefix: '/api/v1' // when a model is serialized, the automatically generated `links` key may need a prefix to produce the correct endpoint URL.
});
```

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