Comparing version 5.6.0 to 5.6.1
# Changelog | ||
## 5.6.1 - 2021-02-01 | ||
Fix unwanted exception on `DELETE` method of Flight Order Management API | ||
## 5.6.0 - 2020-12-03 | ||
@@ -4,0 +7,0 @@ Update Node versions in Travis configuration to [Node LTS versions](https://nodejs.org/en/about/releases/) |
@@ -68,2 +68,6 @@ "use strict"; | ||
try { | ||
if (this.statusCode == 204) { | ||
return; | ||
} | ||
if (this.isJson()) { | ||
@@ -91,3 +95,9 @@ this.result = JSON.parse(this.body); | ||
value: function success() { | ||
return this.parsed && this.statusCode < 300; | ||
if (this.statusCode == 204) { | ||
return true; | ||
} | ||
if (this.parsed && this.statusCode < 300) { | ||
return true; | ||
} | ||
} // PRIVATE | ||
@@ -115,2 +125,2 @@ | ||
module.exports = exports["default"]; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9hbWFkZXVzL2NsaWVudC9yZXNwb25zZS5qcyJdLCJuYW1lcyI6WyJKU09OX0NPTlRFTlRfVFlQRVMiLCJSZXNwb25zZSIsImh0dHBfcmVzcG9uc2UiLCJyZXF1ZXN0IiwiaGVhZGVycyIsInN0YXR1c0NvZGUiLCJib2R5IiwicmVzdWx0IiwiZGF0YSIsInBhcnNlZCIsImNodW5rIiwiaXNKc29uIiwiSlNPTiIsInBhcnNlIiwiU3ludGF4RXJyb3IiLCJpbmRleE9mIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQUEsSUFBSUEsa0JBQWtCLEdBQUcsQ0FBQyxrQkFBRCxFQUFxQiw4QkFBckIsQ0FBekI7QUFFQTs7Ozs7Ozs7Ozs7Ozs7OztJQWVNQyxROzs7QUFDSixvQkFBWUMsYUFBWixFQUEyQkMsT0FBM0IsRUFBb0M7QUFBQTs7QUFDbEMsU0FBS0MsT0FBTCxHQUFlRixhQUFhLENBQUNFLE9BQWQsSUFBeUIsRUFBeEM7QU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50IGlzIHNlZW1pbmdseSBKU09OXG4gICAqXG4gICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBpc0pzb24oKSB7XG4gICAgcmV0dXJuIChKU09OX0NPTlRFTlRfVFlQRVMuaW5kZXhPZih0aGlzLmhlYWRlcnNbJ2NvbnRlbnQtdHlwZSddKSAhPT0gLTEpO1xuICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IFJlc3BvbnNlO1xuIl19 |
{ | ||
"name": "amadeus", | ||
"version": "5.6.0", | ||
"version": "5.6.1", | ||
"description": "Node library for the Amadeus travel APIs", | ||
@@ -5,0 +5,0 @@ "main": "lib/amadeus.js", |
@@ -35,3 +35,3 @@ # Amadeus Node SDK | ||
destinationLocationCode: 'BKK', | ||
departureDate: '2021-04-01', | ||
departureDate: '2021-08-01', | ||
adults: '2' | ||
@@ -192,52 +192,13 @@ }).then(function(response){ | ||
destinationLocationCode: 'BKK', | ||
departureDate: '2021-04-01', | ||
departureDate: '2021-08-01', | ||
adults: '2' | ||
}) | ||
// Flight Choice Prediction | ||
// Flight Offers Price | ||
amadeus.shopping.flightOffersSearch.get({ | ||
originLocationCode: 'SYD', | ||
destinationLocationCode: 'BKK', | ||
departureDate: '2021-04-01', | ||
adults: '2' | ||
}).then(function(response){ | ||
return amadeus.shopping.flightOffers.prediction.post( | ||
JSON.stringify(response) | ||
); | ||
}).then(function(response){ | ||
console.log(response.data); | ||
}).catch(function(responseError){ | ||
console.log(responseError); | ||
}); | ||
// Flight Create Orders | ||
// To book the flight-offer(s) suggested by flightOffersSearch API | ||
// and create a flight-order with travelers' information | ||
amadeus.shopping.flightOffersSearch.get({ | ||
originLocationCode: 'SYD', | ||
destinationLocationCode: 'BKK', | ||
departureDate: '2021-04-01', | ||
departureDate: '2021-08-01', | ||
adults: '1' | ||
}).then(function(response){ | ||
return amadeus.booking.flightOrders.post( | ||
JSON.stringify({ | ||
'type': 'flight-order', | ||
'flightOffers': response.flightOffers, | ||
'travelers_info': [] | ||
}) | ||
); | ||
}).then(function(response){ | ||
console.log(response.data); | ||
}).catch(function(responseError){ | ||
console.log(responseError); | ||
}); | ||
// Flight Offers | ||
amadeus.shopping.flightOffersSearch.get({ | ||
originLocationCode: 'SYD', | ||
destinationLocationCode: 'BKK', | ||
departureDate: '2021-04-01', | ||
adults: '1' | ||
}).then(function(response){ | ||
return amadeus.shopping.flightOffers.pricing.post( | ||
@@ -257,9 +218,29 @@ JSON.stringify({ | ||
// Flight Create Orders | ||
// To book the flight-offer(s) returned by the Flight Offers Price | ||
// and create a flight-order with travelers' information. | ||
// A full example can be found at https://git.io/JtnYo | ||
amadeus.booking.flightOrders.post( | ||
JSON.stringify({ | ||
'type': 'flight-order', | ||
'flightOffers': [priced-offers], | ||
'travelers': [] | ||
}) | ||
) | ||
// Retrieve flight order with ID 'XXX'. This ID comes from the | ||
// Flight Create Orders API, which is a temporary ID in test environment. | ||
amadeus.booking.flightOrder('XXX').get() | ||
// Cancel flight order with ID 'XXX'. This ID comes from the | ||
// Flight Create Orders API, which is a temporary ID in test environment. | ||
amadeus.booking.flightOrder('XXX').delete() | ||
// Flight SeatMap Display | ||
// To retrieve the seat map of each flight included | ||
// in flight offers for MAD-NYC flight on 2020-08-01 | ||
// in flight offers for MAD-NYC flight on 2021-08-01 | ||
amadeus.shopping.flightOffersSearch.get({ | ||
originLocationCode: 'SYD', | ||
destinationLocationCode: 'BKK', | ||
departureDate: '2021-04-01', | ||
departureDate: '2021-08-01', | ||
adults: '1' | ||
@@ -282,2 +263,18 @@ }).then(function(response){ | ||
// Flight Choice Prediction | ||
amadeus.shopping.flightOffersSearch.get({ | ||
originLocationCode: 'SYD', | ||
destinationLocationCode: 'BKK', | ||
departureDate: '2021-04-01', | ||
adults: '2' | ||
}).then(function(response){ | ||
return amadeus.shopping.flightOffers.prediction.post( | ||
JSON.stringify(response) | ||
); | ||
}).then(function(response){ | ||
console.log(response.data); | ||
}).catch(function(responseError){ | ||
console.log(responseError); | ||
}); | ||
// Flight Checkin Links | ||
@@ -353,10 +350,2 @@ amadeus.referenceData.urls.checkinLinks.get({ | ||
// Retrieve flight order with ID 'XXX'. This ID comes from the | ||
// Flight Create Orders API, which is a temporary ID in test environment. | ||
amadeus.booking.flightOrder('XXX').get() | ||
// Cancel flight order with ID 'XXX'. This ID comes from the | ||
// Flight Create Orders API, which is a temporary ID in test environment. | ||
amadeus.booking.flightOrder('XXX').delete() | ||
// Hotel Booking API | ||
@@ -476,3 +465,3 @@ amadeus.booking.hotelBookings.post( | ||
airportCode: 'JFK', | ||
date: '2020-08-01' | ||
date: '2021-08-01' | ||
}) | ||
@@ -479,0 +468,0 @@ |
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
401302
4613
496