-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from bhushankumarl/development
Add basic Test cases, Add jshint lint checking, Code Reformatting
- Loading branch information
Showing
40 changed files
with
854 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
examples/typeScript | ||
test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "0.12" | ||
- "4" | ||
- "5" | ||
- "6" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
var fs = require('fs'); | ||
|
||
var accessKey = process.env.AWS_ACCESS_KEY_ID || 'YOUR_KEY'; | ||
var accessSecret = process.env.AWS_SECRET_ACCESS_KEY || 'YOUR_SECRET'; | ||
|
||
var amazonMws = require('../../../lib/amazon-mws')(accessKey, accessSecret); | ||
var fse = require('fs-extra'); | ||
|
||
/** | ||
* Use __RAW__ to get the raw response in response->data; | ||
* This along with __CHARSET__ do not get written in the request. | ||
* */ | ||
function feedRequest() { | ||
var FeedSubmissionId = '10101010XXX'; | ||
amazonMws.feeds.search({ | ||
'Version': '2009-01-01', | ||
'Action': 'GetFeedSubmissionResult', | ||
'SellerId': 'SELLER_ID', | ||
'MWSAuthToken': 'MWS_AUTH_TOKEN', | ||
'FeedSubmissionId': FeedSubmissionId, | ||
__RAW__: true | ||
}, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
fse.writeFileSync('response.txt', response.data); | ||
console.log('Headers', response.Headers); | ||
}); | ||
} | ||
|
||
feedRequest(); |
26 changes: 26 additions & 0 deletions
26
examples/javaScript/products/getLowestPricedOffersForASIN.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
var accessKey = process.env.AWS_ACCESS_KEY_ID || 'YOUR_KEY'; | ||
var accessSecret = process.env.AWS_SECRET_ACCESS_KEY || 'YOUR_SECRET'; | ||
|
||
var amazonMws = require('../../../lib/amazon-mws')(accessKey, accessSecret); | ||
|
||
var productRequest = function () { | ||
amazonMws.products.searchFor({ | ||
'Version': '2011-10-01', | ||
'Action': 'GetLowestPricedOffersForASIN', | ||
'SellerId': 'SELLER_ID', | ||
'MWSAuthToken': 'MWS_AUTH_TOKEN', | ||
'MarketplaceId': 'MARKET_PLACE_ID', | ||
'ASIN': 'ASIN', | ||
'ItemCondition': 'New' | ||
}, function (error, response) { | ||
if (error) { | ||
console.log('error products', error); | ||
return; | ||
} | ||
console.log('response ', response); | ||
}); | ||
}; | ||
|
||
productRequest(); |
26 changes: 26 additions & 0 deletions
26
examples/javaScript/products/getLowestPricedOffersForSKU.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
var accessKey = process.env.AWS_ACCESS_KEY_ID || 'YOUR_KEY'; | ||
var accessSecret = process.env.AWS_SECRET_ACCESS_KEY || 'YOUR_SECRET'; | ||
|
||
var amazonMws = require('../../../lib/amazon-mws')(accessKey, accessSecret); | ||
|
||
var productRequest = function () { | ||
amazonMws.products.searchFor({ | ||
'Version': '2011-10-01', | ||
'Action': 'GetLowestPricedOffersForSKU', | ||
'SellerId': 'SELLER_ID', | ||
'MWSAuthToken': 'MWS_AUTH_TOKEN', | ||
'MarketplaceId': 'MARKET_PLACE_ID', | ||
'SellerSKU': 'SELLER_SKU', | ||
'ItemCondition': 'New' | ||
}, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response ', response); | ||
}); | ||
}; | ||
|
||
productRequest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"name": "trello-sample", | ||
"version": "1.0.0", | ||
"description": "trello", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@types/node": "^8.0.53", | ||
"@types/es6-promise": "0.0.33", | ||
"babel-eslint": "^8.0.1", | ||
"babel-preset-node6": "^11.0.0", | ||
"amazon-mws": "^0.0.16", | ||
"node-expat": "^2.3.16" | ||
}, | ||
"devDependencies": {} | ||
"name": "amazon-mws-typescript-sample", | ||
"version": "1.0.0", | ||
"description": "trello", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@types/node": "^8.0.53", | ||
"@types/es6-promise": "0.0.33", | ||
"babel-eslint": "^8.0.1", | ||
"babel-preset-node6": "^11.0.0", | ||
"amazon-mws": "*", | ||
"node-expat": "^2.3.16" | ||
}, | ||
"devDependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.