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.4 to 0.0.5

11

amazon-book-search-se.js

@@ -5,3 +5,3 @@ // requires

function amazonBookSearch(settings){
if(!settings || !settings.awsKey || !settings.awsSecret){
if(!settings || !settings.awsKey || !settings.awsSecret || !settings.assocId){
this.configured = false;

@@ -22,3 +22,3 @@ } else {

if(!this.configured){
callback({ message: 'amazonBookSearch must be configured correctly before use.' }, null);
callback({ message: 'Service must be configured correctly before use.' }, null);
return;

@@ -35,3 +35,8 @@ }

return callback(error, null);
};
};
for(var i=0; i < result.results.length; i++){
console.log("result.results[" + i + "]", result.results[i].ItemAttributes);
}
callback(null, result);

@@ -38,0 +43,0 @@ };

@@ -5,5 +5,7 @@ var apacOperationHelper = require('apac').OperationHelper;

this.apiClient = new apacOperationHelper({
awsId: settings.awsKey,
awsId: settings.awsKey,
awsSecret: settings.awsSecret,
assocId: settings.associate || 'wobonic'
assocId: settings.assocId,
maxRequestsPerSecond: 1,
xml2jsOptions: { explicitArray: true }
});

@@ -29,3 +31,4 @@ };

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

@@ -36,12 +39,12 @@ if(page !== undefined && page !== null){

if(!response.ItemSearchResponse && response.ItemSearchErrorResponse){
return callback({ message: response.ItemSearchErrorResponse.Error[0] }, null);
if(!responseResult.ItemSearchResponse && responseResult.ItemSearchErrorResponse){
return callback(new Error(responseResult.ItemSearchErrorResponse.Error[0]), null);
}
if(!response.ItemSearchResponse.Items[0].Request[0].IsValid[0]){
return callback({ message: response.ItemSearchResponse.Items[0].Request[0].Errors[0].Error[0].Message[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);
}
var results = response.ItemSearchResponse.Items[0].Item;
var totalResults = response.ItemSearchResponse.Items[0].TotalResults[0];
var totalPages = response.ItemSearchResponse.Items[0].TotalPages[0];
var results = responseResult.ItemSearchResponse.Items[0].Item;
var totalResults = responseResult.ItemSearchResponse.Items[0].TotalResults[0];
var totalPages = responseResult.ItemSearchResponse.Items[0].TotalPages[0];

@@ -54,2 +57,4 @@ if(!results){

callback(null, output);
}).catch((err) => {
callback(err, null);
});

@@ -56,0 +61,0 @@ }

{
"name": "amazon-book-search-se",
"version": "0.0.4",
"version": "0.0.5",
"description": "Simple wrapper around apac to return book results from Amazon's Product Advertising API. Based on amazon-book-search by kuryaki.",

@@ -15,2 +15,6 @@ "main": "amazon-book-search-se.js",

],
"repository": {
"type": "git",
"url": "git+https://github.com/retroburst/amazon-book-search-se.git"
},
"author": "Andrew D (retroburst) based on code by David Roncancio (kuryaki).",

@@ -21,4 +25,4 @@ "license": "BSD-2-Clause",

"dependencies": {
"apac": "0.0.13"
"apac": "~2.0.0"
}
}

@@ -10,3 +10,3 @@ ## Amazon Book Search SE

$ npm install amazon-book-search
$ npm install amazon-book-search-se

@@ -20,3 +20,3 @@ ### Requirements

var amazonBookSearchSE = require('amazon-book-search-se');
var absse = new amazonBookSearchSE('awsKey', 'awsSecret', 'awsAssociateId');
var absse = new amazonBookSearchSE({ awsKey: "YOUR KEY", awsSecret: "YOUR SECRET", assocId: "YOUR ASSOCIATE TAG" });

@@ -23,0 +23,0 @@ // search by ISBN

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