From 9a478bf368a8339efd71be4d783be0a045a08e7f Mon Sep 17 00:00:00 2001 From: Dave Ohanyan Date: Mon, 26 Sep 2016 20:49:47 +0200 Subject: [PATCH 01/15] upgrades api version for bargain finder max --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index f8480ef..1c4bc34 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -105,7 +105,7 @@ var SabreDevStudioFlight = (function() { * @param callback */ this.bargain_finder_max = function (request, callback) { - var endpoint = '/v1.8.5/shop/flights'; + var endpoint = '/v1.9.5.1/shop/flights'; var options = { 'mode': 'live', 'Content-Type': 'application/json' From 751e2a4c71f3fbca6b5a328f1116065846eede26 Mon Sep 17 00:00:00 2001 From: Dave Ohanyan Date: Mon, 26 Sep 2016 21:01:42 +0200 Subject: [PATCH 02/15] upgrades sabre api version for bargain_finder_max --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index f8480ef..1c4bc34 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -105,7 +105,7 @@ var SabreDevStudioFlight = (function() { * @param callback */ this.bargain_finder_max = function (request, callback) { - var endpoint = '/v1.8.5/shop/flights'; + var endpoint = '/v1.9.5.1/shop/flights'; var options = { 'mode': 'live', 'Content-Type': 'application/json' From 6e9957b70a7bbcbf7b0019cefe2dca19dd3943fd Mon Sep 17 00:00:00 2001 From: Dave Ohanyan Date: Thu, 29 Sep 2016 11:14:13 +0200 Subject: [PATCH 03/15] adds enabletagging to query param --- lib/sabre-dev-studio-flight.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index 1c4bc34..36eb5d5 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -108,7 +108,8 @@ var SabreDevStudioFlight = (function() { var endpoint = '/v1.9.5.1/shop/flights'; var options = { 'mode': 'live', - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + 'enabletagging':true }; that.sabre_dev_studio.post(endpoint, request, options, callback); }; From 2404397615b4473cd9489c6af1bebc4c9581b05f Mon Sep 17 00:00:00 2001 From: Dave Ohanyan Date: Fri, 30 Sep 2016 12:09:53 +0200 Subject: [PATCH 04/15] adds limit to 200 for bargain finder max --- lib/sabre-dev-studio-flight.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index 36eb5d5..e184153 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -109,7 +109,8 @@ var SabreDevStudioFlight = (function() { var options = { 'mode': 'live', 'Content-Type': 'application/json', - 'enabletagging':true + 'enabletagging':true, + 'limit':200 }; that.sabre_dev_studio.post(endpoint, request, options, callback); }; From d15c2fccd93c2add6be222d1fca026d9f90ca4df Mon Sep 17 00:00:00 2001 From: Marko Schilde Date: Tue, 1 Nov 2016 10:41:21 +0100 Subject: [PATCH 05/15] updated BargainFinderMax to 1.9.7 endpoint --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index e184153..c93a857 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -105,7 +105,7 @@ var SabreDevStudioFlight = (function() { * @param callback */ this.bargain_finder_max = function (request, callback) { - var endpoint = '/v1.9.5.1/shop/flights'; + var endpoint = '/v1.9.7/shop/flights'; var options = { 'mode': 'live', 'Content-Type': 'application/json', From fbe175cbfe6fbf43eabe353b487203ce0735a786 Mon Sep 17 00:00:00 2001 From: Davit Ohanyan Date: Tue, 7 Mar 2017 14:13:00 +0100 Subject: [PATCH 06/15] changes bfm to 3.0.0 --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index c93a857..2eebc5a 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -105,7 +105,7 @@ var SabreDevStudioFlight = (function() { * @param callback */ this.bargain_finder_max = function (request, callback) { - var endpoint = '/v1.9.7/shop/flights'; + var endpoint = '/v3.0.0/shop/flights'; var options = { 'mode': 'live', 'Content-Type': 'application/json', From 6987f56e81e4df9c81dbda5ae166b7dfa2a0ee5c Mon Sep 17 00:00:00 2001 From: Davit Ohanyan Date: Mon, 14 Aug 2017 09:17:32 +0200 Subject: [PATCH 07/15] upgrades the api version to 3.2.0 --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index 2eebc5a..518328b 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -105,7 +105,7 @@ var SabreDevStudioFlight = (function() { * @param callback */ this.bargain_finder_max = function (request, callback) { - var endpoint = '/v3.0.0/shop/flights'; + var endpoint = '/v3.2.0/shop/flights'; var options = { 'mode': 'live', 'Content-Type': 'application/json', From 50e79194bf712261d97be9ee14d667da821c8572 Mon Sep 17 00:00:00 2001 From: Davit Ohanyan Date: Tue, 15 Aug 2017 10:34:30 +0200 Subject: [PATCH 08/15] sabre lib exports SabreDevStudioFlight --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index 2eebc5a..499f7f0 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -245,4 +245,4 @@ var SabreDevStudioFlight = (function() { return SabreDevStudioFlight; })(); -module.exports = SabreDevStudioFlight; +module.exports.SabreDevStudioFlight = SabreDevStudioFlight; From 8bfd9b334c9b9cb1628b2f3f54cda1bf3d534c89 Mon Sep 17 00:00:00 2001 From: Marko Schilde Date: Tue, 21 Nov 2017 12:20:36 +0100 Subject: [PATCH 09/15] updated BargainFinderMax to 3.3.0 endpoint (#5) --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index fd99fa5..8d71648 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -105,7 +105,7 @@ var SabreDevStudioFlight = (function() { * @param callback */ this.bargain_finder_max = function (request, callback) { - var endpoint = '/v3.2.0/shop/flights'; + var endpoint = '/v3.3.0/shop/flights'; var options = { 'mode': 'live', 'Content-Type': 'application/json', From 2e4c985ff3e7c099518f3dfa77892620a9fad8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Aydek?= Date: Sat, 3 Feb 2018 21:32:25 +0100 Subject: [PATCH 10/15] update bargain_finder_max from 3.3.0 to 3.4.0 (#6) --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index 8d71648..3e78485 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -105,7 +105,7 @@ var SabreDevStudioFlight = (function() { * @param callback */ this.bargain_finder_max = function (request, callback) { - var endpoint = '/v3.3.0/shop/flights'; + var endpoint = '/v3.4.0/shop/flights'; var options = { 'mode': 'live', 'Content-Type': 'application/json', From 7c7c77febbb19bcc20ed463797dcde0fd737050f Mon Sep 17 00:00:00 2001 From: rpgeeganage Date: Tue, 4 Jun 2019 19:00:29 +0200 Subject: [PATCH 11/15] added retry for connection reset --- lib/sabre-dev-studio.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/sabre-dev-studio.js b/lib/sabre-dev-studio.js index ebcc5ce..862489b 100644 --- a/lib/sabre-dev-studio.js +++ b/lib/sabre-dev-studio.js @@ -101,9 +101,13 @@ var SabreDevStudio = (function() { }; request[method.toLowerCase()](requestUrl, reqestOptions, function(error, response, data) { if (error) { - if (error.data === '') { error.data = requestUrl; } - log.error('Error:', error); - cb(error, data, response); + if (error.code === 'ECONNRESET' && retryCount >= 0) { + fetchAccessToken(endpoint, options, cb, --retryCount); + } else { + if (error.data === '') { error.data = requestUrl; } + log.error('Error:', error); + cb(error, data, response); + } } else if (response.statusCode === 200) { cb(null, data, response); } else if (response.statusCode === 401 && retryCount >= 0) { From c2f8ecf854decc234472bdae47499fb634b98e78 Mon Sep 17 00:00:00 2001 From: rpgeeganage Date: Wed, 5 Jun 2019 19:00:33 +0200 Subject: [PATCH 12/15] removed new Buffer --- lib/sabre-dev-studio.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sabre-dev-studio.js b/lib/sabre-dev-studio.js index 862489b..a2029c2 100644 --- a/lib/sabre-dev-studio.js +++ b/lib/sabre-dev-studio.js @@ -36,10 +36,10 @@ var SabreDevStudio = (function() { init(options); function init(options) { var clientID = function() { - return new Buffer(that.config.client_id).toString('base64'); + return Buffer.from(that.config.client_id, 'base64').toString(); }; var clientSecret = function() { - return new Buffer(that.config.client_secret).toString('base64'); + return Buffer.from(that.config.client_secret, 'base64').toString(); }; var keys = ['client_id', 'client_secret', 'uri', 'access_token']; From 9144c13537603dcd694fafa8778b24dd4b247532 Mon Sep 17 00:00:00 2001 From: rpgeeganage Date: Thu, 6 Jun 2019 15:21:09 +0200 Subject: [PATCH 13/15] fix buffer --- lib/sabre-dev-studio.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sabre-dev-studio.js b/lib/sabre-dev-studio.js index a2029c2..481a672 100644 --- a/lib/sabre-dev-studio.js +++ b/lib/sabre-dev-studio.js @@ -36,10 +36,10 @@ var SabreDevStudio = (function() { init(options); function init(options) { var clientID = function() { - return Buffer.from(that.config.client_id, 'base64').toString(); + return Buffer.from(that.config.client_id).toString('base64'); }; var clientSecret = function() { - return Buffer.from(that.config.client_secret, 'base64').toString(); + return Buffer.from(that.config.client_secret).toString('base64'); }; var keys = ['client_id', 'client_secret', 'uri', 'access_token']; From f87bfe51e4cad3f44debb12b67d604d1924af4f4 Mon Sep 17 00:00:00 2001 From: rpgeeganage Date: Mon, 4 Nov 2019 16:27:08 +0100 Subject: [PATCH 14/15] added timeout of 1 minutes --- lib/sabre-dev-studio.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/sabre-dev-studio.js b/lib/sabre-dev-studio.js index 481a672..b5689f2 100644 --- a/lib/sabre-dev-studio.js +++ b/lib/sabre-dev-studio.js @@ -95,6 +95,7 @@ var SabreDevStudio = (function() { method: method, body: post_body, headers: headers, + timeout: 60 * 10000, auth: { "bearer": this.config.access_token } From 72ce229319f7e8516c9da5e5df0512fe99af5fe1 Mon Sep 17 00:00:00 2001 From: pallavisahni Date: Tue, 14 Sep 2021 11:21:04 +0200 Subject: [PATCH 15/15] version upgrade --- lib/sabre-dev-studio-flight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sabre-dev-studio-flight.js b/lib/sabre-dev-studio-flight.js index 3e78485..33a6c66 100644 --- a/lib/sabre-dev-studio-flight.js +++ b/lib/sabre-dev-studio-flight.js @@ -105,7 +105,7 @@ var SabreDevStudioFlight = (function() { * @param callback */ this.bargain_finder_max = function (request, callback) { - var endpoint = '/v3.4.0/shop/flights'; + var endpoint = '/v4/offers/shop/flights'; var options = { 'mode': 'live', 'Content-Type': 'application/json',