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

resource-client

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resource-client - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

5

lib/default_actions.js

@@ -10,2 +10,7 @@ // Generated by CoffeeScript 1.8.0

},
'queryOne': {
method: 'GET',
isArray: true,
returnFirst: true
},
'save': {

@@ -12,0 +17,0 @@ method: 'POST'

15

lib/index.js

@@ -62,3 +62,3 @@ // Generated by CoffeeScript 1.8.0

}, function(err, response) {
return handleResponse(err, response, null, done);
return handleResponse(err, response, null, done, options);
});

@@ -116,4 +116,7 @@ };

};
handleResponse = function(err, response, originalObject, done) {
var resource, resources, _ref;
handleResponse = function(err, response, originalObject, done, options) {
var errorMessage, resource, resources, _ref;
if (options == null) {
options = {};
}
if (err) {

@@ -126,2 +129,5 @@ return done(err);

});
if (options.returnFirst) {
resources = resources[0];
}
return done(null, resources);

@@ -135,3 +141,4 @@ } else {

} else {
return done(response.body);
errorMessage = JSON.stringify(response.body);
return done(new Error(errorMessage));
}

@@ -138,0 +145,0 @@ };

{
"name": "resource-client",
"version": "1.3.0",
"version": "1.3.1",
"description": "Easily create api clients for your server side resources.",

@@ -27,3 +27,4 @@ "author": "Good Eggs <open-source@goodeggs.com>",

"lodash": "^3.0.0",
"url-assembler": "0.0.3"
"url-assembler": "0.0.3",
"chai": "^2.1.0"
},

@@ -30,0 +31,0 @@ "devDependencies": {

@@ -60,2 +60,3 @@ # Resource Client

- **isArray** - resource is an array. It will not populate variables in the url.
- **returnFirst** - resource is an array. It will return the first result from the array

@@ -76,2 +77,8 @@ ```javascript

});
Product.action('queryOne', {
method: 'GET'
isArray: true
returnFirst: true
});
```

@@ -106,2 +113,3 @@

- **query** - {method: 'GET', isArray: true}
- **queryOne** - {method: 'GET', isArray: true, returnFirst: true}
- **update** - {method: 'PUT'}

@@ -108,0 +116,0 @@ - **save** - {method: 'POST'}

Sorry, the diff of this file is not supported yet

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