pajaydev / ebay-node-api

eBay API Client for node
https://pajaydev.github.io/ebay-node-api
MIT License
132 stars 75 forks source link

Deprecated v1_beta #167

Open ojameno opened 4 months ago

ojameno commented 4 months ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch ebay-node-api@2.8.8 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/ebay-node-api/src/taxonomy-api.js b/node_modules/ebay-node-api/src/taxonomy-api.js
index a1fba80..4a7c617 100644
--- a/node_modules/ebay-node-api/src/taxonomy-api.js
+++ b/node_modules/ebay-node-api/src/taxonomy-api.js
@@ -13,7 +13,7 @@ const getDefaultCategoryTreeId = function (marketPlaceId) {
     marketPlaceId = upperCase(marketPlaceId);
     if (!this.options.appAccessToken) throw new Error('Missing Access token, Generate access token');
     const auth = 'Bearer ' + this.options.appAccessToken;
-    return makeRequest(this.options, `/commerce/taxonomy/v1_beta/get_default_category_tree_id?marketplace_id=${marketPlaceId}`, 'GET', auth).then((result) => {
+    return makeRequest(this.options, `/commerce/taxonomy/v1/get_default_category_tree_id?marketplace_id=${marketPlaceId}`, 'GET', auth).then((result) => {
         return JSON.parse(result);
     });
 };
@@ -27,7 +27,7 @@ const getCategoryTree = function (categoryTreeId) {
     if (!categoryTreeId) categoryTreeId = 0;
     if (!this.options.appAccessToken) throw new Error('Missing Access token, Generate access token');
     const auth = 'Bearer ' + this.options.appAccessToken;
-    return makeRequest(this.options, `/commerce/taxonomy/v1_beta/category_tree/${categoryTreeId}`, 'GET', auth).then((result) => {
+    return makeRequest(this.options, `/commerce/taxonomy/v1/category_tree/${categoryTreeId}`, 'GET', auth).then((result) => {
         return JSON.parse(result);
     });
 };
@@ -43,7 +43,7 @@ const getCategorySubtree = function (categoryTreeId, categoryId) {
     if (!categoryId) throw new Error('Missing Categor id \n Refer documentation here https://developer.ebay.com/api-docs/commerce/taxonomy/resources/category_tree/methods/getCategorySubtree#h2-samples');
     if (!this.options.appAccessToken) throw new Error('Missing Access token, Generate access token');
     const auth = 'Bearer ' + this.options.appAccessToken;
-    return makeRequest(this.options, `/commerce/taxonomy/v1_beta/category_tree/${categoryTreeId}/get_category_subtree?category_id=${categoryId}`, 'GET', auth).then((result) => {
+    return makeRequest(this.options, `/commerce/taxonomy/v1/category_tree/${categoryTreeId}/get_category_subtree?category_id=${categoryId}`, 'GET', auth).then((result) => {
         return JSON.parse(result);
     });
 };
@@ -59,7 +59,7 @@ const getCategorySuggestions = function (categoryTreeId, keyword) {
     if (!keyword) throw new Error('Missing keyword \n Refer documentation here https://developer.ebay.com/api-docs/commerce/taxonomy/resources/category_tree/methods/getCategorySuggestions');
     if (!this.options.appAccessToken) throw new Error('Missing Access token, Generate access token');
     const auth = 'Bearer ' + this.options.appAccessToken;
-    return makeRequest(this.options, `/commerce/taxonomy/v1_beta/category_tree/${categoryTreeId}/get_category_suggestions?q=${keyword}`, 'GET', auth).then((result) => {
+    return makeRequest(this.options, `/commerce/taxonomy/v1/category_tree/${categoryTreeId}/get_category_suggestions?q=${keyword}`, 'GET', auth).then((result) => {
         return JSON.parse(result);
     });
 };
@@ -74,7 +74,7 @@ const getItemAspectsForCategory = function (categoryTreeId, categoryId) {
     if (!categoryId) throw new Error('Missing Category id \n Refer documentation here https://developer.ebay.com/api-docs/commerce/taxonomy/resources/category_tree/methods/getItemAspectsForCategory#h2-samples');
     if (!this.options.appAccessToken) throw new Error('Missing Access token, Generate access token');
     const auth = 'Bearer ' + this.options.appAccessToken;
-    return makeRequest(this.options, `/commerce/taxonomy/v1_beta/category_tree/${categoryTreeId}/get_item_aspects_for_category?category_id=${categoryId}`, 'GET', auth).then((result) => {
+    return makeRequest(this.options, `/commerce/taxonomy/v1/category_tree/${categoryTreeId}/get_item_aspects_for_category?category_id=${categoryId}`, 'GET', auth).then((result) => {
         return JSON.parse(result);
     });
 };

This issue body was partially generated by patch-package.