Comparing version 1.0.1 to 1.1.0
@@ -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 @@ } |
@@ -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: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
450224
69
9777
307
0
15