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

amazon-book-search-se

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amazon-book-search-se - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

28

lib/amazon-search-helper.js

@@ -29,4 +29,4 @@ var apacOperationHelper = require('apac').OperationHelper;

}
this.apiClient.execute('ItemSearch', query).then((response) => {
var actionResponse = function actionResponse(response){
var responseResult = response.result;

@@ -39,23 +39,33 @@ var output = {};

if(!responseResult.ItemSearchResponse && responseResult.ItemSearchErrorResponse){
return callback(new Error(responseResult.ItemSearchErrorResponse.Error[0]), null);
return callback(new Error(responseResult.ItemSearchErrorResponse.Error[0]), null);
}
if(!responseResult.ItemSearchResponse.Items[0].Request[0].IsValid[0]){
return callback(new Error(responseResult.ItemSearchResponse.Items[0].Request[0].Errors[0].Error[0].Message[0]), null);
return callback(new Error(responseResult.ItemSearchResponse.Items[0].Request[0].Errors[0].Error[0].Message[0]), null);
}
var results = responseResult.ItemSearchResponse.Items[0].Item;
var totalResults = responseResult.ItemSearchResponse.Items[0].TotalResults[0];
var totalPages = responseResult.ItemSearchResponse.Items[0].TotalPages[0];
if(!results){
output = { totalResults:0, totalPages:0, currentPage:0, results:[] };
return callback(null, output);
output = { totalResults:0, totalPages:0, currentPage:0, results:[] };
return callback(null, output);
}
output = { totalResults: totalResults, totalPages: totalPages, currentPage: page || 1, results: results};
callback(null, output);
};
var executeResult = null;
var promise = null;
this.apiClient.execute('ItemSearch', query).then((response) => {
if(response && response.result){
actionResponse(response);
} else {
response().then(actionResponse);
}
}).catch((err) => {
callback(err, null);
});
}
};
module.exports = amazonSearchHelper;
{
"name": "amazon-book-search-se",
"version": "0.0.7",
"version": "0.0.8",
"description": "Simple wrapper around apac to return book results from Amazon's Product Advertising API. Based on amazon-book-search by kuryaki. Uses apac version 2.0.0.",

@@ -5,0 +5,0 @@ "main": "amazon-book-search-se.js",

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