diff --git a/CHANGELOG.md b/CHANGELOG.md index 9372b9a..11ab457 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +0.0.2 September 19, 2018 + - Add Support for browse API : search + - Add SANDBOX usage using environment variable + - Changes for the Taxonomy API + - Add Support for Inventory API : createOrReplaceInventoryItem, getInventoryItem + 0.0.1 September 19, 2018 - Initial release with Taxonomy API - Add Support for getOAuthToken diff --git a/README.md b/README.md index 8df0d59..1458189 100644 --- a/README.md +++ b/README.md @@ -35,14 +35,19 @@ export EBAY_CLIENT_ID=KEY export EBAY_CLIENT_SECRET=SECRET ``` +## To Enable Sanbox Purpose +```bash +export EBAY_CLIENT_SANDBOX='true' +``` + ## Configuration Using JavaScript ```js -var eBay = require('../../../lib/eBay-node-client')('YOUR_KEY', 'YOUR_SECRET'); +var eBay = require('ebay-node-client')('YOUR_KEY', 'YOUR_SECRET'); ``` ## Configuration Using TypeScript ```typescript -import * as eBay from 'eBay-node-client'; +import * as eBay from 'ebay-node-client'; const eBay = new eBay(); eBay.setApiKey('YOUR_KEY', 'YOUR_SECRET'); diff --git a/examples/javaScript/application/oauthToken.js b/examples/javaScript/application/oauthToken.js index 8064e64..e3bffea 100644 --- a/examples/javaScript/application/oauthToken.js +++ b/examples/javaScript/application/oauthToken.js @@ -5,17 +5,18 @@ var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; var eBay = require('../../../lib/eBay-node-client')(clientId, clientSecret); -var feedRequest = async function () { +var applicationRequest = async function () { try { var token = await eBay.application.getOAuthToken({ grant_type: 'client_credentials', scope: 'https://api.ebay.com/oauth/api_scope' }); + console.log('token.access_token ', token.access_token); eBay.setToken(token.access_token); } catch (error) { console.log('error ', error); } }; -feedRequest(); +applicationRequest(); diff --git a/examples/javaScript/buy/browse/getItem.js b/examples/javaScript/buy/browse/getItem.js new file mode 100644 index 0000000..0513b7b --- /dev/null +++ b/examples/javaScript/buy/browse/getItem.js @@ -0,0 +1,29 @@ +'use strict'; + +var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; +var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; + +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); + +var browseRequest = async function () { + try { + var token = await eBay.application.getOAuthToken({ + grant_type: 'client_credentials', + scope: 'https://api.ebay.com/oauth/api_scope' + }); + eBay.setToken(token.access_token); + } catch (error) { + + } + + var itemId = 'v1|110329773707|410089528845'; + eBay.browse.getItem(itemId, function (error, response) { + if (error) { + console.log('error ', error); + return; + } + console.log('response', response); + }); +}; + +browseRequest(); diff --git a/examples/javaScript/buy/browse/search.js b/examples/javaScript/buy/browse/search.js new file mode 100644 index 0000000..a974f26 --- /dev/null +++ b/examples/javaScript/buy/browse/search.js @@ -0,0 +1,32 @@ +'use strict'; + +var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; +var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; + +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); + +var browseRequest = async function () { + try { + var token = await eBay.application.getOAuthToken({ + grant_type: 'client_credentials', + scope: 'https://api.ebay.com/oauth/api_scope' + }); + eBay.setToken(token.access_token); + } catch (error) { + + } + + var data = { + gtin: '010942122258', + limit: '1' + }; + eBay.browse.search(data, function (error, response) { + if (error) { + console.log('error ', error); + return; + } + console.log('response', response); + }); +}; + +browseRequest(); diff --git a/examples/javaScript/commerce/taxonomy/getCategorySubtree.js b/examples/javaScript/commerce/taxonomy/getCategorySubtree.js index 2dce440..709460d 100644 --- a/examples/javaScript/commerce/taxonomy/getCategorySubtree.js +++ b/examples/javaScript/commerce/taxonomy/getCategorySubtree.js @@ -3,7 +3,7 @@ var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; -var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret, true); +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); var categoryRequest = async function () { try { @@ -17,9 +17,11 @@ var categoryRequest = async function () { } var categoryTreeId = 203; - var categoryId = 179623; + var data = { + category_id: '179623' + }; - eBay.taxonomy.getCategorySubtree(categoryTreeId, categoryId, function (error, response) { + eBay.taxonomy.getCategorySubtree(categoryTreeId, data , function (error, response) { if (error) { console.log('error ', error); return; diff --git a/examples/javaScript/commerce/taxonomy/getCategorySuggestions.js b/examples/javaScript/commerce/taxonomy/getCategorySuggestions.js index 25d52b9..e97bf22 100644 --- a/examples/javaScript/commerce/taxonomy/getCategorySuggestions.js +++ b/examples/javaScript/commerce/taxonomy/getCategorySuggestions.js @@ -3,7 +3,7 @@ var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; -var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret, true); +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); var categoryRequest = async function () { try { @@ -17,9 +17,11 @@ var categoryRequest = async function () { } var categoryTreeId = 203; - var search_terms = 'abc'; - eBay.taxonomy.getCategorySuggestions(categoryTreeId, search_terms, function (error, response) { + var data = { + 'q': 'abc' + }; + eBay.taxonomy.getCategorySuggestions(categoryTreeId, data, function (error, response) { if (error) { console.log('error ', error); return; diff --git a/examples/javaScript/commerce/taxonomy/getCategoryTree.js b/examples/javaScript/commerce/taxonomy/getCategoryTree.js index 026dbf4..31c5314 100644 --- a/examples/javaScript/commerce/taxonomy/getCategoryTree.js +++ b/examples/javaScript/commerce/taxonomy/getCategoryTree.js @@ -3,7 +3,7 @@ var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; -var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret, true); +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); var categoryRequest = async function () { diff --git a/examples/javaScript/commerce/taxonomy/getDefaultCategoryTreeId.js b/examples/javaScript/commerce/taxonomy/getDefaultCategoryTreeId.js index d992fc5..036cec8 100644 --- a/examples/javaScript/commerce/taxonomy/getDefaultCategoryTreeId.js +++ b/examples/javaScript/commerce/taxonomy/getDefaultCategoryTreeId.js @@ -3,7 +3,7 @@ var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; -var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret, true); +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); var categoryRequest = async function () { try { @@ -16,7 +16,10 @@ var categoryRequest = async function () { } - eBay.taxonomy.getDefaultCategoryTreeId('EBAY_IN', function (error, response) { + var data = { + marketplace_id: 'EBAY_IN' + }; + eBay.taxonomy.getDefaultCategoryTreeId(data, function (error, response) { if (error) { console.log('error ', error); return; diff --git a/examples/javaScript/commerce/taxonomy/getItemAspectsForCategory.js b/examples/javaScript/commerce/taxonomy/getItemAspectsForCategory.js index 65b71b9..a2e6c03 100644 --- a/examples/javaScript/commerce/taxonomy/getItemAspectsForCategory.js +++ b/examples/javaScript/commerce/taxonomy/getItemAspectsForCategory.js @@ -3,7 +3,7 @@ var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; -var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret, true); +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); var categoryRequest = async function () { try { @@ -17,9 +17,11 @@ var categoryRequest = async function () { } var categoryTreeId = 203; - var categoryId = 179623; + var data = { + category_id: '179623' + }; - eBay.taxonomy.getItemAspectsForCategory(categoryTreeId, categoryId, function (error, response) { + eBay.taxonomy.getItemAspectsForCategory(categoryTreeId, data, function (error, response) { if (error) { console.log('error ', error); return; diff --git a/examples/javaScript/sell/inventory/createOrReplaceInventoryItem.js b/examples/javaScript/sell/inventory/createOrReplaceInventoryItem.js new file mode 100644 index 0000000..23a1233 --- /dev/null +++ b/examples/javaScript/sell/inventory/createOrReplaceInventoryItem.js @@ -0,0 +1,50 @@ +'use strict'; + +var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; +var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; + +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); + +var browseRequest = async function () { + var userToken = 'USER_TOKEN'; + eBay.setUserToken(userToken); + + var data = { + 'availability': { + 'shipToLocationAvailability': { + 'quantity': 50 + } + }, + 'condition': 'NEW', + 'product': { + 'title': 'GoPro Hero4 Helmet Cam', + 'description': 'New GoPro Hero4 Helmet Cam. Unopened box.', + 'aspects': { + 'Brand': ['GoPro'], + 'Type': ['Helmet/Action'], + 'Storage Type': ['Removable'], + 'Recording Definition': ['High Definition'], + 'Media Format': ['Flash Drive (SSD)'], + 'Optical Zoom': ['10x'] + }, + 'brand': 'GoPro', + 'mpn': 'CHDHX-401', + 'imageUrls': [ + 'http://i.ebayimg.com/images/i/182196556219-0-1/s-l1000.jpg', + 'http://i.ebayimg.com/images/i/182196556219-0-1/s-l1001.jpg', + 'http://i.ebayimg.com/images/i/182196556219-0-1/s-l1002.jpg' + ] + } + }; + + var sku = '32984729384729'; + eBay.inventory.createOrReplaceInventoryItem(sku, data, function (error, response) { + if (error) { + console.log('error ', error); + return; + } + console.log('response', response); + }); +}; + +browseRequest(); diff --git a/examples/javaScript/sell/inventory/getInventoryItem.js b/examples/javaScript/sell/inventory/getInventoryItem.js new file mode 100644 index 0000000..3faa6da --- /dev/null +++ b/examples/javaScript/sell/inventory/getInventoryItem.js @@ -0,0 +1,23 @@ +'use strict'; + +var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; +var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; + +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); + +var inventoryRequest = async function () { + + var userToken = 'USER_TOKEN'; + eBay.setUserToken(userToken); + + var sku = '32984729384729'; + eBay.inventory.getInventoryItem(sku, function (error, response) { + if (error) { + console.log('error ', error); + return; + } + console.log('response', response); + }); +}; + +inventoryRequest(); diff --git a/examples/javaScript/sell/inventory/getInventoryItems.js b/examples/javaScript/sell/inventory/getInventoryItems.js new file mode 100644 index 0000000..163c62f --- /dev/null +++ b/examples/javaScript/sell/inventory/getInventoryItems.js @@ -0,0 +1,25 @@ +'use strict'; + +var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; +var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; + +var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); + +var inventoryRequest = async function () { + + var userToken = 'USER_TOKEN'; + eBay.setUserToken(userToken); + + var data = { + limit: '10' + }; + eBay.inventory.getInventoryItems(data, function (error, response) { + if (error) { + console.log('error ', error); + return; + } + console.log('response', response); + }); +}; + +inventoryRequest(); diff --git a/lib/eBay-node-client.js b/lib/eBay-node-client.js index c6eb80f..7437d46 100644 --- a/lib/eBay-node-client.js +++ b/lib/eBay-node-client.js @@ -27,8 +27,10 @@ eBay.USER_AGENT_SERIALIZED = null; var exec = require('child_process').exec; var resources = { - taxonomy: require('./resources/commerce/taxonomy'), - application: require('./resources/application') + application: require('./resources/application'), + browse: require('./resources/buy/browse'), + inventory: require('./resources/sell/inventory'), + taxonomy: require('./resources/commerce/taxonomy') }; eBay.eBayResource = require('./eBayResource'); @@ -51,6 +53,9 @@ function eBay(clientId, clientSecret, isSandbox) { dev: false }; + if (process.env.EBAY_CLIENT_SANDBOX === 'true') { + this._api.host = eBay.DEFAULT_SANDBOX_HOST; + } if (isSandbox === true) { this._api.host = eBay.DEFAULT_SANDBOX_HOST; } @@ -98,6 +103,12 @@ eBay.prototype = { } }, + setUserToken: function (token) { + if (token) { + this._setApiField('userToken', token); + } + }, + setTimeout: function (timeout) { this._setApiField('timeout', timeout === null ? eBay.DEFAULT_TIMEOUT : timeout); }, diff --git a/lib/eBayResource.js b/lib/eBayResource.js index 8d7a6aa..8857081 100644 --- a/lib/eBayResource.js +++ b/lib/eBayResource.js @@ -116,35 +116,6 @@ eBayResource.prototype = { _responseHandler: function (requestParamsJSONCopy, req, userOptions, callback) { var self = this; - function processXml(o, action) { - var type = typeof o; - if (type === 'object') { - for (var key in o) { - if (key.indexOf('ns2:') > -1) { - if (action === 'update') { - var temp = key.replace(/^ns2:/, ''); - o[temp] = o[key]; - - } else if (action === 'delete') { - delete o[key]; - } - } - if (key.indexOf('$t') > -1) { - if (action === 'update') { - o['Value'] = o[key]; - } - } - var removeKeys = ['xmlns', 'xmlns:ns2', '$t']; - if (removeKeys.indexOf(key) > -1 && action === 'delete') { - if (action === 'delete') { - delete o[key]; - } - } - processXml(o[key], action); - } - } - } - function processResponseType(res, responseString, callback) { //debug('res %o ', res); //debug('res.headers %o ', res.headers); @@ -165,6 +136,7 @@ eBayResource.prototype = { var response = JSON.parse(responseString); return callback(null, response); } catch (exception) { + debug('exception ', exception); return callback(callback, responseString); } @@ -185,14 +157,15 @@ eBayResource.prototype = { var charset = ''; var content_type = ''; var responseString = ''; - if (headers['content-type'] && headers['content-type'].indexOf('charset') > -1 && headers['content-type'].split(';')[0] && headers['content-type'].split(';')[1]) { - content_type = headers['content-type'].split(';')[0].toLowerCase(); - if (headers['content-type'].split(';')[1].match(/^((\b[^\s=]+)=(([^=]|\\=)+))*$/)[3]) { - charset = headers['content-type'].split(';')[1].match(/^((\b[^\s=]+)=(([^=]|\\=)+))*$/)[3]; - } - } else { + if (headers['content-type']) { content_type = headers['content-type'].toLowerCase(); } + if (content_type && content_type.indexOf('charset') > -1 && content_type.split(';')[0] && content_type.split(';')[1]) { + if (content_type.split(';')[1] && content_type.split(';')[1].match(/^((\b[^\s=]+)=(([^=]|\\=)+))*$/)[3]) { + charset = content_type.split(';')[1].match(/^((\b[^\s=]+)=(([^=]|\\=)+))*$/)[3]; + } + content_type = content_type.split(';')[0].toLowerCase(); + } var ResponseHeaders = headers; res.on('data', function (chunk) { @@ -232,11 +205,19 @@ eBayResource.prototype = { responseString = bufferString.toString('utf8'); } - // debug('responseString ', responseString); + debug('responseString ', responseString); debug('content_type ', content_type); debug('statusCode ', statusCode); try { + if (!responseString && statusCode < 400) { + Object.defineProperty({}, 'lastResponse', { + enumerable: false, + writable: false, + value: res + }); + return callback.call(self, null, {}); + } processResponseType(res, responseString, function (error, response) { if (response.errors) { debug('It is ErrorResponse'); @@ -244,50 +225,27 @@ eBayResource.prototype = { errorResponse.Headers = ResponseHeaders; errorResponse.StatusCode = statusCode || 'unknown'; return callback.call(self, errorResponse, null); + } else if (response.error) { + debug('It is ErrorResponse have a single error'); + var errorDetail = response; + errorDetail.Headers = ResponseHeaders; + errorDetail.StatusCode = statusCode || 'unknown'; + return callback.call(self, errorDetail, null); } else if (error) { return callback.call(self, new Error.eBayAPIError({ message: 'Failed to parse response received from the eBay API', StatusCode: statusCode || 'unknown' }), null); } - - var ResponseMetadata = {}; - if (RESPONSE_CONTENT_TYPE.indexOf(content_type) > -1) { - /** - * It should execute for only XML response - */ - // debug('response Before Process %o ', JSON.stringify(response)); - if (response[requestParamsJSONCopy.Action + 'Response']) { - response = response[requestParamsJSONCopy.Action + 'Response']; - } - //debug('response', response); - try { - ResponseMetadata = response.ResponseMetadata; - } catch (exception) { - debug('exception', exception); - ResponseMetadata = {}; - } - // debug('ResponseMetadata %o ', ResponseMetadata); - if (response[requestParamsJSONCopy.Action + 'Result']) { - response = response[requestParamsJSONCopy.Action + 'Result']; - } - - response.ResponseMetadata = ResponseMetadata; - response.Headers = ResponseHeaders; - response.StatusCode = statusCode || 'unknown'; - // debug('response before %o ', JSON.stringify(response)); - processXml(response, 'update'); - processXml(response, 'delete'); - //debug('response after Process %o ', JSON.stringify(response)); - } - debug('final response %o ', response); + debug('-----------------------------------------------------------------'); + // debug('final response %o ', response); // Expose res object Object.defineProperty(response, 'lastResponse', { enumerable: false, writable: false, value: res }); - callback.call(self, null, response); + return callback.call(self, null, response); }); } catch (exception) { return callback.call(self, new Error.eBayAPIError({ @@ -338,6 +296,8 @@ eBayResource.prototype = { var buffer = new Buffer(keySecret); var base64String = buffer.toString('base64'); authorization = authorization.concat(' ', base64String); + } else if (options.authorization === 'User') { + authorization = authorization.concat(' ', self._eBay.getApiField('userToken')); } else { authorization = authorization.concat(' ', self._eBay.getApiField('token')); } @@ -346,12 +306,18 @@ eBayResource.prototype = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'cache-control': 'no-cache', + 'Content-Language': 'en-US', 'authorization': authorization }; - if (method === 'POST') { + if (['POST'].indexOf(method) > -1) { headers['Content-Type'] = 'application/x-www-form-urlencoded'; self.body = '&' + qs.stringify(data); + } else if (['PUT'].indexOf(method) > -1) { + self.body = JSON.stringify(data); + headers['Content-Length'] = self.body.length; + } else if (['GET'].indexOf(method) > -1) { + path = path.concat('?', qs.stringify(data)); } // Grab client-user-agent before making the request: @@ -375,8 +341,8 @@ eBayResource.prototype = { headers: headers }; debug('path ', path); - // debug('params %o ', params); - // debug('self.body %o ', self.body); + debug('params %o ', params); + debug('self.body %o ', self.body); var req = (isInsecureConnection ? http : https).request(params); req.setTimeout(timeout, self._timeoutHandler(timeout, req, callback)); diff --git a/lib/resources/buy/browse.js b/lib/resources/buy/browse.js new file mode 100644 index 0000000..0b53523 --- /dev/null +++ b/lib/resources/buy/browse.js @@ -0,0 +1,19 @@ +'use strict'; + +var eBayResource = require('../../eBayResource'); +var eBayMethod = eBayResource.method; + +module.exports = eBayResource.extend({ + + search: eBayMethod({ + method: 'GET', + path: 'buy/browse/v1/item_summary/search' + }), + getItem: eBayMethod({ + method: 'GET', + path: 'buy/browse/v1/item/{item_id}', + urlParams: ['item_id'], + required: ['item_id'] + }) + +}); diff --git a/lib/resources/commerce/taxonomy.js b/lib/resources/commerce/taxonomy.js index 17a4b72..109bd7c 100644 --- a/lib/resources/commerce/taxonomy.js +++ b/lib/resources/commerce/taxonomy.js @@ -7,8 +7,7 @@ module.exports = eBayResource.extend({ getDefaultCategoryTreeId: eBayMethod({ method: 'GET', - path: 'get_default_category_tree_id/?marketplace_id={marketplace_id}', - urlParams: ['marketplace_id'], + path: 'commerce/taxonomy/v1_beta/get_default_category_tree_id', required: ['marketplace_id'] }), getCategoryTree: eBayMethod({ @@ -19,21 +18,21 @@ module.exports = eBayResource.extend({ }), getCategorySubtree: eBayMethod({ method: 'GET', - path: 'commerce/taxonomy/v1_beta/category_tree/{category_tree_id}/get_category_subtree?category_id={category_id}', - urlParams: ['category_tree_id', 'category_id'], - required: ['category_tree_id', 'category_id'] + path: 'commerce/taxonomy/v1_beta/category_tree/{category_tree_id}/get_category_subtree', + urlParams: ['category_tree_id'], + required: ['category_tree_id'] }), getCategorySuggestions: eBayMethod({ method: 'GET', - path: 'commerce/taxonomy/v1_beta/category_tree/{category_tree_id}/get_category_suggestions?q={search_terms}', - urlParams: ['category_tree_id', 'search_terms'], - required: ['category_tree_id', 'search_terms'] + path: 'commerce/taxonomy/v1_beta/category_tree/{category_tree_id}/get_category_suggestions', + urlParams: ['category_tree_id'], + required: ['category_tree_id'] }), getItemAspectsForCategory: eBayMethod({ method: 'GET', - path: 'commerce/taxonomy/v1_beta/category_tree/{category_tree_id}/get_item_aspects_for_category?category_id={category_id}', - urlParams: ['category_tree_id', 'category_id'], - required: ['category_tree_id', 'category_id'] + path: 'commerce/taxonomy/v1_beta/category_tree/{category_tree_id}/get_item_aspects_for_category', + urlParams: ['category_tree_id'], + required: ['category_tree_id'] }) }); diff --git a/lib/resources/sell/inventory.js b/lib/resources/sell/inventory.js new file mode 100644 index 0000000..a1f4a89 --- /dev/null +++ b/lib/resources/sell/inventory.js @@ -0,0 +1,30 @@ +'use strict'; + +var eBayResource = require('../../eBayResource'); +var eBayMethod = eBayResource.method; + +module.exports = eBayResource.extend({ + + createOrReplaceInventoryItem: eBayMethod({ + authorization: 'User', + method: 'PUT', + path: 'sell/inventory/v1/inventory_item/{sku}', + urlParams: ['sku'], + required: ['sku'] + }), + getInventoryItem: eBayMethod({ + authorization: 'User', + method: 'GET', + path: 'sell/inventory/v1/inventory_item/{sku}', + urlParams: ['sku'], + required: ['sku'] + }), + getInventoryItems: eBayMethod({ + authorization: 'User', + method: 'GET', + path: 'sell/inventory/v1/inventory_item', + urlParams: ['sku'], + required: ['sku'] + }) + +}); diff --git a/package.json b/package.json index a4000a4..c5a7e95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "eBay-node-client", - "version": "0.0.1", + "name": "ebay-node-client", + "version": "0.0.2", "description": "eBay API wrapper", "keywords": [ "eBay",