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

bestbuy

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bestbuy - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

lib/WarrantiesStrategy.js

12

CHANGELOG.md

@@ -0,1 +1,11 @@

## 1.1.0 (2017-05-01)
Features:
- Added warrany endpoint support. (thanks @troymccabe!)
- Removing references to the deprecated "similar" endpoint
## 1.0.1 (2017-02-27)
- Added addtional test coverage.
## 1.0.0 (2015-11-04)

@@ -6,3 +16,3 @@

- Initialization method must be invoked even when setting environment variables<br>
`var bby = require('bestbuy')();`
`var bby = require('bestbuy')();`
- Callbacks were changed to correctly implement 'error first' pattern.<br>

@@ -9,0 +19,0 @@

@@ -9,2 +9,3 @@ 'use strict';

var OpenBox = require('./OpenBoxStrategy');
var Warranties = require('./WarrantiesStrategy');
var pkg = require('../package.json');

@@ -46,2 +47,3 @@

this.stores = Resource(Default('stores'), this.options);
this.warranties = Resource(Warranties(), this.options);
return this;

@@ -48,0 +50,0 @@ }

2

lib/RecommendationsStrategy.js

@@ -14,3 +14,3 @@ 'use strict';

}
} else if (path === 'alsoViewed' || path === 'similar') {
} else if (path === 'alsoViewed') {
if (typeof criteria !== 'string' && typeof criteria !== 'number') {

@@ -17,0 +17,0 @@ return new Error('Recommendations endpoint requires 2nd parameter to be a SKU for the "' + path + '" method');

{
"name": "bestbuy",
"version": "1.0.1",
"version": "1.1.0",
"description": "High level node.js client for the Best Buy API.",

@@ -5,0 +5,0 @@ "main": "bestbuy.js",

@@ -45,2 +45,3 @@ # Best Buy API

- [`stores`](#stores)
- [`warranties`](#warranties)

@@ -173,8 +174,8 @@ In our documentation, we'll use a couple actual examples:

#### `recommendations('mostViewed' OR 'trendingViewed'[, optional category as a string])`
#### `recommendations('alsoViewed' OR 'similar', sku)`
#### `recommendations('alsoViewed', sku)`
This endpoint serves the search criteria for querying the [Recommendations API as described in our API documentation](https://developer.bestbuy.com/documentation/recommendations-api).
The first parameter expects one of four values: mostViewed, trendingViewed, alsoViewed or similar
The first parameter expects one of three values: mostViewed, trendingViewed or alsoViewed.
If the first parameter is *mostViewed* or *trendingViewed*, an optional second parameter of a categoryId may be provided.
If the first parameter is *alsoViewed* or *similar*, a required second parameter of sku must be provided.
If the first parameter is *alsoViewed*, a required second parameter of sku must be provided.

@@ -256,3 +257,27 @@ The below examples show how to get the most viewed products on BestBuy.com.

### warranties
#### `warranties(sku)`
This endpoint serves warranties for a specified product per the [Warranties API as described in our API documentation](https://developer.bestbuy.com/documentation/stores-api).
The below examples show warranties for an old printer.
##### Using Callbacks
```js
var bby = require('bestbuy')('YOURKEY');
bby.warranties(6354884, function(err, data){
if (err) console.warn(err);
else console.log('Warranties found: ' + data.length);
});
```
##### Using Promises
```js
var bby = require('bestbuy')('YOURKEY');
bby.warranties(6354884)
.then(function(data){
console.log('Warranties found: ' + data.length);
})
.catch(function(err){
console.warn(err);
});
```
## Tests

@@ -259,0 +284,0 @@ Run the existing tests with:

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